entities
listlengths
1
8.61k
max_stars_repo_path
stringlengths
7
172
max_stars_repo_name
stringlengths
5
89
max_stars_count
int64
0
82k
content
stringlengths
14
1.05M
id
stringlengths
2
6
new_content
stringlengths
15
1.05M
modified
bool
1 class
references
stringlengths
29
1.05M
[ { "context": "'question', 'type']\n# contact: [\n# 'firstName'\n# 'lastName'\n# photos: ['url', '", "end": 318, "score": 0.9978651404380798, "start": 309, "tag": "NAME", "value": "firstName" }, { "context": " contact: [\n# 'firstName'\n# ...
test/integration.spec.coffee
jamesknelson/angular-deputy
1
# TODO: set up a big test which uses all the features, using the following model: # studyListOptions = # action: 'partiallist' # method: 'POST' # force: true # select: [ # 'answer' # 'active' # 'locked' # question: ['question', 'type'] # contact: [ # 'firstName' # 'lastName' # photos: ['url', 'active', 'uses'] # ] # ] # new Deputy 'Card', # references: [ # { belongsTo: 'question' } # { belongsTo: 'contact' } # ] # unique: [ # ['questionId', 'contactId'] # ] # endpoints: # get: true # patch: true # delete: true # post: true # list: true # findByQuestionId: true # findByContactId: true # respond: studyListOptions # #### # new Deputy 'Question', # references: [ # { hasMany: 'cards', service: 'Card', dependent: 'destroy' } # ] # endpoints: # get: true # patch: true # post: true # delete: true # list: true # #### # selectAll = [ # 'notes' # 'active' # 'name' # 'source' # cards: [ # 'answer' # 'active' # question: ['question'] # ] # ] # new Deputy 'Contact', # readOnly: [ # 'linkedinId' # 'facebookId' # ] # compute: # name: [cards: ['answer', question: ['question']], (cards) -> # # TODO: think of another way to do this. This will probably be awfully # # slow, but trying to keep two separate pieces of data in different # # resources in sync with every change also blows. # ] # source: ['linkedinId', 'facebookId', (linkedinId, facebookId) -> # ] # references: [ # { hasMany: 'cards', service: 'Card', dependent: 'destroy' } # ] # index: [ # 'source' # 'active' # ['source', 'active'] # ] # endpoints: # get: # select: selectAll # list: # select: selectAll # patch: true # delete: true # findBySource: true # findByActive: true # findBySourceAndActive: true # TESTS: # - can't add another card with existing questionId, contactId
19068
# TODO: set up a big test which uses all the features, using the following model: # studyListOptions = # action: 'partiallist' # method: 'POST' # force: true # select: [ # 'answer' # 'active' # 'locked' # question: ['question', 'type'] # contact: [ # '<NAME>' # '<NAME>' # photos: ['url', 'active', 'uses'] # ] # ] # new Deputy 'Card', # references: [ # { belongsTo: 'question' } # { belongsTo: 'contact' } # ] # unique: [ # ['questionId', 'contactId'] # ] # endpoints: # get: true # patch: true # delete: true # post: true # list: true # findByQuestionId: true # findByContactId: true # respond: studyListOptions # #### # new Deputy 'Question', # references: [ # { hasMany: 'cards', service: 'Card', dependent: 'destroy' } # ] # endpoints: # get: true # patch: true # post: true # delete: true # list: true # #### # selectAll = [ # 'notes' # 'active' # 'name' # 'source' # cards: [ # 'answer' # 'active' # question: ['question'] # ] # ] # new Deputy 'Contact', # readOnly: [ # 'linkedinId' # 'facebookId' # ] # compute: # name: [cards: ['answer', question: ['question']], (cards) -> # # TODO: think of another way to do this. This will probably be awfully # # slow, but trying to keep two separate pieces of data in different # # resources in sync with every change also blows. # ] # source: ['linkedinId', 'facebookId', (linkedinId, facebookId) -> # ] # references: [ # { hasMany: 'cards', service: 'Card', dependent: 'destroy' } # ] # index: [ # 'source' # 'active' # ['source', 'active'] # ] # endpoints: # get: # select: selectAll # list: # select: selectAll # patch: true # delete: true # findBySource: true # findByActive: true # findBySourceAndActive: true # TESTS: # - can't add another card with existing questionId, contactId
true
# TODO: set up a big test which uses all the features, using the following model: # studyListOptions = # action: 'partiallist' # method: 'POST' # force: true # select: [ # 'answer' # 'active' # 'locked' # question: ['question', 'type'] # contact: [ # 'PI:NAME:<NAME>END_PI' # 'PI:NAME:<NAME>END_PI' # photos: ['url', 'active', 'uses'] # ] # ] # new Deputy 'Card', # references: [ # { belongsTo: 'question' } # { belongsTo: 'contact' } # ] # unique: [ # ['questionId', 'contactId'] # ] # endpoints: # get: true # patch: true # delete: true # post: true # list: true # findByQuestionId: true # findByContactId: true # respond: studyListOptions # #### # new Deputy 'Question', # references: [ # { hasMany: 'cards', service: 'Card', dependent: 'destroy' } # ] # endpoints: # get: true # patch: true # post: true # delete: true # list: true # #### # selectAll = [ # 'notes' # 'active' # 'name' # 'source' # cards: [ # 'answer' # 'active' # question: ['question'] # ] # ] # new Deputy 'Contact', # readOnly: [ # 'linkedinId' # 'facebookId' # ] # compute: # name: [cards: ['answer', question: ['question']], (cards) -> # # TODO: think of another way to do this. This will probably be awfully # # slow, but trying to keep two separate pieces of data in different # # resources in sync with every change also blows. # ] # source: ['linkedinId', 'facebookId', (linkedinId, facebookId) -> # ] # references: [ # { hasMany: 'cards', service: 'Card', dependent: 'destroy' } # ] # index: [ # 'source' # 'active' # ['source', 'active'] # ] # endpoints: # get: # select: selectAll # list: # select: selectAll # patch: true # delete: true # findBySource: true # findByActive: true # findBySourceAndActive: true # TESTS: # - can't add another card with existing questionId, contactId
[ { "context": " id: 'acti_'+faker.random.uuid()\n to: ['teacher1@example.com']\n sender: 'Sales McClose <sales_1@codecomba", "end": 354, "score": 0.9999292492866516, "start": 334, "tag": "EMAIL", "value": "teacher1@example.com" }, { "context": " to: ['teacher1@exam...
spec/scripts/sales/closeFactories.coffee
l34kr/codecombat
0
_ = require 'lodash' moment = require 'moment' faker = require 'faker' makeTasksResult = (total_results) -> return { total_results has_more: false data: [] } makeActivityResult = ({ auto1, auto2, they_replied } = {}) -> activities = [] if auto1 activity = { id: 'acti_'+faker.random.uuid() to: ['teacher1@example.com'] sender: 'Sales McClose <sales_1@codecombat.com>' _type: 'Email' template_id: 'template_auto1' # TODO: Be less magical. (This is in createTeacherEmailTemplatesAuto1) date_created: moment().subtract(7, 'days').toDate() } _.assign(activity, auto1) if _.isObject(auto1) activities.push activity activities.push makeStatusChangeActivity('Auto Attempt 1') if auto2 activity = { id: 'acti_'+faker.random.uuid() to: ['teacher1@example.com'] sender: 'Sales McClose <sales_1@codecombat.com>' _type: 'Email' template_id: 'template_auto2' # TODO: Be less magical. (This is in createTeacherEmailTemplatesAuto1) date_created: moment().subtract(4, 'days').toDate() } _.assign(activity, auto2) if _.isObject(auto2) activities.push activity activities.push makeStatusChangeActivity('Auto Attempt 2', 'Auto Attempt 1') if they_replied activity = { id: 'acti_'+faker.random.uuid() to: ['lisa@codecombat.com'] sender: "#{faker.name.findName()} <#{faker.internet.email()}>" _type: 'Email' date_created: moment().subtract(2, 'days').toDate() } _.assign(activity, they_replied) if _.isObject(they_replied) activities.push activity return { has_more: false data: activities } makeStatusChangeActivity = (status, oldStatus) -> { id: 'acti_'+faker.random.uuid() _type: 'LeadStatusChange' user_id: 'close_user_0' new_status_label: status old_status_label: oldStatus date_created: moment().subtract(7, 'days') } # TODO: Add options for status, different contact info makeLead = ({auto1, auto2} = {}) -> if auto1 return { id: 'lead_1' status_label: 'Auto Attempt 1' contacts: [makeContact({ withEmails: true, withPhones: true })] } else if auto2 return { id: 'lead_1' status_label: 'Auto Attempt 2' contacts: [makeContact({ withEmails: true, withPhones: true })] } else return { id: 'lead_1' status_label: 'Not Attempted' contacts: [makeContact({ withEmails: true, withPhones: true })] } makeLeadsResult = () -> { total_results: 1 has_more: false data: [ makeLead() ] } # withEmails: true, false, a number of fake email addresses to generate, or array of email addresses to use makeContact = ({ withEmails, withPhones } = {}) -> contact = {} if withPhones phones = _.times Number(withPhones), -> { phone: faker.phone.phoneNumber() type: faker.random.arrayElement(['office', 'work', 'mobile', 'direct']) } _.assign contact, {phones} if withEmails emails = _.times Number(withEmails.length || withEmails), (i) -> { email: withEmails[i] || faker.internet.email() type: 'office' } _.assign contact, {emails} contact module.exports = { makeTasksResult makeActivityResult makeLead makeLeadsResult makeContact }
108202
_ = require 'lodash' moment = require 'moment' faker = require 'faker' makeTasksResult = (total_results) -> return { total_results has_more: false data: [] } makeActivityResult = ({ auto1, auto2, they_replied } = {}) -> activities = [] if auto1 activity = { id: 'acti_'+faker.random.uuid() to: ['<EMAIL>'] sender: '<NAME> <<EMAIL>>' _type: 'Email' template_id: 'template_auto1' # TODO: Be less magical. (This is in createTeacherEmailTemplatesAuto1) date_created: moment().subtract(7, 'days').toDate() } _.assign(activity, auto1) if _.isObject(auto1) activities.push activity activities.push makeStatusChangeActivity('Auto Attempt 1') if auto2 activity = { id: 'acti_'+faker.random.uuid() to: ['<EMAIL>'] sender: '<NAME> <<EMAIL>>' _type: 'Email' template_id: 'template_auto2' # TODO: Be less magical. (This is in createTeacherEmailTemplatesAuto1) date_created: moment().subtract(4, 'days').toDate() } _.assign(activity, auto2) if _.isObject(auto2) activities.push activity activities.push makeStatusChangeActivity('Auto Attempt 2', 'Auto Attempt 1') if they_replied activity = { id: 'acti_'+faker.random.uuid() to: ['<EMAIL>'] sender: "#{faker.name.findName()} <#{faker.internet.email()}>" _type: 'Email' date_created: moment().subtract(2, 'days').toDate() } _.assign(activity, they_replied) if _.isObject(they_replied) activities.push activity return { has_more: false data: activities } makeStatusChangeActivity = (status, oldStatus) -> { id: 'acti_'+faker.random.uuid() _type: 'LeadStatusChange' user_id: 'close_user_0' new_status_label: status old_status_label: oldStatus date_created: moment().subtract(7, 'days') } # TODO: Add options for status, different contact info makeLead = ({auto1, auto2} = {}) -> if auto1 return { id: 'lead_1' status_label: 'Auto Attempt 1' contacts: [makeContact({ withEmails: true, withPhones: true })] } else if auto2 return { id: 'lead_1' status_label: 'Auto Attempt 2' contacts: [makeContact({ withEmails: true, withPhones: true })] } else return { id: 'lead_1' status_label: 'Not Attempted' contacts: [makeContact({ withEmails: true, withPhones: true })] } makeLeadsResult = () -> { total_results: 1 has_more: false data: [ makeLead() ] } # withEmails: true, false, a number of fake email addresses to generate, or array of email addresses to use makeContact = ({ withEmails, withPhones } = {}) -> contact = {} if withPhones phones = _.times Number(withPhones), -> { phone: faker.phone.phoneNumber() type: faker.random.arrayElement(['office', 'work', 'mobile', 'direct']) } _.assign contact, {phones} if withEmails emails = _.times Number(withEmails.length || withEmails), (i) -> { email: withEmails[i] || faker.internet.email() type: 'office' } _.assign contact, {emails} contact module.exports = { makeTasksResult makeActivityResult makeLead makeLeadsResult makeContact }
true
_ = require 'lodash' moment = require 'moment' faker = require 'faker' makeTasksResult = (total_results) -> return { total_results has_more: false data: [] } makeActivityResult = ({ auto1, auto2, they_replied } = {}) -> activities = [] if auto1 activity = { id: 'acti_'+faker.random.uuid() to: ['PI:EMAIL:<EMAIL>END_PI'] sender: 'PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>' _type: 'Email' template_id: 'template_auto1' # TODO: Be less magical. (This is in createTeacherEmailTemplatesAuto1) date_created: moment().subtract(7, 'days').toDate() } _.assign(activity, auto1) if _.isObject(auto1) activities.push activity activities.push makeStatusChangeActivity('Auto Attempt 1') if auto2 activity = { id: 'acti_'+faker.random.uuid() to: ['PI:EMAIL:<EMAIL>END_PI'] sender: 'PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>' _type: 'Email' template_id: 'template_auto2' # TODO: Be less magical. (This is in createTeacherEmailTemplatesAuto1) date_created: moment().subtract(4, 'days').toDate() } _.assign(activity, auto2) if _.isObject(auto2) activities.push activity activities.push makeStatusChangeActivity('Auto Attempt 2', 'Auto Attempt 1') if they_replied activity = { id: 'acti_'+faker.random.uuid() to: ['PI:EMAIL:<EMAIL>END_PI'] sender: "#{faker.name.findName()} <#{faker.internet.email()}>" _type: 'Email' date_created: moment().subtract(2, 'days').toDate() } _.assign(activity, they_replied) if _.isObject(they_replied) activities.push activity return { has_more: false data: activities } makeStatusChangeActivity = (status, oldStatus) -> { id: 'acti_'+faker.random.uuid() _type: 'LeadStatusChange' user_id: 'close_user_0' new_status_label: status old_status_label: oldStatus date_created: moment().subtract(7, 'days') } # TODO: Add options for status, different contact info makeLead = ({auto1, auto2} = {}) -> if auto1 return { id: 'lead_1' status_label: 'Auto Attempt 1' contacts: [makeContact({ withEmails: true, withPhones: true })] } else if auto2 return { id: 'lead_1' status_label: 'Auto Attempt 2' contacts: [makeContact({ withEmails: true, withPhones: true })] } else return { id: 'lead_1' status_label: 'Not Attempted' contacts: [makeContact({ withEmails: true, withPhones: true })] } makeLeadsResult = () -> { total_results: 1 has_more: false data: [ makeLead() ] } # withEmails: true, false, a number of fake email addresses to generate, or array of email addresses to use makeContact = ({ withEmails, withPhones } = {}) -> contact = {} if withPhones phones = _.times Number(withPhones), -> { phone: faker.phone.phoneNumber() type: faker.random.arrayElement(['office', 'work', 'mobile', 'direct']) } _.assign contact, {phones} if withEmails emails = _.times Number(withEmails.length || withEmails), (i) -> { email: withEmails[i] || faker.internet.email() type: 'office' } _.assign contact, {emails} contact module.exports = { makeTasksResult makeActivityResult makeLead makeLeadsResult makeContact }
[ { "context": "key,value,prevValue) ->\n key = key.replace('AllSelected','')\n @_allFilters(key).isEvery('isFiltering')", "end": 2552, "score": 0.9857697486877441, "start": 2544, "tag": "KEY", "value": "Selected" } ]
app/mixins/filter-params.coffee
zkwentz/ember-filter-params
8
`import Ember from 'ember'` FilterParamsMixin = Ember.Mixin.create( filters: Ember.computed(-> [] ) multiFilters: Ember.computed(-> [] ) _filters: (-> Ember.keys(@get('filters')) ).property('filters') _multiFilters: (-> Ember.keys(@get('multiFilters')) ).property('multiFilters') init: -> @_super() @get('_filters').forEach (filter) => filterName = "#{filter}Selected" filterValue = Ember.computed(filter,@filterSelected) @set(filterName,filterValue) @get('_multiFilters').forEach (multiFilter) => @set(multiFilter,null) @setupMultiFilter(multiFilter) return setupMultiFilter: (key) -> Ember.run.next(@,-> multiFilter = key multiFilterSelected = Ember.A([]) filterParam = @get(multiFilter) filterParams = filterParam?.split(',') || [] allFilters = @_allFilters(multiFilter) if !!allFilters allFilters?.then((multiFilters) => multiFilters.forEach (filter) => filter.set('isFiltering',filterParams?.contains(filter.get('id'))) ).finally => @set("#{multiFilter}Selected",Ember.computed("#{@get('multiFilters')[multiFilter]}.@each.isFiltering",@multiFilterSelected)) @set("#{multiFilter}AllSelected",Ember.computed("#{@get('multiFilters')[multiFilter]}.@each.isFiltering",@multiFilterAllSelected)) @addObserver("#{multiFilter}Selected.@each.id",@,'multiFilterSelectedObserver') @removeObserver(multiFilter) @addObserver(multiFilter,@,'multiFilterObserver') ) filterSelected: (key,value,prevValue) -> key = key.replace('Selected','') filter = null # setter if !!value @set(key,value.id) filterId = @get(key) if !!filterId key = @get('filters')[key] if !!key @get(key)?.then (filters) => filters.findBy('id',filterId) multiFilterSelected: (key,value,prevValue) -> key = key.replace('Selected','') @_allFilters(key).filterBy('isFiltering') multiFilterObserver: (sender, multiFilter) -> @_allFilters(multiFilter).setEach('isFiltering',false) unless @get(multiFilter) multiFilterSelectedObserver: (sender, key) -> key = key.replace('.@each.id','') multiFilterSelected = @get(key) key = key.replace('Selected','') newValue = multiFilterSelected.mapBy('id').toString() newValue = if newValue.length then newValue else null @set(key,newValue) multiFilterAllSelected: (key,value,prevValue) -> key = key.replace('AllSelected','') @_allFilters(key).isEvery('isFiltering') _allFilters: (filterName) -> @get(@get('multiFilters')[filterName]) _selectMultiple: (filterName, filters) -> @_allFilters(filterName).setEach('isFiltering',false) filters.setEach('isFiltering',true) return _select: (filterName, filter) -> filter.set('isFiltering',!filter.get('isFiltering')) return actions: selectAll: (filterName) -> allFilters = @_allFilters(filterName) allSelected = @get("#{filterName}AllSelected") allFilters.setEach('isFiltering',!allSelected) select: (filterName, filters) -> if Ember.isArray(filters) @_selectMultiple(filterName, filters) else @_select(filterName, filters) ) `export default FilterParamsMixin`
189404
`import Ember from 'ember'` FilterParamsMixin = Ember.Mixin.create( filters: Ember.computed(-> [] ) multiFilters: Ember.computed(-> [] ) _filters: (-> Ember.keys(@get('filters')) ).property('filters') _multiFilters: (-> Ember.keys(@get('multiFilters')) ).property('multiFilters') init: -> @_super() @get('_filters').forEach (filter) => filterName = "#{filter}Selected" filterValue = Ember.computed(filter,@filterSelected) @set(filterName,filterValue) @get('_multiFilters').forEach (multiFilter) => @set(multiFilter,null) @setupMultiFilter(multiFilter) return setupMultiFilter: (key) -> Ember.run.next(@,-> multiFilter = key multiFilterSelected = Ember.A([]) filterParam = @get(multiFilter) filterParams = filterParam?.split(',') || [] allFilters = @_allFilters(multiFilter) if !!allFilters allFilters?.then((multiFilters) => multiFilters.forEach (filter) => filter.set('isFiltering',filterParams?.contains(filter.get('id'))) ).finally => @set("#{multiFilter}Selected",Ember.computed("#{@get('multiFilters')[multiFilter]}.@each.isFiltering",@multiFilterSelected)) @set("#{multiFilter}AllSelected",Ember.computed("#{@get('multiFilters')[multiFilter]}.@each.isFiltering",@multiFilterAllSelected)) @addObserver("#{multiFilter}Selected.@each.id",@,'multiFilterSelectedObserver') @removeObserver(multiFilter) @addObserver(multiFilter,@,'multiFilterObserver') ) filterSelected: (key,value,prevValue) -> key = key.replace('Selected','') filter = null # setter if !!value @set(key,value.id) filterId = @get(key) if !!filterId key = @get('filters')[key] if !!key @get(key)?.then (filters) => filters.findBy('id',filterId) multiFilterSelected: (key,value,prevValue) -> key = key.replace('Selected','') @_allFilters(key).filterBy('isFiltering') multiFilterObserver: (sender, multiFilter) -> @_allFilters(multiFilter).setEach('isFiltering',false) unless @get(multiFilter) multiFilterSelectedObserver: (sender, key) -> key = key.replace('.@each.id','') multiFilterSelected = @get(key) key = key.replace('Selected','') newValue = multiFilterSelected.mapBy('id').toString() newValue = if newValue.length then newValue else null @set(key,newValue) multiFilterAllSelected: (key,value,prevValue) -> key = key.replace('All<KEY>','') @_allFilters(key).isEvery('isFiltering') _allFilters: (filterName) -> @get(@get('multiFilters')[filterName]) _selectMultiple: (filterName, filters) -> @_allFilters(filterName).setEach('isFiltering',false) filters.setEach('isFiltering',true) return _select: (filterName, filter) -> filter.set('isFiltering',!filter.get('isFiltering')) return actions: selectAll: (filterName) -> allFilters = @_allFilters(filterName) allSelected = @get("#{filterName}AllSelected") allFilters.setEach('isFiltering',!allSelected) select: (filterName, filters) -> if Ember.isArray(filters) @_selectMultiple(filterName, filters) else @_select(filterName, filters) ) `export default FilterParamsMixin`
true
`import Ember from 'ember'` FilterParamsMixin = Ember.Mixin.create( filters: Ember.computed(-> [] ) multiFilters: Ember.computed(-> [] ) _filters: (-> Ember.keys(@get('filters')) ).property('filters') _multiFilters: (-> Ember.keys(@get('multiFilters')) ).property('multiFilters') init: -> @_super() @get('_filters').forEach (filter) => filterName = "#{filter}Selected" filterValue = Ember.computed(filter,@filterSelected) @set(filterName,filterValue) @get('_multiFilters').forEach (multiFilter) => @set(multiFilter,null) @setupMultiFilter(multiFilter) return setupMultiFilter: (key) -> Ember.run.next(@,-> multiFilter = key multiFilterSelected = Ember.A([]) filterParam = @get(multiFilter) filterParams = filterParam?.split(',') || [] allFilters = @_allFilters(multiFilter) if !!allFilters allFilters?.then((multiFilters) => multiFilters.forEach (filter) => filter.set('isFiltering',filterParams?.contains(filter.get('id'))) ).finally => @set("#{multiFilter}Selected",Ember.computed("#{@get('multiFilters')[multiFilter]}.@each.isFiltering",@multiFilterSelected)) @set("#{multiFilter}AllSelected",Ember.computed("#{@get('multiFilters')[multiFilter]}.@each.isFiltering",@multiFilterAllSelected)) @addObserver("#{multiFilter}Selected.@each.id",@,'multiFilterSelectedObserver') @removeObserver(multiFilter) @addObserver(multiFilter,@,'multiFilterObserver') ) filterSelected: (key,value,prevValue) -> key = key.replace('Selected','') filter = null # setter if !!value @set(key,value.id) filterId = @get(key) if !!filterId key = @get('filters')[key] if !!key @get(key)?.then (filters) => filters.findBy('id',filterId) multiFilterSelected: (key,value,prevValue) -> key = key.replace('Selected','') @_allFilters(key).filterBy('isFiltering') multiFilterObserver: (sender, multiFilter) -> @_allFilters(multiFilter).setEach('isFiltering',false) unless @get(multiFilter) multiFilterSelectedObserver: (sender, key) -> key = key.replace('.@each.id','') multiFilterSelected = @get(key) key = key.replace('Selected','') newValue = multiFilterSelected.mapBy('id').toString() newValue = if newValue.length then newValue else null @set(key,newValue) multiFilterAllSelected: (key,value,prevValue) -> key = key.replace('AllPI:KEY:<KEY>END_PI','') @_allFilters(key).isEvery('isFiltering') _allFilters: (filterName) -> @get(@get('multiFilters')[filterName]) _selectMultiple: (filterName, filters) -> @_allFilters(filterName).setEach('isFiltering',false) filters.setEach('isFiltering',true) return _select: (filterName, filter) -> filter.set('isFiltering',!filter.get('isFiltering')) return actions: selectAll: (filterName) -> allFilters = @_allFilters(filterName) allSelected = @get("#{filterName}AllSelected") allFilters.setEach('isFiltering',!allSelected) select: (filterName, filters) -> if Ember.isArray(filters) @_selectMultiple(filterName, filters) else @_select(filterName, filters) ) `export default FilterParamsMixin`
[ { "context": "ges with observer pattern.\n * @function\n * @author İsmail Demirbilek\n###\nangular.module 'esef.frontend.storage'\n .fac", "end": 236, "score": 0.9998894929885864, "start": 219, "tag": "NAME", "value": "İsmail Demirbilek" } ]
src/storage/coffee/services/storage.coffee
egemsoft/esef-frontend
0
'use strict' ###* * @ngdoc service * @name esef.frontend.storage.services:storage * @description * Storage service which stores key/value objects and notifies changes with observer pattern. * @function * @author İsmail Demirbilek ### angular.module 'esef.frontend.storage' .factory 'storage', -> storage = {} observerCallbacks = [] ###* * @ngdoc object * @name store * @methodOf esef.frontend.storage.services:storage * @description * Store method for storage. Stores given object with given key. Calls registered callback functions to inform about the change. * @param {string} key - Storage key. * @param {object} newValues - Object to be stored on given key. * @return {object} - storage service. * @function ### store: (key, newValues) -> storage[key] = angular.copy newValues # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name setProperty * @methodOf esef.frontend.storage.services:storage * @description * Set method for single property on given key. Calls registered callback functions to inform about the change. * @param {string} key - Object key. * @param {string} propKey - Property key on desired object. * @param {string} val - New value to be set. * @return {object} - storage service. * @function ### setProperty: (key, propKey, val) -> storage[key][propKey] = angular.copy val # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name removeProperty * @methodOf esef.frontend.storage.services:storage * @description * Remove a single property on given object. Calls registered callback functions to inform about the change. * @param {string} key - Object key. * @param {string} key - Property key stored on given object key. * @return {object} - storage service. * @function ### removeProperty: (key, propKey) -> delete storage[key][propKey] # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name set * @methodOf esef.frontend.storage.services:storage * @description * Set method for storage service. Sets given object as storage. * @return {object} - storage service. * @function ### set: (newStorage) -> storage = angular.copy newStorage this.notifyObservers() this ###* * @ngdoc object * @name get * @methodOf esef.frontend.storage.services:storage * @description * Get method for storage service. * @param {string} key - Key of desired object. * @return {object} - Desired object stored on given key. * @function ### get: (key) -> angular.copy storage[key] ###* * @ngdoc object * @name registerObserverCallback * @methodOf esef.frontend.storage.services:storage * @description * Registers callback to observe changes on service. * @param {function} callback - Observer callback function * @return {object} - storage service. * @function ### registerObserverCallback: (callback) -> observerCallbacks.push(callback) this ###* * @ngdoc object * @name notifyObservers * @methodOf esef.frontend.storage.services:storage * @description * Notifies registered observers by running callbacks. * @return {object} - Storage service. * @function ### notifyObservers: -> angular.forEach observerCallbacks, (callback) -> callback() this
142162
'use strict' ###* * @ngdoc service * @name esef.frontend.storage.services:storage * @description * Storage service which stores key/value objects and notifies changes with observer pattern. * @function * @author <NAME> ### angular.module 'esef.frontend.storage' .factory 'storage', -> storage = {} observerCallbacks = [] ###* * @ngdoc object * @name store * @methodOf esef.frontend.storage.services:storage * @description * Store method for storage. Stores given object with given key. Calls registered callback functions to inform about the change. * @param {string} key - Storage key. * @param {object} newValues - Object to be stored on given key. * @return {object} - storage service. * @function ### store: (key, newValues) -> storage[key] = angular.copy newValues # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name setProperty * @methodOf esef.frontend.storage.services:storage * @description * Set method for single property on given key. Calls registered callback functions to inform about the change. * @param {string} key - Object key. * @param {string} propKey - Property key on desired object. * @param {string} val - New value to be set. * @return {object} - storage service. * @function ### setProperty: (key, propKey, val) -> storage[key][propKey] = angular.copy val # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name removeProperty * @methodOf esef.frontend.storage.services:storage * @description * Remove a single property on given object. Calls registered callback functions to inform about the change. * @param {string} key - Object key. * @param {string} key - Property key stored on given object key. * @return {object} - storage service. * @function ### removeProperty: (key, propKey) -> delete storage[key][propKey] # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name set * @methodOf esef.frontend.storage.services:storage * @description * Set method for storage service. Sets given object as storage. * @return {object} - storage service. * @function ### set: (newStorage) -> storage = angular.copy newStorage this.notifyObservers() this ###* * @ngdoc object * @name get * @methodOf esef.frontend.storage.services:storage * @description * Get method for storage service. * @param {string} key - Key of desired object. * @return {object} - Desired object stored on given key. * @function ### get: (key) -> angular.copy storage[key] ###* * @ngdoc object * @name registerObserverCallback * @methodOf esef.frontend.storage.services:storage * @description * Registers callback to observe changes on service. * @param {function} callback - Observer callback function * @return {object} - storage service. * @function ### registerObserverCallback: (callback) -> observerCallbacks.push(callback) this ###* * @ngdoc object * @name notifyObservers * @methodOf esef.frontend.storage.services:storage * @description * Notifies registered observers by running callbacks. * @return {object} - Storage service. * @function ### notifyObservers: -> angular.forEach observerCallbacks, (callback) -> callback() this
true
'use strict' ###* * @ngdoc service * @name esef.frontend.storage.services:storage * @description * Storage service which stores key/value objects and notifies changes with observer pattern. * @function * @author PI:NAME:<NAME>END_PI ### angular.module 'esef.frontend.storage' .factory 'storage', -> storage = {} observerCallbacks = [] ###* * @ngdoc object * @name store * @methodOf esef.frontend.storage.services:storage * @description * Store method for storage. Stores given object with given key. Calls registered callback functions to inform about the change. * @param {string} key - Storage key. * @param {object} newValues - Object to be stored on given key. * @return {object} - storage service. * @function ### store: (key, newValues) -> storage[key] = angular.copy newValues # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name setProperty * @methodOf esef.frontend.storage.services:storage * @description * Set method for single property on given key. Calls registered callback functions to inform about the change. * @param {string} key - Object key. * @param {string} propKey - Property key on desired object. * @param {string} val - New value to be set. * @return {object} - storage service. * @function ### setProperty: (key, propKey, val) -> storage[key][propKey] = angular.copy val # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name removeProperty * @methodOf esef.frontend.storage.services:storage * @description * Remove a single property on given object. Calls registered callback functions to inform about the change. * @param {string} key - Object key. * @param {string} key - Property key stored on given object key. * @return {object} - storage service. * @function ### removeProperty: (key, propKey) -> delete storage[key][propKey] # call registered observers this.notifyObservers() this ###* * @ngdoc object * @name set * @methodOf esef.frontend.storage.services:storage * @description * Set method for storage service. Sets given object as storage. * @return {object} - storage service. * @function ### set: (newStorage) -> storage = angular.copy newStorage this.notifyObservers() this ###* * @ngdoc object * @name get * @methodOf esef.frontend.storage.services:storage * @description * Get method for storage service. * @param {string} key - Key of desired object. * @return {object} - Desired object stored on given key. * @function ### get: (key) -> angular.copy storage[key] ###* * @ngdoc object * @name registerObserverCallback * @methodOf esef.frontend.storage.services:storage * @description * Registers callback to observe changes on service. * @param {function} callback - Observer callback function * @return {object} - storage service. * @function ### registerObserverCallback: (callback) -> observerCallbacks.push(callback) this ###* * @ngdoc object * @name notifyObservers * @methodOf esef.frontend.storage.services:storage * @description * Notifies registered observers by running callbacks. * @return {object} - Storage service. * @function ### notifyObservers: -> angular.forEach observerCallbacks, (callback) -> callback() this
[ { "context": ": $scope.email\n \"password\": $scope.password\n \"remember\": Boolean($scop", "end": 439, "score": 0.9372374415397644, "start": 424, "tag": "PASSWORD", "value": "$scope.password" } ]
v2.5/src/app/controllers/loginController.coffee
sharonlucong/compass-intel-rsa-dist
0
define(['./baseController'], ()-> 'use strict'; angular.module('compass.controllers') .controller 'loginCtrl', ['$scope', '$state', 'authService', 'userFactory', ($scope, $state, authService, userFactory) -> $scope.alerts = [] $scope.login = -> credentials = "email": $scope.email "password": $scope.password "remember": Boolean($scope.remember) authService.login(credentials).success (data) -> authService.setCookies("isAuthenticated", true,0.0833,Boolean($scope.remember)) userFactory.login() $state.transitionTo("clusterList") .error (response) -> $scope.alerts.push(response) ] )
177667
define(['./baseController'], ()-> 'use strict'; angular.module('compass.controllers') .controller 'loginCtrl', ['$scope', '$state', 'authService', 'userFactory', ($scope, $state, authService, userFactory) -> $scope.alerts = [] $scope.login = -> credentials = "email": $scope.email "password": <PASSWORD> "remember": Boolean($scope.remember) authService.login(credentials).success (data) -> authService.setCookies("isAuthenticated", true,0.0833,Boolean($scope.remember)) userFactory.login() $state.transitionTo("clusterList") .error (response) -> $scope.alerts.push(response) ] )
true
define(['./baseController'], ()-> 'use strict'; angular.module('compass.controllers') .controller 'loginCtrl', ['$scope', '$state', 'authService', 'userFactory', ($scope, $state, authService, userFactory) -> $scope.alerts = [] $scope.login = -> credentials = "email": $scope.email "password": PI:PASSWORD:<PASSWORD>END_PI "remember": Boolean($scope.remember) authService.login(credentials).success (data) -> authService.setCookies("isAuthenticated", true,0.0833,Boolean($scope.remember)) userFactory.login() $state.transitionTo("clusterList") .error (response) -> $scope.alerts.push(response) ] )
[ { "context": "ql:\n admin_db: 'root'\n admin_password: 'rootme'\n admin_username: 'root'\n engine: 'mysq", "end": 108, "score": 0.999264657497406, "start": 102, "tag": "PASSWORD", "value": "rootme" }, { "context": " admin_password: 'rootme'\n admin_username:...
packages/db/env/mysql/test.coffee
wdavidw/node-mecano
0
module.exports = tags: db: true db: mysql: admin_db: 'root' admin_password: 'rootme' admin_username: 'root' engine: 'mysql' host: 'mysql' port: 3306 config: [ label: 'local' , label: 'remote' ssh: host: '127.0.0.1', username: process.env.USER, private_key_path: '~/.ssh/id_ed25519' ]
158288
module.exports = tags: db: true db: mysql: admin_db: 'root' admin_password: '<PASSWORD>' admin_username: 'root' engine: 'mysql' host: 'mysql' port: 3306 config: [ label: 'local' , label: 'remote' ssh: host: '127.0.0.1', username: process.env.USER, private_key_path: <KEY>' ]
true
module.exports = tags: db: true db: mysql: admin_db: 'root' admin_password: 'PI:PASSWORD:<PASSWORD>END_PI' admin_username: 'root' engine: 'mysql' host: 'mysql' port: 3306 config: [ label: 'local' , label: 'remote' ssh: host: '127.0.0.1', username: process.env.USER, private_key_path: PI:KEY:<KEY>END_PI' ]
[ { "context": "\n asp = new ASP { progress_hook }\n userids = [ 'maxtaco@keybase.io', 'you@yahoo.com' ]\n passphrase = Buffer.from \"c", "end": 647, "score": 0.9999245405197144, "start": 629, "tag": "EMAIL", "value": "maxtaco@keybase.io" }, { "context": "gress_hook }\n userids = [...
dev/gen.iced
samkenxstream/kbpgp
464
{KeyManager} = require '../src/keymanager' {bufferify,ASP} = require '../src/util' {make_esc} = require 'iced-error' util = require 'util' {box} = require '../src/keybase/encode' {Encryptor} = require 'triplesec' progress_hook = (obj) -> if obj.p? s = obj.p.toString() s = "#{s[0...3]}....#{s[(s.length-6)...]}" else s = "" interval = if obj.total? and obj.i? then "(#{obj.i} of #{obj.total})" else "" console.warn "+ #{obj.what} #{interval} #{s}" main = (cb) -> esc = make_esc cb, "main" tsenc = new Encryptor { key : bufferify("shitty"), version : 2 } asp = new ASP { progress_hook } userids = [ 'maxtaco@keybase.io', 'you@yahoo.com' ] passphrase = Buffer.from "cats1122", "utf8" await KeyManager.generate { asp, nbits : 1024, nsubs : 1, userids }, esc defer bundle await bundle.sign {asp}, esc defer() await bundle.export_pgp_public {}, esc defer msg console.log msg # await bundle.export_private_to_server {tsenc,asp}, esc defer pair # await KeyManager.import_from_packed_keybase { raw : pair.keybase, asp }, defer b2 # console.log b2 #await bundle.export_pgp_private_to_client { passphrase, asp }, esc defer msg #console.log util.inspect(pair, { depth : null }) #console.log box(pair.keybase).toString('base64') #console.log msg #await bundle.merge_pgp_private { raw : msg, asp }, esc defer b2 #await bundle.open_pgp { passphrase }, esc defer() #await bundle.open_keybase { tsenc, asp}, esc defer() #console.log bundle.keybase.primary cb null await main defer err if err? console.log err process.exit -1 else process.exit 0
187113
{KeyManager} = require '../src/keymanager' {bufferify,ASP} = require '../src/util' {make_esc} = require 'iced-error' util = require 'util' {box} = require '../src/keybase/encode' {Encryptor} = require 'triplesec' progress_hook = (obj) -> if obj.p? s = obj.p.toString() s = "#{s[0...3]}....#{s[(s.length-6)...]}" else s = "" interval = if obj.total? and obj.i? then "(#{obj.i} of #{obj.total})" else "" console.warn "+ #{obj.what} #{interval} #{s}" main = (cb) -> esc = make_esc cb, "main" tsenc = new Encryptor { key : bufferify("shitty"), version : 2 } asp = new ASP { progress_hook } userids = [ '<EMAIL>', '<EMAIL>' ] passphrase = Buffer.from "<PASSWORD>", "utf<PASSWORD>" await KeyManager.generate { asp, nbits : 1024, nsubs : 1, userids }, esc defer bundle await bundle.sign {asp}, esc defer() await bundle.export_pgp_public {}, esc defer msg console.log msg # await bundle.export_private_to_server {tsenc,asp}, esc defer pair # await KeyManager.import_from_packed_keybase { raw : pair.keybase, asp }, defer b2 # console.log b2 #await bundle.export_pgp_private_to_client { passphrase, asp }, esc defer msg #console.log util.inspect(pair, { depth : null }) #console.log box(pair.keybase).toString('base64') #console.log msg #await bundle.merge_pgp_private { raw : msg, asp }, esc defer b2 #await bundle.open_pgp { passphrase }, esc defer() #await bundle.open_keybase { tsenc, asp}, esc defer() #console.log bundle.keybase.primary cb null await main defer err if err? console.log err process.exit -1 else process.exit 0
true
{KeyManager} = require '../src/keymanager' {bufferify,ASP} = require '../src/util' {make_esc} = require 'iced-error' util = require 'util' {box} = require '../src/keybase/encode' {Encryptor} = require 'triplesec' progress_hook = (obj) -> if obj.p? s = obj.p.toString() s = "#{s[0...3]}....#{s[(s.length-6)...]}" else s = "" interval = if obj.total? and obj.i? then "(#{obj.i} of #{obj.total})" else "" console.warn "+ #{obj.what} #{interval} #{s}" main = (cb) -> esc = make_esc cb, "main" tsenc = new Encryptor { key : bufferify("shitty"), version : 2 } asp = new ASP { progress_hook } userids = [ 'PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI' ] passphrase = Buffer.from "PI:PASSWORD:<PASSWORD>END_PI", "utfPI:PASSWORD:<PASSWORD>END_PI" await KeyManager.generate { asp, nbits : 1024, nsubs : 1, userids }, esc defer bundle await bundle.sign {asp}, esc defer() await bundle.export_pgp_public {}, esc defer msg console.log msg # await bundle.export_private_to_server {tsenc,asp}, esc defer pair # await KeyManager.import_from_packed_keybase { raw : pair.keybase, asp }, defer b2 # console.log b2 #await bundle.export_pgp_private_to_client { passphrase, asp }, esc defer msg #console.log util.inspect(pair, { depth : null }) #console.log box(pair.keybase).toString('base64') #console.log msg #await bundle.merge_pgp_private { raw : msg, asp }, esc defer b2 #await bundle.open_pgp { passphrase }, esc defer() #await bundle.open_keybase { tsenc, asp}, esc defer() #console.log bundle.keybase.primary cb null await main defer err if err? console.log err process.exit -1 else process.exit 0
[ { "context": " user2', (done) ->\n fileData =\n fileKey: '2107ff00571d2cf89eebbd0ddabbdeb38fb0'\n fileName: 'ic_favorite_task.png'\n fil", "end": 434, "score": 0.9997634291648865, "start": 398, "tag": "KEY", "value": "2107ff00571d2cf89eebbd0ddabbdeb38fb0" }, { "cont...
talk-api2x/test/controllers/story.coffee
ikingye/talk-os
3,084
should = require 'should' async = require 'async' Promise = require 'bluebird' app = require '../app' limbo = require 'limbo' {prepare, prepareAsync, cleanup, request, requestAsync} = app { StoryModel NotificationModel } = limbo.use 'talk' describe 'Story#CURD', -> before prepare it 'should create a private story with file and involve user2', (done) -> fileData = fileKey: '2107ff00571d2cf89eebbd0ddabbdeb38fb0' fileName: 'ic_favorite_task.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' other: 'unnecessary property' $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:create' hits |= 0b1 channel.should.containEql "user:#{app.user1._id}" channel.should.containEql "user:#{app.user2._id}" data.category.should.eql 'file' data.data.should.have.properties 'downloadUrl', 'fileKey' data.data.should.not.have.properties 'other' data.members.length.should.eql 2 data._memberIds.should.containEql "#{app.user1._id}" data._memberIds.should.containEql "#{app.user2._id}" app.story1 = data if event is 'notification:update' hits |= 0b10 data.type.should.eql 'story' data.text.should.containEql '{{__info-create-story}}' resolve() if hits is 0b11 catch err reject err $story = Promise.resolve().then -> options = method: 'POST' url: '/stories' body: _teamId: app.team1._id _sessionUserId: app.user1._id category: 'file' data: fileData _memberIds: [ app.user2._id ] requestAsync options .spread (res, story) -> app._dataId = story.data._id story Promise.all [$broadcast, $story] .nodeify done it 'should read a story', (done) -> options = method: 'GET' url: "/stories/#{app.story1._id}" qs: _sessionUserId: app.user2._id request options, (err, res, story) -> story.should.have.properties 'creator', 'members' # Populated creator and members story.members.length.should.eql 2 story.members.forEach (member) -> member.should.have.properties 'name' done err it 'should read a list of stories', (done) -> options = method: 'GET' url: "/stories" qs: _sessionUserId: app.user2._id _teamId: app.team1._id request options, (err, res, stories) -> stories.length.should.above 0 stories.forEach (story) -> story.should.have.properties 'creator', 'members' # Populated creator and members story.members.length.should.eql 2 story.members.forEach (member) -> member.should.have.properties 'name' done err it 'should update a story', (done) -> newFileData = fileKey: '2107ff00571d2cf89eebbd0ddabbdeb38fb0' fileName: 'new_filename.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' other: 'unnecessary property' $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> if event is 'story:update' hits |= 0b1 data.data.should.have.properties 'downloadUrl' data.data.fileName.should.eql 'new_filename.png' # Should not change other fields data._memberIds.length.should.eql 2 # Do not update unprovided fields of data "#{data.data._id}".should.eql "#{app._dataId}" if event is 'message:create' hits |= 0b10 data.body.should.eql '{{__info-update-story}} new_filename.png' resolve() if hits is 0b11 $updateStory = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id data: newFileData requestAsync options Promise.all [$broadcast, $updateStory] .nodeify done it 'should remove a story', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:remove' hits |= 0b1 if event is 'notification:remove' hits |= 0b10 resolve() if hits is 0b11 catch err reject err $removeStory = Promise.resolve().then -> options = method: 'DELETE' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id requestAsync options Promise.all [$broadcast, $removeStory] .nodeify done after cleanup describe 'Story#Members', -> before (done) -> $prepare = prepareAsync() $story = $prepare.then -> story = new StoryModel creator: app.user1._id team: app.team1._id category: 'file' data: fileKey: '1107ff00571d2cf89eebbd0ddabbdeb38fb0' fileName: 'ic_favorite_task.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' app.story1 = story story.$save() $story.nodeify done it 'should add user to story1', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:update' hits |= 0b1 data.members.length.should.eql 2 data.members.forEach (member) -> member.should.have.properties 'name' if event is 'notification:update' hits |= 0b10 data.text.should.eql '{{__info-invite-members}} dajiangyou2' if event is 'message:create' hits |= 0b100 data.body.should.eql '{{__info-invite-members}} dajiangyou2' resolve() if hits is 0b111 catch err reject err $addMembers = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id addMembers: [app.user2._id] requestAsync options Promise.all [$broadcast, $addMembers] .nodeify done it 'should remove user from story1', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:update' hits |= 0b1 data.members.length.should.eql 1 data.members.forEach (member) -> member.should.have.properties 'name' if event is 'notification:update' hits |= 0b10 "#{data._teamId}".should.eql "#{app.team1._id}" if event is 'message:create' hits |= 0b100 data.body.should.eql "{{__info-remove-members}} dajiangyou2" resolve() if hits is 0b111 catch err reject err $removeMembers = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id removeMembers: [app.user2._id] requestAsync options Promise.all [$broadcast, $removeMembers] .nodeify done after cleanup describe 'Story#Link', -> before prepare it 'should create a link typed story and get url metas from link address', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try # Create new story without title if event is 'story:create' hits |= 0b1 data.category.should.eql 'link' resolve() if hits is 0b1 catch err reject err $createStory = Promise.resolve().then -> options = method: 'POST' url: '/stories' body: _sessionUserId: app.user1._id _teamId: app.team1._id category: 'link' data: url: 'http://t.cn/Rz3I0cX' app.requestAsync options Promise.all [$createStory, $broadcast] .nodeify done after cleanup
62954
should = require 'should' async = require 'async' Promise = require 'bluebird' app = require '../app' limbo = require 'limbo' {prepare, prepareAsync, cleanup, request, requestAsync} = app { StoryModel NotificationModel } = limbo.use 'talk' describe 'Story#CURD', -> before prepare it 'should create a private story with file and involve user2', (done) -> fileData = fileKey: '<KEY>' fileName: 'ic_favorite_task.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' other: 'unnecessary property' $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:create' hits |= 0b1 channel.should.containEql "user:#{app.user1._id}" channel.should.containEql "user:#{app.user2._id}" data.category.should.eql 'file' data.data.should.have.properties 'downloadUrl', 'fileKey' data.data.should.not.have.properties 'other' data.members.length.should.eql 2 data._memberIds.should.containEql "#{app.user1._id}" data._memberIds.should.containEql "#{app.user2._id}" app.story1 = data if event is 'notification:update' hits |= 0b10 data.type.should.eql 'story' data.text.should.containEql '{{__info-create-story}}' resolve() if hits is 0b11 catch err reject err $story = Promise.resolve().then -> options = method: 'POST' url: '/stories' body: _teamId: app.team1._id _sessionUserId: app.user1._id category: 'file' data: fileData _memberIds: [ app.user2._id ] requestAsync options .spread (res, story) -> app._dataId = story.data._id story Promise.all [$broadcast, $story] .nodeify done it 'should read a story', (done) -> options = method: 'GET' url: "/stories/#{app.story1._id}" qs: _sessionUserId: app.user2._id request options, (err, res, story) -> story.should.have.properties 'creator', 'members' # Populated creator and members story.members.length.should.eql 2 story.members.forEach (member) -> member.should.have.properties 'name' done err it 'should read a list of stories', (done) -> options = method: 'GET' url: "/stories" qs: _sessionUserId: app.user2._id _teamId: app.team1._id request options, (err, res, stories) -> stories.length.should.above 0 stories.forEach (story) -> story.should.have.properties 'creator', 'members' # Populated creator and members story.members.length.should.eql 2 story.members.forEach (member) -> member.should.have.properties 'name' done err it 'should update a story', (done) -> newFileData = fileKey: '<KEY>' fileName: 'new_filename.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' other: 'unnecessary property' $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> if event is 'story:update' hits |= 0b1 data.data.should.have.properties 'downloadUrl' data.data.fileName.should.eql 'new_filename.png' # Should not change other fields data._memberIds.length.should.eql 2 # Do not update unprovided fields of data "#{data.data._id}".should.eql "#{app._dataId}" if event is 'message:create' hits |= 0b10 data.body.should.eql '{{__info-update-story}} new_filename.png' resolve() if hits is 0b11 $updateStory = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id data: newFileData requestAsync options Promise.all [$broadcast, $updateStory] .nodeify done it 'should remove a story', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:remove' hits |= 0b1 if event is 'notification:remove' hits |= 0b10 resolve() if hits is 0b11 catch err reject err $removeStory = Promise.resolve().then -> options = method: 'DELETE' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id requestAsync options Promise.all [$broadcast, $removeStory] .nodeify done after cleanup describe 'Story#Members', -> before (done) -> $prepare = prepareAsync() $story = $prepare.then -> story = new StoryModel creator: app.user1._id team: app.team1._id category: 'file' data: fileKey: '<KEY>' fileName: 'ic_favorite_task.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' app.story1 = story story.$save() $story.nodeify done it 'should add user to story1', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:update' hits |= 0b1 data.members.length.should.eql 2 data.members.forEach (member) -> member.should.have.properties 'name' if event is 'notification:update' hits |= 0b10 data.text.should.eql '{{__info-invite-members}} dajiangyou2' if event is 'message:create' hits |= 0b100 data.body.should.eql '{{__info-invite-members}} dajiangyou2' resolve() if hits is 0b111 catch err reject err $addMembers = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id addMembers: [app.user2._id] requestAsync options Promise.all [$broadcast, $addMembers] .nodeify done it 'should remove user from story1', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:update' hits |= 0b1 data.members.length.should.eql 1 data.members.forEach (member) -> member.should.have.properties 'name' if event is 'notification:update' hits |= 0b10 "#{data._teamId}".should.eql "#{app.team1._id}" if event is 'message:create' hits |= 0b100 data.body.should.eql "{{__info-remove-members}} dajiangyou2" resolve() if hits is 0b111 catch err reject err $removeMembers = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id removeMembers: [app.user2._id] requestAsync options Promise.all [$broadcast, $removeMembers] .nodeify done after cleanup describe 'Story#Link', -> before prepare it 'should create a link typed story and get url metas from link address', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try # Create new story without title if event is 'story:create' hits |= 0b1 data.category.should.eql 'link' resolve() if hits is 0b1 catch err reject err $createStory = Promise.resolve().then -> options = method: 'POST' url: '/stories' body: _sessionUserId: app.user1._id _teamId: app.team1._id category: 'link' data: url: 'http://t.cn/Rz3I0cX' app.requestAsync options Promise.all [$createStory, $broadcast] .nodeify done after cleanup
true
should = require 'should' async = require 'async' Promise = require 'bluebird' app = require '../app' limbo = require 'limbo' {prepare, prepareAsync, cleanup, request, requestAsync} = app { StoryModel NotificationModel } = limbo.use 'talk' describe 'Story#CURD', -> before prepare it 'should create a private story with file and involve user2', (done) -> fileData = fileKey: 'PI:KEY:<KEY>END_PI' fileName: 'ic_favorite_task.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' other: 'unnecessary property' $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:create' hits |= 0b1 channel.should.containEql "user:#{app.user1._id}" channel.should.containEql "user:#{app.user2._id}" data.category.should.eql 'file' data.data.should.have.properties 'downloadUrl', 'fileKey' data.data.should.not.have.properties 'other' data.members.length.should.eql 2 data._memberIds.should.containEql "#{app.user1._id}" data._memberIds.should.containEql "#{app.user2._id}" app.story1 = data if event is 'notification:update' hits |= 0b10 data.type.should.eql 'story' data.text.should.containEql '{{__info-create-story}}' resolve() if hits is 0b11 catch err reject err $story = Promise.resolve().then -> options = method: 'POST' url: '/stories' body: _teamId: app.team1._id _sessionUserId: app.user1._id category: 'file' data: fileData _memberIds: [ app.user2._id ] requestAsync options .spread (res, story) -> app._dataId = story.data._id story Promise.all [$broadcast, $story] .nodeify done it 'should read a story', (done) -> options = method: 'GET' url: "/stories/#{app.story1._id}" qs: _sessionUserId: app.user2._id request options, (err, res, story) -> story.should.have.properties 'creator', 'members' # Populated creator and members story.members.length.should.eql 2 story.members.forEach (member) -> member.should.have.properties 'name' done err it 'should read a list of stories', (done) -> options = method: 'GET' url: "/stories" qs: _sessionUserId: app.user2._id _teamId: app.team1._id request options, (err, res, stories) -> stories.length.should.above 0 stories.forEach (story) -> story.should.have.properties 'creator', 'members' # Populated creator and members story.members.length.should.eql 2 story.members.forEach (member) -> member.should.have.properties 'name' done err it 'should update a story', (done) -> newFileData = fileKey: 'PI:KEY:<KEY>END_PI' fileName: 'new_filename.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' other: 'unnecessary property' $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> if event is 'story:update' hits |= 0b1 data.data.should.have.properties 'downloadUrl' data.data.fileName.should.eql 'new_filename.png' # Should not change other fields data._memberIds.length.should.eql 2 # Do not update unprovided fields of data "#{data.data._id}".should.eql "#{app._dataId}" if event is 'message:create' hits |= 0b10 data.body.should.eql '{{__info-update-story}} new_filename.png' resolve() if hits is 0b11 $updateStory = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id data: newFileData requestAsync options Promise.all [$broadcast, $updateStory] .nodeify done it 'should remove a story', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:remove' hits |= 0b1 if event is 'notification:remove' hits |= 0b10 resolve() if hits is 0b11 catch err reject err $removeStory = Promise.resolve().then -> options = method: 'DELETE' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id requestAsync options Promise.all [$broadcast, $removeStory] .nodeify done after cleanup describe 'Story#Members', -> before (done) -> $prepare = prepareAsync() $story = $prepare.then -> story = new StoryModel creator: app.user1._id team: app.team1._id category: 'file' data: fileKey: 'PI:KEY:<KEY>END_PI' fileName: 'ic_favorite_task.png' fileType: 'png' fileSize: 2986 fileCategory: 'image' app.story1 = story story.$save() $story.nodeify done it 'should add user to story1', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:update' hits |= 0b1 data.members.length.should.eql 2 data.members.forEach (member) -> member.should.have.properties 'name' if event is 'notification:update' hits |= 0b10 data.text.should.eql '{{__info-invite-members}} dajiangyou2' if event is 'message:create' hits |= 0b100 data.body.should.eql '{{__info-invite-members}} dajiangyou2' resolve() if hits is 0b111 catch err reject err $addMembers = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id addMembers: [app.user2._id] requestAsync options Promise.all [$broadcast, $addMembers] .nodeify done it 'should remove user from story1', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try if event is 'story:update' hits |= 0b1 data.members.length.should.eql 1 data.members.forEach (member) -> member.should.have.properties 'name' if event is 'notification:update' hits |= 0b10 "#{data._teamId}".should.eql "#{app.team1._id}" if event is 'message:create' hits |= 0b100 data.body.should.eql "{{__info-remove-members}} dajiangyou2" resolve() if hits is 0b111 catch err reject err $removeMembers = Promise.resolve().then -> options = method: 'PUT' url: "/stories/#{app.story1._id}" body: _sessionUserId: app.user1._id removeMembers: [app.user2._id] requestAsync options Promise.all [$broadcast, $removeMembers] .nodeify done after cleanup describe 'Story#Link', -> before prepare it 'should create a link typed story and get url metas from link address', (done) -> $broadcast = new Promise (resolve, reject) -> hits = 0 app.broadcast = (channel, event, data) -> try # Create new story without title if event is 'story:create' hits |= 0b1 data.category.should.eql 'link' resolve() if hits is 0b1 catch err reject err $createStory = Promise.resolve().then -> options = method: 'POST' url: '/stories' body: _sessionUserId: app.user1._id _teamId: app.team1._id category: 'link' data: url: 'http://t.cn/Rz3I0cX' app.requestAsync options Promise.all [$createStory, $broadcast] .nodeify done after cleanup
[ { "context": "ypeLookup.CardSkin # category of cosmetic\n\tname: \"Healing Mystic Bandai Namco\"\n\tshopDescription: \"Heal", "end": 44622, "score": 0.7467601299285889, "start": 44620, "tag": "NAME", "value": "He" }, { "context": "category of cosmetic\n\tname: \"Healing Mystic Bandai...
app/sdk/cosmetics/cosmeticsFactory.coffee
willroberts/duelyst
5
# do not add this file to any resource package # it is handled by special processing _ = require 'underscore' moment = require 'moment' RSX = require('app/data/resources') CosmeticsLookup = require './cosmeticsLookup' CosmeticsTypeLookup = require './cosmeticsTypeLookup' CosmeticsChestTypeLookup = require './cosmeticsChestTypeLookup' EmoteCategory = require './emoteCategory' Factions = require 'app/sdk/cards/factionsLookup' Rarity = require 'app/sdk/cards/rarityLookup' RarityFactory = require 'app/sdk/cards/rarityFactory' Cards = require 'app/sdk/cards/cardsLookup' i18next = require 'i18next' class CosmeticsFactory @_cosmeticsById: {} @cosmeticForIdentifier: (identifier) -> cosmeticData = @_cosmeticsById[identifier] if cosmeticData return cosmeticData @cosmeticForSku: (sku) -> cosmeticId = parseInt(sku.slice(sku.lastIndexOf("-")+1)) return @cosmeticForIdentifier(cosmeticId) @_cachedCosmetics: null @getAllCosmetics: () -> return @_cachedCosmetics @_cachedCosmeticsForType: null @cosmeticsForType: (cosmeticType) -> return @_cachedCosmeticsForType[cosmeticType] @_cachedCosmeticsForTypeAndFaction: null @cosmeticsForTypeAndFaction: (cosmeticType, factionId) -> return @_cachedCosmeticsForTypeAndFaction[cosmeticType][factionId] @_cachedCosmeticsForTypeAndRarity: null @cosmeticsForTypeAndRarity: (cosmeticType, rarityId) -> return @_cachedCosmeticsForTypeAndRarity[cosmeticType][rarityId] @_cachedCosmeticsForTypeAndFactionAndRarity: null @cosmeticsForTypeAndFactionAndRarity: (cosmeticType, factionId, rarityId) -> return @_cachedCosmeticsForTypeAndFactionAndRarity[cosmeticType][factionId][rarityId] @_cachedCosmeticsForFaction: null @cosmeticsForFaction: (factionId) -> return @_cachedCosmeticsForFaction[factionId] @_cachedCosmeticsForRarity: null @cosmeticsForRarity: (rarityId) -> return @_cachedCosmeticsForRarity[rarityId] @_cachedCosmeticsForChestType: null @cosmeticsForChestType: (chestType) -> return @_cachedCosmeticsForChestType[chestType] @_cachedCosmeticSubTypesByType: null @visibleCosmeticSubTypesForType: (cosmeticType) -> orderedSubTypes = [] # To do any manual ordering add a subtype to the if/else below, anything not in list will be appended if cosmeticType == CosmeticsTypeLookup.Emote orderedSubTypes = ["Lyonar","Songhai","Vetruvian","Abyssian","Magmar","Vanar","Neutral"] else if cosmeticType == CosmeticsTypeLookup.CardBack orderedSubTypes = [] else if cosmeticType == CosmeticsTypeLookup.ProfileIcon orderedSubTypes = ["Lyonar","Songhai","Vetruvian","Abyssian","Magmar","Vanar","Neutral"] else if cosmeticType == CosmeticsTypeLookup.Scene orderedSubTypes = [] # To hide a subtype, _.without it here # Append any subtypes that are not in the above list allSubtypesForType = @_cachedCosmeticSubTypesByType[cosmeticType] subTypesNotInOrderedList = _.difference(allSubtypesForType,orderedSubTypes) # Combine ordered and any missing subtypes visibleSubTypes = orderedSubTypes.concat(subTypesNotInOrderedList) return visibleSubTypes @_cachedLocalizedSubTypeTitles: null @localizedSubTypeTitle: (subTypeId) -> if not @_cachedLocalizedSubTypeTitles? @_cachedLocalizedSubTypeTitles = {} @_cachedLocalizedSubTypeTitles["all"] = i18next.t("shop.all_subcategories_title") @_cachedLocalizedSubTypeTitles["Lyonar"] = i18next.t("factions.faction_1_abbreviated_name") @_cachedLocalizedSubTypeTitles["Songhai"] = i18next.t("factions.faction_2_abbreviated_name") @_cachedLocalizedSubTypeTitles["Vetruvian"] = i18next.t("factions.faction_3_abbreviated_name") @_cachedLocalizedSubTypeTitles["Abyssian"] = i18next.t("factions.faction_4_abbreviated_name") @_cachedLocalizedSubTypeTitles["Magmar"] = i18next.t("factions.faction_5_abbreviated_name") @_cachedLocalizedSubTypeTitles["Vanar"] = i18next.t("factions.faction_6_abbreviated_name") @_cachedLocalizedSubTypeTitles["Neutral"] = i18next.t("factions.faction_neutral_abbreviated_name") @_cachedLocalizedSubTypeTitles["Emotes"] = i18next.t("shop.category_emotes_name") if @_cachedLocalizedSubTypeTitles[subTypeId]? return @_cachedLocalizedSubTypeTitles[subTypeId] else # console.warn "No localized string for subtype: " + subTypeId return subTypeId @_cachedCosmeticsForTypeAndSubType: null @cosmeticsForTypeAndSubtype: (type,subType) -> return @_cachedCosmeticsForTypeAndSubType[type][subType] @profileIconForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.ProfileIcon return cosmeticData else # return default profile icon return @cosmeticForIdentifier(@getDefaultProfileIconIdentifier()) @isIdentifierForProfileIcon: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.ProfileIcon @getDefaultProfileIconIdentifier: () -> return CosmeticsLookup.ProfileIcon.Tree @cardBackForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardBack return cosmeticData else # return default card back return @cosmeticForIdentifier(@getDefaultCardBackIdentifier()) @isIdentifierForCardBack: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardBack @getDefaultCardBackIdentifier: () -> return CosmeticsLookup.CardBack.Normal @sceneForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.Scene return cosmeticData else # return default card back return @cosmeticForIdentifier(@getDefaultSceneIdentifier()) @isIdentifierForScene: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.Scene @getDefaultSceneIdentifier: () -> return CosmeticsLookup.Scene.Frostfire @_cachedCardSkinsForCardId: null @cardSkinsForCard: (cardId) -> return @_cachedCardSkinsForCardId[cardId] || [] @_cachedCardSkinIdsForCardId: null @cardSkinIdsForCard: (cardId) -> return @_cachedCardSkinIdsForCardId[cardId] || [] @isIdentifierForCardSkin: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardSkin @injectSkinPropertiesIntoCard: (card, identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardSkin # anim resource animResource = cosmeticData.animResource if animResource? then card.setBaseAnimResource(animResource) @cosmeticProductDataForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? return @_mapCosmeticDataToProductData(cosmeticData) @cosmeticProductDataForType: (cosmeticType,cosmeticSubType) -> cosmeticDatas = null if cosmeticType? and not cosmeticSubType? cosmeticDatas = CosmeticsFactory.cosmeticsForType(cosmeticType) else if cosmeticType? and cosmeticSubType? cosmeticDatas = CosmeticsFactory.cosmeticsForTypeAndSubtype(cosmeticType,cosmeticSubType) else console.warn "No cosmetic type provided to CosmeticsFactory.cosmeticModelsForType" return [] cosmeticDatas = _.filter cosmeticDatas, (c)-> return c.purchasable && c.rarityId return _.map(cosmeticDatas,(cosmeticData) => return @_mapCosmeticDataToProductData(cosmeticData) ) @_mapCosmeticDataToProductData: (cosmeticData)-> rarityData = RarityFactory.rarityForIdentifier(cosmeticData.rarityId) cosmeticRSX = cosmeticData.rsx || {} cosmeticCoverRSX = cosmeticData.coverRSX || RSX.challenge_gate_010 cosmeticAnimResource = cosmeticData.animResource || {} return { id: cosmeticData.id sku: cosmeticData.sku steam_id: cosmeticData.id name: cosmeticData.name price: rarityData.cosmeticHardPrice rarity_id: cosmeticData.rarityId || Rarity.Common anim_resource: cosmeticAnimResource icon_image_url: cosmeticData.img icon_image_resource_name: cosmeticRSX.name cover_image_url: cosmeticCoverRSX.img cover_image_resource_name: cosmeticCoverRSX.name description: cosmeticData.shopDescription category_name: CosmeticsTypeLookup[cosmeticData.typeId] # TODO: player visible name category_id: cosmeticData.typeId sub_category_name: cosmeticData.subTypeId type: "cosmetic" faction_id: if !cosmeticData.factionId? or cosmeticData.factionId == Factions.Neutral then 0 else cosmeticData.factionId general_id: cosmeticData.generalId || 0 } @cosmeticResourcesForIdentifier: (identifier) -> resources = [] cosmeticData = @.cosmeticForIdentifier(identifier) if cosmeticData? if cosmeticData.rsx? then resources.push(cosmeticData.rsx) if cosmeticData.coverRSX? then resources.push(cosmeticData.coverRSX) if cosmeticData.glowOutlineRSX? then resources.push(cosmeticData.glowOutlineRSX) if cosmeticData.animResource? for animResourceKey in Object.keys(cosmeticData.animResource) animResourceName = cosmeticData.animResource[animResourceKey] if _.isString(animResourceName) rsx = RSX[animResourceName] if rsx? then resources.push(rsx) return resources @cosmeticProductAttrsForIdentifier: (identifier)-> cosmeticData = @.cosmeticForIdentifier(identifier) if cosmeticData return @._mapCosmeticDataToProductData(cosmeticData) else return null @cosmeticProductAttrsForSKU: (sku)-> cosmeticData = @.cosmeticForSku(sku) if cosmeticData return @._mapCosmeticDataToProductData(cosmeticData) else return null @nameForCosmeticTypeId: (cosmeticTypeId)-> if cosmeticTypeId == CosmeticsTypeLookup.Emote return "Emote" else if cosmeticTypeId == CosmeticsTypeLookup.CardBack return "Card Back" else if cosmeticTypeId == CosmeticsTypeLookup.ProfileIcon return "Profile Icon" else if cosmeticTypeId == CosmeticsTypeLookup.CardSkin return "Card Skin" else if cosmeticTypeId == CosmeticsTypeLookup.Scene return "Scene" else if cosmeticTypeId == CosmeticsTypeLookup.BattleMap return "Battle Map" else return null @nameForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return i18next.t("rarity.rarity_common") else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return i18next.t("rarity.rarity_rare") else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return i18next.t("rarity.rarity_epic") else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return i18next.t("mystery_crates.boss_crate_adjective") else if cosmeticCrateType == CosmeticsChestTypeLookup.Frostfire return i18next.t("mystery_crates.frostfire_adjective") else if cosmeticCrateType == CosmeticsChestTypeLookup.FrostfirePremium return i18next.t("mystery_crates.frostfire_premium_adjective") else return i18next.t("mystery_crates.gift_crate_adjective") @keySKUForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return "Common_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return "Rare_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return "Epic_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return "Boss_Chest_Key" else console.warn "Invalid cosmetic chest type provided to CosmeticsFactory.keySKUForCosmeticChestType" return "Invalid_Chest_Key" @descriptionForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return [ i18next.t("cosmetics.common_mystery_crate_1"), i18next.t("cosmetics.common_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return [ i18next.t("cosmetics.rare_mystery_crate_1"), i18next.t("cosmetics.rare_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return [ i18next.t("cosmetics.epic_mystery_crate_1"), i18next.t("cosmetics.epic_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return [ i18next.t("cosmetics.boss_crate_1"), i18next.t("cosmetics.boss_crate_2"), i18next.t("cosmetics.boss_crate_3"), i18next.t("cosmetics.boss_crate_4") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Frostfire return i18next.t("cosmetics.frostfire_crate") else if cosmeticCrateType == CosmeticsChestTypeLookup.FrostfirePremium return i18next.t("cosmetics.frostfire_premium_crate") else return i18next.t("cosmetics.generic_mystery_crate") # setup emote data cos = CosmeticsFactory._cosmeticsById ### EXAMPLE: cos[CosmeticsLookup.CardBacks.Shiny] = { id: CosmeticsLookup.CardBacks.Shiny # id of cosmetic that maps to cosmetics lookup enabled: true # whether cosmetic is enabled globally alwaysVisible: true # whether cosmetic is always visible to the user, whether they own it or not availableAt: moment.utc("2016-12-25").valueOf() # Optional factionId: Factions.Faction1 # if this cosmetic is limited to a faction # Optional generalId: Cards.Faction1.AltGeneral img: RSX.emote_basic_happy.img # img to use for showing emote label: "Hello" # text to use for text only emotes order: 0 # sorting order of cosmetic (shows in ascending order, i.e. all 0s, then all 1s) typeId: CosmeticsTypeLookup.CardBack # category of cosmetic subType: "Shiny" # Any string identifier, shown as the sub category in shop sku: "emote-200" # This is autogenerated, ctrl f: "Generate skus procedurally" chestType: CosmeticsChestTypeLookup.Common # TODO: is chest it unlocks in == rarity? rarityId: Rarity.Common rewardOrder: 0 # Rewards of a lower number (within a rarity) are always rewarded first from loot crates, defaults to 0 } ### # region COSMETICS ORDERING ORDER_EMOTES = 0 ORDER_CARD_BACKS = 1 ORDER_PROFILE_ICONS = 0 ORDER_MAIN_MENU_PLATES = 1 ORDER_CARD_SKINS = 2 ORDER_SCENES = 0 # endregion COSMETICS ORDERING # region EMOTE ORDERING EMOTE_ORDER_HAPPY = 0 EMOTE_ORDER_ANGRY = 1 EMOTE_ORDER_CONFUSED = 2 EMOTE_ORDER_SAD = 3 EMOTE_ORDER_TAUNT = 4 # wink EMOTE_ORDER_KISS = 5 # love EMOTE_ORDER_FRUSTRATED = 6 EMOTE_ORDER_SURPRISED = 7 EMOTE_ORDER_BOW = 8 EMOTE_ORDER_SLEEP = 9 EMOTE_ORDER_SUNGLASSES = 10 EMOTE_ORDER_CUSTOM = 11 # endregion EMOTE ORDERING # region Cosmetics datas # Shorthand the cosmetics lookups cl = CosmeticsLookup CardBack = cl.CardBack Emote = cl.Emote ProfileIcon = cl.ProfileIcon CardSkin = cl.CardSkin Scene = cl.Scene BattleMap = cl.BattleMap # region Scenes cos[Scene.MagaariEmberHighlands] = { id: Scene.MagaariEmberHighlands typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_magaari_name") shopDescription: i18next.t("cosmetics.scene_magaari_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "MagaariEmberHighlands" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.ObsidianWoods] = { id: Scene.ObsidianWoods typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_obsidian_woods_name") shopDescription: i18next.t("cosmetics.scene_obsidian_woods_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "ObsidianWoods" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Frostfire] = { id: Scene.Frostfire typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_frostfire_festival_name") shopDescription: i18next.t("cosmetics.scene_frostfire_festival_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "FrostfireMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Vetruvian] = { id: Scene.Vetruvian typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_city_of_kaero_name") shopDescription: i18next.t("cosmetics.scene_city_of_kaero_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "VetruvianMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Shimzar] = { id: Scene.Shimzar typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_unearthed_prophecy_name") shopDescription: i18next.t("cosmetics.scene_unearthed_prophecy_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "ShimzarMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } # endregion Scenes # region Card Skins cos[CardSkin.Faction1GeneralTier2] = { id: CardSkin.Faction1GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_argeon_m2_name") shopDescription: i18next.t("cosmetics.skin_argeon_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1GeneralTier2GIF.img rsx: RSX.f1GeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.General skinNum: 1 animResource: { breathing: RSX.f1GeneralTier2Breathing.name idle: RSX.f1GeneralTier2Idle.name walk: RSX.f1GeneralTier2Run.name attack: RSX.f1GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1GeneralTier2Damage.name death: RSX.f1GeneralTier2Death.name castStart: RSX.f1GeneralTier2CastStart.name castEnd: RSX.f1GeneralTier2CastEnd.name castLoop: RSX.f1GeneralTier2CastLoop.name cast: RSX.f1GeneralTier2Cast.name } } cos[CardSkin.Faction1GeneralRogueLegacy] = { id: CardSkin.Faction1GeneralRogueLegacy typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_rogue_legacy_name") shopDescription: i18next.t("cosmetics.skin_rogue_legacy_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS img: RSX.f1GeneralRogueLegacyGIF.img rsx: RSX.f1GeneralRogueLegacyGIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction1.General skinNum: 2 animResource: { breathing: RSX.f1GeneralRogueLegacyBreathing.name idle: RSX.f1GeneralRogueLegacyIdle.name walk: RSX.f1GeneralRogueLegacyRun.name attack: RSX.f1GeneralRogueLegacyAttack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1GeneralRogueLegacyDamage.name death: RSX.f1GeneralRogueLegacyDeath.name castStart: RSX.f1GeneralRogueLegacyCastStart.name castEnd: RSX.f1GeneralRogueLegacyCastEnd.name castLoop: RSX.f1GeneralRogueLegacyCastLoop.name cast: RSX.f1GeneralRogueLegacyCast.name } } cos[CardSkin.Faction1AltGeneralTier2] = { id: CardSkin.Faction1AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ziran_m2_name") shopDescription: i18next.t("cosmetics.skin_ziran_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1AltGeneralTier2GIF.img rsx: RSX.f1AltGeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.AltGeneral skinNum: 1 animResource: { breathing : RSX.f1AltGeneralTier2Breathing.name idle : RSX.f1AltGeneralTier2Idle.name walk : RSX.f1AltGeneralTier2Run.name attack : RSX.f1AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.5 damage : RSX.f1AltGeneralTier2Hit.name death : RSX.f1AltGeneralTier2Death.name castStart : RSX.f1AltGeneralTier2CastStart.name castEnd : RSX.f1AltGeneralTier2CastEnd.name castLoop : RSX.f1AltGeneralTier2CastLoop.name cast : RSX.f1AltGeneralTier2Cast.name } } cos[CardSkin.Faction1IVGeneralTier2] = { id: CardSkin.Faction1IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_brome_m2_name") shopDescription: i18next.t("cosmetics.skin_brome_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1IVGeneralTier2GIF.img rsx: RSX.f1IVGeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.ThirdGeneral skinNum: 1 animResource: { breathing: RSX.f1IVGeneralTier2Breathing.name idle: RSX.f1IVGeneralTier2Idle.name walk: RSX.f1IVGeneralTier2Run.name attack: RSX.f1IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1IVGeneralTier2Damage.name death: RSX.f1IVGeneralTier2Death.name castStart: RSX.f1IVGeneralTier2CastStart.name castEnd: RSX.f1IVGeneralTier2CastEnd.name castLoop: RSX.f1IVGeneralTier2CastLoop.name cast: RSX.f1IVGeneralTier2Cast.name } } cos[CardSkin.Faction2GeneralTier2] = { id: CardSkin.Faction2GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_kaleos_m2_name") shopDescription: i18next.t("cosmetics.skin_kaleos_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2GeneralTier2GIF.img rsx: RSX.f2GeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.General skinNum: 1 animResource: { breathing : RSX.f2GeneralTier2Breathing.name idle : RSX.f2GeneralTier2Idle.name walk : RSX.f2GeneralTier2Run.name attack : RSX.f2GeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2GeneralTier2Damage.name death : RSX.f2GeneralTier2Death.name castStart : RSX.f2GeneralTier2CastStart.name castEnd : RSX.f2GeneralTier2CastEnd.name castLoop : RSX.f2GeneralTier2CastLoop.name cast : RSX.f2GeneralTier2Cast.name } } cos[CardSkin.Faction2GeneralDogehai] = { id: CardSkin.Faction2GeneralDogehai typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_dogehai_name") shopDescription: i18next.t("cosmetics.skin_dogehai_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS img: RSX.f2GeneralDogehaiGIF.img rsx: RSX.f2GeneralDogehaiGIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction2.General skinNum: 2 animResource: { breathing : RSX.f2GeneralDogehaiBreathing.name idle : RSX.f2GeneralDogehaiIdle.name walk : RSX.f2GeneralDogehaiRun.name attack : RSX.f2GeneralDogehaiAttack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2GeneralDogehaiDamage.name death : RSX.f2GeneralDogehaiDeath.name castStart : RSX.f2GeneralDogehaiCastStart.name castEnd : RSX.f2GeneralDogehaiCastEnd.name castLoop : RSX.f2GeneralDogehaiCastLoop.name cast : RSX.f2GeneralDogehaiCast.name } } cos[CardSkin.Faction2AltGeneralTier2] = { id: CardSkin.Faction2AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_reva_m2_name") shopDescription: i18next.t("cosmetics.skin_reva_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2AltGeneralTier2GIF.img rsx: RSX.f2AltGeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.AltGeneral skinNum: 1 animResource: { breathing : RSX.f2AltGeneralTier2Breathing.name idle : RSX.f2AltGeneralTier2Idle.name walk : RSX.f2AltGeneralTier2Run.name attack : RSX.f2AltGeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 1.0 damage : RSX.f2AltGeneralTier2Hit.name death : RSX.f2AltGeneralTier2Death.name castStart : RSX.f2AltGeneralTier2CastStart.name castEnd : RSX.f2AltGeneralTier2CastEnd.name castLoop : RSX.f2AltGeneralTier2CastLoop.name cast : RSX.f2AltGeneralTier2Cast.name } } cos[CardSkin.Faction2IVGeneralTier2] = { id: CardSkin.Faction2IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_shidai_m2_name") shopDescription: i18next.t("cosmetics.skin_shidai_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2IVGeneralTier2GIF.img rsx: RSX.f2IVGeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f2IVGeneralTier2Breathing.name idle : RSX.f2IVGeneralTier2Idle.name walk : RSX.f2IVGeneralTier2Run.name attack : RSX.f2IVGeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2IVGeneralTier2Damage.name death : RSX.f2IVGeneralTier2Death.name castStart : RSX.f2IVGeneralTier2CastStart.name castEnd : RSX.f2IVGeneralTier2CastEnd.name castLoop : RSX.f2IVGeneralTier2CastLoop.name cast : RSX.f2IVGeneralTier2Cast.name } } cos[CardSkin.Faction3GeneralTier2] = { id: CardSkin.Faction3GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zirix_m2_name") shopDescription: i18next.t("cosmetics.skin_zirix_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3GeneralTier2GIF.img rsx: RSX.f3GeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.General skinNum: 1 animResource: { breathing : RSX.f3GeneralTier2Breathing.name idle : RSX.f3GeneralTier2Idle.name walk : RSX.f3GeneralTier2Run.name attack : RSX.f3GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3GeneralTier2Damage.name death : RSX.f3GeneralTier2Death.name castStart : RSX.f3GeneralTier2CastStart.name castEnd : RSX.f3GeneralTier2CastEnd.name castLoop : RSX.f3GeneralTier2CastLoop.name cast : RSX.f3GeneralTier2Cast.name } } cos[CardSkin.Faction3GeneralFestive] = { id: CardSkin.Faction3GeneralFestive typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zirix_festive_name") shopDescription: i18next.t("cosmetics.skin_zirix_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f3GeneralFestiveGIF.img rsx: RSX.f3GeneralFestiveGIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction3.General skinNum: 2 animResource: { breathing : RSX.f3GeneralFestiveBreathing.name idle : RSX.f3GeneralFestiveIdle.name walk : RSX.f3GeneralFestiveRun.name attack : RSX.f3GeneralFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3GeneralFestiveDamage.name death : RSX.f3GeneralFestiveDeath.name castStart : RSX.f3GeneralFestiveCastStart.name castEnd : RSX.f3GeneralFestiveCastEnd.name castLoop : RSX.f3GeneralFestiveCastLoop.name cast : RSX.f3GeneralFestiveCast.name } } cos[CardSkin.Faction3AltGeneralTier2] = { id: CardSkin.Faction3AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_sajj_m2_name") shopDescription: i18next.t("cosmetics.skin_sajj_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3AltGeneralTier2GIF.img rsx: RSX.f3AltGeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.AltGeneral skinNum: 1 animResource: { breathing : RSX.f3AltGeneralTier2Breathing.name idle : RSX.f3AltGeneralTier2Idle.name walk : RSX.f3AltGeneralTier2Run.name attack : RSX.f3AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.f3AltGeneralTier2Hit.name death : RSX.f3AltGeneralTier2Death.name castStart : RSX.f3AltGeneralTier2CastStart.name castEnd : RSX.f3AltGeneralTier2CastEnd.name castLoop : RSX.f3AltGeneralTier2CastLoop.name cast : RSX.f3AltGeneralTier2Cast.name } } cos[CardSkin.Faction3IVGeneralTier2] = { id: CardSkin.Faction3IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ciphyron_m2_name") shopDescription: i18next.t("cosmetics.skin_ciphyron_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3IVGeneralTier2GIF.img rsx: RSX.f3IVGeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f3IVGeneralTier2Breathing.name idle : RSX.f3IVGeneralTier2Idle.name walk : RSX.f3IVGeneralTier2Run.name attack : RSX.f3IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3IVGeneralTier2Damage.name death : RSX.f3IVGeneralTier2Death.name castStart : RSX.f3IVGeneralTier2CastStart.name castEnd : RSX.f3IVGeneralTier2CastEnd.name castLoop : RSX.f3IVGeneralTier2CastLoop.name cast : RSX.f3IVGeneralTier2Cast.name } } cos[CardSkin.Faction4GeneralTier2] = { id: CardSkin.Faction4GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_lilithe_m2_name") shopDescription: i18next.t("cosmetics.skin_lilithe_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4GeneralTier2GIF.img rsx: RSX.f4GeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.General skinNum: 1 animResource: { breathing : RSX.f4GeneralTier2Breathing.name idle : RSX.f4GeneralTier2Idle.name walk : RSX.f4GeneralTier2Run.name attack : RSX.f4GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage : RSX.f4GeneralTier2Damage.name death : RSX.f4GeneralTier2Death.name castStart : RSX.f4GeneralTier2CastStart.name castEnd : RSX.f4GeneralTier2CastEnd.name castLoop : RSX.f4GeneralTier2CastLoop.name cast : RSX.f4GeneralTier2Cast.name } } cos[CardSkin.Faction4AltGeneralTier2] = { id: CardSkin.Faction4AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_cassyva_m2_name") shopDescription: i18next.t("cosmetics.skin_cassyva_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4AltGeneralTier2GIF.img rsx: RSX.f4AltGeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.AltGeneral skinNum: 1 animResource: { breathing : RSX.f4AltGeneralTier2Breathing.name idle : RSX.f4AltGeneralTier2Idle.name walk : RSX.f4AltGeneralTier2Run.name attack : RSX.f4AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.5 damage : RSX.f4AltGeneralTier2Hit.name death : RSX.f4AltGeneralTier2Death.name castStart : RSX.f4AltGeneralTier2CastStart.name castEnd : RSX.f4AltGeneralTier2CastEnd.name castLoop : RSX.f4AltGeneralTier2CastLoop.name cast : RSX.f4AltGeneralTier2Cast.name } } cos[CardSkin.Faction4IVGeneralTier2] = { id: CardSkin.Faction4IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_maehv_m2_name") shopDescription: i18next.t("cosmetics.skin_maehv_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4IVGeneralTier2GIF.img rsx: RSX.f4IVGeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f4IVGeneralTier2Breathing.name idle : RSX.f4IVGeneralTier2Idle.name walk : RSX.f4IVGeneralTier2Run.name attack : RSX.f4IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage : RSX.f4IVGeneralTier2Damage.name death : RSX.f4IVGeneralTier2Death.name castStart : RSX.f4IVGeneralTier2CastStart.name castEnd : RSX.f4IVGeneralTier2CastEnd.name castLoop : RSX.f4IVGeneralTier2CastLoop.name cast : RSX.f4IVGeneralTier2Cast.name } } cos[CardSkin.Faction5GeneralTier2] = { id: CardSkin.Faction5GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_vaath_m2_name") shopDescription: i18next.t("cosmetics.skin_vaath_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5GeneralTier2GIF.img rsx: RSX.f5GeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.General skinNum: 1 animResource: { breathing : RSX.f5GeneralTier2Breathing.name idle : RSX.f5GeneralTier2Idle.name walk : RSX.f5GeneralTier2Run.name attack : RSX.f5GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f5GeneralTier2Damage.name death : RSX.f5GeneralTier2Death.name castStart : RSX.f5GeneralTier2CastStart.name castEnd : RSX.f5GeneralTier2CastEnd.name castLoop : RSX.f5GeneralTier2CastLoop.name cast : RSX.f5GeneralTier2Cast.name } } cos[CardSkin.Faction5AltGeneralTier2] = { id: CardSkin.Faction5AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_starhorn_m2_name") shopDescription: i18next.t("cosmetics.skin_starhorn_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5AltGeneralTier2GIF.img rsx: RSX.f5AltGeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.AltGeneral skinNum: 1 animResource: { breathing : RSX.f5AltGeneralTier2Breathing.name idle : RSX.f5AltGeneralTier2Idle.name walk : RSX.f5AltGeneralTier2Run.name attack : RSX.f5AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.f5AltGeneralTier2Hit.name death : RSX.f5AltGeneralTier2Death.name castStart : RSX.f5AltGeneralTier2CastStart.name castEnd : RSX.f5AltGeneralTier2CastEnd.name castLoop : RSX.f5AltGeneralTier2CastLoop.name cast : RSX.f5AltGeneralTier2Cast.name } } cos[CardSkin.Faction5IVGeneralTier2] = { id: CardSkin.Faction5IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ragnora_m2_name") shopDescription: i18next.t("cosmetics.skin_ragnora_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5IVGeneralTier2GIF.img rsx: RSX.f5IVGeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f5IVGeneralTier2Breathing.name idle : RSX.f5IVGeneralTier2Idle.name walk : RSX.f5IVGeneralTier2Run.name attack : RSX.f5IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f5IVGeneralTier2Damage.name death : RSX.f5IVGeneralTier2Death.name castStart : RSX.f5IVGeneralTier2CastStart.name castEnd : RSX.f5IVGeneralTier2CastEnd.name castLoop : RSX.f5IVGeneralTier2CastLoop.name cast : RSX.f5IVGeneralTier2Cast.name } } cos[CardSkin.Faction6GeneralTier2] = { id: CardSkin.Faction6GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_faie_m2_name") shopDescription: i18next.t("cosmetics.skin_faie_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6GeneralTier2GIF.img rsx: RSX.f6GeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.General skinNum: 1 animResource: { breathing : RSX.f6GeneralTier2Breathing.name idle : RSX.f6GeneralTier2Idle.name walk : RSX.f6GeneralTier2Run.name attack : RSX.f6GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6GeneralTier2Damage.name death : RSX.f6GeneralTier2Death.name castStart : RSX.f6GeneralTier2CastStart.name castEnd : RSX.f6GeneralTier2CastEnd.name castLoop : RSX.f6GeneralTier2CastLoop.name cast : RSX.f6GeneralTier2Cast.name } } cos[CardSkin.Faction6GeneralFestive] = { id: CardSkin.Faction6GeneralFestive typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_faie_festive_name") shopDescription: i18next.t("cosmetics.skin_faie_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f6GeneralFestiveGIF.img rsx: RSX.f6GeneralFestiveGIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction6.General skinNum: 2 animResource: { breathing : RSX.f6GeneralFestiveBreathing.name idle : RSX.f6GeneralFestiveIdle.name walk : RSX.f6GeneralFestiveRun.name attack : RSX.f6GeneralFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6GeneralFestiveDamage.name death : RSX.f6GeneralFestiveDeath.name castStart : RSX.f6GeneralFestiveCastStart.name castEnd : RSX.f6GeneralFestiveCastEnd.name castLoop : RSX.f6GeneralFestiveCastLoop.name cast : RSX.f6GeneralFestiveCast.name } } cos[CardSkin.Faction6AltGeneralTier2] = { id: CardSkin.Faction6AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_kara_m2_name") shopDescription: i18next.t("cosmetics.skin_kara_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6AltGeneralTier2GIF.img rsx: RSX.f6AltGeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.AltGeneral skinNum: 1 animResource: { breathing : RSX.f6AltGeneralTier2Breathing.name idle : RSX.f6AltGeneralTier2Idle.name walk : RSX.f6AltGeneralTier2Run.name attack : RSX.f6AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.2 damage : RSX.f6AltGeneralTier2Hit.name death : RSX.f6AltGeneralTier2Death.name castStart : RSX.f6AltGeneralTier2CastStart.name castEnd : RSX.f6AltGeneralTier2CastEnd.name castLoop : RSX.f6AltGeneralTier2CastLoop.name cast : RSX.f6AltGeneralTier2Cast.name } } cos[CardSkin.Faction6IVGeneralTier2] = { id: CardSkin.Faction6IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ilena_m2_name") shopDescription: i18next.t("cosmetics.skin_ilena_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6IVGeneralTier2GIF.img rsx: RSX.f6IVGeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f6IVGeneralTier2Breathing.name idle : RSX.f6IVGeneralTier2Idle.name walk : RSX.f6IVGeneralTier2Run.name attack : RSX.f6IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6IVGeneralTier2Damage.name death : RSX.f6IVGeneralTier2Death.name castStart : RSX.f6IVGeneralTier2CastStart.name castEnd : RSX.f6IVGeneralTier2CastEnd.name castLoop : RSX.f6IVGeneralTier2CastLoop.name cast : RSX.f6IVGeneralTier2Cast.name } } cos[CardSkin.SarlacPrime] = { id: CardSkin.SarlacPrime typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_sarlac_prime_name") shopDescription: i18next.t("cosmetics.skin_sarlac_prime_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.SarlacTheEternal skinNum: 1 animResource: { breathing : RSX.neutralSarlacPrimeBreathing.name idle : RSX.neutralSarlacPrimeIdle.name walk : RSX.neutralSarlacPrimeRun.name attack : RSX.neutralSarlacPrimeAttack.name attackReleaseDelay: 0.0 attackDelay: .25 damage : RSX.neutralSarlacPrimeHit.name death : RSX.neutralSarlacPrimeDeath.name } } cos[CardSkin.KeeperOfTheValue] = { id: CardSkin.KeeperOfTheValue typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_keeper_name") shopDescription: i18next.t("cosmetics.skin_keeper_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.KeeperOfTheVale skinNum: 1 animResource: { breathing : RSX.neutralKeeperOfTheValueBreathing.name idle : RSX.neutralKeeperOfTheValueIdle.name walk : RSX.neutralKeeperOfTheValueRun.name attack : RSX.neutralKeeperOfTheValueAttack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.neutralKeeperOfTheValueHit.name death : RSX.neutralKeeperOfTheValueDeath.name } } cos[CardSkin.Darkjammer] = { id: CardSkin.Darkjammer typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_darkjammer_name") shopDescription: i18next.t("cosmetics.skin_darkjammer_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.Spelljammer skinNum: 1 animResource: { breathing : RSX.neutralDarkjammerBreathing.name idle : RSX.neutralDarkjammerIdle.name walk : RSX.neutralDarkjammerRun.name attack : RSX.neutralDarkjammerAttack.name attackReleaseDelay: 0.0 attackDelay: .9 damage : RSX.neutralDarkjammerHit.name death : RSX.neutralDarkjammerDeath.name } } cos[CardSkin.FrostfireTiger] = { id: CardSkin.FrostfireTiger typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_frostfire_tiger_name") shopDescription: i18next.t("cosmetics.skin_frostfire_tiger_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.neutralFrostfireTigerGIF.img rsx: RSX.neutralFrostfireTigerGIF factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Neutral.SaberspineTiger skinNum: 1 animResource: { breathing : RSX.neutralFrostfireTigerBreathing.name idle : RSX.neutralFrostfireTigerIdle.name walk : RSX.neutralFrostfireTigerRun.name attack : RSX.neutralFrostfireTigerAttack.name attackReleaseDelay: 0.0 attackDelay: .4 damage : RSX.neutralFrostfireTigerHit.name death : RSX.neutralFrostfireTigerDeath.name } } cos[CardSkin.FestiveSnowchaser] = { id: CardSkin.FestiveSnowchaser typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_festive_snowchaser_name") shopDescription: i18next.t("cosmetics.skin_festive_snowchaser_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f6FestiveSnowchaserGIF.img rsx: RSX.f6FestiveSnowchaserGIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction6.WyrBeast skinNum: 1 animResource: { breathing : RSX.f6FestiveSnowchaserBreathing.name idle : RSX.f6FestiveSnowchaserIdle.name walk : RSX.f6FestiveSnowchaserRun.name attack : RSX.f6FestiveSnowchaserAttack.name attackReleaseDelay: 0.0 attackDelay: .3 damage : RSX.f6FestiveSnowchaserDamage.name death : RSX.f6FestiveSnowchaserDeath.name } } cos[CardSkin.ElyxMK2] = { id: CardSkin.ElyxMK2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Elyx Stormblade MK2" shopDescription: "Elyx Stormblade MK2" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction1.ElyxStormblade skinNum: 1 animResource: { breathing : RSX.f1ElyxStormbladeMK2Breathing.name idle : RSX.f1ElyxStormbladeMK2Idle.name walk : RSX.f1ElyxStormbladeMK2Run.name attack : RSX.f1ElyxStormbladeMK2Attack.name attackReleaseDelay: 0.0 attackDelay: .3 damage : RSX.f1ElyxStormbladeMK2Hit.name death : RSX.f1ElyxStormbladeMK2Death.name } } cos[CardSkin.HealingMysticBN] = { id: CardSkin.HealingMysticBN typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Healing Mystic Bandai Namco" shopDescription: "Healing Mystic Bandai Namco" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.HealingMystic skinNum: 1 animResource: { breathing : RSX.neutralHealingMysticBNBreathing.name idle : RSX.neutralHealingMysticBNIdle.name walk : RSX.neutralHealingMysticBNRun.name attack : RSX.neutralHealingMysticBNAttack.name attackReleaseDelay: 0.0 attackDelay: 0.9 damage : RSX.neutralHealingMysticBNHit.name death : RSX.neutralHealingMysticBNDeath.name } } cos[CardSkin.HealingMysticTwitch] = { id: CardSkin.HealingMysticTwitch typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Healing Mystic Twitch" shopDescription: "Healing Mystic Twitch" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.HealingMystic skinNum: 2 animResource: { breathing : RSX.neutralhealingMysticTwitchBreathing.name idle : RSX.neutralhealingMysticTwitchIdle.name walk : RSX.neutralhealingMysticTwitchRun.name attack : RSX.neutralhealingMysticTwitchAttack.name attackReleaseDelay: 0.0 attackDelay: 0.9 damage : RSX.neutralhealingMysticTwitchHit.name death : RSX.neutralhealingMysticTwitchDeath.name } } cos[CardSkin.FestiveZyx] = { id: CardSkin.FestiveZyx typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zyx_festive_name") shopDescription: i18next.t("cosmetics.skin_zyx_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.neutralZyxFestiveGIF.img rsx: RSX.neutralZyxFestiveGIF factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Neutral.Zyx skinNum: 1 animResource: { breathing : RSX.neutralZyxFestiveBreathing.name idle : RSX.neutralZyxFestiveIdle.name walk : RSX.neutralZyxFestiveRun.name attack : RSX.neutralZyxFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: .4 damage : RSX.neutralZyxFestiveHit.name death : RSX.neutralZyxFestiveDeath.name } } cos[CardSkin.MirkbloodDevourerBoss] = { id: CardSkin.MirkbloodDevourerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Mirkblood Devourer" shopDescription: "This skin was used in the Umbra boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mirkbloodDevourerBossGIF.img rsx: RSX.mirkbloodDevourerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.MirkbloodDevourer skinNum: 1 animResource: { breathing : RSX.bossUmbraBreathing.name idle : RSX.bossUmbraIdle.name walk : RSX.bossUmbraRun.name attack : RSX.bossUmbraAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossUmbraHit.name death : RSX.bossUmbraDeath.name } } cos[CardSkin.DreadnoughtBoss] = { id: CardSkin.DreadnoughtBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Dreadnought" shopDescription: "This skin was used in the Boreal Juggernaut boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.dreadnoughtBossGIF.img rsx: RSX.dreadnoughtBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Dreadnaught skinNum: 1 animResource: { breathing : RSX.bossBorealJuggernautBreathing.name idle : RSX.bossBorealJuggernautIdle.name walk : RSX.bossBorealJuggernautRun.name attack : RSX.bossBorealJuggernautAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossBorealJuggernautHit.name death : RSX.bossBorealJuggernautDeath.name } } cos[CardSkin.IroncladBoss] = { id: CardSkin.IroncladBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Ironclad" shopDescription: "This skin was used in the Cade the Desolator boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.ironcladBossGIF.img rsx: RSX.ironcladBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Ironclad skinNum: 1 animResource: { breathing : RSX.bossChaosKnightBreathing.name idle : RSX.bossChaosKnightIdle.name walk : RSX.bossChaosKnightRun.name attack : RSX.bossChaosKnightAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossChaosKnightHit.name death : RSX.bossChaosKnightDeath.name } } cos[CardSkin.ZendoBoss] = { id: CardSkin.ZendoBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Grandmaster Zendo" shopDescription: "This skin was used in the Shinkage Zendo boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.zendoBossGIF.img rsx: RSX.zendoBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.GrandmasterZendo skinNum: 1 animResource: { breathing : RSX.bossShinkageZendoBreathing.name idle : RSX.bossShinkageZendoIdle.name walk : RSX.bossShinkageZendoRun.name attack : RSX.bossShinkageZendoAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossShinkageZendoHit.name death : RSX.bossShinkageZendoDeath.name } } cos[CardSkin.Z0rBoss] = { id: CardSkin.Z0rBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Z0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.z0rBossGIF.img rsx: RSX.z0rBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Z0r skinNum: 1 animResource: { breathing : RSX.bossDecepticleBreathing.name idle : RSX.bossDecepticleIdle.name walk : RSX.bossDecepticleRun.name attack : RSX.bossDecepticleAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleHit.name death : RSX.bossDecepticleDeath.name } } cos[CardSkin.Mechaz0rChassisBoss] = { id: CardSkin.Mechaz0rChassisBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Chassis of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rChassisBossGIF.img rsx: RSX.mechaz0rChassisBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rChassis skinNum: 1 animResource: { breathing : RSX.bossDecepticleChassisBreathing.name idle : RSX.bossDecepticleChassisIdle.name walk : RSX.bossDecepticleChassisRun.name attack : RSX.bossDecepticleChassisAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleChassisHit.name death : RSX.bossDecepticleChassisDeath.name } } cos[CardSkin.Mechaz0rHelmBoss] = { id: CardSkin.Mechaz0rHelmBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Helm of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rHelmBossGIF.img rsx: RSX.mechaz0rHelmBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rHelm skinNum: 1 animResource: { breathing : RSX.bossDecepticleHelmBreathing.name idle : RSX.bossDecepticleHelmIdle.name walk : RSX.bossDecepticleHelmRun.name attack : RSX.bossDecepticleHelmAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleHelmHit.name death : RSX.bossDecepticleHelmDeath.name } } cos[CardSkin.AlterRexxBoss] = { id: CardSkin.AlterRexxBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Alter Rexx" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.alterRexxBossGIF.img rsx: RSX.alterRexxBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.AlterRexx skinNum: 1 animResource: { breathing : RSX.bossDecepticlePrimeBreathing.name idle : RSX.bossDecepticlePrimeIdle.name walk : RSX.bossDecepticlePrimeRun.name attack : RSX.bossDecepticlePrimeAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticlePrimeHit.name death : RSX.bossDecepticlePrimeDeath.name } } cos[CardSkin.Mechaz0rSwordBoss] = { id: CardSkin.Mechaz0rSwordBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Sword of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rSwordBossGIF.img rsx: RSX.mechaz0rSwordBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rSword skinNum: 1 animResource: { breathing : RSX.bossDecepticleSwordBreathing.name idle : RSX.bossDecepticleSwordIdle.name walk : RSX.bossDecepticleSwordRun.name attack : RSX.bossDecepticleSwordAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleSwordHit.name death : RSX.bossDecepticleSwordDeath.name } } cos[CardSkin.Mechaz0rWingsBoss] = { id: CardSkin.Mechaz0rWingsBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Wings of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rWingsBossGIF.img rsx: RSX.mechaz0rWingsBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rWings skinNum: 1 animResource: { breathing : RSX.bossDecepticleWingsBreathing.name idle : RSX.bossDecepticleWingsIdle.name walk : RSX.bossDecepticleWingsRun.name attack : RSX.bossDecepticleWingsAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleWingsHit.name death : RSX.bossDecepticleWingsDeath.name } } cos[CardSkin.ZukongBoss] = { id: CardSkin.ZukongBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Zukong" shopDescription: "This skin was used in the Wu'jin the Trickster boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.zukongBossGIF.img rsx: RSX.zukongBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Zukong skinNum: 1 animResource: { breathing : RSX.bossWujinBreathing.name idle : RSX.bossWujinIdle.name walk : RSX.bossWujinRun.name attack : RSX.bossWujinAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWujinHit.name death : RSX.bossWujinDeath.name } } cos[CardSkin.WartalonBoss] = { id: CardSkin.WartalonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "War Talon" shopDescription: "This skin was used in the Solfist boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.wartalonBossGIF.img rsx: RSX.wartalonBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.WarTalon skinNum: 1 animResource: { breathing : RSX.bossSolfistBreathing.name idle : RSX.bossSolfistIdle.name walk : RSX.bossSolfistRun.name attack : RSX.bossSolfistAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSolfistHit.name death : RSX.bossSolfistDeath.name } } cos[CardSkin.EMPBoss] = { id: CardSkin.EMPBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "EMP" shopDescription: "This skin was used in the Automaton 8 boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.empBossGIF.img rsx: RSX.empBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.EMP skinNum: 1 animResource: { breathing : RSX.bossEMPBreathing.name idle : RSX.bossEMPIdle.name walk : RSX.bossEMPRun.name attack : RSX.bossEMPAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossEMPHit.name death : RSX.bossEMPDeath.name } } cos[CardSkin.ArchonBoss] = { id: CardSkin.ArchonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Archon Spellbinder" shopDescription: "This skin was used in the Orias the Heretic boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.archonBossGIF.img rsx: RSX.archonBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.ArchonSpellbinder skinNum: 1 animResource: { breathing : RSX.bossOriasBreathing.name idle : RSX.bossOriasIdle.name walk : RSX.bossOriasRun.name attack : RSX.bossOriasAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossOriasHit.name death : RSX.bossOriasDeath.name } } cos[CardSkin.BastionBoss] = { id: CardSkin.BastionBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Bastion" shopDescription: "This skin was used in the Orias the Heretic boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.bastionBossGIF.img rsx: RSX.bastionBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Bastion skinNum: 1 animResource: { breathing : RSX.bossOriasIdolBreathing.name idle : RSX.bossOriasIdolIdle.name walk : RSX.bossOriasIdolRun.name attack : RSX.bossOriasIdolAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossOriasIdolHit.name death : RSX.bossOriasIdolDeath.name } } cos[CardSkin.HighHandBoss] = { id: CardSkin.HighHandBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "The High Hand" shopDescription: "This skin was used in the Malyk boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.highHandBossGIF.img rsx: RSX.highHandBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.TheHighHand skinNum: 1 animResource: { breathing : RSX.bossMalykBreathing.name idle : RSX.bossMalykIdle.name walk : RSX.bossMalykRun.name attack : RSX.bossMalykAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossMalykHit.name death : RSX.bossMalykDeath.name } } cos[CardSkin.BlackSolusBoss] = { id: CardSkin.BlackSolusBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Black solus" shopDescription: "This skin was used in the Archonis boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.blackSolusBossGIF.img rsx: RSX.blackSolusBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.BlackSolus skinNum: 1 animResource: { breathing : RSX.bossManaManBreathing.name idle : RSX.bossManaManIdle.name walk : RSX.bossManaManRun.name attack : RSX.bossManaManAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossManaManDamage.name death : RSX.bossManaManDeath.name } } cos[CardSkin.CalculatorBoss] = { id: CardSkin.CalculatorBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Calculator" shopDescription: "This skin was used in the Paragon of Light boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.calculatorBossGIF.img rsx: RSX.calculatorBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Calculator skinNum: 1 animResource: { breathing : RSX.bossParagonBreathing.name idle : RSX.bossParagonIdle.name walk : RSX.bossParagonRun.name attack : RSX.bossParagonAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossParagonHit.name death : RSX.bossParagonDeath.name } } cos[CardSkin.ChakkramBoss] = { id: CardSkin.ChakkramBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Chakkram" shopDescription: "This skin was used in the Scion of the Void boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.chakkramBossGIF.img rsx: RSX.chakkramBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Chakkram skinNum: 1 animResource: { breathing : RSX.bossVampireBreathing.name idle : RSX.bossVampireIdle.name walk : RSX.bossVampireRun.name attack : RSX.bossVampireAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossVampireHit.name death : RSX.bossVampireDeath.name } } cos[CardSkin.KronBoss] = { id: CardSkin.KronBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Inquisitor Kron" shopDescription: "This skin was used in the High Templar Kron boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.kronBossGIF.img rsx: RSX.kronBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.InquisitorKron skinNum: 1 animResource: { breathing : RSX.bossKronBreathing.name idle : RSX.bossKronIdle.name walk : RSX.bossKronRun.name attack : RSX.bossKronAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossKronHit.name death : RSX.bossKronDeath.name } } cos[CardSkin.MeltdownBoss] = { id: CardSkin.MeltdownBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Meltdown" shopDescription: "This skin was used in the Megapenti boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.meltdownBossGIF.img rsx: RSX.meltdownBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Meltdown skinNum: 1 animResource: { breathing : RSX.bossSerpentiBreathing.name idle : RSX.bossSerpentiIdle.name walk : RSX.bossSerpentiRun.name attack : RSX.bossSerpentiAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSerpentiHit.name death : RSX.bossSerpentiDeath.name } } cos[CardSkin.ArcaneDevourerBoss] = { id: CardSkin.ArcaneDevourerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Arcane Devourer" shopDescription: "This skin was used in the Rin the Shadowsworn boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.arcaneDevourerBossGIF.img rsx: RSX.arcaneDevourerBossGIF factionId: Factions.Faction4 rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.ArcaneDevourer skinNum: 1 animResource: { breathing : RSX.bossWraithBreathing.name idle : RSX.bossWraithIdle.name walk : RSX.bossWraithRun.name attack : RSX.bossWraithAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWraithHit.name death : RSX.bossWraithDeath.name } } cos[CardSkin.TrinityWingBoss] = { id: CardSkin.TrinityWingBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Trinity Wing" shopDescription: "This skin was used in the Skfall Tyrant boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.trinityWingBossGIF.img rsx: RSX.trinityWingBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.TrinityWing skinNum: 1 animResource: { breathing : RSX.bossSkyfallTyrantBreathing.name idle : RSX.bossSkyfallTyrantIdle.name walk : RSX.bossSkyfallTyrantRun.name attack : RSX.bossSkyfallTyrantAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSkyfallTyrantHit.name death : RSX.bossSkyfallTyrantDeath.name } } cos[CardSkin.FuriosaBoss] = { id: CardSkin.FuriosaBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Furiosa" shopDescription: "This skin was used in the Cindera boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.furiosaBossGIF.img rsx: RSX.furiosaBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.Furosa skinNum: 1 animResource: { breathing : RSX.bossCinderaBreathing.name idle : RSX.bossCinderaIdle.name walk : RSX.bossCinderaRun.name attack : RSX.bossCinderaAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossCinderaHit.name death : RSX.bossCinderaDeath.name } } cos[CardSkin.ArclyteSentinelBoss] = { id: CardSkin.ArclyteSentinelBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Arclyte Sentinel" shopDescription: "This skin was used in the Crystalline Champion boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.arclyteSentinelBossGIF.img rsx: RSX.arclyteSentinelBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.ArclyteSentinel skinNum: 1 animResource: { breathing : RSX.bossCrystalBreathing.name idle : RSX.bossCrystalIdle.name walk : RSX.bossCrystalRun.name attack : RSX.bossCrystalAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossCrystalDamage.name death : RSX.bossCrystalDeath.name } } cos[CardSkin.RancourBoss] = { id: CardSkin.RancourBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Rancour" shopDescription: "This skin was used in the Xel boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.rancourBossGIF.img rsx: RSX.rancourBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Rancour skinNum: 1 animResource: { breathing : RSX.bossAntiswarmBreathing.name idle : RSX.bossAntiswarmIdle.name walk : RSX.bossAntiswarmRun.name attack : RSX.bossAntiswarmAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossAntiswarmHit.name death : RSX.bossAntiswarmDeath.name } } cos[CardSkin.SwornAvengerBoss] = { id: CardSkin.SwornAvengerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Sworn Avenger" shopDescription: "This skin was used in the Skurge boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.swornAvengerBossGIF.img rsx: RSX.swornAvengerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.SwornAvenger skinNum: 1 animResource: { breathing : RSX.bossSkurgeBreathing.name idle : RSX.bossSkurgeIdle.name walk : RSX.bossSkurgeRun.name attack : RSX.bossSkurgeAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSkurgeHit.name death : RSX.bossSkurgeDeath.name } } cos[CardSkin.SwornDefenderBoss] = { id: CardSkin.SwornDefenderBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Sworn Defender" shopDescription: "This skin was used in the Skurge boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.swornDefenderBossGIF.img rsx: RSX.swornDefenderBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.SwornDefender skinNum: 1 animResource: { breathing : RSX.bossValiantBreathing.name idle : RSX.bossValiantIdle.name walk : RSX.bossValiantRun.name attack : RSX.bossValiantAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossValiantHit.name death : RSX.bossValiantDeath.name } } cos[CardSkin.QuartermasterGaujBoss] = { id: CardSkin.QuartermasterGaujBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Quartermaster Gauj" shopDescription: "This skin was used in the Shadow Lord boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.quartermasterGaujBossGIF.img rsx: RSX.quartermasterGaujBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.QuartermasterGauj skinNum: 1 animResource: { breathing : RSX.bossShadowLordBreathing.name idle : RSX.bossShadowLordIdle.name walk : RSX.bossShadowLordRun.name attack : RSX.bossShadowLordAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossShadowLordHit.name death : RSX.bossShadowLordDeath.name } } cos[CardSkin.AlabasterTitanBoss] = { id: CardSkin.AlabasterTitanBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Alabaster Titan" shopDescription: "This skin was used in the Archmagus Vol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.alabasterTitanBossGIF.img rsx: RSX.alabasterTitanBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.AlabasterTitan skinNum: 1 animResource: { breathing : RSX.bossGolBreathing.name idle : RSX.bossGolIdle.name walk : RSX.bossGolRun.name attack : RSX.bossGolAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossGolHit.name death : RSX.bossGolDeath.name } } cos[CardSkin.RadiantDragoonBoss] = { id: CardSkin.RadiantDragoonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Radiant Dragoon" shopDescription: "This skin was used in the Archmagus Vol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.radiantDragoonBossGIF.img rsx: RSX.radiantDragoonBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.RadiantDragoon skinNum: 1 animResource: { breathing : RSX.bossKaneBreathing.name idle : RSX.bossKaneIdle.name walk : RSX.bossKaneRun.name attack : RSX.bossKaneAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossKaneHit.name death : RSX.bossKaneDeath.name } } cos[CardSkin.TethermancerBoss] = { id: CardSkin.TethermancerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Tethermancer" shopDescription: "This skin was used in the Taskmaster Beatrix boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.tethermancerBossGIF.img rsx: RSX.tethermancerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Tethermancer skinNum: 1 animResource: { breathing : RSX.bossTaskmasterBreathing.name idle : RSX.bossTaskmasterIdle.name walk : RSX.bossTaskmasterRun.name attack : RSX.bossTaskmasterAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossTaskmasterHit.name death : RSX.bossTaskmasterDeath.name } } cos[CardSkin.DrogonBoss] = { id: CardSkin.DrogonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Drogon" shopDescription: "This skin was used in the Grym the Vengeful boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.drogonBossGIF.img rsx: RSX.drogonBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Drogon skinNum: 1 animResource: { breathing : RSX.bossGrymBreathing.name idle : RSX.bossGrymIdle.name walk : RSX.bossGrymRun.name attack : RSX.bossGrymAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossGrymHit.name death : RSX.bossGrymDeath.name } } cos[CardSkin.PantheranBoss] = { id: CardSkin.PantheranBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Pantheran" shopDescription: "This skin was used in the Nahlgol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.pantheranBossGIF.img rsx: RSX.pantheranBossGIF factionId: Factions.Vetruvian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction3.Pantheran skinNum: 1 animResource: { breathing : RSX.bossSandPantherBreathing.name idle : RSX.bossSandPantherIdle.name walk : RSX.bossSandPantherRun.name attack : RSX.bossSandPantherAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSandPantherDamage.name death : RSX.bossSandPantherDeath.name } } cos[CardSkin.LysianBrawlerBoss] = { id: CardSkin.LysianBrawlerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Lysian Brawler" shopDescription: "This skin was used in the Wolfpunch boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.lysianBrawlerBossGIF.img rsx: RSX.lysianBrawlerBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.LysianBrawler skinNum: 1 animResource: { breathing : RSX.bossWolfpunchBreathing.name idle : RSX.bossWolfpunchIdle.name walk : RSX.bossWolfpunchRun.name attack : RSX.bossWolfpunchAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWolfpunchDamage.name death : RSX.bossWolfpunchDeath.name } } cos[CardSkin.DeathKnellBoss] = { id: CardSkin.DeathKnellBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Death Knell" shopDescription: "This skin was used in the Unhallowed boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.deathKnellBossGIF.img rsx: RSX.deathKnellBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.DeathKnell skinNum: 1 animResource: { breathing : RSX.bossUnhallowedBreathing.name idle : RSX.bossUnhallowedIdle.name walk : RSX.bossUnhallowedRun.name attack : RSX.bossUnhallowedAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossUnhallowedHit.name death : RSX.bossUnhallowedDeath.name } } cos[CardSkin.DraugerLordBoss] = { id: CardSkin.DraugerLordBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Draugar Lord" shopDescription: "This skin was used in the Santaur the Terrible boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.draugerLordBossGIF.img rsx: RSX.draugerLordBossGIF factionId: Factions.Vanar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction6.PrismaticGiant skinNum: 1 animResource: { breathing : RSX.bossChristmasBreathing.name idle : RSX.bossChristmasIdle.name walk : RSX.bossChristmasRun.name attack : RSX.bossChristmasAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossChristmasDamage.name death : RSX.bossChristmasDeath.name } } cos[CardSkin.NightWatcherBoss] = { id: CardSkin.NightWatcherBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Night Watcher" shopDescription: "This skin was used in the Legion boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.nightWatcherBossGIF.img rsx: RSX.nightWatcherBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.NightWatcher skinNum: 1 animResource: { breathing : RSX.bossLegionBreathing.name idle : RSX.bossLegionIdle.name walk : RSX.bossLegionRun.name attack : RSX.bossLegionAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossLegionHit.name death : RSX.bossLegionDeath.name } } cos[CardSkin.CalligrapherBoss] = { id: CardSkin.CalligrapherBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Calligrapher" shopDescription: "This skin was used in the Harmony boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.calligrapherBossGIF.img rsx: RSX.calligrapherBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.Calligrapher skinNum: 1 animResource: { breathing : RSX.bossHarmonyBreathing.name idle : RSX.bossHarmonyIdle.name walk : RSX.bossHarmonyRun.name attack : RSX.bossHarmonyAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossHarmonyHit.name death : RSX.bossHarmonyDeath.name } } cos[CardSkin.PandoraBoss] = { id: CardSkin.PandoraBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Pandora" shopDescription: "This skin was used in the Andromeda boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.pandoraBossGIF.img rsx: RSX.pandoraBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Pandora skinNum: 1 animResource: { breathing : RSX.bossAndromedaBreathing.name idle : RSX.bossAndromedaIdle.name walk : RSX.bossAndromedaRun.name attack : RSX.bossAndromedaAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossAndromedaHit.name death : RSX.bossAndromedaDeath.name } } cos[CardSkin.GrandmasterNoshRakBoss] = { id: CardSkin.GrandmasterNoshRakBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Grandmaster Nosh-Rak" shopDescription: "This skin was used in the Invader boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.grandmasterNoshRakBossGIF.img rsx: RSX.grandmasterNoshRakBossGIF factionId: Factions.Vetruvian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction3.GrandmasterNoshRak skinNum: 1 animResource: { breathing : RSX.bossInvaderBreathing.name idle : RSX.bossInvaderIdle.name walk : RSX.bossInvaderRun.name attack : RSX.bossInvaderAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossInvaderHit.name death : RSX.bossInvaderDeath.name } } cos[CardSkin.IroncliffeGuardianBoss] = { id: CardSkin.IroncliffeGuardianBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Ironcliffe Guardian" shopDescription: "This skin was used in the Invader boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.ironcliffeGuardianBossGIF.img rsx: RSX.ironcliffeGuardianBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.IroncliffeGuardian skinNum: 1 animResource: { breathing : RSX.bossProtectorBreathing.name idle : RSX.bossProtectorIdle.name walk : RSX.bossProtectorRun.name attack : RSX.bossProtectorAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossProtectorDamage.name death : RSX.bossProtectorDeath.name } } cos[CardSkin.CelestialPhantomBoss] = { id: CardSkin.CelestialPhantomBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Celestial Phantom" shopDescription: "This skin was used in the Soulstealer boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.celestialPhantomBossGIF.img rsx: RSX.celestialPhantomBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.CelestialPhantom skinNum: 1 animResource: { breathing : RSX.bossSoulstealerBreathing.name idle : RSX.bossSoulstealerIdle.name walk : RSX.bossSoulstealerRun.name attack : RSX.bossSoulstealerAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSoulstealerDamage.name death : RSX.bossSoulstealerDeath.name } } cos[CardSkin.GrailmasterBoss] = { id: CardSkin.GrailmasterBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Grailmaster" shopDescription: "This skin was used in the Kahlmar the Spell Eater boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.grailmasterBossGIF.img rsx: RSX.grailmasterBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Grailmaster skinNum: 1 animResource: { breathing : RSX.bossSpelleaterBreathing.name idle : RSX.bossSpelleaterIdle.name walk : RSX.bossSpelleaterRun.name attack : RSX.bossSpelleaterAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSpelleaterHit.name death : RSX.bossSpelleaterDeath.name } } # endregion Card Skins # region Card Backs cos[CardBack.Normal] = { id: CardBack.Normal typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_classic_name") shopDescription: i18next.t("cosmetics.cardback_classic_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Common img: RSX.card_back.img rsx: RSX.card_back glowOutlineRSX: RSX.card_back_glow_outline unlockable: false purchasable: false } cos[CardBack.Agenor] = { id: CardBack.Agenor typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_redstark_name") shopDescription: i18next.t("cosmetics.cardback_redstark_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_agenor.img rsx: RSX.card_back_agenor glowOutlineRSX: RSX.card_back_agenor_glow_outline unlockable: false purchasable: true } cos[CardBack.Gauntlet] = { id: CardBack.Gauntlet typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_sienna_name") shopDescription: i18next.t("cosmetics.cardback_sienna_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_gauntlet.img rsx: RSX.card_back_gauntlet glowOutlineRSX: RSX.card_back_gauntlet_glow_outline unlockable: false purchasable: true } cos[CardBack.Magma] = { id: CardBack.Magma typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_dance_of_dreams_name") shopDescription: i18next.t("cosmetics.cardback_dance_of_dreams_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_magma.img rsx: RSX.card_back_magma glowOutlineRSX: RSX.card_back_magma_glow_outline unlockable: false purchasable: true } cos[CardBack.Shimzar] = { id: CardBack.Shimzar typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_shimzar_name") shopDescription: i18next.t("cosmetics.cardback_shimzar_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_shimzar.img rsx: RSX.card_back_shimzar glowOutlineRSX: RSX.card_back_shimzar_glow_outline unlockable: true purchasable: true } cos[CardBack.LyonarGears] = { id: CardBack.LyonarGears typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_azurite_name") shopDescription: i18next.t("cosmetics.cardback_azurite_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_lyonar_gears.img rsx: RSX.card_back_lyonar_gears glowOutlineRSX: RSX.card_back_lyonar_gears_glow_outline unlockable: false purchasable: true } cos[CardBack.HumbleBundle] = { id: CardBack.HumbleBundle typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_humble_bundle_name") shopDescription: i18next.t("cosmetics.cardback_humble_bundle_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_humblebundle.img rsx: RSX.card_back_humblebundle glowOutlineRSX: RSX.card_back_humblebundle_glow_outline unlockable: true purchasable: false } cos[CardBack.DawnDuelysts] = { id: CardBack.DawnDuelysts typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_dawn_of_duelysts_name") shopDescription: i18next.t("cosmetics.cardback_dawn_of_duelysts_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_dawnduelysts.img rsx: RSX.card_back_dawnduelysts glowOutlineRSX: RSX.card_back_dawnduelysts_glow_outline unlockable: true purchasable: false } cos[CardBack.Snowchaser] = { id: CardBack.Snowchaser typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_snowchaser_cup_name") shopDescription: i18next.t("cosmetics.cardback_snowchaser_cup_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_snowchaser.img rsx: RSX.card_back_snowchaser glowOutlineRSX: RSX.card_back_snowchaser_glow_outline unlockable: true purchasable: true } # endregion Card Backs # region Profile Icons cos[ProfileIcon.Tree] = { id: ProfileIcon.Tree typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_tree_of_eyos_name") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Fixed img: RSX.portrait_tree.img rsx: RSX.portrait_tree unlockable: false purchasable: false } cos[ProfileIcon.abyssian_abyssalcrawler] = { id: ProfileIcon.abyssian_abyssalcrawler typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_abyssal_crawler_name") shopDescription: i18next.t("cosmetics.icon_abyssal_crawler_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_abyssalcrawler.img rsx: RSX.portrait_abyssian_abyssalcrawler unlockable: false purchasable: true } cos[ProfileIcon.abyssian_cassyvasoulreaper1] = { id: ProfileIcon.abyssian_cassyvasoulreaper1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_cassyva_name") shopDescription: i18next.t("cosmetics.icon_cassyva_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_cassyvasoulreaper1.img rsx: RSX.portrait_abyssian_cassyvasoulreaper1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_maehv1] = { id: ProfileIcon.abyssian_maehv1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_maehv_name") shopDescription: i18next.t("cosmetics.icon_maehv_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_maehv1.img rsx: RSX.portrait_abyssian_maehv1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_crest] = { id: ProfileIcon.abyssian_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_abyssian_crest_name") shopDescription: i18next.t("cosmetics.icon_abyssian_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_crest.img rsx: RSX.portrait_abyssian_crest unlockable: false purchasable: true } cos[ProfileIcon.abyssian_gloomchaser] = { id: ProfileIcon.abyssian_gloomchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_gloomchaser_name") shopDescription: i18next.t("cosmetics.icon_gloomchaser_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_gloomchaser.img rsx: RSX.portrait_abyssian_gloomchaser unlockable: false purchasable: true } cos[ProfileIcon.abyssian_kelainosister] = { id: ProfileIcon.abyssian_kelainosister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_shadow_sister_name") shopDescription: i18next.t("cosmetics.icon_shadow_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_kelainosister.img rsx: RSX.portrait_abyssian_kelainosister unlockable: false purchasable: true } cos[ProfileIcon.abyssian_lilithe1] = { id: ProfileIcon.abyssian_lilithe1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_lilithe_name") shopDescription: i18next.t("cosmetics.icon_lilithe_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_lilithe1.img rsx: RSX.portrait_abyssian_lilithe1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_lilithe2] = { id: ProfileIcon.abyssian_lilithe2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_lilithe_mk2_name") shopDescription: i18next.t("cosmetics.icon_lilithe_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_lilithe2.img rsx: RSX.portrait_abyssian_lilithe2 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_vorpalreaver] = { id: ProfileIcon.abyssian_vorpalreaver typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_vorpal_reaver_name") shopDescription: i18next.t("cosmetics.icon_vorpal_reaver_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_vorpalreaver.img rsx: RSX.portrait_abyssian_vorpalreaver unlockable: false purchasable: true } cos[ProfileIcon.abyssian_wraithling] = { id: ProfileIcon.abyssian_wraithling typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_wraithling_name") shopDescription: i18next.t("cosmetics.icon_wraithling_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_wraithling.img rsx: RSX.portrait_abyssian_wraithling unlockable: false purchasable: true } cos[ProfileIcon.frostfire] = { id: ProfileIcon.frostfire typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_frostfire_2015_name") shopDescription: i18next.t("cosmetics.icon_frostfire_2015_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_frostfire.img rsx: RSX.portrait_frostfire unlockable: false purchasable: true } cos[ProfileIcon.lyonar_arclytesentinel] = { id: ProfileIcon.lyonar_arclytesentinel typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_arclyte_sentinel_name") shopDescription: i18next.t("cosmetics.icon_arclyte_sentinel_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_arclytesentinel.img rsx: RSX.portrait_lyonar_arclytesentinel unlockable: false purchasable: true } cos[ProfileIcon.lyonar_argeonhighmayne1] = { id: ProfileIcon.lyonar_argeonhighmayne1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_argeon_name") shopDescription: i18next.t("cosmetics.icon_argeon_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_argeonhighmayne1.img rsx: RSX.portrait_lyonar_argeonhighmayne1 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_argeonhighmayne2] = { id: ProfileIcon.lyonar_argeonhighmayne2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_argeon_mk2_name") shopDescription: i18next.t("cosmetics.icon_argeon_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_argeonhighmayne2.img rsx: RSX.portrait_lyonar_argeonhighmayne2 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_crest] = { id: ProfileIcon.lyonar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_lyonar_crest_name") shopDescription: i18next.t("cosmetics.icon_lyonar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_crest.img rsx: RSX.portrait_lyonar_crest unlockable: false purchasable: true } cos[ProfileIcon.lyonar_lightchaser] = { id: ProfileIcon.lyonar_lightchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_lightchaser_name") shopDescription: i18next.t("cosmetics.icon_lightchaser_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_lightchaser.img rsx: RSX.portrait_lyonar_lightchaser unlockable: false purchasable: true } cos[ProfileIcon.lyonar_silverguardknight] = { id: ProfileIcon.lyonar_silverguardknight typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_silverguard_knight_name") shopDescription: i18next.t("cosmetics.icon_silverguard_knight_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_silverguardknight.img rsx: RSX.portrait_lyonar_silverguardknight unlockable: false purchasable: true } cos[ProfileIcon.lyonar_steropesister] = { id: ProfileIcon.lyonar_steropesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_sun_sister_name") shopDescription: i18next.t("cosmetics.icon_sun_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_steropesister.img rsx: RSX.portrait_lyonar_steropesister unlockable: false purchasable: true } cos[ProfileIcon.lyonar_suntidemaiden] = { id: ProfileIcon.lyonar_suntidemaiden typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_suntide_maiden_name") shopDescription: i18next.t("cosmetics.icon_suntide_maiden_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_suntidemaiden.img rsx: RSX.portrait_lyonar_suntidemaiden unlockable: false purchasable: true } cos[ProfileIcon.lyonar_windbladeadept] = { id: ProfileIcon.lyonar_windbladeadept typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_windblade_adept_name") shopDescription: i18next.t("cosmetics.icon_windblade_adept_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_windbladeadept.img rsx: RSX.portrait_lyonar_windbladeadept unlockable: false purchasable: true } cos[ProfileIcon.lyonar_ziransunforge1] = { id: ProfileIcon.lyonar_ziransunforge1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_ziran_name") shopDescription: i18next.t("cosmetics.icon_ziran_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_ziransunforge1.img rsx: RSX.portrait_lyonar_ziransunforge1 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_brome1] = { id: ProfileIcon.lyonar_brome1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_brome_name") shopDescription: i18next.t("cosmetics.icon_brome_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_brome1.img rsx: RSX.portrait_lyonar_brome1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_crest] = { id: ProfileIcon.magmar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_magmar_crest_name") shopDescription: i18next.t("cosmetics.icon_magmar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_crest.img rsx: RSX.portrait_magmar_crest unlockable: false purchasable: true } cos[ProfileIcon.magmar_dreadnought] = { id: ProfileIcon.magmar_dreadnought typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_dreadnought_name") shopDescription: i18next.t("cosmetics.icon_dreadnought_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_dreadnought.img rsx: RSX.portrait_magmar_dreadnought unlockable: false purchasable: true } cos[ProfileIcon.magmar_elucidator] = { id: ProfileIcon.magmar_elucidator typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_elucidator_name") shopDescription: i18next.t("cosmetics.icon_elucidator_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_elucidator.img rsx: RSX.portrait_magmar_elucidator unlockable: false purchasable: true } cos[ProfileIcon.magmar_makantorwarbeast] = { id: ProfileIcon.magmar_makantorwarbeast typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_makantor_name") shopDescription: i18next.t("cosmetics.icon_makantor_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_makantorwarbeast.img rsx: RSX.portrait_magmar_makantorwarbeast unlockable: false purchasable: true } cos[ProfileIcon.magmar_phalanxar] = { id: ProfileIcon.magmar_phalanxar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_phalanxar_name") shopDescription: i18next.t("cosmetics.icon_phalanxar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_phalanxar.img rsx: RSX.portrait_magmar_phalanxar unlockable: false purchasable: true } cos[ProfileIcon.magmar_silitharelder] = { id: ProfileIcon.magmar_silitharelder typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_silithar_elder_name") shopDescription: i18next.t("cosmetics.icon_silithar_elder_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_silitharelder.img rsx: RSX.portrait_magmar_silitharelder unlockable: false purchasable: true } cos[ProfileIcon.magmar_starhorn1] = { id: ProfileIcon.magmar_starhorn1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_starhorn_1_name") shopDescription: i18next.t("cosmetics.icon_starhorn_1_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_starhorn1.img rsx: RSX.portrait_magmar_starhorn1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_starhorn2] = { id: ProfileIcon.magmar_starhorn2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_starhorn_2_name") shopDescription: i18next.t("cosmetics.icon_starhorn_2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_starhorn2.img rsx: RSX.portrait_magmar_starhorn2 unlockable: false purchasable: true } cos[ProfileIcon.magmar_ragnora1] = { id: ProfileIcon.magmar_ragnora1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_ragnora_name") shopDescription: i18next.t("cosmetics.icon_ragnora_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_ragnora1.img rsx: RSX.portrait_magmar_ragnora1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_taygetesister] = { id: ProfileIcon.magmar_taygetesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_taygete_name") shopDescription: i18next.t("cosmetics.icon_taygete_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_taygetesister.img rsx: RSX.portrait_magmar_taygetesister unlockable: false purchasable: true } cos[ProfileIcon.magmar_vaath1] = { id: ProfileIcon.magmar_vaath1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_vaath_name") shopDescription: i18next.t("cosmetics.icon_vaath_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_vaath1.img rsx: RSX.portrait_magmar_vaath1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_vaath2] = { id: ProfileIcon.magmar_vaath2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_vaath_mk2_name") shopDescription: i18next.t("cosmetics.icon_vaath_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_vaath2.img rsx: RSX.portrait_magmar_vaath2 unlockable: false purchasable: true } cos[ProfileIcon.magmar_veteransilithar] = { id: ProfileIcon.magmar_veteransilithar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_veteran_silithar_name") shopDescription: i18next.t("cosmetics.icon_veteran_silithar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_veteransilithar.img rsx: RSX.portrait_magmar_veteransilithar unlockable: false purchasable: true } cos[ProfileIcon.magmar_youngsilithar] = { id: ProfileIcon.magmar_youngsilithar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_young_silithar_name") shopDescription: i18next.t("cosmetics.icon_young_silithar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_youngsilithar.img rsx: RSX.portrait_magmar_youngsilithar unlockable: false purchasable: true } cos[ProfileIcon.neutral_beastmaster] = { id: ProfileIcon.neutral_beastmaster typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_beastmaster_name") shopDescription: i18next.t("cosmetics.icon_beastmaster_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_beastmaster.img rsx: RSX.portrait_neutral_beastmaster unlockable: false purchasable: true } cos[ProfileIcon.neutral_cannonofmechaz0r] = { id: ProfileIcon.neutral_cannonofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_cannon_mech_name") shopDescription: i18next.t("cosmetics.icon_cannon_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_cannonofmechaz0r.img rsx: RSX.portrait_neutral_cannonofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_chassisofmechaz0r] = { id: ProfileIcon.neutral_chassisofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_chassis_mech_name") shopDescription: i18next.t("cosmetics.icon_chassis_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_chassisofmechaz0r.img rsx: RSX.portrait_neutral_chassisofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_gnasher] = { id: ProfileIcon.neutral_gnasher typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_gnasher_name") shopDescription: i18next.t("cosmetics.icon_gnasher_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_gnasher.img rsx: RSX.portrait_neutral_gnasher unlockable: false purchasable: true } cos[ProfileIcon.neutral_goldenmantella] = { id: ProfileIcon.neutral_goldenmantella typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_golden_mantella_name") shopDescription: i18next.t("cosmetics.icon_golden_mantella_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_goldenmantella.img rsx: RSX.portrait_neutral_goldenmantella unlockable: false purchasable: true } cos[ProfileIcon.neutral_grincher] = { id: ProfileIcon.neutral_grincher typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_grincher_name") shopDescription: i18next.t("cosmetics.icon_grincher_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_grincher.img rsx: RSX.portrait_neutral_grincher unlockable: false purchasable: true } cos[ProfileIcon.neutral_helmofmechaz0r] = { id: ProfileIcon.neutral_helmofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_helm_mech_name") shopDescription: i18next.t("cosmetics.icon_helm_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_helmofmechaz0r.img rsx: RSX.portrait_neutral_helmofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_hydrax1] = { id: ProfileIcon.neutral_hydrax1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_hydrax_name") shopDescription: i18next.t("cosmetics.icon_hydrax_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_hydrax1.img rsx: RSX.portrait_neutral_hydrax1 unlockable: false purchasable: true } cos[ProfileIcon.neutral_hydrax2] = { id: ProfileIcon.neutral_hydrax2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_hydrax_2_name") shopDescription: i18next.t("cosmetics.icon_hydrax_2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_hydrax2.img rsx: RSX.portrait_neutral_hydrax2 unlockable: false purchasable: true } cos[ProfileIcon.neutral_ion] = { id: ProfileIcon.neutral_ion typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_ion_name") shopDescription: i18next.t("cosmetics.icon_ion_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_ion.img rsx: RSX.portrait_neutral_ion unlockable: false purchasable: true } cos[ProfileIcon.neutral_ladylocke] = { id: ProfileIcon.neutral_ladylocke typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_lady_locke_name") shopDescription: i18next.t("cosmetics.icon_lady_locke_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_ladylocke.img rsx: RSX.portrait_neutral_ladylocke unlockable: false purchasable: true } cos[ProfileIcon.neutral_lkiansister] = { id: ProfileIcon.neutral_lkiansister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_sworn_sister_name") shopDescription: i18next.t("cosmetics.icon_sworn_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_lkiansister.img rsx: RSX.portrait_neutral_lkiansister unlockable: false purchasable: true } cos[ProfileIcon.neutral_mechaz0r] = { id: ProfileIcon.neutral_mechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_mechaz0r_name") shopDescription: i18next.t("cosmetics.icon_mechaz0r_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_mechaz0r.img rsx: RSX.portrait_neutral_mechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_nip] = { id: ProfileIcon.neutral_nip typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_dex_name") shopDescription: i18next.t("cosmetics.icon_dex_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_nip.img rsx: RSX.portrait_neutral_nip unlockable: false purchasable: true } cos[ProfileIcon.neutral_rawr] = { id: ProfileIcon.neutral_rawr typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rawr_name") shopDescription: i18next.t("cosmetics.icon_rawr_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rawr.img rsx: RSX.portrait_neutral_rawr unlockable: false purchasable: true } cos[ProfileIcon.neutral_rok] = { id: ProfileIcon.neutral_rok typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rok_name") shopDescription: i18next.t("cosmetics.icon_rok_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rok.img rsx: RSX.portrait_neutral_rok unlockable: false purchasable: true } cos[ProfileIcon.neutral_rook] = { id: ProfileIcon.neutral_rook typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rook_name") shopDescription: i18next.t("cosmetics.icon_rook_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rook.img rsx: RSX.portrait_neutral_rook unlockable: false purchasable: true } cos[ProfileIcon.neutral_silverbeak] = { id: ProfileIcon.neutral_silverbeak typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_silverbeak_name") shopDescription: i18next.t("cosmetics.icon_silverbeak_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_silverbeak.img rsx: RSX.portrait_neutral_silverbeak unlockable: false purchasable: true } cos[ProfileIcon.neutral_soboro] = { id: ProfileIcon.neutral_soboro typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_soboro_name") shopDescription: i18next.t("cosmetics.icon_soboro_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_soboro.img rsx: RSX.portrait_neutral_soboro unlockable: false purchasable: true } cos[ProfileIcon.neutral_swordofmechaz0r] = { id: ProfileIcon.neutral_swordofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_sword_mech_name") shopDescription: i18next.t("cosmetics.icon_sword_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_swordofmechaz0r.img rsx: RSX.portrait_neutral_swordofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_wingsofmechaz0r] = { id: ProfileIcon.neutral_wingsofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_wings_mech_name") shopDescription: i18next.t("cosmetics.icon_wings_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_wingsofmechaz0r.img rsx: RSX.portrait_neutral_wingsofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_z0r] = { id: ProfileIcon.neutral_z0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_z0r_name") shopDescription: i18next.t("cosmetics.icon_z0r_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_z0r.img rsx: RSX.portrait_neutral_z0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_zukong] = { id: ProfileIcon.neutral_zukong typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_zukong_name") shopDescription: i18next.t("cosmetics.icon_zukong_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_zukong.img rsx: RSX.portrait_neutral_zukong unlockable: false purchasable: true } cos[ProfileIcon.songhai_alkyonesister] = { id: ProfileIcon.songhai_alkyonesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_storm_sister_name") shopDescription: i18next.t("cosmetics.icon_storm_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_alkyonesister.img rsx: RSX.portrait_songhai_alkyonesister unlockable: false purchasable: true } cos[ProfileIcon.songhai_crest] = { id: ProfileIcon.songhai_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_songhai_crest_name") shopDescription: i18next.t("cosmetics.icon_songhai_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_crest.img rsx: RSX.portrait_songhai_crest unlockable: false purchasable: true } cos[ProfileIcon.songhai_gorehorn] = { id: ProfileIcon.songhai_gorehorn typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_gorehorn_name") shopDescription: i18next.t("cosmetics.icon_gorehorn_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_gorehorn.img rsx: RSX.portrait_songhai_gorehorn unlockable: false purchasable: true } cos[ProfileIcon.songhai_grandmasterzendo] = { id: ProfileIcon.songhai_grandmasterzendo typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_zendo_name") shopDescription: i18next.t("cosmetics.icon_zendo_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_grandmasterzendo.img rsx: RSX.portrait_songhai_grandmasterzendo unlockable: false purchasable: true } cos[ProfileIcon.songhai_heartseeker] = { id: ProfileIcon.songhai_heartseeker typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_heartseeker_name") shopDescription: i18next.t("cosmetics.icon_heartseeker_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_heartseeker.img rsx: RSX.portrait_songhai_heartseeker unlockable: false purchasable: true } cos[ProfileIcon.songhai_kaidoassassin] = { id: ProfileIcon.songhai_kaidoassassin typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_kaido_assassin_name") shopDescription: i18next.t("cosmetics.icon_kaido_assassin_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_kaidoassassin.img rsx: RSX.portrait_songhai_kaidoassassin unlockable: false purchasable: true } cos[ProfileIcon.songhai_kaleosxaan1] = { id: ProfileIcon.songhai_kaleosxaan1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_kaleos_name") shopDescription: i18next.t("cosmetics.icon_kaleos_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_kaleosxaan1.img rsx: RSX.portrait_songhai_kaleosxaan1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_revaeventide1] = { id: ProfileIcon.songhai_revaeventide1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_reva_name") shopDescription: i18next.t("cosmetics.icon_reva_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_revaeventide1.img rsx: RSX.portrait_songhai_revaeventide1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_revaeventide2] = { id: ProfileIcon.songhai_revaeventide2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_reva_mk2_name") shopDescription: i18next.t("cosmetics.icon_reva_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_revaeventide2.img rsx: RSX.portrait_songhai_revaeventide2 unlockable: false purchasable: true } cos[ProfileIcon.songhai_shidai1] = { id: ProfileIcon.songhai_shidai1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_shidai_name") shopDescription: i18next.t("cosmetics.icon_shidai_name") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_shidai1.img rsx: RSX.portrait_songhai_shidai1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_scarletviper] = { id: ProfileIcon.songhai_scarletviper typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_scarlet_viper_name") shopDescription: i18next.t("cosmetics.icon_scarlet_viper_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_scarletviper.img rsx: RSX.portrait_songhai_scarletviper unlockable: false purchasable: true } cos[ProfileIcon.songhai_tuskboar] = { id: ProfileIcon.songhai_tuskboar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_tusk_boar_name") shopDescription: i18next.t("cosmetics.icon_tusk_boar_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_tuskboar.img rsx: RSX.portrait_songhai_tuskboar unlockable: false purchasable: true } cos[ProfileIcon.songhai_widowmaker] = { id: ProfileIcon.songhai_widowmaker typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_widowmaker_name") shopDescription: i18next.t("cosmetics.icon_widowmaker_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_widowmaker.img rsx: RSX.portrait_songhai_widowmaker unlockable: false purchasable: true } cos[ProfileIcon.vanar_arcticdisplacer] = { id: ProfileIcon.vanar_arcticdisplacer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_arctic_displacer_name") shopDescription: i18next.t("cosmetics.icon_arctic_displacer_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_arcticdisplacer.img rsx: RSX.portrait_vanar_arcticdisplacer unlockable: false purchasable: true } cos[ProfileIcon.vanar_crest] = { id: ProfileIcon.vanar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_vanar_crest_name") shopDescription: i18next.t("cosmetics.icon_vanar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_crest.img rsx: RSX.portrait_vanar_crest unlockable: false purchasable: true } cos[ProfileIcon.vanar_draugarlord] = { id: ProfileIcon.vanar_draugarlord typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_draugar_lord_name") shopDescription: i18next.t("cosmetics.icon_draugar_lord_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_draugarlord.img rsx: RSX.portrait_vanar_draugarlord unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing_warbird] = { id: ProfileIcon.vanar_faiebloodwing_warbird typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_warbird_name") shopDescription: i18next.t("cosmetics.icon_warbird_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing_warbird.img rsx: RSX.portrait_vanar_faiebloodwing_warbird unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing1] = { id: ProfileIcon.vanar_faiebloodwing1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_faie_name") shopDescription: i18next.t("cosmetics.icon_faie_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing1.img rsx: RSX.portrait_vanar_faiebloodwing1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing2] = { id: ProfileIcon.vanar_faiebloodwing2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_faie_mk2_name") shopDescription: i18next.t("cosmetics.icon_faie_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing2.img rsx: RSX.portrait_vanar_faiebloodwing2 unlockable: false purchasable: true } cos[ProfileIcon.vanar_glacialelemental] = { id: ProfileIcon.vanar_glacialelemental typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_glacial_elemental_name") shopDescription: i18next.t("cosmetics.icon_glacial_elemental_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_glacialelemental.img rsx: RSX.portrait_vanar_glacialelemental unlockable: false purchasable: true } cos[ProfileIcon.vanar_hearthsister] = { id: ProfileIcon.vanar_hearthsister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_hearth_sister_name") shopDescription: i18next.t("cosmetics.icon_hearth_sister_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_hearthsister.img rsx: RSX.portrait_vanar_hearthsister unlockable: false purchasable: true } cos[ProfileIcon.vanar_icebladedryad] = { id: ProfileIcon.vanar_icebladedryad typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_iceblade_dryad_name") shopDescription: i18next.t("cosmetics.icon_iceblade_dryad_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_icebladedryad.img rsx: RSX.portrait_vanar_icebladedryad unlockable: false purchasable: true } cos[ProfileIcon.vanar_karawinterblade1] = { id: ProfileIcon.vanar_karawinterblade1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_kara_name") shopDescription: i18next.t("cosmetics.icon_kara_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_karawinterblade1.img rsx: RSX.portrait_vanar_karawinterblade1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_karawinterblade2] = { id: ProfileIcon.vanar_karawinterblade2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_kara_mk2_name") shopDescription: i18next.t("cosmetics.icon_kara_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_karawinterblade2.img rsx: RSX.portrait_vanar_karawinterblade2 unlockable: false purchasable: true } cos[ProfileIcon.vanar_ilena1] = { id: ProfileIcon.vanar_ilena1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_ilena_name") shopDescription: i18next.t("cosmetics.icon_ilena_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_ilena1.img rsx: RSX.portrait_vanar_ilena1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_maiasister] = { id: ProfileIcon.vanar_maiasister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_wind_sister_name") shopDescription: i18next.t("cosmetics.icon_wind_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_maiasister.img rsx: RSX.portrait_vanar_maiasister unlockable: false purchasable: true } cos[ProfileIcon.vanar_razorback] = { id: ProfileIcon.vanar_razorback typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_razorback_name") shopDescription: i18next.t("cosmetics.icon_razorback_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_razorback.img rsx: RSX.portrait_vanar_razorback unlockable: false purchasable: true } cos[ProfileIcon.vanar_snowchaser] = { id: ProfileIcon.vanar_snowchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_snowchaser_name") shopDescription: i18next.t("cosmetics.icon_snowchaser_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_snowchaser.img rsx: RSX.portrait_vanar_snowchaser unlockable: false purchasable: true } cos[ProfileIcon.vanar_wolfraven] = { id: ProfileIcon.vanar_wolfraven typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_wolfraven_name") shopDescription: i18next.t("cosmetics.icon_wolfraven_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_wolfraven.img rsx: RSX.portrait_vanar_wolfraven unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_crest] = { id: ProfileIcon.vetruvian_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_vetruvian_crest_name") shopDescription: i18next.t("cosmetics.icon_vetruvian_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_crest.img rsx: RSX.portrait_vetruvian_crest unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_miragemaster] = { id: ProfileIcon.vetruvian_miragemaster typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_mirage_master_name") shopDescription: i18next.t("cosmetics.icon_mirage_master_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_miragemaster.img rsx: RSX.portrait_vetruvian_miragemaster unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_pax] = { id: ProfileIcon.vetruvian_pax typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_pax_name") shopDescription: i18next.t("cosmetics.icon_pax_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_pax.img rsx: RSX.portrait_vetruvian_pax unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_pyromancer] = { id: ProfileIcon.vetruvian_pyromancer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_pyromancer_name") shopDescription: i18next.t("cosmetics.icon_pyromancer_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_pyromancer.img rsx: RSX.portrait_vetruvian_pyromancer unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_rae] = { id: ProfileIcon.vetruvian_rae typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_rae_name") shopDescription: i18next.t("cosmetics.icon_rae_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_rae.img rsx: RSX.portrait_vetruvian_rae unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_saonsister] = { id: ProfileIcon.vetruvian_saonsister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_sand_sister_name") shopDescription: i18next.t("cosmetics.icon_sand_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_saonsister.img rsx: RSX.portrait_vetruvian_saonsister unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_scionesssajj1] = { id: ProfileIcon.vetruvian_scionesssajj1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_sajj_name") shopDescription: i18next.t("cosmetics.icon_sajj_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_scionesssajj1.img rsx: RSX.portrait_vetruvian_scionesssajj1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_ciphyron1] = { id: ProfileIcon.vetruvian_ciphyron1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_ciphyron_name") shopDescription: i18next.t("cosmetics.icon_ciphyron_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_ciphyron1.img rsx: RSX.portrait_vetruvian_ciphyron1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_starfirescarab] = { id: ProfileIcon.vetruvian_starfirescarab typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_starfire_scarab_name") shopDescription: i18next.t("cosmetics.icon_starfire_scarab_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_starfirescarab.img rsx: RSX.portrait_vetruvian_starfirescarab unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_windshrike] = { id: ProfileIcon.vetruvian_windshrike typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_windshrike_name") shopDescription: i18next.t("cosmetics.icon_windshrike_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_windshrike.img rsx: RSX.portrait_vetruvian_windshrike unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_zirixstarstrider1] = { id: ProfileIcon.vetruvian_zirixstarstrider1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_zirix_name") shopDescription: i18next.t("cosmetics.icon_zirix_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_zirixstarstrider1.img rsx: RSX.portrait_vetruvian_zirixstarstrider1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_zirixstarstrider2] = { id: ProfileIcon.vetruvian_zirixstarstrider2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_zirix_mk2_name") shopDescription: i18next.t("cosmetics.icon_zirix_mk2_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_zirixstarstrider2.img rsx: RSX.portrait_vetruvian_zirixstarstrider2 unlockable: false purchasable: true } cos[ProfileIcon.Bloodmoon] = { id: ProfileIcon.Bloodmoon typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_bloodmoon_ruins_name") shopDescription: i18next.t("cosmetics.icon_bloodmoon_ruins_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_bloodmoon.img rsx: RSX.portrait_bloodmoon unlockable: false purchasable: false } cos[ProfileIcon.CrystalCaverns] = { id: ProfileIcon.CrystalCaverns typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_crystal_caverns_name") shopDescription: i18next.t("cosmetics.icon_crystal_caverns_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_crystal_caverns.img rsx: RSX.portrait_crystal_caverns unlockable: false purchasable: false } cos[ProfileIcon.Kaero] = { id: ProfileIcon.Kaero typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_kaero_name") shopDescription: i18next.t("cosmetics.icon_kaero_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_kaero.img rsx: RSX.portrait_kaero unlockable: false purchasable: false } cos[ProfileIcon.WhistlingBlade] = { id: ProfileIcon.WhistlingBlade typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_whistling_blades_name") shopDescription: i18next.t("cosmetics.icon_whistling_blades_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_whistling_blade.img rsx: RSX.portrait_whistling_blade unlockable: false purchasable: false } cos[ProfileIcon.obsidian_woods] = { id: ProfileIcon.obsidian_woods typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS enabled: true subTypeId: "Neutral" name: i18next.t("cosmetics.icon_obsidian_woods_name") shopDescription: i18next.t("cosmetics.icon_obsidian_woods_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_obsidian_woods.img rsx: RSX.portrait_obsidian_woods unlockable: false purchasable: false } cos[ProfileIcon.rashas_tomb] = { id: ProfileIcon.rashas_tomb typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS enabled: true subTypeId: "Neutral" name: i18next.t("cosmetics.icon_rashas_tomb_name") shopDescription: i18next.t("cosmetics.icon_rashas_tomb_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_rashas_tomb.img rsx: RSX.portrait_rashas_tomb unlockable: false purchasable: false } cos[ProfileIcon.grandmaster_icon] = { id: ProfileIcon.grandmaster_icon typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_grandmaster_name") shopDescription: i18next.t("cosmetics.icon_grandmaster_desc") rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_grandmaster_portrait.img rsx: RSX.portrait_grandmaster_portrait unlockable: true purchasable: false } cos[ProfileIcon.tournament_dawnofduelysts1] = { id: ProfileIcon.tournament_dawnofduelysts1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Emperor Sargos" shopDescription: "Emperor Sargos" rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_tournament_dawnofduelysts1.img rsx: RSX.portrait_tournament_dawnofduelysts1 unlockable: false purchasable: true } cos[ProfileIcon.tournament_dawnofduelysts2] = { id: ProfileIcon.tournament_dawnofduelysts2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "The Coming of Rasha" shopDescription: "The Coming of Rasha" rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_tournament_dawnofduelysts2.img rsx: RSX.portrait_tournament_dawnofduelysts2 unlockable: false purchasable: true } cos[ProfileIcon.aer] = { id: ProfileIcon.aer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Aer Pridebeak" shopDescription: "Aer Pridebeak" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_aer.img rsx: RSX.portrait_aer unlockable: false purchasable: true } cos[ProfileIcon.frizzing_mystic] = { id: ProfileIcon.frizzing_mystic typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Frizzing Mystic" shopDescription: "Frizzing Mystic" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_frizzing_mystic.img rsx: RSX.portrait_frizzing_mystic unlockable: false purchasable: true } cos[ProfileIcon.gibbet] = { id: ProfileIcon.gibbet typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" enabled: true name: "Gibbet" shopDescription: "Gibbet" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_gibbet.img rsx: RSX.portrait_gibbet unlockable: false purchasable: true } cos[ProfileIcon.orbo] = { id: ProfileIcon.orbo typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Orbo the Ostentatious" shopDescription: "Orbo the Ostentatious" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_orbo.img rsx: RSX.portrait_orbo unlockable: false purchasable: true } cos[ProfileIcon.canopic] = { id: ProfileIcon.canopic typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" enabled: true name: "Fifth Canopic" shopDescription: "Fifth Canopic" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_canopic.img rsx: RSX.portrait_canopic unlockable: false purchasable: true } cos[ProfileIcon.veracity] = { id: ProfileIcon.veracity typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" enabled: true name: "Yggdra's Voracity" shopDescription: "Yggdra's Voracity" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_veracity.img rsx: RSX.portrait_veracity unlockable: false purchasable: true } cos[ProfileIcon.indominus] = { id: ProfileIcon.indominus typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" enabled: true name: "Indominus" shopDescription: "Indominus" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_indominus.img rsx: RSX.portrait_indominus unlockable: false purchasable: true } cos[ProfileIcon.spriggen] = { id: ProfileIcon.spriggen typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Spriggen" shopDescription: "Spriggen" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_spriggen.img rsx: RSX.portrait_spriggen unlockable: false purchasable: true } cos[ProfileIcon.eternityPainter] = { id: ProfileIcon.eternityPainter typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" enabled: true name: "Eternity Painter" shopDescription: "Eternity Painter" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_eternityPainter.img rsx: RSX.portrait_eternityPainter unlockable: false purchasable: true } cos[ProfileIcon.skullProphet] = { id: ProfileIcon.skullProphet typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" enabled: true name: "Skull Prophet" shopDescription: "Skull Prophet" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_skullProphet.img rsx: RSX.portrait_skullProphet unlockable: false purchasable: true } cos[ProfileIcon.sinisterSilhouette] = { id: ProfileIcon.sinisterSilhouette typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Sinister Silhouette" shopDescription: "Sinister Silhouette" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_sinisterSilhouette.img rsx: RSX.portrait_sinisterSilhouette unlockable: false purchasable: true } # endregion Profile Icons # region emotes # Emotes were converted from prior format (from EmoteFactory) to this by executing these regex replaces: # https://gist.github.com/RobotRocker/13b08cd699b2a0242d9ae770dcdcb7a6 # region TEXT cos[Emote.TextHello] = { id: Emote.TextHello typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_hello_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextGLHF] = { id: Emote.TextGLHF typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_glhf_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextGG] = { id: Emote.TextGG typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_well_played_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextOops] = { id: Emote.TextOops typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_oops_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } # endregion TEXT # region HEALING MYSTIC cos[Emote.HealingMysticHappy] = { id: Emote.HealingMysticHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_happy.img rsx: RSX.emote_healing_mystic_happy title: "So Happy!" name: i18next.t("cosmetics.emote_hm_happy_name") shopDescription: i18next.t("cosmetics.emote_hm_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticSad] = { id: Emote.HealingMysticSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_sad.img rsx: RSX.emote_healing_mystic_sad title: "So Sad!" name: i18next.t("cosmetics.emote_hm_sad_name") shopDescription: i18next.t("cosmetics.emote_hm_sad_desc") emoteOrder: EMOTE_ORDER_SAD factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticThumbsUp] = { id: Emote.HealingMysticThumbsUp typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_thumbs_up.img rsx: RSX.emote_healing_mystic_thumbs_up title: "Yay!" name: i18next.t("cosmetics.emote_hm_thumbs_up_name") shopDescription: i18next.t("cosmetics.emote_hm_thumbs_up_desc") emoteOrder: EMOTE_ORDER_TAUNT factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticConfused] = { id: Emote.HealingMysticConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_confused.img rsx: RSX.emote_healing_mystic_confused title: "Huh!?" name: i18next.t("cosmetics.emote_hm_surprise_name") shopDescription: i18next.t("cosmetics.emote_hm_surprise_desc") emoteOrder: EMOTE_ORDER_CONFUSED factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticBlink] = { id: Emote.HealingMysticBlink typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_blink.img rsx: RSX.emote_healing_mystic_blink title: "Blink" name: i18next.t("cosmetics.emote_hm_blink_name") shopDescription: i18next.t("cosmetics.emote_hm_blink_desc") emoteOrder: EMOTE_ORDER_BOW factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } # endregion HEALING MYSTIC # region ALPHA cos[Emote.OtherIcebladeDryad] = { id: Emote.OtherIcebladeDryad typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: false alwaysVisible: false img: RSX.emote_alpha_iceblade_dryad.img rsx: RSX.emote_alpha_iceblade_dryad title: "Peace!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherRook] = { id: Emote.OtherRook typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: true alwaysVisible: false img: RSX.emote_alpha_rook.img rsx: RSX.emote_alpha_rook title: "Yeah Baby!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherLightchaser] = { id: Emote.OtherLightchaser typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: false alwaysVisible: false img: RSX.emote_alpha_lightchaser.img rsx: RSX.emote_alpha_lightchaser title: "Blargh!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherSnowChaserHoliday2015] = { id: Emote.OtherSnowChaserHoliday2015 typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_neutral_snowchaser_holiday_2015.img rsx: RSX.emote_neutral_snowchaser_holiday_2015 title: "Happy Holidays!" name: i18next.t("cosmetics.emote_holiday_snowchaser_name") shopDescription: i18next.t("cosmetics.emote_holiday_snowchaser_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: true } # endregion ALPHA # region NEUTRAL cos[Emote.emote_mechaz0r_cannon_confused] = { id: Emote.emote_mechaz0r_cannon_confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_cannon_confused.img rsx: RSX.emote_mechaz0r_cannon_confused name: i18next.t("cosmetics.emote_cannon_mech_name") shopDescription: i18next.t("cosmetics.emote_cannon_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_chassis_angry] = { id: Emote.emote_mechaz0r_chassis_angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_chassis_angry.img rsx: RSX.emote_mechaz0r_chassis_angry name: i18next.t("cosmetics.emote_chassis_mech_name") shopDescription: i18next.t("cosmetics.emote_chassis_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_helm_taunt] = { id: Emote.emote_mechaz0r_helm_taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_helm_taunt.img rsx: RSX.emote_mechaz0r_helm_taunt name: i18next.t("cosmetics.emote_helm_mech_name") shopDescription: i18next.t("cosmetics.emote_helm_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_sad] = { id: Emote.emote_mechaz0r_sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_sad.img rsx: RSX.emote_mechaz0r_sad name: i18next.t("cosmetics.emote_mechaz0r_name") shopDescription: i18next.t("cosmetics.emote_mechaz0r_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_sword_frustrated] = { id: Emote.emote_mechaz0r_sword_frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_sword_frustrated.img rsx: RSX.emote_mechaz0r_sword_frustrated name: i18next.t("cosmetics.emote_sword_mech_name") shopDescription: i18next.t("cosmetics.emote_sword_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_wings_happy] = { id: Emote.emote_mechaz0r_wings_happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_wings_happy.img rsx: RSX.emote_mechaz0r_wings_happy name: i18next.t("cosmetics.emote_wings_mech_name") shopDescription: i18next.t("cosmetics.emote_wings_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_ladylocke] = { id: Emote.emote_ladylocke typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_ladylocke.img rsx: RSX.emote_ladylocke name: i18next.t("cosmetics.emote_lady_locke_name") shopDescription: i18next.t("cosmetics.emote_lady_locke_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_phalanxar_thumbsdown] = { id: Emote.emote_phalanxar_thumbsdown typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_phalanxar_thumbsdown.img rsx: RSX.emote_phalanxar_thumbsdown name: i18next.t("cosmetics.emote_phalanxar_name") shopDescription: i18next.t("cosmetics.emote_phalanxar_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_snowchaser_bow] = { id: Emote.emote_snowchaser_bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_snowchaser_bow.img rsx: RSX.emote_snowchaser_bow name: i18next.t("cosmetics.emote_snowchaser_bow_name") shopDescription: i18next.t("cosmetics.emote_snowchaser_bow_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_hollowgrovekeeper] = { id: Emote.emote_hollowgrovekeeper typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_hollowgrovekeeper.img rsx: RSX.emote_hollowgrovekeeper name: i18next.t("cosmetics.emote_hollow_grovekeeper_name") shopDescription: i18next.t("cosmetics.emote_hollow_grovekeeper_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_lightbender] = { id: Emote.emote_lightbender typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_lightbender.img rsx: RSX.emote_lightbender name: i18next.t("cosmetics.emote_lightbender_name") shopDescription: i18next.t("cosmetics.emote_lightbender_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_primusfist] = { id: Emote.emote_primusfist typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_primusfist.img rsx: RSX.emote_primusfist name: i18next.t("cosmetics.emote_primus_fist_name") shopDescription: i18next.t("cosmetics.emote_primus_fist_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_zenrui] = { id: Emote.emote_zenrui typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_zenrui.img rsx: RSX.emote_zenrui name: i18next.t("cosmetics.emote_zenrui_name") shopDescription: i18next.t("cosmetics.emote_zenrui_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_bow] = { id: Emote.emote_fog_bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_bow.img rsx: RSX.emote_fog_bow name: i18next.t("cosmetics.emote_fog_bow_name") shopDescription: i18next.t("cosmetics.emote_fog_bow_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_confused] = { id: Emote.emote_fog_confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_confused.img rsx: RSX.emote_fog_confused name: i18next.t("cosmetics.emote_fog_confused_name") shopDescription: i18next.t("cosmetics.emote_fog_confused_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_dead] = { id: Emote.emote_fog_dead typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_dead.img rsx: RSX.emote_fog_dead name: i18next.t("cosmetics.emote_fog_gg_name") shopDescription: i18next.t("cosmetics.emote_fog_gg_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_frustrated] = { id: Emote.emote_fog_frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_frustrated.img rsx: RSX.emote_fog_frustrated name: i18next.t("cosmetics.emote_fog_sweat_name") shopDescription: i18next.t("cosmetics.emote_fog_sweat_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_happy] = { id: Emote.emote_fog_happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_happy.img rsx: RSX.emote_fog_happy name: i18next.t("cosmetics.emote_fog_happy_name") shopDescription: i18next.t("cosmetics.emote_fog_happy_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sad] = { id: Emote.emote_fog_sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sad.img rsx: RSX.emote_fog_sad name: i18next.t("cosmetics.emote_fog_cry_name") shopDescription: i18next.t("cosmetics.emote_fog_cry_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sleep] = { id: Emote.emote_fog_sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sleep.img rsx: RSX.emote_fog_sleep name: i18next.t("cosmetics.emote_fog_sleep_name") shopDescription: i18next.t("cosmetics.emote_fog_sleep_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sunglasses] = { id: Emote.emote_fog_sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sunglasses.img rsx: RSX.emote_fog_sunglasses name: i18next.t("cosmetics.emote_fog_smile_name") shopDescription: i18next.t("cosmetics.emote_fog_smile_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_surprised] = { id: Emote.emote_fog_surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_surprised.img rsx: RSX.emote_fog_surprised name: i18next.t("cosmetics.emote_fog_surprised_name") shopDescription: i18next.t("cosmetics.emote_fog_surprised_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_taunt_alt] = { id: Emote.emote_fog_taunt_alt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_taunt_alt.img rsx: RSX.emote_fog_taunt_alt name: i18next.t("cosmetics.emote_fog_kiss_name") shopDescription: i18next.t("cosmetics.emote_fog_kiss_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_taunt] = { id: Emote.emote_fog_taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_taunt.img rsx: RSX.emote_fog_taunt name: i18next.t("cosmetics.emote_fog_wink_name") shopDescription: i18next.t("cosmetics.emote_fog_wink_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } # endregion NEUTRAL # region FACTION 1 cos[Emote.Faction1Taunt] = { id: Emote.Faction1Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_taunt.img rsx: RSX.emote_f1_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Angry] = { id: Emote.Faction1Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_angry.img rsx: RSX.emote_f1_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Confused] = { id: Emote.Faction1Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_confused.img rsx: RSX.emote_f1_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sad] = { id: Emote.Faction1Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sad.img rsx: RSX.emote_f1_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Frustrated] = { id: Emote.Faction1Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_frustrated.img rsx: RSX.emote_f1_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Surprised] = { id: Emote.Faction1Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_surprised.img rsx: RSX.emote_f1_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Bow] = { id: Emote.Faction1Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_bow.img rsx: RSX.emote_f1_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sleep] = { id: Emote.Faction1Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sleep.img rsx: RSX.emote_f1_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sunglasses] = { id: Emote.Faction1Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sunglasses.img rsx: RSX.emote_f1_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Happy] = { id: Emote.Faction1Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_basic_happy.img rsx: RSX.emote_basic_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: false } cos[Emote.Faction1Kiss] = { id: Emote.Faction1Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_kiss.img rsx: RSX.emote_f1_kiss title: "Kiss" name: i18next.t("cosmetics.emote_argeon_love_name") shopDescription: i18next.t("cosmetics.emote_argeon_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } # endregion FACTION 1 # region FACTION 2 cos[Emote.Faction2Taunt] = { id: Emote.Faction2Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_taunt.img rsx: RSX.emote_f2_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Happy] = { id: Emote.Faction2Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_happy.img rsx: RSX.emote_f2_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Confused] = { id: Emote.Faction2Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_confused.img rsx: RSX.emote_f2_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sad] = { id: Emote.Faction2Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sad.img rsx: RSX.emote_f2_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Frustrated] = { id: Emote.Faction2Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_frustrated.img rsx: RSX.emote_f2_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Surprised] = { id: Emote.Faction2Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_surprised.img rsx: RSX.emote_f2_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Bow] = { id: Emote.Faction2Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_bow.img rsx: RSX.emote_f2_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sleep] = { id: Emote.Faction2Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sleep.img rsx: RSX.emote_f2_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sunglasses] = { id: Emote.Faction2Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sunglasses.img rsx: RSX.emote_f2_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Angry] = { id: Emote.Faction2Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_basic_angry.img rsx: RSX.emote_basic_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: false } cos[Emote.Faction2Kiss] = { id: Emote.Faction2Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_kiss.img rsx: RSX.emote_f2_kiss title: "Kiss" name: i18next.t("cosmetics.emote_kaleos_love_name") shopDescription: i18next.t("cosmetics.emote_kaleos_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } # endregion FACTION 2 # region FACTION 3 cos[Emote.Faction3Taunt] = { id: Emote.Faction3Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_taunt.img rsx: RSX.emote_f3_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Happy] = { id: Emote.Faction3Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_happy.img rsx: RSX.emote_f3_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Angry] = { id: Emote.Faction3Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_angry.img rsx: RSX.emote_f3_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sad] = { id: Emote.Faction3Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sad.img rsx: RSX.emote_f3_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Frustrated] = { id: Emote.Faction3Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_frustrated.img rsx: RSX.emote_f3_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Surprised] = { id: Emote.Faction3Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_surprised.img rsx: RSX.emote_f3_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Bow] = { id: Emote.Faction3Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_bow.img rsx: RSX.emote_f3_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sleep] = { id: Emote.Faction3Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sleep.img rsx: RSX.emote_f3_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sunglasses] = { id: Emote.Faction3Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sunglasses.img rsx: RSX.emote_f3_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Confused] = { id: Emote.Faction3Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_basic_confused.img rsx: RSX.emote_basic_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: false } cos[Emote.Faction3Kiss] = { id: Emote.Faction3Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_kiss.img rsx: RSX.emote_f3_kiss title: "Kiss" name: i18next.t("cosmetics.emote_zirix_love_name") shopDescription: i18next.t("cosmetics.emote_zirix_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } # endregion FACTION 3 # region FACTION 4 cos[Emote.Faction4Taunt] = { id: Emote.Faction4Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_taunt.img rsx: RSX.emote_f4_teal_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Happy] = { id: Emote.Faction4Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_happy.img rsx: RSX.emote_f4_teal_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Angry] = { id: Emote.Faction4Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_angry.img rsx: RSX.emote_f4_teal_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Confused] = { id: Emote.Faction4Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_confused.img rsx: RSX.emote_f4_teal_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sad] = { id: Emote.Faction4Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sad.img rsx: RSX.emote_f4_teal_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Surprised] = { id: Emote.Faction4Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_surprised.img rsx: RSX.emote_f4_teal_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Bow] = { id: Emote.Faction4Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_bow.img rsx: RSX.emote_f4_teal_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sleep] = { id: Emote.Faction4Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sleep.img rsx: RSX.emote_f4_teal_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sunglasses] = { id: Emote.Faction4Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sunglasses.img rsx: RSX.emote_f4_teal_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Frustrated] = { id: Emote.Faction4Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_frustrated.img rsx: RSX.emote_f4_teal_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: false } cos[Emote.Faction4Kiss] = { id: Emote.Faction4Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_kiss.img rsx: RSX.emote_f4_teal_kiss title: "Kiss" name: i18next.t("cosmetics.emote_lilithe_love_name") shopDescription: i18next.t("cosmetics.emote_lilithe_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } # endregion FACTION 4 # region FACTION 5 cos[Emote.Faction5Taunt] = { id: Emote.Faction5Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_taunt.img rsx: RSX.emote_f5_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Happy] = { id: Emote.Faction5Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_happy.img rsx: RSX.emote_f5_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Angry] = { id: Emote.Faction5Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_angry.img rsx: RSX.emote_f5_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Confused] = { id: Emote.Faction5Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_confused.img rsx: RSX.emote_f5_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Frustrated] = { id: Emote.Faction5Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_frustrated.img rsx: RSX.emote_f5_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Surprised] = { id: Emote.Faction5Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_surprised.img rsx: RSX.emote_f5_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Bow] = { id: Emote.Faction5Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_bow.img rsx: RSX.emote_f5_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sleep] = { id: Emote.Faction5Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_sleep.img rsx: RSX.emote_f5_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sunglasses] = { id: Emote.Faction5Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_sunglasses.img rsx: RSX.emote_f5_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sad] = { id: Emote.Faction5Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_basic_sad.img rsx: RSX.emote_basic_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: false } cos[Emote.Faction5Kiss] = { id: Emote.Faction5Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_kiss.img rsx: RSX.emote_f5_kiss title: "Kiss" name: i18next.t("cosmetics.emote_vaath_love_name") shopDescription: i18next.t("cosmetics.emote_vaath_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } # endregion FACTION 5 # region FACTION 6 cos[Emote.Faction6Frustrated] = { id: Emote.Faction6Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_frustrated.img rsx: RSX.emote_f6_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Happy] = { id: Emote.Faction6Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_happy.img rsx: RSX.emote_f6_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Angry] = { id: Emote.Faction6Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_angry.img rsx: RSX.emote_f6_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Confused] = { id: Emote.Faction6Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_confused.img rsx: RSX.emote_f6_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sad] = { id: Emote.Faction6Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sad.img rsx: RSX.emote_f6_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Surprised] = { id: Emote.Faction6Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_surprised.img rsx: RSX.emote_f6_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Bow] = { id: Emote.Faction6Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_bow.img rsx: RSX.emote_f6_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sleep] = { id: Emote.Faction6Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sleep.img rsx: RSX.emote_f6_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sunglasses] = { id: Emote.Faction6Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sunglasses.img rsx: RSX.emote_f6_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Taunt] = { id: Emote.Faction6Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_taunt.img rsx: RSX.emote_f6_taunt title: "Taunt" name: i18next.t("cosmetics.emote_faie_love_name") shopDescription: i18next.t("cosmetics.emote_faie_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Kiss] = { id: Emote.Faction6Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_basic_kiss.img rsx: RSX.emote_basic_kiss title: "Kiss" name: i18next.t("cosmetics.emote_faie_kiss_name") shopDescription: i18next.t("cosmetics.emote_faie_kiss_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: false } # endregion FACTION 6 # region ALT GENERALS # region FACTION 1 ALT cos[Emote.Faction1AltTaunt] = { id: Emote.Faction1AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_taunt.img rsx: RSX.emote_f1_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ziran_wink_name") shopDescription: i18next.t("cosmetics.emote_ziran_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltAngry] = { id: Emote.Faction1AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_angry.img rsx: RSX.emote_f1_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_ziran_angry_name") shopDescription: i18next.t("cosmetics.emote_ziran_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltConfused] = { id: Emote.Faction1AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_confused.img rsx: RSX.emote_f1_alt_confused name: i18next.t("cosmetics.emote_ziran_confused_name") shopDescription: i18next.t("cosmetics.emote_ziran_confused_desc") shopDescription: "Umm..." emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSad] = { id: Emote.Faction1AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sad.img rsx: RSX.emote_f1_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_ziran_crying_name") shopDescription: i18next.t("cosmetics.emote_ziran_crying_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltFrustrated] = { id: Emote.Faction1AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_frustrated.img rsx: RSX.emote_f1_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ziran_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ziran_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSurprised] = { id: Emote.Faction1AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_surprised.img rsx: RSX.emote_f1_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ziran_surprised_name") shopDescription: i18next.t("cosmetics.emote_ziran_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltBow] = { id: Emote.Faction1AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_bow.img rsx: RSX.emote_f1_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_ziran_bow_name") shopDescription: i18next.t("cosmetics.emote_ziran_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSleep] = { id: Emote.Faction1AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sleep.img rsx: RSX.emote_f1_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ziran_sleep_name") shopDescription: i18next.t("cosmetics.emote_ziran_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSunglasses] = { id: Emote.Faction1AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sunglasses.img rsx: RSX.emote_f1_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ziran_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ziran_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltHappy] = { id: Emote.Faction1AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_happy.img rsx: RSX.emote_f1_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_ziran_happy_name") shopDescription: i18next.t("cosmetics.emote_ziran_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltKiss] = { id: Emote.Faction1AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_kiss.img rsx: RSX.emote_f1_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ziran_love_name") shopDescription: i18next.t("cosmetics.emote_ziran_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } # endregion FACTION 1 ALT # region FACTION 2 ALT cos[Emote.Faction2AltTaunt] = { id: Emote.Faction2AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_taunt.img rsx: RSX.emote_f2_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_reva_wink_name") shopDescription: i18next.t("cosmetics.emote_reva_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltHappy] = { id: Emote.Faction2AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_happy.img rsx: RSX.emote_f2_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_reva_happy_name") shopDescription: i18next.t("cosmetics.emote_reva_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltConfused] = { id: Emote.Faction2AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_confused.img rsx: RSX.emote_f2_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_reva_confused_name") shopDescription: i18next.t("cosmetics.emote_reva_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSad] = { id: Emote.Faction2AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sad.img rsx: RSX.emote_f2_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_reva_sad_name") shopDescription: i18next.t("cosmetics.emote_reva_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltFrustrated] = { id: Emote.Faction2AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_frustrated.img rsx: RSX.emote_f2_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_reva_frustrated_name") shopDescription: i18next.t("cosmetics.emote_reva_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSurprised] = { id: Emote.Faction2AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_surprised.img rsx: RSX.emote_f2_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_reva_surprised_name") shopDescription: i18next.t("cosmetics.emote_reva_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltBow] = { id: Emote.Faction2AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_bow.img rsx: RSX.emote_f2_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_reva_bow_name") shopDescription: i18next.t("cosmetics.emote_reva_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSleep] = { id: Emote.Faction2AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sleep.img rsx: RSX.emote_f2_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_reva_sleep_name") shopDescription: i18next.t("cosmetics.emote_reva_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSunglasses] = { id: Emote.Faction2AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sunglasses.img rsx: RSX.emote_f2_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_reva_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_reva_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltAngry] = { id: Emote.Faction2AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_angry.img rsx: RSX.emote_f2_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_reva_angry_name") shopDescription: i18next.t("cosmetics.emote_reva_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltKiss] = { id: Emote.Faction2AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_kiss.img rsx: RSX.emote_f2_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_reva_love_name") shopDescription: i18next.t("cosmetics.emote_reva_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } # endregion FACTION 2 ALT # region FACTION 3 ALT cos[Emote.Faction3AltTaunt] = { id: Emote.Faction3AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_taunt.img rsx: RSX.emote_f3_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_sajj_wink_name") shopDescription: i18next.t("cosmetics.emote_sajj_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltHappy] = { id: Emote.Faction3AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_happy.img rsx: RSX.emote_f3_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_sajj_happy_name") shopDescription: i18next.t("cosmetics.emote_sajj_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltAngry] = { id: Emote.Faction3AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_angry.img rsx: RSX.emote_f3_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_sajj_angry_name") shopDescription: i18next.t("cosmetics.emote_sajj_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSad] = { id: Emote.Faction3AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sad.img rsx: RSX.emote_f3_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_sajj_sad_name") shopDescription: i18next.t("cosmetics.emote_sajj_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltFrustrated] = { id: Emote.Faction3AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_frustrated.img rsx: RSX.emote_f3_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_sajj_frustrated_name") shopDescription: i18next.t("cosmetics.emote_sajj_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSurprised] = { id: Emote.Faction3AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_surprised.img rsx: RSX.emote_f3_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_sajj_surprised_name") shopDescription: i18next.t("cosmetics.emote_sajj_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltBow] = { id: Emote.Faction3AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_bow.img rsx: RSX.emote_f3_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_sajj_bow_name") shopDescription: i18next.t("cosmetics.emote_sajj_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSleep] = { id: Emote.Faction3AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sleep.img rsx: RSX.emote_f3_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_sajj_sleep_name") shopDescription: i18next.t("cosmetics.emote_sajj_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSunglasses] = { id: Emote.Faction3AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sunglasses.img rsx: RSX.emote_f3_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_sajj_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_sajj_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltConfused] = { id: Emote.Faction3AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_confused.img rsx: RSX.emote_f3_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_sajj_confused_name") shopDescription: i18next.t("cosmetics.emote_sajj_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltKiss] = { id: Emote.Faction3AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_kiss.img rsx: RSX.emote_f3_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_sajj_love_name") shopDescription: i18next.t("cosmetics.emote_sajj_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } # endregion FACTION 3 ALT # region FACTION 4 ALT cos[Emote.Faction4AltTaunt] = { id: Emote.Faction4AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_taunt.img rsx: RSX.emote_f4_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_cassyva_wink_name") shopDescription: i18next.t("cosmetics.emote_cassyva_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltHappy] = { id: Emote.Faction4AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_happy.img rsx: RSX.emote_f4_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_cassyva_happy_name") shopDescription: i18next.t("cosmetics.emote_cassyva_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltAngry] = { id: Emote.Faction4AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_angry.img rsx: RSX.emote_f4_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_cassyva_angry_name") shopDescription: i18next.t("cosmetics.emote_cassyva_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltConfused] = { id: Emote.Faction4AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_confused.img rsx: RSX.emote_f4_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_cassyva_confused_name") shopDescription: i18next.t("cosmetics.emote_cassyva_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSad] = { id: Emote.Faction4AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sad.img rsx: RSX.emote_f4_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_cassyva_sad_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSurprised] = { id: Emote.Faction4AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_surprised.img rsx: RSX.emote_f4_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_cassyva_surprised_name") shopDescription: i18next.t("cosmetics.emote_cassyva_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltBow] = { id: Emote.Faction4AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_bow.img rsx: RSX.emote_f4_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_cassyva_bow_name") shopDescription: i18next.t("cosmetics.emote_cassyva_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSleep] = { id: Emote.Faction4AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sleep.img rsx: RSX.emote_f4_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_cassyva_sleep_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSunglasses] = { id: Emote.Faction4AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sunglasses.img rsx: RSX.emote_f4_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_cassyva_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltFrustrated] = { id: Emote.Faction4AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_frustrated.img rsx: RSX.emote_f4_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_cassyva_frustrated_name") shopDescription: i18next.t("cosmetics.emote_cassyva_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltKiss] = { id: Emote.Faction4AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_kiss.img rsx: RSX.emote_f4_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_cassyva_love_name") shopDescription: i18next.t("cosmetics.emote_cassyva_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } # endregion FACTION 4 ALT # region FACTION 5 ALT cos[Emote.Faction5AltTaunt] = { id: Emote.Faction5AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_taunt.img rsx: RSX.emote_f5_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_starhorn_wink_name") shopDescription: i18next.t("cosmetics.emote_starhorn_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltHappy] = { id: Emote.Faction5AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_happy.img rsx: RSX.emote_f5_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_starhorn_happy_name") shopDescription: i18next.t("cosmetics.emote_starhorn_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltAngry] = { id: Emote.Faction5AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_angry.img rsx: RSX.emote_f5_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_starhorn_angry_name") shopDescription: i18next.t("cosmetics.emote_starhorn_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltConfused] = { id: Emote.Faction5AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_confused.img rsx: RSX.emote_f5_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_starhorn_confused_name") shopDescription: i18next.t("cosmetics.emote_starhorn_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltFrustrated] = { id: Emote.Faction5AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_frustrated.img rsx: RSX.emote_f5_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_starhorn_frustrated_name") shopDescription: i18next.t("cosmetics.emote_starhorn_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSurprised] = { id: Emote.Faction5AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_surprised.img rsx: RSX.emote_f5_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_starhorn_surprised_name") shopDescription: i18next.t("cosmetics.emote_starhorn_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltBow] = { id: Emote.Faction5AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_bow.img rsx: RSX.emote_f5_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_starhorn_bow_name") shopDescription: i18next.t("cosmetics.emote_starhorn_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSleep] = { id: Emote.Faction5AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sleep.img rsx: RSX.emote_f5_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_starhorn_sleep_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSunglasses] = { id: Emote.Faction5AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sunglasses.img rsx: RSX.emote_f5_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_starhorn_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSad] = { id: Emote.Faction5AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sad.img rsx: RSX.emote_f5_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_starhorn_sad_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltKiss] = { id: Emote.Faction5AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_kiss.img rsx: RSX.emote_f5_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_starhorn_love_name") shopDescription: i18next.t("cosmetics.emote_starhorn_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } # endregion FACTION 5 ALT # region FACTION 6 ALT cos[Emote.Faction6AltFrustrated] = { id: Emote.Faction6AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_frustrated.img rsx: RSX.emote_f6_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_kara_frustrated_name") shopDescription: i18next.t("cosmetics.emote_kara_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltHappy] = { id: Emote.Faction6AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_happy.img rsx: RSX.emote_f6_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_kara_happy_name") shopDescription: i18next.t("cosmetics.emote_kara_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltAngry] = { id: Emote.Faction6AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_angry.img rsx: RSX.emote_f6_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_kara_angry_name") shopDescription: i18next.t("cosmetics.emote_kara_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltConfused] = { id: Emote.Faction6AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_confused.img rsx: RSX.emote_f6_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_kara_confused_name") shopDescription: i18next.t("cosmetics.emote_kara_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSad] = { id: Emote.Faction6AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sad.img rsx: RSX.emote_f6_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_kara_sad_name") shopDescription: i18next.t("cosmetics.emote_kara_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSurprised] = { id: Emote.Faction6AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_surprised.img rsx: RSX.emote_f6_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_kara_surprised_name") shopDescription: i18next.t("cosmetics.emote_kara_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltBow] = { id: Emote.Faction6AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_bow.img rsx: RSX.emote_f6_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_kara_bow_name") shopDescription: i18next.t("cosmetics.emote_kara_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSleep] = { id: Emote.Faction6AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sleep.img rsx: RSX.emote_f6_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_kara_sleep_name") shopDescription: i18next.t("cosmetics.emote_kara_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSunglasses] = { id: Emote.Faction6AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sunglasses.img rsx: RSX.emote_f6_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_kara_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_kara_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltTaunt] = { id: Emote.Faction6AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_taunt.img rsx: RSX.emote_f6_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_kara_wink_name") shopDescription: i18next.t("cosmetics.emote_kara_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltKiss] = { id: Emote.Faction6AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_kiss.img rsx: RSX.emote_f6_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_kara_love_name") shopDescription: i18next.t("cosmetics.emote_kara_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } # endregion FACTION 6 ALT # endregion ALT GENERALS # region THIRD GENERALS # region FACTION 1 THIRD cos[Emote.Faction1ThirdTaunt] = { id: Emote.Faction1ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_taunt.img rsx: RSX.emote_f1_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_brome_wink_name") shopDescription: i18next.t("cosmetics.emote_brome_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdAngry] = { id: Emote.Faction1ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_angry.img rsx: RSX.emote_f1_third_angry title: "Angry" name: i18next.t("cosmetics.emote_brome_angry_name") shopDescription: i18next.t("cosmetics.emote_brome_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdConfused] = { id: Emote.Faction1ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_confused.img rsx: RSX.emote_f1_third_confused name: i18next.t("cosmetics.emote_brome_confused_name") shopDescription: i18next.t("cosmetics.emote_brome_confused_desc") shopDescription: "Umm..." emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSad] = { id: Emote.Faction1ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sad.img rsx: RSX.emote_f1_third_sad title: "Sad" name: i18next.t("cosmetics.emote_brome_crying_name") shopDescription: i18next.t("cosmetics.emote_brome_crying_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdFrustrated] = { id: Emote.Faction1ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_frustrated.img rsx: RSX.emote_f1_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_brome_frustrated_name") shopDescription: i18next.t("cosmetics.emote_brome_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSurprised] = { id: Emote.Faction1ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_surprised.img rsx: RSX.emote_f1_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_brome_surprised_name") shopDescription: i18next.t("cosmetics.emote_brome_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdBow] = { id: Emote.Faction1ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_bow.img rsx: RSX.emote_f1_third_bow title: "Bow" name: i18next.t("cosmetics.emote_brome_bow_name") shopDescription: i18next.t("cosmetics.emote_brome_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSleep] = { id: Emote.Faction1ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sleep.img rsx: RSX.emote_f1_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_brome_sleep_name") shopDescription: i18next.t("cosmetics.emote_brome_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSunglasses] = { id: Emote.Faction1ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sunglasses.img rsx: RSX.emote_f1_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_brome_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_brome_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdHappy] = { id: Emote.Faction1ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_happy.img rsx: RSX.emote_f1_third_happy title: "Happy" name: i18next.t("cosmetics.emote_brome_happy_name") shopDescription: i18next.t("cosmetics.emote_brome_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdKiss] = { id: Emote.Faction1ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_kiss.img rsx: RSX.emote_f1_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_brome_love_name") shopDescription: i18next.t("cosmetics.emote_brome_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 1 THIRD # region FACTION 2 THIRD cos[Emote.Faction2ThirdTaunt] = { id: Emote.Faction2ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_taunt.img rsx: RSX.emote_f2_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_shidai_wink_name") shopDescription: i18next.t("cosmetics.emote_shidai_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdHappy] = { id: Emote.Faction2ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_happy.img rsx: RSX.emote_f2_third_happy title: "Happy" name: i18next.t("cosmetics.emote_shidai_happy_name") shopDescription: i18next.t("cosmetics.emote_shidai_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdConfused] = { id: Emote.Faction2ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_confused.img rsx: RSX.emote_f2_third_confused title: "Confused" name: i18next.t("cosmetics.emote_shidai_confused_name") shopDescription: i18next.t("cosmetics.emote_shidai_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSad] = { id: Emote.Faction2ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sad.img rsx: RSX.emote_f2_third_sad title: "Sad" name: i18next.t("cosmetics.emote_shidai_sad_name") shopDescription: i18next.t("cosmetics.emote_shidai_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdFrustrated] = { id: Emote.Faction2ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_frustrated.img rsx: RSX.emote_f2_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_shidai_frustrated_name") shopDescription: i18next.t("cosmetics.emote_shidai_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSurprised] = { id: Emote.Faction2ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_surprised.img rsx: RSX.emote_f2_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_shidai_surprised_name") shopDescription: i18next.t("cosmetics.emote_shidai_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdBow] = { id: Emote.Faction2ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_bow.img rsx: RSX.emote_f2_third_bow title: "Bow" name: i18next.t("cosmetics.emote_shidai_bow_name") shopDescription: i18next.t("cosmetics.emote_shidai_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSleep] = { id: Emote.Faction2ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sleep.img rsx: RSX.emote_f2_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_shidai_sleep_name") shopDescription: i18next.t("cosmetics.emote_shidai_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSunglasses] = { id: Emote.Faction2ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sunglasses.img rsx: RSX.emote_f2_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_shidai_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_shidai_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdAngry] = { id: Emote.Faction2ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_angry.img rsx: RSX.emote_f2_third_angry title: "Angry" name: i18next.t("cosmetics.emote_shidai_angry_name") shopDescription: i18next.t("cosmetics.emote_shidai_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdKiss] = { id: Emote.Faction2ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_kiss.img rsx: RSX.emote_f2_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_shidai_love_name") shopDescription: i18next.t("cosmetics.emote_shidai_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 2 THIRD # region FACTION 3 THIRD cos[Emote.Faction3ThirdTaunt] = { id: Emote.Faction3ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_taunt.img rsx: RSX.emote_f3_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ciphyron_wink_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdHappy] = { id: Emote.Faction3ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_happy.img rsx: RSX.emote_f3_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ciphyron_happy_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdAngry] = { id: Emote.Faction3ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_angry.img rsx: RSX.emote_f3_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ciphyron_angry_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSad] = { id: Emote.Faction3ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sad.img rsx: RSX.emote_f3_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ciphyron_sad_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdFrustrated] = { id: Emote.Faction3ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_frustrated.img rsx: RSX.emote_f3_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ciphyron_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSurprised] = { id: Emote.Faction3ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_surprised.img rsx: RSX.emote_f3_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ciphyron_surprised_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdBow] = { id: Emote.Faction3ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_bow.img rsx: RSX.emote_f3_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ciphyron_bow_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSleep] = { id: Emote.Faction3ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sleep.img rsx: RSX.emote_f3_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ciphyron_sleep_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSunglasses] = { id: Emote.Faction3ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sunglasses.img rsx: RSX.emote_f3_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ciphyron_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdConfused] = { id: Emote.Faction3ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_confused.img rsx: RSX.emote_f3_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ciphyron_confused_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdKiss] = { id: Emote.Faction3ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_kiss.img rsx: RSX.emote_f3_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ciphyron_love_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 3 THIRD # region FACTION 4 THIRD cos[Emote.Faction4ThirdTaunt] = { id: Emote.Faction4ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_taunt.img rsx: RSX.emote_f4_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_maehv_wink_name") shopDescription: i18next.t("cosmetics.emote_maehv_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdHappy] = { id: Emote.Faction4ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_happy.img rsx: RSX.emote_f4_third_happy title: "Happy" name: i18next.t("cosmetics.emote_maehv_happy_name") shopDescription: i18next.t("cosmetics.emote_maehv_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdAngry] = { id: Emote.Faction4ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_angry.img rsx: RSX.emote_f4_third_angry title: "Angry" name: i18next.t("cosmetics.emote_maehv_angry_name") shopDescription: i18next.t("cosmetics.emote_maehv_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdConfused] = { id: Emote.Faction4ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_confused.img rsx: RSX.emote_f4_third_confused title: "Confused" name: i18next.t("cosmetics.emote_maehv_confused_name") shopDescription: i18next.t("cosmetics.emote_maehv_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSad] = { id: Emote.Faction4ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sad.img rsx: RSX.emote_f4_third_sad title: "Sad" name: i18next.t("cosmetics.emote_maehv_sad_name") shopDescription: i18next.t("cosmetics.emote_maehv_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSurprised] = { id: Emote.Faction4ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_surprised.img rsx: RSX.emote_f4_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_maehv_surprised_name") shopDescription: i18next.t("cosmetics.emote_maehv_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdBow] = { id: Emote.Faction4ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_bow.img rsx: RSX.emote_f4_third_bow title: "Bow" name: i18next.t("cosmetics.emote_maehv_bow_name") shopDescription: i18next.t("cosmetics.emote_maehv_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSleep] = { id: Emote.Faction4ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sleep.img rsx: RSX.emote_f4_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_maehv_sleep_name") shopDescription: i18next.t("cosmetics.emote_maehv_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSunglasses] = { id: Emote.Faction4ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sunglasses.img rsx: RSX.emote_f4_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_maehv_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_maehv_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdFrustrated] = { id: Emote.Faction4ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_frustrated.img rsx: RSX.emote_f4_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_maehv_frustrated_name") shopDescription: i18next.t("cosmetics.emote_maehv_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdKiss] = { id: Emote.Faction4ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_kiss.img rsx: RSX.emote_f4_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_maehv_love_name") shopDescription: i18next.t("cosmetics.emote_maehv_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 4 THIRD # region FACTION 5 THIRD cos[Emote.Faction5ThirdTaunt] = { id: Emote.Faction5ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_taunt.img rsx: RSX.emote_f5_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ragnora_wink_name") shopDescription: i18next.t("cosmetics.emote_ragnora_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdHappy] = { id: Emote.Faction5ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_happy.img rsx: RSX.emote_f5_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ragnora_happy_name") shopDescription: i18next.t("cosmetics.emote_ragnora_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdAngry] = { id: Emote.Faction5ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_angry.img rsx: RSX.emote_f5_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ragnora_angry_name") shopDescription: i18next.t("cosmetics.emote_ragnora_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdConfused] = { id: Emote.Faction5ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_confused.img rsx: RSX.emote_f5_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ragnora_confused_name") shopDescription: i18next.t("cosmetics.emote_ragnora_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdFrustrated] = { id: Emote.Faction5ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_frustrated.img rsx: RSX.emote_f5_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ragnora_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ragnora_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSurprised] = { id: Emote.Faction5ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_surprised.img rsx: RSX.emote_f5_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ragnora_surprised_name") shopDescription: i18next.t("cosmetics.emote_ragnora_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdBow] = { id: Emote.Faction5ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_bow.img rsx: RSX.emote_f5_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ragnora_bow_name") shopDescription: i18next.t("cosmetics.emote_ragnora_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSleep] = { id: Emote.Faction5ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sleep.img rsx: RSX.emote_f5_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ragnora_sleep_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSunglasses] = { id: Emote.Faction5ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sunglasses.img rsx: RSX.emote_f5_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ragnora_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSad] = { id: Emote.Faction5ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sad.img rsx: RSX.emote_f5_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ragnora_sad_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdKiss] = { id: Emote.Faction5ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_kiss.img rsx: RSX.emote_f5_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ragnora_love_name") shopDescription: i18next.t("cosmetics.emote_ragnora_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 5 THIRD # region FACTION 6 THIRD cos[Emote.Faction6ThirdFrustrated] = { id: Emote.Faction6ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_frustrated.img rsx: RSX.emote_f6_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ilena_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ilena_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdHappy] = { id: Emote.Faction6ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_happy.img rsx: RSX.emote_f6_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ilena_happy_name") shopDescription: i18next.t("cosmetics.emote_ilena_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdAngry] = { id: Emote.Faction6ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_angry.img rsx: RSX.emote_f6_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ilena_angry_name") shopDescription: i18next.t("cosmetics.emote_ilena_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdConfused] = { id: Emote.Faction6ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_confused.img rsx: RSX.emote_f6_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ilena_confused_name") shopDescription: i18next.t("cosmetics.emote_ilena_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSad] = { id: Emote.Faction6ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sad.img rsx: RSX.emote_f6_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ilena_sad_name") shopDescription: i18next.t("cosmetics.emote_ilena_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSurprised] = { id: Emote.Faction6ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_surprised.img rsx: RSX.emote_f6_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ilena_surprised_name") shopDescription: i18next.t("cosmetics.emote_ilena_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdBow] = { id: Emote.Faction6ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_bow.img rsx: RSX.emote_f6_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ilena_bow_name") shopDescription: i18next.t("cosmetics.emote_ilena_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSleep] = { id: Emote.Faction6ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sleep.img rsx: RSX.emote_f6_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ilena_sleep_name") shopDescription: i18next.t("cosmetics.emote_ilena_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSunglasses] = { id: Emote.Faction6ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sunglasses.img rsx: RSX.emote_f6_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ilena_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ilena_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdTaunt] = { id: Emote.Faction6ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_taunt.img rsx: RSX.emote_f6_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ilena_wink_name") shopDescription: i18next.t("cosmetics.emote_ilena_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdKiss] = { id: Emote.Faction6ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_kiss.img rsx: RSX.emote_f6_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ilena_love_name") shopDescription: i18next.t("cosmetics.emote_ilena_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 6 THIRD # endregion THIRD GENERALS # endregion emotes # region Battlemaps cos[BattleMap.Magmar] = { id: BattleMap.Magmar typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_magmar_name") shopDescription: i18next.t("cosmetics.battlemap_magmar_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_magmar.img rsx: RSX.shop_battle_map_magmar unlockable: false purchasable: true battleMapTemplateIndex: 7 } cos[BattleMap.Abyssian] = { id: BattleMap.Abyssian typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_abyssian_name") shopDescription: i18next.t("cosmetics.battlemap_abyssian_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_abyssian.img rsx: RSX.shop_battle_map_abyssian unlockable: false purchasable: true battleMapTemplateIndex: 8 } cos[BattleMap.Redrock] = { id: BattleMap.Redrock typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_redrock_name") shopDescription: i18next.t("cosmetics.battlemap_redrock_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_redrock.img rsx: RSX.shop_battle_map_redrock unlockable: false purchasable: true battleMapTemplateIndex: 9 } cos[BattleMap.Vanar] = { id: BattleMap.Vanar typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_vanar_name") shopDescription: i18next.t("cosmetics.battlemap_vanar_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_vanar.img rsx: RSX.shop_battle_map_vanar unlockable: false purchasable: true battleMapTemplateIndex: 10 } # endregion Battlemaps # endregion Cosmetics datas # Generate skus procedurally for cosmeticTypeKey,cosmeticsOfType of CosmeticsLookup if not cosmeticsOfType? or !_.isObject(cosmeticsOfType) continue cosmeticTypeId = CosmeticsTypeLookup[cosmeticTypeKey] if not cosmeticTypeId? continue for cosmeticKey,cosmeticId of cosmeticsOfType cosmeticData = cos[cosmeticId] if not cosmeticData? continue cosmeticData.sku = cosmeticTypeId + "-" + cosmeticKey + "-" + cosmeticId ## Generate default subTypes #for cosId,cosForSubtype of cos # if cosForSubtype.subType? # continue # if cosForSubtype.typeId == CosmeticsTypeLookup.Emote && cosForSubtype.factionId? # subType = "n/a" # if subType? # cosForSubtype.subType = subType # # cosForSubtype.subTypeId ?= "n/a" # setup caches CosmeticsFactory._cachedCosmetics = [] CosmeticsFactory._cachedCosmeticsForType = {} CosmeticsFactory._cachedCosmeticsForTypeAndFaction = {} CosmeticsFactory._cachedCosmeticsForTypeAndRarity = {} CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity = {} CosmeticsFactory._cachedCosmeticsForFaction = {} CosmeticsFactory._cachedCosmeticsForRarity = {} CosmeticsFactory._cachedCosmeticsForChestType = {} CosmeticsFactory._cachedCosmeticsForTypeAndSubType = {} CosmeticsFactory._cachedCosmeticSubTypesByType = {} CosmeticsFactory._cachedCardSkinsForCardId = {} CosmeticsFactory._cachedCardSkinIdsForCardId = {} # ensure that all cosmetic types, rarities, factions, and chest types have at least an empty array cosmeticTypes = Object.keys(CosmeticsTypeLookup) cosmeticChestTypes = Object.keys(CosmeticsChestTypeLookup) factionIds = Object.keys(Factions) rarityIds = Object.keys(Rarity) for cosmeticTypeKey in cosmeticTypes type = CosmeticsTypeLookup[cosmeticTypeKey] CosmeticsFactory._cachedCosmeticsForType[type] ?= [] CosmeticsFactory._cachedCosmeticSubTypesByType[type] ?= [] for factionIdKey in factionIds factionId = Factions[factionIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type][factionId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId][rarityId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type][rarityId] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type] ?= {} for factionIdKey in factionIds factionId = Factions[factionIdKey] CosmeticsFactory._cachedCosmeticsForFaction[factionId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForRarity[rarityId] ?= [] for cosmeticChestTypeKey in cosmeticChestTypes chestType = CosmeticsChestTypeLookup[cosmeticChestTypeKey] CosmeticsFactory._cachedCosmeticsForChestType[chestType] ?= [] # add all cosmetics to caches cosmeticIdKeys = Object.keys(CosmeticsFactory._cosmeticsById) for cosmeticIdKey of cosmeticIdKeys cosmeticId = cosmeticIdKeys[cosmeticIdKey] cosmeticData = CosmeticsFactory._cosmeticsById[cosmeticId] type = cosmeticData.typeId factionId = cosmeticData.factionId rarityId = cosmeticData.rarityId chestType = cosmeticData.chestType subType = cosmeticData.subTypeId CosmeticsFactory._cachedCosmetics.push(cosmeticData) if type? CosmeticsFactory._cachedCosmeticsForType[type].push(cosmeticData) if factionId? CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type][factionId].push(cosmeticData) if rarityId? CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type][rarityId].push(cosmeticData) if factionId? and rarityId? CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId][rarityId].push(cosmeticData) if subType? CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type][subType] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type][subType].push(cosmeticData) if not _.contains(CosmeticsFactory._cachedCosmeticSubTypesByType[type],subType) CosmeticsFactory._cachedCosmeticSubTypesByType[type].push(subType) if type == CosmeticsTypeLookup.CardSkin cardId = cosmeticData.cardId if cardId? CosmeticsFactory._cachedCardSkinsForCardId[cardId] ?= [] CosmeticsFactory._cachedCardSkinsForCardId[cardId].push(cosmeticData) CosmeticsFactory._cachedCardSkinIdsForCardId[cardId] ?= [] CosmeticsFactory._cachedCardSkinIdsForCardId[cardId].push(cosmeticData.id) if factionId? CosmeticsFactory._cachedCosmeticsForFaction[factionId].push(cosmeticData) if rarityId? CosmeticsFactory._cachedCosmeticsForRarity[rarityId].push(cosmeticData) if chestType? CosmeticsFactory._cachedCosmeticsForChestType[chestType].push(cosmeticData) # Generate default descriptions # TODO: Better language for shop descriptors _getEmotionDescriptor = (emoteOrder) -> if emoteOrder == EMOTE_ORDER_ANGRY return i18next.t("cosmetics.emote_anger") else if emoteOrder == EMOTE_ORDER_BOW return i18next.t("cosmetics.emote_respect") else if emoteOrder == EMOTE_ORDER_CONFUSED return i18next.t("cosmetics.emote_confusion") else if emoteOrder == EMOTE_ORDER_FRUSTRATED return i18next.t("cosmetics.emote_frustration") else if emoteOrder == EMOTE_ORDER_HAPPY return i18next.t("cosmetics.emote_happiness") else if emoteOrder == EMOTE_ORDER_SAD return i18next.t("cosmetics.emote_sadness") else if emoteOrder == EMOTE_ORDER_SLEEP return i18next.t("cosmetics.emote_impatience") else if emoteOrder == EMOTE_ORDER_SUNGLASSES return i18next.t("cosmetics.emote_style") else if emoteOrder == EMOTE_ORDER_SURPRISED return i18next.t("cosmetics.emote_surprise") else if emoteOrder == EMOTE_ORDER_TAUNT return i18next.t("cosmetics.emote_confidence") else if emoteOrder == EMOTE_ORDER_KISS return i18next.t("cosmetics.emote_love") else return i18next.t("cosmetics.emote_emotion") allCosForDesc = CosmeticsFactory.getAllCosmetics() for cosForDesc in allCosForDesc if cosForDesc.shopDescription? continue if cosForDesc.typeId == CosmeticsTypeLookup.CardBack cosForDesc.shopDescription = i18next.t("cosmetics.cardback_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.Scene cosForDesc.shopDescription = i18next.t("cosmetics.scene_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.ProfileIcon cosForDesc.shopDescription = i18next.t("cosmetics.icon_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.Emote generalDescriptor = "" if cosForDesc.generalId? if cosForDesc.generalId == Cards.Faction1.General then generalDescriptor = i18next.t("cosmetics.shop_emote_argeon") if cosForDesc.generalId == Cards.Faction1.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ziran") if cosForDesc.generalId == Cards.Faction1.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_brome") if cosForDesc.generalId == Cards.Faction2.General then generalDescriptor = i18next.t("cosmetics.shop_emote_kaleos") if cosForDesc.generalId == Cards.Faction2.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_reva") if cosForDesc.generalId == Cards.Faction2.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_shidai") if cosForDesc.generalId == Cards.Faction3.General then generalDescriptor = i18next.t("cosmetics.shop_emote_zirix") if cosForDesc.generalId == Cards.Faction3.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_sajj") if cosForDesc.generalId == Cards.Faction3.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ciphyron") if cosForDesc.generalId == Cards.Faction4.General then generalDescriptor = i18next.t("cosmetics.shop_emote_lilithe") if cosForDesc.generalId == Cards.Faction4.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_cassyva") if cosForDesc.generalId == Cards.Faction4.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_maehv") if cosForDesc.generalId == Cards.Faction5.General then generalDescriptor = i18next.t("cosmetics.shop_emote_vaath") if cosForDesc.generalId == Cards.Faction5.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_starhorn") if cosForDesc.generalId == Cards.Faction5.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ragnora") if cosForDesc.generalId == Cards.Faction6.General then generalDescriptor = i18next.t("cosmetics.shop_emote_faie") if cosForDesc.generalId == Cards.Faction6.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_kara") if cosForDesc.generalId == Cards.Faction6.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ilena") cosForDesc.shopDescription = i18next.t("cosmetics.shop_emote",{emote:_getEmotionDescriptor(cosForDesc.emoteOrder)},{general:generalDescriptor}) #cosForDesc.shopDescription = "Express your #{_getEmotionDescriptor(cosForDesc.emoteOrder)} in game#{generalDescriptor}" # Set default reward orders allCosForRewardOrder = CosmeticsFactory.getAllCosmetics() for cosForOrder in allCosForRewardOrder if not cosForOrder.rewardOrder? cosForOrder.rewardOrder = 0 module.exports = CosmeticsFactory
13111
# do not add this file to any resource package # it is handled by special processing _ = require 'underscore' moment = require 'moment' RSX = require('app/data/resources') CosmeticsLookup = require './cosmeticsLookup' CosmeticsTypeLookup = require './cosmeticsTypeLookup' CosmeticsChestTypeLookup = require './cosmeticsChestTypeLookup' EmoteCategory = require './emoteCategory' Factions = require 'app/sdk/cards/factionsLookup' Rarity = require 'app/sdk/cards/rarityLookup' RarityFactory = require 'app/sdk/cards/rarityFactory' Cards = require 'app/sdk/cards/cardsLookup' i18next = require 'i18next' class CosmeticsFactory @_cosmeticsById: {} @cosmeticForIdentifier: (identifier) -> cosmeticData = @_cosmeticsById[identifier] if cosmeticData return cosmeticData @cosmeticForSku: (sku) -> cosmeticId = parseInt(sku.slice(sku.lastIndexOf("-")+1)) return @cosmeticForIdentifier(cosmeticId) @_cachedCosmetics: null @getAllCosmetics: () -> return @_cachedCosmetics @_cachedCosmeticsForType: null @cosmeticsForType: (cosmeticType) -> return @_cachedCosmeticsForType[cosmeticType] @_cachedCosmeticsForTypeAndFaction: null @cosmeticsForTypeAndFaction: (cosmeticType, factionId) -> return @_cachedCosmeticsForTypeAndFaction[cosmeticType][factionId] @_cachedCosmeticsForTypeAndRarity: null @cosmeticsForTypeAndRarity: (cosmeticType, rarityId) -> return @_cachedCosmeticsForTypeAndRarity[cosmeticType][rarityId] @_cachedCosmeticsForTypeAndFactionAndRarity: null @cosmeticsForTypeAndFactionAndRarity: (cosmeticType, factionId, rarityId) -> return @_cachedCosmeticsForTypeAndFactionAndRarity[cosmeticType][factionId][rarityId] @_cachedCosmeticsForFaction: null @cosmeticsForFaction: (factionId) -> return @_cachedCosmeticsForFaction[factionId] @_cachedCosmeticsForRarity: null @cosmeticsForRarity: (rarityId) -> return @_cachedCosmeticsForRarity[rarityId] @_cachedCosmeticsForChestType: null @cosmeticsForChestType: (chestType) -> return @_cachedCosmeticsForChestType[chestType] @_cachedCosmeticSubTypesByType: null @visibleCosmeticSubTypesForType: (cosmeticType) -> orderedSubTypes = [] # To do any manual ordering add a subtype to the if/else below, anything not in list will be appended if cosmeticType == CosmeticsTypeLookup.Emote orderedSubTypes = ["Lyonar","Songhai","Vetruvian","Abyssian","Magmar","Vanar","Neutral"] else if cosmeticType == CosmeticsTypeLookup.CardBack orderedSubTypes = [] else if cosmeticType == CosmeticsTypeLookup.ProfileIcon orderedSubTypes = ["Lyonar","Songhai","Vetruvian","Abyssian","Magmar","Vanar","Neutral"] else if cosmeticType == CosmeticsTypeLookup.Scene orderedSubTypes = [] # To hide a subtype, _.without it here # Append any subtypes that are not in the above list allSubtypesForType = @_cachedCosmeticSubTypesByType[cosmeticType] subTypesNotInOrderedList = _.difference(allSubtypesForType,orderedSubTypes) # Combine ordered and any missing subtypes visibleSubTypes = orderedSubTypes.concat(subTypesNotInOrderedList) return visibleSubTypes @_cachedLocalizedSubTypeTitles: null @localizedSubTypeTitle: (subTypeId) -> if not @_cachedLocalizedSubTypeTitles? @_cachedLocalizedSubTypeTitles = {} @_cachedLocalizedSubTypeTitles["all"] = i18next.t("shop.all_subcategories_title") @_cachedLocalizedSubTypeTitles["Lyonar"] = i18next.t("factions.faction_1_abbreviated_name") @_cachedLocalizedSubTypeTitles["Songhai"] = i18next.t("factions.faction_2_abbreviated_name") @_cachedLocalizedSubTypeTitles["Vetruvian"] = i18next.t("factions.faction_3_abbreviated_name") @_cachedLocalizedSubTypeTitles["Abyssian"] = i18next.t("factions.faction_4_abbreviated_name") @_cachedLocalizedSubTypeTitles["Magmar"] = i18next.t("factions.faction_5_abbreviated_name") @_cachedLocalizedSubTypeTitles["Vanar"] = i18next.t("factions.faction_6_abbreviated_name") @_cachedLocalizedSubTypeTitles["Neutral"] = i18next.t("factions.faction_neutral_abbreviated_name") @_cachedLocalizedSubTypeTitles["Emotes"] = i18next.t("shop.category_emotes_name") if @_cachedLocalizedSubTypeTitles[subTypeId]? return @_cachedLocalizedSubTypeTitles[subTypeId] else # console.warn "No localized string for subtype: " + subTypeId return subTypeId @_cachedCosmeticsForTypeAndSubType: null @cosmeticsForTypeAndSubtype: (type,subType) -> return @_cachedCosmeticsForTypeAndSubType[type][subType] @profileIconForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.ProfileIcon return cosmeticData else # return default profile icon return @cosmeticForIdentifier(@getDefaultProfileIconIdentifier()) @isIdentifierForProfileIcon: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.ProfileIcon @getDefaultProfileIconIdentifier: () -> return CosmeticsLookup.ProfileIcon.Tree @cardBackForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardBack return cosmeticData else # return default card back return @cosmeticForIdentifier(@getDefaultCardBackIdentifier()) @isIdentifierForCardBack: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardBack @getDefaultCardBackIdentifier: () -> return CosmeticsLookup.CardBack.Normal @sceneForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.Scene return cosmeticData else # return default card back return @cosmeticForIdentifier(@getDefaultSceneIdentifier()) @isIdentifierForScene: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.Scene @getDefaultSceneIdentifier: () -> return CosmeticsLookup.Scene.Frostfire @_cachedCardSkinsForCardId: null @cardSkinsForCard: (cardId) -> return @_cachedCardSkinsForCardId[cardId] || [] @_cachedCardSkinIdsForCardId: null @cardSkinIdsForCard: (cardId) -> return @_cachedCardSkinIdsForCardId[cardId] || [] @isIdentifierForCardSkin: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardSkin @injectSkinPropertiesIntoCard: (card, identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardSkin # anim resource animResource = cosmeticData.animResource if animResource? then card.setBaseAnimResource(animResource) @cosmeticProductDataForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? return @_mapCosmeticDataToProductData(cosmeticData) @cosmeticProductDataForType: (cosmeticType,cosmeticSubType) -> cosmeticDatas = null if cosmeticType? and not cosmeticSubType? cosmeticDatas = CosmeticsFactory.cosmeticsForType(cosmeticType) else if cosmeticType? and cosmeticSubType? cosmeticDatas = CosmeticsFactory.cosmeticsForTypeAndSubtype(cosmeticType,cosmeticSubType) else console.warn "No cosmetic type provided to CosmeticsFactory.cosmeticModelsForType" return [] cosmeticDatas = _.filter cosmeticDatas, (c)-> return c.purchasable && c.rarityId return _.map(cosmeticDatas,(cosmeticData) => return @_mapCosmeticDataToProductData(cosmeticData) ) @_mapCosmeticDataToProductData: (cosmeticData)-> rarityData = RarityFactory.rarityForIdentifier(cosmeticData.rarityId) cosmeticRSX = cosmeticData.rsx || {} cosmeticCoverRSX = cosmeticData.coverRSX || RSX.challenge_gate_010 cosmeticAnimResource = cosmeticData.animResource || {} return { id: cosmeticData.id sku: cosmeticData.sku steam_id: cosmeticData.id name: cosmeticData.name price: rarityData.cosmeticHardPrice rarity_id: cosmeticData.rarityId || Rarity.Common anim_resource: cosmeticAnimResource icon_image_url: cosmeticData.img icon_image_resource_name: cosmeticRSX.name cover_image_url: cosmeticCoverRSX.img cover_image_resource_name: cosmeticCoverRSX.name description: cosmeticData.shopDescription category_name: CosmeticsTypeLookup[cosmeticData.typeId] # TODO: player visible name category_id: cosmeticData.typeId sub_category_name: cosmeticData.subTypeId type: "cosmetic" faction_id: if !cosmeticData.factionId? or cosmeticData.factionId == Factions.Neutral then 0 else cosmeticData.factionId general_id: cosmeticData.generalId || 0 } @cosmeticResourcesForIdentifier: (identifier) -> resources = [] cosmeticData = @.cosmeticForIdentifier(identifier) if cosmeticData? if cosmeticData.rsx? then resources.push(cosmeticData.rsx) if cosmeticData.coverRSX? then resources.push(cosmeticData.coverRSX) if cosmeticData.glowOutlineRSX? then resources.push(cosmeticData.glowOutlineRSX) if cosmeticData.animResource? for animResourceKey in Object.keys(cosmeticData.animResource) animResourceName = cosmeticData.animResource[animResourceKey] if _.isString(animResourceName) rsx = RSX[animResourceName] if rsx? then resources.push(rsx) return resources @cosmeticProductAttrsForIdentifier: (identifier)-> cosmeticData = @.cosmeticForIdentifier(identifier) if cosmeticData return @._mapCosmeticDataToProductData(cosmeticData) else return null @cosmeticProductAttrsForSKU: (sku)-> cosmeticData = @.cosmeticForSku(sku) if cosmeticData return @._mapCosmeticDataToProductData(cosmeticData) else return null @nameForCosmeticTypeId: (cosmeticTypeId)-> if cosmeticTypeId == CosmeticsTypeLookup.Emote return "Emote" else if cosmeticTypeId == CosmeticsTypeLookup.CardBack return "Card Back" else if cosmeticTypeId == CosmeticsTypeLookup.ProfileIcon return "Profile Icon" else if cosmeticTypeId == CosmeticsTypeLookup.CardSkin return "Card Skin" else if cosmeticTypeId == CosmeticsTypeLookup.Scene return "Scene" else if cosmeticTypeId == CosmeticsTypeLookup.BattleMap return "Battle Map" else return null @nameForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return i18next.t("rarity.rarity_common") else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return i18next.t("rarity.rarity_rare") else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return i18next.t("rarity.rarity_epic") else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return i18next.t("mystery_crates.boss_crate_adjective") else if cosmeticCrateType == CosmeticsChestTypeLookup.Frostfire return i18next.t("mystery_crates.frostfire_adjective") else if cosmeticCrateType == CosmeticsChestTypeLookup.FrostfirePremium return i18next.t("mystery_crates.frostfire_premium_adjective") else return i18next.t("mystery_crates.gift_crate_adjective") @keySKUForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return "Common_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return "Rare_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return "Epic_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return "Boss_Chest_Key" else console.warn "Invalid cosmetic chest type provided to CosmeticsFactory.keySKUForCosmeticChestType" return "Invalid_Chest_Key" @descriptionForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return [ i18next.t("cosmetics.common_mystery_crate_1"), i18next.t("cosmetics.common_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return [ i18next.t("cosmetics.rare_mystery_crate_1"), i18next.t("cosmetics.rare_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return [ i18next.t("cosmetics.epic_mystery_crate_1"), i18next.t("cosmetics.epic_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return [ i18next.t("cosmetics.boss_crate_1"), i18next.t("cosmetics.boss_crate_2"), i18next.t("cosmetics.boss_crate_3"), i18next.t("cosmetics.boss_crate_4") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Frostfire return i18next.t("cosmetics.frostfire_crate") else if cosmeticCrateType == CosmeticsChestTypeLookup.FrostfirePremium return i18next.t("cosmetics.frostfire_premium_crate") else return i18next.t("cosmetics.generic_mystery_crate") # setup emote data cos = CosmeticsFactory._cosmeticsById ### EXAMPLE: cos[CosmeticsLookup.CardBacks.Shiny] = { id: CosmeticsLookup.CardBacks.Shiny # id of cosmetic that maps to cosmetics lookup enabled: true # whether cosmetic is enabled globally alwaysVisible: true # whether cosmetic is always visible to the user, whether they own it or not availableAt: moment.utc("2016-12-25").valueOf() # Optional factionId: Factions.Faction1 # if this cosmetic is limited to a faction # Optional generalId: Cards.Faction1.AltGeneral img: RSX.emote_basic_happy.img # img to use for showing emote label: "Hello" # text to use for text only emotes order: 0 # sorting order of cosmetic (shows in ascending order, i.e. all 0s, then all 1s) typeId: CosmeticsTypeLookup.CardBack # category of cosmetic subType: "Shiny" # Any string identifier, shown as the sub category in shop sku: "emote-200" # This is autogenerated, ctrl f: "Generate skus procedurally" chestType: CosmeticsChestTypeLookup.Common # TODO: is chest it unlocks in == rarity? rarityId: Rarity.Common rewardOrder: 0 # Rewards of a lower number (within a rarity) are always rewarded first from loot crates, defaults to 0 } ### # region COSMETICS ORDERING ORDER_EMOTES = 0 ORDER_CARD_BACKS = 1 ORDER_PROFILE_ICONS = 0 ORDER_MAIN_MENU_PLATES = 1 ORDER_CARD_SKINS = 2 ORDER_SCENES = 0 # endregion COSMETICS ORDERING # region EMOTE ORDERING EMOTE_ORDER_HAPPY = 0 EMOTE_ORDER_ANGRY = 1 EMOTE_ORDER_CONFUSED = 2 EMOTE_ORDER_SAD = 3 EMOTE_ORDER_TAUNT = 4 # wink EMOTE_ORDER_KISS = 5 # love EMOTE_ORDER_FRUSTRATED = 6 EMOTE_ORDER_SURPRISED = 7 EMOTE_ORDER_BOW = 8 EMOTE_ORDER_SLEEP = 9 EMOTE_ORDER_SUNGLASSES = 10 EMOTE_ORDER_CUSTOM = 11 # endregion EMOTE ORDERING # region Cosmetics datas # Shorthand the cosmetics lookups cl = CosmeticsLookup CardBack = cl.CardBack Emote = cl.Emote ProfileIcon = cl.ProfileIcon CardSkin = cl.CardSkin Scene = cl.Scene BattleMap = cl.BattleMap # region Scenes cos[Scene.MagaariEmberHighlands] = { id: Scene.MagaariEmberHighlands typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_magaari_name") shopDescription: i18next.t("cosmetics.scene_magaari_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "MagaariEmberHighlands" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.ObsidianWoods] = { id: Scene.ObsidianWoods typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_obsidian_woods_name") shopDescription: i18next.t("cosmetics.scene_obsidian_woods_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "ObsidianWoods" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Frostfire] = { id: Scene.Frostfire typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_frostfire_festival_name") shopDescription: i18next.t("cosmetics.scene_frostfire_festival_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "FrostfireMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Vetruvian] = { id: Scene.Vetruvian typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_city_of_kaero_name") shopDescription: i18next.t("cosmetics.scene_city_of_kaero_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "VetruvianMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Shimzar] = { id: Scene.Shimzar typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_unearthed_prophecy_name") shopDescription: i18next.t("cosmetics.scene_unearthed_prophecy_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "ShimzarMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } # endregion Scenes # region Card Skins cos[CardSkin.Faction1GeneralTier2] = { id: CardSkin.Faction1GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_argeon_m2_name") shopDescription: i18next.t("cosmetics.skin_argeon_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1GeneralTier2GIF.img rsx: RSX.f1GeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.General skinNum: 1 animResource: { breathing: RSX.f1GeneralTier2Breathing.name idle: RSX.f1GeneralTier2Idle.name walk: RSX.f1GeneralTier2Run.name attack: RSX.f1GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1GeneralTier2Damage.name death: RSX.f1GeneralTier2Death.name castStart: RSX.f1GeneralTier2CastStart.name castEnd: RSX.f1GeneralTier2CastEnd.name castLoop: RSX.f1GeneralTier2CastLoop.name cast: RSX.f1GeneralTier2Cast.name } } cos[CardSkin.Faction1GeneralRogueLegacy] = { id: CardSkin.Faction1GeneralRogueLegacy typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_rogue_legacy_name") shopDescription: i18next.t("cosmetics.skin_rogue_legacy_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS img: RSX.f1GeneralRogueLegacyGIF.img rsx: RSX.f1GeneralRogueLegacyGIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction1.General skinNum: 2 animResource: { breathing: RSX.f1GeneralRogueLegacyBreathing.name idle: RSX.f1GeneralRogueLegacyIdle.name walk: RSX.f1GeneralRogueLegacyRun.name attack: RSX.f1GeneralRogueLegacyAttack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1GeneralRogueLegacyDamage.name death: RSX.f1GeneralRogueLegacyDeath.name castStart: RSX.f1GeneralRogueLegacyCastStart.name castEnd: RSX.f1GeneralRogueLegacyCastEnd.name castLoop: RSX.f1GeneralRogueLegacyCastLoop.name cast: RSX.f1GeneralRogueLegacyCast.name } } cos[CardSkin.Faction1AltGeneralTier2] = { id: CardSkin.Faction1AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ziran_m2_name") shopDescription: i18next.t("cosmetics.skin_ziran_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1AltGeneralTier2GIF.img rsx: RSX.f1AltGeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.AltGeneral skinNum: 1 animResource: { breathing : RSX.f1AltGeneralTier2Breathing.name idle : RSX.f1AltGeneralTier2Idle.name walk : RSX.f1AltGeneralTier2Run.name attack : RSX.f1AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.5 damage : RSX.f1AltGeneralTier2Hit.name death : RSX.f1AltGeneralTier2Death.name castStart : RSX.f1AltGeneralTier2CastStart.name castEnd : RSX.f1AltGeneralTier2CastEnd.name castLoop : RSX.f1AltGeneralTier2CastLoop.name cast : RSX.f1AltGeneralTier2Cast.name } } cos[CardSkin.Faction1IVGeneralTier2] = { id: CardSkin.Faction1IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_brome_m2_name") shopDescription: i18next.t("cosmetics.skin_brome_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1IVGeneralTier2GIF.img rsx: RSX.f1IVGeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.ThirdGeneral skinNum: 1 animResource: { breathing: RSX.f1IVGeneralTier2Breathing.name idle: RSX.f1IVGeneralTier2Idle.name walk: RSX.f1IVGeneralTier2Run.name attack: RSX.f1IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1IVGeneralTier2Damage.name death: RSX.f1IVGeneralTier2Death.name castStart: RSX.f1IVGeneralTier2CastStart.name castEnd: RSX.f1IVGeneralTier2CastEnd.name castLoop: RSX.f1IVGeneralTier2CastLoop.name cast: RSX.f1IVGeneralTier2Cast.name } } cos[CardSkin.Faction2GeneralTier2] = { id: CardSkin.Faction2GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_kaleos_m2_name") shopDescription: i18next.t("cosmetics.skin_kaleos_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2GeneralTier2GIF.img rsx: RSX.f2GeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.General skinNum: 1 animResource: { breathing : RSX.f2GeneralTier2Breathing.name idle : RSX.f2GeneralTier2Idle.name walk : RSX.f2GeneralTier2Run.name attack : RSX.f2GeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2GeneralTier2Damage.name death : RSX.f2GeneralTier2Death.name castStart : RSX.f2GeneralTier2CastStart.name castEnd : RSX.f2GeneralTier2CastEnd.name castLoop : RSX.f2GeneralTier2CastLoop.name cast : RSX.f2GeneralTier2Cast.name } } cos[CardSkin.Faction2GeneralDogehai] = { id: CardSkin.Faction2GeneralDogehai typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_dogehai_name") shopDescription: i18next.t("cosmetics.skin_dogehai_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS img: RSX.f2GeneralDogehaiGIF.img rsx: RSX.f2GeneralDogehaiGIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction2.General skinNum: 2 animResource: { breathing : RSX.f2GeneralDogehaiBreathing.name idle : RSX.f2GeneralDogehaiIdle.name walk : RSX.f2GeneralDogehaiRun.name attack : RSX.f2GeneralDogehaiAttack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2GeneralDogehaiDamage.name death : RSX.f2GeneralDogehaiDeath.name castStart : RSX.f2GeneralDogehaiCastStart.name castEnd : RSX.f2GeneralDogehaiCastEnd.name castLoop : RSX.f2GeneralDogehaiCastLoop.name cast : RSX.f2GeneralDogehaiCast.name } } cos[CardSkin.Faction2AltGeneralTier2] = { id: CardSkin.Faction2AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_reva_m2_name") shopDescription: i18next.t("cosmetics.skin_reva_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2AltGeneralTier2GIF.img rsx: RSX.f2AltGeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.AltGeneral skinNum: 1 animResource: { breathing : RSX.f2AltGeneralTier2Breathing.name idle : RSX.f2AltGeneralTier2Idle.name walk : RSX.f2AltGeneralTier2Run.name attack : RSX.f2AltGeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 1.0 damage : RSX.f2AltGeneralTier2Hit.name death : RSX.f2AltGeneralTier2Death.name castStart : RSX.f2AltGeneralTier2CastStart.name castEnd : RSX.f2AltGeneralTier2CastEnd.name castLoop : RSX.f2AltGeneralTier2CastLoop.name cast : RSX.f2AltGeneralTier2Cast.name } } cos[CardSkin.Faction2IVGeneralTier2] = { id: CardSkin.Faction2IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_shidai_m2_name") shopDescription: i18next.t("cosmetics.skin_shidai_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2IVGeneralTier2GIF.img rsx: RSX.f2IVGeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f2IVGeneralTier2Breathing.name idle : RSX.f2IVGeneralTier2Idle.name walk : RSX.f2IVGeneralTier2Run.name attack : RSX.f2IVGeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2IVGeneralTier2Damage.name death : RSX.f2IVGeneralTier2Death.name castStart : RSX.f2IVGeneralTier2CastStart.name castEnd : RSX.f2IVGeneralTier2CastEnd.name castLoop : RSX.f2IVGeneralTier2CastLoop.name cast : RSX.f2IVGeneralTier2Cast.name } } cos[CardSkin.Faction3GeneralTier2] = { id: CardSkin.Faction3GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zirix_m2_name") shopDescription: i18next.t("cosmetics.skin_zirix_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3GeneralTier2GIF.img rsx: RSX.f3GeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.General skinNum: 1 animResource: { breathing : RSX.f3GeneralTier2Breathing.name idle : RSX.f3GeneralTier2Idle.name walk : RSX.f3GeneralTier2Run.name attack : RSX.f3GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3GeneralTier2Damage.name death : RSX.f3GeneralTier2Death.name castStart : RSX.f3GeneralTier2CastStart.name castEnd : RSX.f3GeneralTier2CastEnd.name castLoop : RSX.f3GeneralTier2CastLoop.name cast : RSX.f3GeneralTier2Cast.name } } cos[CardSkin.Faction3GeneralFestive] = { id: CardSkin.Faction3GeneralFestive typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zirix_festive_name") shopDescription: i18next.t("cosmetics.skin_zirix_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f3GeneralFestiveGIF.img rsx: RSX.f3GeneralFestiveGIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction3.General skinNum: 2 animResource: { breathing : RSX.f3GeneralFestiveBreathing.name idle : RSX.f3GeneralFestiveIdle.name walk : RSX.f3GeneralFestiveRun.name attack : RSX.f3GeneralFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3GeneralFestiveDamage.name death : RSX.f3GeneralFestiveDeath.name castStart : RSX.f3GeneralFestiveCastStart.name castEnd : RSX.f3GeneralFestiveCastEnd.name castLoop : RSX.f3GeneralFestiveCastLoop.name cast : RSX.f3GeneralFestiveCast.name } } cos[CardSkin.Faction3AltGeneralTier2] = { id: CardSkin.Faction3AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_sajj_m2_name") shopDescription: i18next.t("cosmetics.skin_sajj_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3AltGeneralTier2GIF.img rsx: RSX.f3AltGeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.AltGeneral skinNum: 1 animResource: { breathing : RSX.f3AltGeneralTier2Breathing.name idle : RSX.f3AltGeneralTier2Idle.name walk : RSX.f3AltGeneralTier2Run.name attack : RSX.f3AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.f3AltGeneralTier2Hit.name death : RSX.f3AltGeneralTier2Death.name castStart : RSX.f3AltGeneralTier2CastStart.name castEnd : RSX.f3AltGeneralTier2CastEnd.name castLoop : RSX.f3AltGeneralTier2CastLoop.name cast : RSX.f3AltGeneralTier2Cast.name } } cos[CardSkin.Faction3IVGeneralTier2] = { id: CardSkin.Faction3IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ciphyron_m2_name") shopDescription: i18next.t("cosmetics.skin_ciphyron_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3IVGeneralTier2GIF.img rsx: RSX.f3IVGeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f3IVGeneralTier2Breathing.name idle : RSX.f3IVGeneralTier2Idle.name walk : RSX.f3IVGeneralTier2Run.name attack : RSX.f3IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3IVGeneralTier2Damage.name death : RSX.f3IVGeneralTier2Death.name castStart : RSX.f3IVGeneralTier2CastStart.name castEnd : RSX.f3IVGeneralTier2CastEnd.name castLoop : RSX.f3IVGeneralTier2CastLoop.name cast : RSX.f3IVGeneralTier2Cast.name } } cos[CardSkin.Faction4GeneralTier2] = { id: CardSkin.Faction4GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_lilithe_m2_name") shopDescription: i18next.t("cosmetics.skin_lilithe_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4GeneralTier2GIF.img rsx: RSX.f4GeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.General skinNum: 1 animResource: { breathing : RSX.f4GeneralTier2Breathing.name idle : RSX.f4GeneralTier2Idle.name walk : RSX.f4GeneralTier2Run.name attack : RSX.f4GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage : RSX.f4GeneralTier2Damage.name death : RSX.f4GeneralTier2Death.name castStart : RSX.f4GeneralTier2CastStart.name castEnd : RSX.f4GeneralTier2CastEnd.name castLoop : RSX.f4GeneralTier2CastLoop.name cast : RSX.f4GeneralTier2Cast.name } } cos[CardSkin.Faction4AltGeneralTier2] = { id: CardSkin.Faction4AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_cassyva_m2_name") shopDescription: i18next.t("cosmetics.skin_cassyva_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4AltGeneralTier2GIF.img rsx: RSX.f4AltGeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.AltGeneral skinNum: 1 animResource: { breathing : RSX.f4AltGeneralTier2Breathing.name idle : RSX.f4AltGeneralTier2Idle.name walk : RSX.f4AltGeneralTier2Run.name attack : RSX.f4AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.5 damage : RSX.f4AltGeneralTier2Hit.name death : RSX.f4AltGeneralTier2Death.name castStart : RSX.f4AltGeneralTier2CastStart.name castEnd : RSX.f4AltGeneralTier2CastEnd.name castLoop : RSX.f4AltGeneralTier2CastLoop.name cast : RSX.f4AltGeneralTier2Cast.name } } cos[CardSkin.Faction4IVGeneralTier2] = { id: CardSkin.Faction4IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_maehv_m2_name") shopDescription: i18next.t("cosmetics.skin_maehv_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4IVGeneralTier2GIF.img rsx: RSX.f4IVGeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f4IVGeneralTier2Breathing.name idle : RSX.f4IVGeneralTier2Idle.name walk : RSX.f4IVGeneralTier2Run.name attack : RSX.f4IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage : RSX.f4IVGeneralTier2Damage.name death : RSX.f4IVGeneralTier2Death.name castStart : RSX.f4IVGeneralTier2CastStart.name castEnd : RSX.f4IVGeneralTier2CastEnd.name castLoop : RSX.f4IVGeneralTier2CastLoop.name cast : RSX.f4IVGeneralTier2Cast.name } } cos[CardSkin.Faction5GeneralTier2] = { id: CardSkin.Faction5GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_vaath_m2_name") shopDescription: i18next.t("cosmetics.skin_vaath_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5GeneralTier2GIF.img rsx: RSX.f5GeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.General skinNum: 1 animResource: { breathing : RSX.f5GeneralTier2Breathing.name idle : RSX.f5GeneralTier2Idle.name walk : RSX.f5GeneralTier2Run.name attack : RSX.f5GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f5GeneralTier2Damage.name death : RSX.f5GeneralTier2Death.name castStart : RSX.f5GeneralTier2CastStart.name castEnd : RSX.f5GeneralTier2CastEnd.name castLoop : RSX.f5GeneralTier2CastLoop.name cast : RSX.f5GeneralTier2Cast.name } } cos[CardSkin.Faction5AltGeneralTier2] = { id: CardSkin.Faction5AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_starhorn_m2_name") shopDescription: i18next.t("cosmetics.skin_starhorn_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5AltGeneralTier2GIF.img rsx: RSX.f5AltGeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.AltGeneral skinNum: 1 animResource: { breathing : RSX.f5AltGeneralTier2Breathing.name idle : RSX.f5AltGeneralTier2Idle.name walk : RSX.f5AltGeneralTier2Run.name attack : RSX.f5AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.f5AltGeneralTier2Hit.name death : RSX.f5AltGeneralTier2Death.name castStart : RSX.f5AltGeneralTier2CastStart.name castEnd : RSX.f5AltGeneralTier2CastEnd.name castLoop : RSX.f5AltGeneralTier2CastLoop.name cast : RSX.f5AltGeneralTier2Cast.name } } cos[CardSkin.Faction5IVGeneralTier2] = { id: CardSkin.Faction5IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ragnora_m2_name") shopDescription: i18next.t("cosmetics.skin_ragnora_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5IVGeneralTier2GIF.img rsx: RSX.f5IVGeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f5IVGeneralTier2Breathing.name idle : RSX.f5IVGeneralTier2Idle.name walk : RSX.f5IVGeneralTier2Run.name attack : RSX.f5IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f5IVGeneralTier2Damage.name death : RSX.f5IVGeneralTier2Death.name castStart : RSX.f5IVGeneralTier2CastStart.name castEnd : RSX.f5IVGeneralTier2CastEnd.name castLoop : RSX.f5IVGeneralTier2CastLoop.name cast : RSX.f5IVGeneralTier2Cast.name } } cos[CardSkin.Faction6GeneralTier2] = { id: CardSkin.Faction6GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_faie_m2_name") shopDescription: i18next.t("cosmetics.skin_faie_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6GeneralTier2GIF.img rsx: RSX.f6GeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.General skinNum: 1 animResource: { breathing : RSX.f6GeneralTier2Breathing.name idle : RSX.f6GeneralTier2Idle.name walk : RSX.f6GeneralTier2Run.name attack : RSX.f6GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6GeneralTier2Damage.name death : RSX.f6GeneralTier2Death.name castStart : RSX.f6GeneralTier2CastStart.name castEnd : RSX.f6GeneralTier2CastEnd.name castLoop : RSX.f6GeneralTier2CastLoop.name cast : RSX.f6GeneralTier2Cast.name } } cos[CardSkin.Faction6GeneralFestive] = { id: CardSkin.Faction6GeneralFestive typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_faie_festive_name") shopDescription: i18next.t("cosmetics.skin_faie_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f6GeneralFestiveGIF.img rsx: RSX.f6GeneralFestiveGIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction6.General skinNum: 2 animResource: { breathing : RSX.f6GeneralFestiveBreathing.name idle : RSX.f6GeneralFestiveIdle.name walk : RSX.f6GeneralFestiveRun.name attack : RSX.f6GeneralFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6GeneralFestiveDamage.name death : RSX.f6GeneralFestiveDeath.name castStart : RSX.f6GeneralFestiveCastStart.name castEnd : RSX.f6GeneralFestiveCastEnd.name castLoop : RSX.f6GeneralFestiveCastLoop.name cast : RSX.f6GeneralFestiveCast.name } } cos[CardSkin.Faction6AltGeneralTier2] = { id: CardSkin.Faction6AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_kara_m2_name") shopDescription: i18next.t("cosmetics.skin_kara_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6AltGeneralTier2GIF.img rsx: RSX.f6AltGeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.AltGeneral skinNum: 1 animResource: { breathing : RSX.f6AltGeneralTier2Breathing.name idle : RSX.f6AltGeneralTier2Idle.name walk : RSX.f6AltGeneralTier2Run.name attack : RSX.f6AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.2 damage : RSX.f6AltGeneralTier2Hit.name death : RSX.f6AltGeneralTier2Death.name castStart : RSX.f6AltGeneralTier2CastStart.name castEnd : RSX.f6AltGeneralTier2CastEnd.name castLoop : RSX.f6AltGeneralTier2CastLoop.name cast : RSX.f6AltGeneralTier2Cast.name } } cos[CardSkin.Faction6IVGeneralTier2] = { id: CardSkin.Faction6IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ilena_m2_name") shopDescription: i18next.t("cosmetics.skin_ilena_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6IVGeneralTier2GIF.img rsx: RSX.f6IVGeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f6IVGeneralTier2Breathing.name idle : RSX.f6IVGeneralTier2Idle.name walk : RSX.f6IVGeneralTier2Run.name attack : RSX.f6IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6IVGeneralTier2Damage.name death : RSX.f6IVGeneralTier2Death.name castStart : RSX.f6IVGeneralTier2CastStart.name castEnd : RSX.f6IVGeneralTier2CastEnd.name castLoop : RSX.f6IVGeneralTier2CastLoop.name cast : RSX.f6IVGeneralTier2Cast.name } } cos[CardSkin.SarlacPrime] = { id: CardSkin.SarlacPrime typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_sarlac_prime_name") shopDescription: i18next.t("cosmetics.skin_sarlac_prime_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.SarlacTheEternal skinNum: 1 animResource: { breathing : RSX.neutralSarlacPrimeBreathing.name idle : RSX.neutralSarlacPrimeIdle.name walk : RSX.neutralSarlacPrimeRun.name attack : RSX.neutralSarlacPrimeAttack.name attackReleaseDelay: 0.0 attackDelay: .25 damage : RSX.neutralSarlacPrimeHit.name death : RSX.neutralSarlacPrimeDeath.name } } cos[CardSkin.KeeperOfTheValue] = { id: CardSkin.KeeperOfTheValue typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_keeper_name") shopDescription: i18next.t("cosmetics.skin_keeper_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.KeeperOfTheVale skinNum: 1 animResource: { breathing : RSX.neutralKeeperOfTheValueBreathing.name idle : RSX.neutralKeeperOfTheValueIdle.name walk : RSX.neutralKeeperOfTheValueRun.name attack : RSX.neutralKeeperOfTheValueAttack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.neutralKeeperOfTheValueHit.name death : RSX.neutralKeeperOfTheValueDeath.name } } cos[CardSkin.Darkjammer] = { id: CardSkin.Darkjammer typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_darkjammer_name") shopDescription: i18next.t("cosmetics.skin_darkjammer_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.Spelljammer skinNum: 1 animResource: { breathing : RSX.neutralDarkjammerBreathing.name idle : RSX.neutralDarkjammerIdle.name walk : RSX.neutralDarkjammerRun.name attack : RSX.neutralDarkjammerAttack.name attackReleaseDelay: 0.0 attackDelay: .9 damage : RSX.neutralDarkjammerHit.name death : RSX.neutralDarkjammerDeath.name } } cos[CardSkin.FrostfireTiger] = { id: CardSkin.FrostfireTiger typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_frostfire_tiger_name") shopDescription: i18next.t("cosmetics.skin_frostfire_tiger_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.neutralFrostfireTigerGIF.img rsx: RSX.neutralFrostfireTigerGIF factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Neutral.SaberspineTiger skinNum: 1 animResource: { breathing : RSX.neutralFrostfireTigerBreathing.name idle : RSX.neutralFrostfireTigerIdle.name walk : RSX.neutralFrostfireTigerRun.name attack : RSX.neutralFrostfireTigerAttack.name attackReleaseDelay: 0.0 attackDelay: .4 damage : RSX.neutralFrostfireTigerHit.name death : RSX.neutralFrostfireTigerDeath.name } } cos[CardSkin.FestiveSnowchaser] = { id: CardSkin.FestiveSnowchaser typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_festive_snowchaser_name") shopDescription: i18next.t("cosmetics.skin_festive_snowchaser_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f6FestiveSnowchaserGIF.img rsx: RSX.f6FestiveSnowchaserGIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction6.WyrBeast skinNum: 1 animResource: { breathing : RSX.f6FestiveSnowchaserBreathing.name idle : RSX.f6FestiveSnowchaserIdle.name walk : RSX.f6FestiveSnowchaserRun.name attack : RSX.f6FestiveSnowchaserAttack.name attackReleaseDelay: 0.0 attackDelay: .3 damage : RSX.f6FestiveSnowchaserDamage.name death : RSX.f6FestiveSnowchaserDeath.name } } cos[CardSkin.ElyxMK2] = { id: CardSkin.ElyxMK2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Elyx Stormblade MK2" shopDescription: "Elyx Stormblade MK2" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction1.ElyxStormblade skinNum: 1 animResource: { breathing : RSX.f1ElyxStormbladeMK2Breathing.name idle : RSX.f1ElyxStormbladeMK2Idle.name walk : RSX.f1ElyxStormbladeMK2Run.name attack : RSX.f1ElyxStormbladeMK2Attack.name attackReleaseDelay: 0.0 attackDelay: .3 damage : RSX.f1ElyxStormbladeMK2Hit.name death : RSX.f1ElyxStormbladeMK2Death.name } } cos[CardSkin.HealingMysticBN] = { id: CardSkin.HealingMysticBN typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>aling Mystic Bandai <NAME>" shopDescription: "Healing Mystic Bandai Namco" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.HealingMystic skinNum: 1 animResource: { breathing : RSX.neutralHealingMysticBNBreathing.name idle : RSX.neutralHealingMysticBNIdle.name walk : RSX.neutralHealingMysticBNRun.name attack : RSX.neutralHealingMysticBNAttack.name attackReleaseDelay: 0.0 attackDelay: 0.9 damage : RSX.neutralHealingMysticBNHit.name death : RSX.neutralHealingMysticBNDeath.name } } cos[CardSkin.HealingMysticTwitch] = { id: CardSkin.HealingMysticTwitch typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Healing Mystic Twitch" shopDescription: "Healing Mystic Twitch" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.HealingMystic skinNum: 2 animResource: { breathing : RSX.neutralhealingMysticTwitchBreathing.name idle : RSX.neutralhealingMysticTwitchIdle.name walk : RSX.neutralhealingMysticTwitchRun.name attack : RSX.neutralhealingMysticTwitchAttack.name attackReleaseDelay: 0.0 attackDelay: 0.9 damage : RSX.neutralhealingMysticTwitchHit.name death : RSX.neutralhealingMysticTwitchDeath.name } } cos[CardSkin.FestiveZyx] = { id: CardSkin.FestiveZyx typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zyx_festive_name") shopDescription: i18next.t("cosmetics.skin_zyx_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.neutralZyxFestiveGIF.img rsx: RSX.neutralZyxFestiveGIF factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Neutral.Zyx skinNum: 1 animResource: { breathing : RSX.neutralZyxFestiveBreathing.name idle : RSX.neutralZyxFestiveIdle.name walk : RSX.neutralZyxFestiveRun.name attack : RSX.neutralZyxFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: .4 damage : RSX.neutralZyxFestiveHit.name death : RSX.neutralZyxFestiveDeath.name } } cos[CardSkin.MirkbloodDevourerBoss] = { id: CardSkin.MirkbloodDevourerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Umbra boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mirkbloodDevourerBossGIF.img rsx: RSX.mirkbloodDevourerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.MirkbloodDevourer skinNum: 1 animResource: { breathing : RSX.bossUmbraBreathing.name idle : RSX.bossUmbraIdle.name walk : RSX.bossUmbraRun.name attack : RSX.bossUmbraAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossUmbraHit.name death : RSX.bossUmbraDeath.name } } cos[CardSkin.DreadnoughtBoss] = { id: CardSkin.DreadnoughtBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Boreal Juggernaut boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.dreadnoughtBossGIF.img rsx: RSX.dreadnoughtBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Dreadnaught skinNum: 1 animResource: { breathing : RSX.bossBorealJuggernautBreathing.name idle : RSX.bossBorealJuggernautIdle.name walk : RSX.bossBorealJuggernautRun.name attack : RSX.bossBorealJuggernautAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossBorealJuggernautHit.name death : RSX.bossBorealJuggernautDeath.name } } cos[CardSkin.IroncladBoss] = { id: CardSkin.IroncladBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Ironclad" shopDescription: "This skin was used in the Cade the Desolator boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.ironcladBossGIF.img rsx: RSX.ironcladBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Ironclad skinNum: 1 animResource: { breathing : RSX.bossChaosKnightBreathing.name idle : RSX.bossChaosKnightIdle.name walk : RSX.bossChaosKnightRun.name attack : RSX.bossChaosKnightAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossChaosKnightHit.name death : RSX.bossChaosKnightDeath.name } } cos[CardSkin.ZendoBoss] = { id: CardSkin.ZendoBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Shinkage Zendo boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.zendoBossGIF.img rsx: RSX.zendoBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.GrandmasterZendo skinNum: 1 animResource: { breathing : RSX.bossShinkageZendoBreathing.name idle : RSX.bossShinkageZendoIdle.name walk : RSX.bossShinkageZendoRun.name attack : RSX.bossShinkageZendoAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossShinkageZendoHit.name death : RSX.bossShinkageZendoDeath.name } } cos[CardSkin.Z0rBoss] = { id: CardSkin.Z0rBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.z0rBossGIF.img rsx: RSX.z0rBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Z0r skinNum: 1 animResource: { breathing : RSX.bossDecepticleBreathing.name idle : RSX.bossDecepticleIdle.name walk : RSX.bossDecepticleRun.name attack : RSX.bossDecepticleAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleHit.name death : RSX.bossDecepticleDeath.name } } cos[CardSkin.Mechaz0rChassisBoss] = { id: CardSkin.Mechaz0rChassisBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Chassis of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rChassisBossGIF.img rsx: RSX.mechaz0rChassisBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rChassis skinNum: 1 animResource: { breathing : RSX.bossDecepticleChassisBreathing.name idle : RSX.bossDecepticleChassisIdle.name walk : RSX.bossDecepticleChassisRun.name attack : RSX.bossDecepticleChassisAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleChassisHit.name death : RSX.bossDecepticleChassisDeath.name } } cos[CardSkin.Mechaz0rHelmBoss] = { id: CardSkin.Mechaz0rHelmBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Helm of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rHelmBossGIF.img rsx: RSX.mechaz0rHelmBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rHelm skinNum: 1 animResource: { breathing : RSX.bossDecepticleHelmBreathing.name idle : RSX.bossDecepticleHelmIdle.name walk : RSX.bossDecepticleHelmRun.name attack : RSX.bossDecepticleHelmAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleHelmHit.name death : RSX.bossDecepticleHelmDeath.name } } cos[CardSkin.AlterRexxBoss] = { id: CardSkin.AlterRexxBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.alterRexxBossGIF.img rsx: RSX.alterRexxBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.AlterRexx skinNum: 1 animResource: { breathing : RSX.bossDecepticlePrimeBreathing.name idle : RSX.bossDecepticlePrimeIdle.name walk : RSX.bossDecepticlePrimeRun.name attack : RSX.bossDecepticlePrimeAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticlePrimeHit.name death : RSX.bossDecepticlePrimeDeath.name } } cos[CardSkin.Mechaz0rSwordBoss] = { id: CardSkin.Mechaz0rSwordBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rSwordBossGIF.img rsx: RSX.mechaz0rSwordBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rSword skinNum: 1 animResource: { breathing : RSX.bossDecepticleSwordBreathing.name idle : RSX.bossDecepticleSwordIdle.name walk : RSX.bossDecepticleSwordRun.name attack : RSX.bossDecepticleSwordAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleSwordHit.name death : RSX.bossDecepticleSwordDeath.name } } cos[CardSkin.Mechaz0rWingsBoss] = { id: CardSkin.Mechaz0rWingsBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rWingsBossGIF.img rsx: RSX.mechaz0rWingsBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rWings skinNum: 1 animResource: { breathing : RSX.bossDecepticleWingsBreathing.name idle : RSX.bossDecepticleWingsIdle.name walk : RSX.bossDecepticleWingsRun.name attack : RSX.bossDecepticleWingsAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleWingsHit.name death : RSX.bossDecepticleWingsDeath.name } } cos[CardSkin.ZukongBoss] = { id: CardSkin.ZukongBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Wu'jin the Trickster boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.zukongBossGIF.img rsx: RSX.zukongBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Zukong skinNum: 1 animResource: { breathing : RSX.bossWujinBreathing.name idle : RSX.bossWujinIdle.name walk : RSX.bossWujinRun.name attack : RSX.bossWujinAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWujinHit.name death : RSX.bossWujinDeath.name } } cos[CardSkin.WartalonBoss] = { id: CardSkin.WartalonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Solfist boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.wartalonBossGIF.img rsx: RSX.wartalonBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.WarTalon skinNum: 1 animResource: { breathing : RSX.bossSolfistBreathing.name idle : RSX.bossSolfistIdle.name walk : RSX.bossSolfistRun.name attack : RSX.bossSolfistAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSolfistHit.name death : RSX.bossSolfistDeath.name } } cos[CardSkin.EMPBoss] = { id: CardSkin.EMPBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Automaton 8 boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.empBossGIF.img rsx: RSX.empBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.EMP skinNum: 1 animResource: { breathing : RSX.bossEMPBreathing.name idle : RSX.bossEMPIdle.name walk : RSX.bossEMPRun.name attack : RSX.bossEMPAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossEMPHit.name death : RSX.bossEMPDeath.name } } cos[CardSkin.ArchonBoss] = { id: CardSkin.ArchonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Orias the Heretic boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.archonBossGIF.img rsx: RSX.archonBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.ArchonSpellbinder skinNum: 1 animResource: { breathing : RSX.bossOriasBreathing.name idle : RSX.bossOriasIdle.name walk : RSX.bossOriasRun.name attack : RSX.bossOriasAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossOriasHit.name death : RSX.bossOriasDeath.name } } cos[CardSkin.BastionBoss] = { id: CardSkin.BastionBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Orias the Heretic boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.bastionBossGIF.img rsx: RSX.bastionBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Bastion skinNum: 1 animResource: { breathing : RSX.bossOriasIdolBreathing.name idle : RSX.bossOriasIdolIdle.name walk : RSX.bossOriasIdolRun.name attack : RSX.bossOriasIdolAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossOriasIdolHit.name death : RSX.bossOriasIdolDeath.name } } cos[CardSkin.HighHandBoss] = { id: CardSkin.HighHandBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "The High Hand" shopDescription: "This skin was used in the Malyk boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.highHandBossGIF.img rsx: RSX.highHandBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.TheHighHand skinNum: 1 animResource: { breathing : RSX.bossMalykBreathing.name idle : RSX.bossMalykIdle.name walk : RSX.bossMalykRun.name attack : RSX.bossMalykAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossMalykHit.name death : RSX.bossMalykDeath.name } } cos[CardSkin.BlackSolusBoss] = { id: CardSkin.BlackSolusBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Black solus" shopDescription: "This skin was used in the Archonis boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.blackSolusBossGIF.img rsx: RSX.blackSolusBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.BlackSolus skinNum: 1 animResource: { breathing : RSX.bossManaManBreathing.name idle : RSX.bossManaManIdle.name walk : RSX.bossManaManRun.name attack : RSX.bossManaManAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossManaManDamage.name death : RSX.bossManaManDeath.name } } cos[CardSkin.CalculatorBoss] = { id: CardSkin.CalculatorBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Calculator" shopDescription: "This skin was used in the Paragon of Light boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.calculatorBossGIF.img rsx: RSX.calculatorBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Calculator skinNum: 1 animResource: { breathing : RSX.bossParagonBreathing.name idle : RSX.bossParagonIdle.name walk : RSX.bossParagonRun.name attack : RSX.bossParagonAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossParagonHit.name death : RSX.bossParagonDeath.name } } cos[CardSkin.ChakkramBoss] = { id: CardSkin.ChakkramBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Scion of the Void boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.chakkramBossGIF.img rsx: RSX.chakkramBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Chakkram skinNum: 1 animResource: { breathing : RSX.bossVampireBreathing.name idle : RSX.bossVampireIdle.name walk : RSX.bossVampireRun.name attack : RSX.bossVampireAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossVampireHit.name death : RSX.bossVampireDeath.name } } cos[CardSkin.KronBoss] = { id: CardSkin.KronBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the High Templar Kron boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.kronBossGIF.img rsx: RSX.kronBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.InquisitorKron skinNum: 1 animResource: { breathing : RSX.bossKronBreathing.name idle : RSX.bossKronIdle.name walk : RSX.bossKronRun.name attack : RSX.bossKronAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossKronHit.name death : RSX.bossKronDeath.name } } cos[CardSkin.MeltdownBoss] = { id: CardSkin.MeltdownBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Megapenti boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.meltdownBossGIF.img rsx: RSX.meltdownBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Meltdown skinNum: 1 animResource: { breathing : RSX.bossSerpentiBreathing.name idle : RSX.bossSerpentiIdle.name walk : RSX.bossSerpentiRun.name attack : RSX.bossSerpentiAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSerpentiHit.name death : RSX.bossSerpentiDeath.name } } cos[CardSkin.ArcaneDevourerBoss] = { id: CardSkin.ArcaneDevourerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Rin the Shadowsworn boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.arcaneDevourerBossGIF.img rsx: RSX.arcaneDevourerBossGIF factionId: Factions.Faction4 rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.ArcaneDevourer skinNum: 1 animResource: { breathing : RSX.bossWraithBreathing.name idle : RSX.bossWraithIdle.name walk : RSX.bossWraithRun.name attack : RSX.bossWraithAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWraithHit.name death : RSX.bossWraithDeath.name } } cos[CardSkin.TrinityWingBoss] = { id: CardSkin.TrinityWingBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Skfall Tyrant boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.trinityWingBossGIF.img rsx: RSX.trinityWingBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.TrinityWing skinNum: 1 animResource: { breathing : RSX.bossSkyfallTyrantBreathing.name idle : RSX.bossSkyfallTyrantIdle.name walk : RSX.bossSkyfallTyrantRun.name attack : RSX.bossSkyfallTyrantAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSkyfallTyrantHit.name death : RSX.bossSkyfallTyrantDeath.name } } cos[CardSkin.FuriosaBoss] = { id: CardSkin.FuriosaBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Cindera boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.furiosaBossGIF.img rsx: RSX.furiosaBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.Furosa skinNum: 1 animResource: { breathing : RSX.bossCinderaBreathing.name idle : RSX.bossCinderaIdle.name walk : RSX.bossCinderaRun.name attack : RSX.bossCinderaAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossCinderaHit.name death : RSX.bossCinderaDeath.name } } cos[CardSkin.ArclyteSentinelBoss] = { id: CardSkin.ArclyteSentinelBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Crystalline Champion boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.arclyteSentinelBossGIF.img rsx: RSX.arclyteSentinelBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.ArclyteSentinel skinNum: 1 animResource: { breathing : RSX.bossCrystalBreathing.name idle : RSX.bossCrystalIdle.name walk : RSX.bossCrystalRun.name attack : RSX.bossCrystalAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossCrystalDamage.name death : RSX.bossCrystalDeath.name } } cos[CardSkin.RancourBoss] = { id: CardSkin.RancourBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Xel boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.rancourBossGIF.img rsx: RSX.rancourBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Rancour skinNum: 1 animResource: { breathing : RSX.bossAntiswarmBreathing.name idle : RSX.bossAntiswarmIdle.name walk : RSX.bossAntiswarmRun.name attack : RSX.bossAntiswarmAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossAntiswarmHit.name death : RSX.bossAntiswarmDeath.name } } cos[CardSkin.SwornAvengerBoss] = { id: CardSkin.SwornAvengerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Skurge boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.swornAvengerBossGIF.img rsx: RSX.swornAvengerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.SwornAvenger skinNum: 1 animResource: { breathing : RSX.bossSkurgeBreathing.name idle : RSX.bossSkurgeIdle.name walk : RSX.bossSkurgeRun.name attack : RSX.bossSkurgeAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSkurgeHit.name death : RSX.bossSkurgeDeath.name } } cos[CardSkin.SwornDefenderBoss] = { id: CardSkin.SwornDefenderBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>orn Defender" shopDescription: "This skin was used in the Skurge boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.swornDefenderBossGIF.img rsx: RSX.swornDefenderBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.SwornDefender skinNum: 1 animResource: { breathing : RSX.bossValiantBreathing.name idle : RSX.bossValiantIdle.name walk : RSX.bossValiantRun.name attack : RSX.bossValiantAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossValiantHit.name death : RSX.bossValiantDeath.name } } cos[CardSkin.QuartermasterGaujBoss] = { id: CardSkin.QuartermasterGaujBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Shadow Lord boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.quartermasterGaujBossGIF.img rsx: RSX.quartermasterGaujBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.QuartermasterGauj skinNum: 1 animResource: { breathing : RSX.bossShadowLordBreathing.name idle : RSX.bossShadowLordIdle.name walk : RSX.bossShadowLordRun.name attack : RSX.bossShadowLordAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossShadowLordHit.name death : RSX.bossShadowLordDeath.name } } cos[CardSkin.AlabasterTitanBoss] = { id: CardSkin.AlabasterTitanBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Archmagus Vol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.alabasterTitanBossGIF.img rsx: RSX.alabasterTitanBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.AlabasterTitan skinNum: 1 animResource: { breathing : RSX.bossGolBreathing.name idle : RSX.bossGolIdle.name walk : RSX.bossGolRun.name attack : RSX.bossGolAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossGolHit.name death : RSX.bossGolDeath.name } } cos[CardSkin.RadiantDragoonBoss] = { id: CardSkin.RadiantDragoonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Archmagus Vol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.radiantDragoonBossGIF.img rsx: RSX.radiantDragoonBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.RadiantDragoon skinNum: 1 animResource: { breathing : RSX.bossKaneBreathing.name idle : RSX.bossKaneIdle.name walk : RSX.bossKaneRun.name attack : RSX.bossKaneAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossKaneHit.name death : RSX.bossKaneDeath.name } } cos[CardSkin.TethermancerBoss] = { id: CardSkin.TethermancerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Taskmaster Beatrix boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.tethermancerBossGIF.img rsx: RSX.tethermancerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Tethermancer skinNum: 1 animResource: { breathing : RSX.bossTaskmasterBreathing.name idle : RSX.bossTaskmasterIdle.name walk : RSX.bossTaskmasterRun.name attack : RSX.bossTaskmasterAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossTaskmasterHit.name death : RSX.bossTaskmasterDeath.name } } cos[CardSkin.DrogonBoss] = { id: CardSkin.DrogonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Drogon" shopDescription: "This skin was used in the Grym the Vengeful boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.drogonBossGIF.img rsx: RSX.drogonBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Drogon skinNum: 1 animResource: { breathing : RSX.bossGrymBreathing.name idle : RSX.bossGrymIdle.name walk : RSX.bossGrymRun.name attack : RSX.bossGrymAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossGrymHit.name death : RSX.bossGrymDeath.name } } cos[CardSkin.PantheranBoss] = { id: CardSkin.PantheranBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>theran" shopDescription: "This skin was used in the Nahlgol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.pantheranBossGIF.img rsx: RSX.pantheranBossGIF factionId: Factions.Vetruvian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction3.Pantheran skinNum: 1 animResource: { breathing : RSX.bossSandPantherBreathing.name idle : RSX.bossSandPantherIdle.name walk : RSX.bossSandPantherRun.name attack : RSX.bossSandPantherAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSandPantherDamage.name death : RSX.bossSandPantherDeath.name } } cos[CardSkin.LysianBrawlerBoss] = { id: CardSkin.LysianBrawlerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Wolfpunch boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.lysianBrawlerBossGIF.img rsx: RSX.lysianBrawlerBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.LysianBrawler skinNum: 1 animResource: { breathing : RSX.bossWolfpunchBreathing.name idle : RSX.bossWolfpunchIdle.name walk : RSX.bossWolfpunchRun.name attack : RSX.bossWolfpunchAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWolfpunchDamage.name death : RSX.bossWolfpunchDeath.name } } cos[CardSkin.DeathKnellBoss] = { id: CardSkin.DeathKnellBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME> Knell" shopDescription: "This skin was used in the Unhallowed boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.deathKnellBossGIF.img rsx: RSX.deathKnellBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.DeathKnell skinNum: 1 animResource: { breathing : RSX.bossUnhallowedBreathing.name idle : RSX.bossUnhallowedIdle.name walk : RSX.bossUnhallowedRun.name attack : RSX.bossUnhallowedAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossUnhallowedHit.name death : RSX.bossUnhallowedDeath.name } } cos[CardSkin.DraugerLordBoss] = { id: CardSkin.DraugerLordBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Santaur the Terrible boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.draugerLordBossGIF.img rsx: RSX.draugerLordBossGIF factionId: Factions.Vanar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction6.PrismaticGiant skinNum: 1 animResource: { breathing : RSX.bossChristmasBreathing.name idle : RSX.bossChristmasIdle.name walk : RSX.bossChristmasRun.name attack : RSX.bossChristmasAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossChristmasDamage.name death : RSX.bossChristmasDeath.name } } cos[CardSkin.NightWatcherBoss] = { id: CardSkin.NightWatcherBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Legion boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.nightWatcherBossGIF.img rsx: RSX.nightWatcherBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.NightWatcher skinNum: 1 animResource: { breathing : RSX.bossLegionBreathing.name idle : RSX.bossLegionIdle.name walk : RSX.bossLegionRun.name attack : RSX.bossLegionAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossLegionHit.name death : RSX.bossLegionDeath.name } } cos[CardSkin.CalligrapherBoss] = { id: CardSkin.CalligrapherBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Harmony boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.calligrapherBossGIF.img rsx: RSX.calligrapherBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.Calligrapher skinNum: 1 animResource: { breathing : RSX.bossHarmonyBreathing.name idle : RSX.bossHarmonyIdle.name walk : RSX.bossHarmonyRun.name attack : RSX.bossHarmonyAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossHarmonyHit.name death : RSX.bossHarmonyDeath.name } } cos[CardSkin.PandoraBoss] = { id: CardSkin.PandoraBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Andromeda boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.pandoraBossGIF.img rsx: RSX.pandoraBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Pandora skinNum: 1 animResource: { breathing : RSX.bossAndromedaBreathing.name idle : RSX.bossAndromedaIdle.name walk : RSX.bossAndromedaRun.name attack : RSX.bossAndromedaAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossAndromedaHit.name death : RSX.bossAndromedaDeath.name } } cos[CardSkin.GrandmasterNoshRakBoss] = { id: CardSkin.GrandmasterNoshRakBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Invader boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.grandmasterNoshRakBossGIF.img rsx: RSX.grandmasterNoshRakBossGIF factionId: Factions.Vetruvian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction3.GrandmasterNoshRak skinNum: 1 animResource: { breathing : RSX.bossInvaderBreathing.name idle : RSX.bossInvaderIdle.name walk : RSX.bossInvaderRun.name attack : RSX.bossInvaderAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossInvaderHit.name death : RSX.bossInvaderDeath.name } } cos[CardSkin.IroncliffeGuardianBoss] = { id: CardSkin.IroncliffeGuardianBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Invader boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.ironcliffeGuardianBossGIF.img rsx: RSX.ironcliffeGuardianBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.IroncliffeGuardian skinNum: 1 animResource: { breathing : RSX.bossProtectorBreathing.name idle : RSX.bossProtectorIdle.name walk : RSX.bossProtectorRun.name attack : RSX.bossProtectorAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossProtectorDamage.name death : RSX.bossProtectorDeath.name } } cos[CardSkin.CelestialPhantomBoss] = { id: CardSkin.CelestialPhantomBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Soulstealer boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.celestialPhantomBossGIF.img rsx: RSX.celestialPhantomBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.CelestialPhantom skinNum: 1 animResource: { breathing : RSX.bossSoulstealerBreathing.name idle : RSX.bossSoulstealerIdle.name walk : RSX.bossSoulstealerRun.name attack : RSX.bossSoulstealerAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSoulstealerDamage.name death : RSX.bossSoulstealerDeath.name } } cos[CardSkin.GrailmasterBoss] = { id: CardSkin.GrailmasterBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "<NAME>" shopDescription: "This skin was used in the Kahlmar the Spell Eater boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.grailmasterBossGIF.img rsx: RSX.grailmasterBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Grailmaster skinNum: 1 animResource: { breathing : RSX.bossSpelleaterBreathing.name idle : RSX.bossSpelleaterIdle.name walk : RSX.bossSpelleaterRun.name attack : RSX.bossSpelleaterAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSpelleaterHit.name death : RSX.bossSpelleaterDeath.name } } # endregion Card Skins # region Card Backs cos[CardBack.Normal] = { id: CardBack.Normal typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_classic_name") shopDescription: i18next.t("cosmetics.cardback_classic_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Common img: RSX.card_back.img rsx: RSX.card_back glowOutlineRSX: RSX.card_back_glow_outline unlockable: false purchasable: false } cos[CardBack.Agenor] = { id: CardBack.Agenor typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_redstark_name") shopDescription: i18next.t("cosmetics.cardback_redstark_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_agenor.img rsx: RSX.card_back_agenor glowOutlineRSX: RSX.card_back_agenor_glow_outline unlockable: false purchasable: true } cos[CardBack.Gauntlet] = { id: CardBack.Gauntlet typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_sienna_name") shopDescription: i18next.t("cosmetics.cardback_sienna_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_gauntlet.img rsx: RSX.card_back_gauntlet glowOutlineRSX: RSX.card_back_gauntlet_glow_outline unlockable: false purchasable: true } cos[CardBack.Magma] = { id: CardBack.Magma typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_dance_of_dreams_name") shopDescription: i18next.t("cosmetics.cardback_dance_of_dreams_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_magma.img rsx: RSX.card_back_magma glowOutlineRSX: RSX.card_back_magma_glow_outline unlockable: false purchasable: true } cos[CardBack.Shimzar] = { id: CardBack.Shimzar typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_shimzar_name") shopDescription: i18next.t("cosmetics.cardback_shimzar_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_shimzar.img rsx: RSX.card_back_shimzar glowOutlineRSX: RSX.card_back_shimzar_glow_outline unlockable: true purchasable: true } cos[CardBack.LyonarGears] = { id: CardBack.LyonarGears typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_azurite_name") shopDescription: i18next.t("cosmetics.cardback_azurite_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_lyonar_gears.img rsx: RSX.card_back_lyonar_gears glowOutlineRSX: RSX.card_back_lyonar_gears_glow_outline unlockable: false purchasable: true } cos[CardBack.HumbleBundle] = { id: CardBack.HumbleBundle typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_humble_bundle_name") shopDescription: i18next.t("cosmetics.cardback_humble_bundle_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_humblebundle.img rsx: RSX.card_back_humblebundle glowOutlineRSX: RSX.card_back_humblebundle_glow_outline unlockable: true purchasable: false } cos[CardBack.DawnDuelysts] = { id: CardBack.DawnDuelysts typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_dawn_of_duelysts_name") shopDescription: i18next.t("cosmetics.cardback_dawn_of_duelysts_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_dawnduelysts.img rsx: RSX.card_back_dawnduelysts glowOutlineRSX: RSX.card_back_dawnduelysts_glow_outline unlockable: true purchasable: false } cos[CardBack.Snowchaser] = { id: CardBack.Snowchaser typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_snowchaser_cup_name") shopDescription: i18next.t("cosmetics.cardback_snowchaser_cup_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_snowchaser.img rsx: RSX.card_back_snowchaser glowOutlineRSX: RSX.card_back_snowchaser_glow_outline unlockable: true purchasable: true } # endregion Card Backs # region Profile Icons cos[ProfileIcon.Tree] = { id: ProfileIcon.Tree typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_tree_of_eyos_name") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Fixed img: RSX.portrait_tree.img rsx: RSX.portrait_tree unlockable: false purchasable: false } cos[ProfileIcon.abyssian_abyssalcrawler] = { id: ProfileIcon.abyssian_abyssalcrawler typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_abyssal_crawler_name") shopDescription: i18next.t("cosmetics.icon_abyssal_crawler_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_abyssalcrawler.img rsx: RSX.portrait_abyssian_abyssalcrawler unlockable: false purchasable: true } cos[ProfileIcon.abyssian_cassyvasoulreaper1] = { id: ProfileIcon.abyssian_cassyvasoulreaper1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_cassyva_name") shopDescription: i18next.t("cosmetics.icon_cassyva_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_cassyvasoulreaper1.img rsx: RSX.portrait_abyssian_cassyvasoulreaper1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_maehv1] = { id: ProfileIcon.abyssian_maehv1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_maehv_name") shopDescription: i18next.t("cosmetics.icon_maehv_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_maehv1.img rsx: RSX.portrait_abyssian_maehv1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_crest] = { id: ProfileIcon.abyssian_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_abyssian_crest_name") shopDescription: i18next.t("cosmetics.icon_abyssian_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_crest.img rsx: RSX.portrait_abyssian_crest unlockable: false purchasable: true } cos[ProfileIcon.abyssian_gloomchaser] = { id: ProfileIcon.abyssian_gloomchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_gloomchaser_name") shopDescription: i18next.t("cosmetics.icon_gloomchaser_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_gloomchaser.img rsx: RSX.portrait_abyssian_gloomchaser unlockable: false purchasable: true } cos[ProfileIcon.abyssian_kelainosister] = { id: ProfileIcon.abyssian_kelainosister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_shadow_sister_name") shopDescription: i18next.t("cosmetics.icon_shadow_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_kelainosister.img rsx: RSX.portrait_abyssian_kelainosister unlockable: false purchasable: true } cos[ProfileIcon.abyssian_lilithe1] = { id: ProfileIcon.abyssian_lilithe1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_lilithe_name") shopDescription: i18next.t("cosmetics.icon_lilithe_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_lilithe1.img rsx: RSX.portrait_abyssian_lilithe1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_lilithe2] = { id: ProfileIcon.abyssian_lilithe2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_lilithe_mk2_name") shopDescription: i18next.t("cosmetics.icon_lilithe_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_lilithe2.img rsx: RSX.portrait_abyssian_lilithe2 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_vorpalreaver] = { id: ProfileIcon.abyssian_vorpalreaver typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_vorpal_reaver_name") shopDescription: i18next.t("cosmetics.icon_vorpal_reaver_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_vorpalreaver.img rsx: RSX.portrait_abyssian_vorpalreaver unlockable: false purchasable: true } cos[ProfileIcon.abyssian_wraithling] = { id: ProfileIcon.abyssian_wraithling typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_wraithling_name") shopDescription: i18next.t("cosmetics.icon_wraithling_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_wraithling.img rsx: RSX.portrait_abyssian_wraithling unlockable: false purchasable: true } cos[ProfileIcon.frostfire] = { id: ProfileIcon.frostfire typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_frostfire_2015_name") shopDescription: i18next.t("cosmetics.icon_frostfire_2015_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_frostfire.img rsx: RSX.portrait_frostfire unlockable: false purchasable: true } cos[ProfileIcon.lyonar_arclytesentinel] = { id: ProfileIcon.lyonar_arclytesentinel typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_arclyte_sentinel_name") shopDescription: i18next.t("cosmetics.icon_arclyte_sentinel_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_arclytesentinel.img rsx: RSX.portrait_lyonar_arclytesentinel unlockable: false purchasable: true } cos[ProfileIcon.lyonar_argeonhighmayne1] = { id: ProfileIcon.lyonar_argeonhighmayne1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_argeon_name") shopDescription: i18next.t("cosmetics.icon_argeon_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_argeonhighmayne1.img rsx: RSX.portrait_lyonar_argeonhighmayne1 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_argeonhighmayne2] = { id: ProfileIcon.lyonar_argeonhighmayne2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_argeon_mk2_name") shopDescription: i18next.t("cosmetics.icon_argeon_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_argeonhighmayne2.img rsx: RSX.portrait_lyonar_argeonhighmayne2 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_crest] = { id: ProfileIcon.lyonar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_lyonar_crest_name") shopDescription: i18next.t("cosmetics.icon_lyonar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_crest.img rsx: RSX.portrait_lyonar_crest unlockable: false purchasable: true } cos[ProfileIcon.lyonar_lightchaser] = { id: ProfileIcon.lyonar_lightchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_lightchaser_name") shopDescription: i18next.t("cosmetics.icon_lightchaser_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_lightchaser.img rsx: RSX.portrait_lyonar_lightchaser unlockable: false purchasable: true } cos[ProfileIcon.lyonar_silverguardknight] = { id: ProfileIcon.lyonar_silverguardknight typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_silverguard_knight_name") shopDescription: i18next.t("cosmetics.icon_silverguard_knight_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_silverguardknight.img rsx: RSX.portrait_lyonar_silverguardknight unlockable: false purchasable: true } cos[ProfileIcon.lyonar_steropesister] = { id: ProfileIcon.lyonar_steropesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_sun_sister_name") shopDescription: i18next.t("cosmetics.icon_sun_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_steropesister.img rsx: RSX.portrait_lyonar_steropesister unlockable: false purchasable: true } cos[ProfileIcon.lyonar_suntidemaiden] = { id: ProfileIcon.lyonar_suntidemaiden typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_suntide_maiden_name") shopDescription: i18next.t("cosmetics.icon_suntide_maiden_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_suntidemaiden.img rsx: RSX.portrait_lyonar_suntidemaiden unlockable: false purchasable: true } cos[ProfileIcon.lyonar_windbladeadept] = { id: ProfileIcon.lyonar_windbladeadept typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_windblade_adept_name") shopDescription: i18next.t("cosmetics.icon_windblade_adept_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_windbladeadept.img rsx: RSX.portrait_lyonar_windbladeadept unlockable: false purchasable: true } cos[ProfileIcon.lyonar_ziransunforge1] = { id: ProfileIcon.lyonar_ziransunforge1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_ziran_name") shopDescription: i18next.t("cosmetics.icon_ziran_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_ziransunforge1.img rsx: RSX.portrait_lyonar_ziransunforge1 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_brome1] = { id: ProfileIcon.lyonar_brome1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_brome_name") shopDescription: i18next.t("cosmetics.icon_brome_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_brome1.img rsx: RSX.portrait_lyonar_brome1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_crest] = { id: ProfileIcon.magmar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_magmar_crest_name") shopDescription: i18next.t("cosmetics.icon_magmar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_crest.img rsx: RSX.portrait_magmar_crest unlockable: false purchasable: true } cos[ProfileIcon.magmar_dreadnought] = { id: ProfileIcon.magmar_dreadnought typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_dreadnought_name") shopDescription: i18next.t("cosmetics.icon_dreadnought_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_dreadnought.img rsx: RSX.portrait_magmar_dreadnought unlockable: false purchasable: true } cos[ProfileIcon.magmar_elucidator] = { id: ProfileIcon.magmar_elucidator typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_elucidator_name") shopDescription: i18next.t("cosmetics.icon_elucidator_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_elucidator.img rsx: RSX.portrait_magmar_elucidator unlockable: false purchasable: true } cos[ProfileIcon.magmar_makantorwarbeast] = { id: ProfileIcon.magmar_makantorwarbeast typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_makantor_name") shopDescription: i18next.t("cosmetics.icon_makantor_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_makantorwarbeast.img rsx: RSX.portrait_magmar_makantorwarbeast unlockable: false purchasable: true } cos[ProfileIcon.magmar_phalanxar] = { id: ProfileIcon.magmar_phalanxar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_phalanxar_name") shopDescription: i18next.t("cosmetics.icon_phalanxar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_phalanxar.img rsx: RSX.portrait_magmar_phalanxar unlockable: false purchasable: true } cos[ProfileIcon.magmar_silitharelder] = { id: ProfileIcon.magmar_silitharelder typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_silithar_elder_name") shopDescription: i18next.t("cosmetics.icon_silithar_elder_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_silitharelder.img rsx: RSX.portrait_magmar_silitharelder unlockable: false purchasable: true } cos[ProfileIcon.magmar_starhorn1] = { id: ProfileIcon.magmar_starhorn1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_starhorn_1_name") shopDescription: i18next.t("cosmetics.icon_starhorn_1_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_starhorn1.img rsx: RSX.portrait_magmar_starhorn1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_starhorn2] = { id: ProfileIcon.magmar_starhorn2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_starhorn_2_name") shopDescription: i18next.t("cosmetics.icon_starhorn_2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_starhorn2.img rsx: RSX.portrait_magmar_starhorn2 unlockable: false purchasable: true } cos[ProfileIcon.magmar_ragnora1] = { id: ProfileIcon.magmar_ragnora1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_ragnora_name") shopDescription: i18next.t("cosmetics.icon_ragnora_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_ragnora1.img rsx: RSX.portrait_magmar_ragnora1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_taygetesister] = { id: ProfileIcon.magmar_taygetesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_taygete_name") shopDescription: i18next.t("cosmetics.icon_taygete_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_taygetesister.img rsx: RSX.portrait_magmar_taygetesister unlockable: false purchasable: true } cos[ProfileIcon.magmar_vaath1] = { id: ProfileIcon.magmar_vaath1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_vaath_name") shopDescription: i18next.t("cosmetics.icon_vaath_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_vaath1.img rsx: RSX.portrait_magmar_vaath1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_vaath2] = { id: ProfileIcon.magmar_vaath2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_vaath_mk2_name") shopDescription: i18next.t("cosmetics.icon_vaath_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_vaath2.img rsx: RSX.portrait_magmar_vaath2 unlockable: false purchasable: true } cos[ProfileIcon.magmar_veteransilithar] = { id: ProfileIcon.magmar_veteransilithar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_veteran_silithar_name") shopDescription: i18next.t("cosmetics.icon_veteran_silithar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_veteransilithar.img rsx: RSX.portrait_magmar_veteransilithar unlockable: false purchasable: true } cos[ProfileIcon.magmar_youngsilithar] = { id: ProfileIcon.magmar_youngsilithar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_young_silithar_name") shopDescription: i18next.t("cosmetics.icon_young_silithar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_youngsilithar.img rsx: RSX.portrait_magmar_youngsilithar unlockable: false purchasable: true } cos[ProfileIcon.neutral_beastmaster] = { id: ProfileIcon.neutral_beastmaster typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_beastmaster_name") shopDescription: i18next.t("cosmetics.icon_beastmaster_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_beastmaster.img rsx: RSX.portrait_neutral_beastmaster unlockable: false purchasable: true } cos[ProfileIcon.neutral_cannonofmechaz0r] = { id: ProfileIcon.neutral_cannonofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_cannon_mech_name") shopDescription: i18next.t("cosmetics.icon_cannon_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_cannonofmechaz0r.img rsx: RSX.portrait_neutral_cannonofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_chassisofmechaz0r] = { id: ProfileIcon.neutral_chassisofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_chassis_mech_name") shopDescription: i18next.t("cosmetics.icon_chassis_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_chassisofmechaz0r.img rsx: RSX.portrait_neutral_chassisofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_gnasher] = { id: ProfileIcon.neutral_gnasher typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_gnasher_name") shopDescription: i18next.t("cosmetics.icon_gnasher_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_gnasher.img rsx: RSX.portrait_neutral_gnasher unlockable: false purchasable: true } cos[ProfileIcon.neutral_goldenmantella] = { id: ProfileIcon.neutral_goldenmantella typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_golden_mantella_name") shopDescription: i18next.t("cosmetics.icon_golden_mantella_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_goldenmantella.img rsx: RSX.portrait_neutral_goldenmantella unlockable: false purchasable: true } cos[ProfileIcon.neutral_grincher] = { id: ProfileIcon.neutral_grincher typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_grincher_name") shopDescription: i18next.t("cosmetics.icon_grincher_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_grincher.img rsx: RSX.portrait_neutral_grincher unlockable: false purchasable: true } cos[ProfileIcon.neutral_helmofmechaz0r] = { id: ProfileIcon.neutral_helmofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_helm_mech_name") shopDescription: i18next.t("cosmetics.icon_helm_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_helmofmechaz0r.img rsx: RSX.portrait_neutral_helmofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_hydrax1] = { id: ProfileIcon.neutral_hydrax1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_hydrax_name") shopDescription: i18next.t("cosmetics.icon_hydrax_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_hydrax1.img rsx: RSX.portrait_neutral_hydrax1 unlockable: false purchasable: true } cos[ProfileIcon.neutral_hydrax2] = { id: ProfileIcon.neutral_hydrax2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_hydrax_2_name") shopDescription: i18next.t("cosmetics.icon_hydrax_2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_hydrax2.img rsx: RSX.portrait_neutral_hydrax2 unlockable: false purchasable: true } cos[ProfileIcon.neutral_ion] = { id: ProfileIcon.neutral_ion typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_ion_name") shopDescription: i18next.t("cosmetics.icon_ion_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_ion.img rsx: RSX.portrait_neutral_ion unlockable: false purchasable: true } cos[ProfileIcon.neutral_ladylocke] = { id: ProfileIcon.neutral_ladylocke typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_lady_locke_name") shopDescription: i18next.t("cosmetics.icon_lady_locke_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_ladylocke.img rsx: RSX.portrait_neutral_ladylocke unlockable: false purchasable: true } cos[ProfileIcon.neutral_lkiansister] = { id: ProfileIcon.neutral_lkiansister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_sworn_sister_name") shopDescription: i18next.t("cosmetics.icon_sworn_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_lkiansister.img rsx: RSX.portrait_neutral_lkiansister unlockable: false purchasable: true } cos[ProfileIcon.neutral_mechaz0r] = { id: ProfileIcon.neutral_mechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_mechaz0r_name") shopDescription: i18next.t("cosmetics.icon_mechaz0r_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_mechaz0r.img rsx: RSX.portrait_neutral_mechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_nip] = { id: ProfileIcon.neutral_nip typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_dex_name") shopDescription: i18next.t("cosmetics.icon_dex_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_nip.img rsx: RSX.portrait_neutral_nip unlockable: false purchasable: true } cos[ProfileIcon.neutral_rawr] = { id: ProfileIcon.neutral_rawr typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rawr_name") shopDescription: i18next.t("cosmetics.icon_rawr_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rawr.img rsx: RSX.portrait_neutral_rawr unlockable: false purchasable: true } cos[ProfileIcon.neutral_rok] = { id: ProfileIcon.neutral_rok typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rok_name") shopDescription: i18next.t("cosmetics.icon_rok_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rok.img rsx: RSX.portrait_neutral_rok unlockable: false purchasable: true } cos[ProfileIcon.neutral_rook] = { id: ProfileIcon.neutral_rook typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rook_name") shopDescription: i18next.t("cosmetics.icon_rook_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rook.img rsx: RSX.portrait_neutral_rook unlockable: false purchasable: true } cos[ProfileIcon.neutral_silverbeak] = { id: ProfileIcon.neutral_silverbeak typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_silverbeak_name") shopDescription: i18next.t("cosmetics.icon_silverbeak_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_silverbeak.img rsx: RSX.portrait_neutral_silverbeak unlockable: false purchasable: true } cos[ProfileIcon.neutral_soboro] = { id: ProfileIcon.neutral_soboro typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_soboro_name") shopDescription: i18next.t("cosmetics.icon_soboro_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_soboro.img rsx: RSX.portrait_neutral_soboro unlockable: false purchasable: true } cos[ProfileIcon.neutral_swordofmechaz0r] = { id: ProfileIcon.neutral_swordofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_sword_mech_name") shopDescription: i18next.t("cosmetics.icon_sword_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_swordofmechaz0r.img rsx: RSX.portrait_neutral_swordofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_wingsofmechaz0r] = { id: ProfileIcon.neutral_wingsofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_wings_mech_name") shopDescription: i18next.t("cosmetics.icon_wings_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_wingsofmechaz0r.img rsx: RSX.portrait_neutral_wingsofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_z0r] = { id: ProfileIcon.neutral_z0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_z0r_name") shopDescription: i18next.t("cosmetics.icon_z0r_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_z0r.img rsx: RSX.portrait_neutral_z0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_zukong] = { id: ProfileIcon.neutral_zukong typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_zukong_name") shopDescription: i18next.t("cosmetics.icon_zukong_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_zukong.img rsx: RSX.portrait_neutral_zukong unlockable: false purchasable: true } cos[ProfileIcon.songhai_alkyonesister] = { id: ProfileIcon.songhai_alkyonesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_storm_sister_name") shopDescription: i18next.t("cosmetics.icon_storm_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_alkyonesister.img rsx: RSX.portrait_songhai_alkyonesister unlockable: false purchasable: true } cos[ProfileIcon.songhai_crest] = { id: ProfileIcon.songhai_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_songhai_crest_name") shopDescription: i18next.t("cosmetics.icon_songhai_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_crest.img rsx: RSX.portrait_songhai_crest unlockable: false purchasable: true } cos[ProfileIcon.songhai_gorehorn] = { id: ProfileIcon.songhai_gorehorn typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_gorehorn_name") shopDescription: i18next.t("cosmetics.icon_gorehorn_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_gorehorn.img rsx: RSX.portrait_songhai_gorehorn unlockable: false purchasable: true } cos[ProfileIcon.songhai_grandmasterzendo] = { id: ProfileIcon.songhai_grandmasterzendo typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_zendo_name") shopDescription: i18next.t("cosmetics.icon_zendo_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_grandmasterzendo.img rsx: RSX.portrait_songhai_grandmasterzendo unlockable: false purchasable: true } cos[ProfileIcon.songhai_heartseeker] = { id: ProfileIcon.songhai_heartseeker typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_heartseeker_name") shopDescription: i18next.t("cosmetics.icon_heartseeker_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_heartseeker.img rsx: RSX.portrait_songhai_heartseeker unlockable: false purchasable: true } cos[ProfileIcon.songhai_kaidoassassin] = { id: ProfileIcon.songhai_kaidoassassin typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_kaido_assassin_name") shopDescription: i18next.t("cosmetics.icon_kaido_assassin_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_kaidoassassin.img rsx: RSX.portrait_songhai_kaidoassassin unlockable: false purchasable: true } cos[ProfileIcon.songhai_kaleosxaan1] = { id: ProfileIcon.songhai_kaleosxaan1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_kaleos_name") shopDescription: i18next.t("cosmetics.icon_kaleos_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_kaleosxaan1.img rsx: RSX.portrait_songhai_kaleosxaan1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_revaeventide1] = { id: ProfileIcon.songhai_revaeventide1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_reva_name") shopDescription: i18next.t("cosmetics.icon_reva_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_revaeventide1.img rsx: RSX.portrait_songhai_revaeventide1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_revaeventide2] = { id: ProfileIcon.songhai_revaeventide2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_reva_mk2_name") shopDescription: i18next.t("cosmetics.icon_reva_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_revaeventide2.img rsx: RSX.portrait_songhai_revaeventide2 unlockable: false purchasable: true } cos[ProfileIcon.songhai_shidai1] = { id: ProfileIcon.songhai_shidai1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_shidai_name") shopDescription: i18next.t("cosmetics.icon_shidai_name") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_shidai1.img rsx: RSX.portrait_songhai_shidai1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_scarletviper] = { id: ProfileIcon.songhai_scarletviper typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_scarlet_viper_name") shopDescription: i18next.t("cosmetics.icon_scarlet_viper_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_scarletviper.img rsx: RSX.portrait_songhai_scarletviper unlockable: false purchasable: true } cos[ProfileIcon.songhai_tuskboar] = { id: ProfileIcon.songhai_tuskboar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_tusk_boar_name") shopDescription: i18next.t("cosmetics.icon_tusk_boar_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_tuskboar.img rsx: RSX.portrait_songhai_tuskboar unlockable: false purchasable: true } cos[ProfileIcon.songhai_widowmaker] = { id: ProfileIcon.songhai_widowmaker typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_widowmaker_name") shopDescription: i18next.t("cosmetics.icon_widowmaker_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_widowmaker.img rsx: RSX.portrait_songhai_widowmaker unlockable: false purchasable: true } cos[ProfileIcon.vanar_arcticdisplacer] = { id: ProfileIcon.vanar_arcticdisplacer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_arctic_displacer_name") shopDescription: i18next.t("cosmetics.icon_arctic_displacer_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_arcticdisplacer.img rsx: RSX.portrait_vanar_arcticdisplacer unlockable: false purchasable: true } cos[ProfileIcon.vanar_crest] = { id: ProfileIcon.vanar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_vanar_crest_name") shopDescription: i18next.t("cosmetics.icon_vanar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_crest.img rsx: RSX.portrait_vanar_crest unlockable: false purchasable: true } cos[ProfileIcon.vanar_draugarlord] = { id: ProfileIcon.vanar_draugarlord typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_draugar_lord_name") shopDescription: i18next.t("cosmetics.icon_draugar_lord_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_draugarlord.img rsx: RSX.portrait_vanar_draugarlord unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing_warbird] = { id: ProfileIcon.vanar_faiebloodwing_warbird typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_warbird_name") shopDescription: i18next.t("cosmetics.icon_warbird_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing_warbird.img rsx: RSX.portrait_vanar_faiebloodwing_warbird unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing1] = { id: ProfileIcon.vanar_faiebloodwing1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_faie_name") shopDescription: i18next.t("cosmetics.icon_faie_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing1.img rsx: RSX.portrait_vanar_faiebloodwing1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing2] = { id: ProfileIcon.vanar_faiebloodwing2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_faie_mk2_name") shopDescription: i18next.t("cosmetics.icon_faie_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing2.img rsx: RSX.portrait_vanar_faiebloodwing2 unlockable: false purchasable: true } cos[ProfileIcon.vanar_glacialelemental] = { id: ProfileIcon.vanar_glacialelemental typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_glacial_elemental_name") shopDescription: i18next.t("cosmetics.icon_glacial_elemental_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_glacialelemental.img rsx: RSX.portrait_vanar_glacialelemental unlockable: false purchasable: true } cos[ProfileIcon.vanar_hearthsister] = { id: ProfileIcon.vanar_hearthsister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_hearth_sister_name") shopDescription: i18next.t("cosmetics.icon_hearth_sister_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_hearthsister.img rsx: RSX.portrait_vanar_hearthsister unlockable: false purchasable: true } cos[ProfileIcon.vanar_icebladedryad] = { id: ProfileIcon.vanar_icebladedryad typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_iceblade_dryad_name") shopDescription: i18next.t("cosmetics.icon_iceblade_dryad_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_icebladedryad.img rsx: RSX.portrait_vanar_icebladedryad unlockable: false purchasable: true } cos[ProfileIcon.vanar_karawinterblade1] = { id: ProfileIcon.vanar_karawinterblade1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_kara_name") shopDescription: i18next.t("cosmetics.icon_kara_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_karawinterblade1.img rsx: RSX.portrait_vanar_karawinterblade1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_karawinterblade2] = { id: ProfileIcon.vanar_karawinterblade2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_kara_mk2_name") shopDescription: i18next.t("cosmetics.icon_kara_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_karawinterblade2.img rsx: RSX.portrait_vanar_karawinterblade2 unlockable: false purchasable: true } cos[ProfileIcon.vanar_ilena1] = { id: ProfileIcon.vanar_ilena1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_ilena_name") shopDescription: i18next.t("cosmetics.icon_ilena_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_ilena1.img rsx: RSX.portrait_vanar_ilena1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_maiasister] = { id: ProfileIcon.vanar_maiasister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_wind_sister_name") shopDescription: i18next.t("cosmetics.icon_wind_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_maiasister.img rsx: RSX.portrait_vanar_maiasister unlockable: false purchasable: true } cos[ProfileIcon.vanar_razorback] = { id: ProfileIcon.vanar_razorback typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_razorback_name") shopDescription: i18next.t("cosmetics.icon_razorback_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_razorback.img rsx: RSX.portrait_vanar_razorback unlockable: false purchasable: true } cos[ProfileIcon.vanar_snowchaser] = { id: ProfileIcon.vanar_snowchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_snowchaser_name") shopDescription: i18next.t("cosmetics.icon_snowchaser_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_snowchaser.img rsx: RSX.portrait_vanar_snowchaser unlockable: false purchasable: true } cos[ProfileIcon.vanar_wolfraven] = { id: ProfileIcon.vanar_wolfraven typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_wolfraven_name") shopDescription: i18next.t("cosmetics.icon_wolfraven_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_wolfraven.img rsx: RSX.portrait_vanar_wolfraven unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_crest] = { id: ProfileIcon.vetruvian_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_vetruvian_crest_name") shopDescription: i18next.t("cosmetics.icon_vetruvian_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_crest.img rsx: RSX.portrait_vetruvian_crest unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_miragemaster] = { id: ProfileIcon.vetruvian_miragemaster typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_mirage_master_name") shopDescription: i18next.t("cosmetics.icon_mirage_master_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_miragemaster.img rsx: RSX.portrait_vetruvian_miragemaster unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_pax] = { id: ProfileIcon.vetruvian_pax typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_pax_name") shopDescription: i18next.t("cosmetics.icon_pax_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_pax.img rsx: RSX.portrait_vetruvian_pax unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_pyromancer] = { id: ProfileIcon.vetruvian_pyromancer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_pyromancer_name") shopDescription: i18next.t("cosmetics.icon_pyromancer_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_pyromancer.img rsx: RSX.portrait_vetruvian_pyromancer unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_rae] = { id: ProfileIcon.vetruvian_rae typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_rae_name") shopDescription: i18next.t("cosmetics.icon_rae_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_rae.img rsx: RSX.portrait_vetruvian_rae unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_saonsister] = { id: ProfileIcon.vetruvian_saonsister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_sand_sister_name") shopDescription: i18next.t("cosmetics.icon_sand_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_saonsister.img rsx: RSX.portrait_vetruvian_saonsister unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_scionesssajj1] = { id: ProfileIcon.vetruvian_scionesssajj1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_sajj_name") shopDescription: i18next.t("cosmetics.icon_sajj_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_scionesssajj1.img rsx: RSX.portrait_vetruvian_scionesssajj1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_ciphyron1] = { id: ProfileIcon.vetruvian_ciphyron1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_ciphyron_name") shopDescription: i18next.t("cosmetics.icon_ciphyron_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_ciphyron1.img rsx: RSX.portrait_vetruvian_ciphyron1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_starfirescarab] = { id: ProfileIcon.vetruvian_starfirescarab typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_starfire_scarab_name") shopDescription: i18next.t("cosmetics.icon_starfire_scarab_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_starfirescarab.img rsx: RSX.portrait_vetruvian_starfirescarab unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_windshrike] = { id: ProfileIcon.vetruvian_windshrike typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_windshrike_name") shopDescription: i18next.t("cosmetics.icon_windshrike_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_windshrike.img rsx: RSX.portrait_vetruvian_windshrike unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_zirixstarstrider1] = { id: ProfileIcon.vetruvian_zirixstarstrider1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_zirix_name") shopDescription: i18next.t("cosmetics.icon_zirix_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_zirixstarstrider1.img rsx: RSX.portrait_vetruvian_zirixstarstrider1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_zirixstarstrider2] = { id: ProfileIcon.vetruvian_zirixstarstrider2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_zirix_mk2_name") shopDescription: i18next.t("cosmetics.icon_zirix_mk2_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_zirixstarstrider2.img rsx: RSX.portrait_vetruvian_zirixstarstrider2 unlockable: false purchasable: true } cos[ProfileIcon.Bloodmoon] = { id: ProfileIcon.Bloodmoon typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_bloodmoon_ruins_name") shopDescription: i18next.t("cosmetics.icon_bloodmoon_ruins_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_bloodmoon.img rsx: RSX.portrait_bloodmoon unlockable: false purchasable: false } cos[ProfileIcon.CrystalCaverns] = { id: ProfileIcon.CrystalCaverns typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_crystal_caverns_name") shopDescription: i18next.t("cosmetics.icon_crystal_caverns_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_crystal_caverns.img rsx: RSX.portrait_crystal_caverns unlockable: false purchasable: false } cos[ProfileIcon.Kaero] = { id: ProfileIcon.Kaero typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_kaero_name") shopDescription: i18next.t("cosmetics.icon_kaero_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_kaero.img rsx: RSX.portrait_kaero unlockable: false purchasable: false } cos[ProfileIcon.WhistlingBlade] = { id: ProfileIcon.WhistlingBlade typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_whistling_blades_name") shopDescription: i18next.t("cosmetics.icon_whistling_blades_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_whistling_blade.img rsx: RSX.portrait_whistling_blade unlockable: false purchasable: false } cos[ProfileIcon.obsidian_woods] = { id: ProfileIcon.obsidian_woods typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS enabled: true subTypeId: "Neutral" name: i18next.t("cosmetics.icon_obsidian_woods_name") shopDescription: i18next.t("cosmetics.icon_obsidian_woods_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_obsidian_woods.img rsx: RSX.portrait_obsidian_woods unlockable: false purchasable: false } cos[ProfileIcon.rashas_tomb] = { id: ProfileIcon.rashas_tomb typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS enabled: true subTypeId: "Neutral" name: i18next.t("cosmetics.icon_rashas_tomb_name") shopDescription: i18next.t("cosmetics.icon_rashas_tomb_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_rashas_tomb.img rsx: RSX.portrait_rashas_tomb unlockable: false purchasable: false } cos[ProfileIcon.grandmaster_icon] = { id: ProfileIcon.grandmaster_icon typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_grandmaster_name") shopDescription: i18next.t("cosmetics.icon_grandmaster_desc") rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_grandmaster_portrait.img rsx: RSX.portrait_grandmaster_portrait unlockable: true purchasable: false } cos[ProfileIcon.tournament_dawnofduelysts1] = { id: ProfileIcon.tournament_dawnofduelysts1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "<NAME>" shopDescription: "Emperor Sargos" rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_tournament_dawnofduelysts1.img rsx: RSX.portrait_tournament_dawnofduelysts1 unlockable: false purchasable: true } cos[ProfileIcon.tournament_dawnofduelysts2] = { id: ProfileIcon.tournament_dawnofduelysts2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "The Coming of Rasha" shopDescription: "The Coming of Rasha" rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_tournament_dawnofduelysts2.img rsx: RSX.portrait_tournament_dawnofduelysts2 unlockable: false purchasable: true } cos[ProfileIcon.aer] = { id: ProfileIcon.aer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "<NAME>" shopDescription: "Aer Pridebeak" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_aer.img rsx: RSX.portrait_aer unlockable: false purchasable: true } cos[ProfileIcon.frizzing_mystic] = { id: ProfileIcon.frizzing_mystic typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "<NAME>" shopDescription: "Frizzing Mystic" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_frizzing_mystic.img rsx: RSX.portrait_frizzing_mystic unlockable: false purchasable: true } cos[ProfileIcon.gibbet] = { id: ProfileIcon.gibbet typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" enabled: true name: "<NAME>" shopDescription: "Gibbet" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_gibbet.img rsx: RSX.portrait_gibbet unlockable: false purchasable: true } cos[ProfileIcon.orbo] = { id: ProfileIcon.orbo typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Orbo the Ostentatious" shopDescription: "Orbo the Ostentatious" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_orbo.img rsx: RSX.portrait_orbo unlockable: false purchasable: true } cos[ProfileIcon.canopic] = { id: ProfileIcon.canopic typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" enabled: true name: "Fifth Canopic" shopDescription: "Fifth Canopic" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_canopic.img rsx: RSX.portrait_canopic unlockable: false purchasable: true } cos[ProfileIcon.veracity] = { id: ProfileIcon.veracity typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" enabled: true name: "<NAME>" shopDescription: "Yggdra's Voracity" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_veracity.img rsx: RSX.portrait_veracity unlockable: false purchasable: true } cos[ProfileIcon.indominus] = { id: ProfileIcon.indominus typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" enabled: true name: "Indominus" shopDescription: "Indominus" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_indominus.img rsx: RSX.portrait_indominus unlockable: false purchasable: true } cos[ProfileIcon.spriggen] = { id: ProfileIcon.spriggen typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "<NAME>" shopDescription: "Spriggen" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_spriggen.img rsx: RSX.portrait_spriggen unlockable: false purchasable: true } cos[ProfileIcon.eternityPainter] = { id: ProfileIcon.eternityPainter typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" enabled: true name: "Eternity Painter" shopDescription: "Eternity Painter" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_eternityPainter.img rsx: RSX.portrait_eternityPainter unlockable: false purchasable: true } cos[ProfileIcon.skullProphet] = { id: ProfileIcon.skullProphet typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" enabled: true name: "Skull Prophet" shopDescription: "Skull Prophet" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_skullProphet.img rsx: RSX.portrait_skullProphet unlockable: false purchasable: true } cos[ProfileIcon.sinisterSilhouette] = { id: ProfileIcon.sinisterSilhouette typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "<NAME>" shopDescription: "<NAME>" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_sinisterSilhouette.img rsx: RSX.portrait_sinisterSilhouette unlockable: false purchasable: true } # endregion Profile Icons # region emotes # Emotes were converted from prior format (from EmoteFactory) to this by executing these regex replaces: # https://gist.github.com/RobotRocker/13b08cd699b2a0242d9ae770dcdcb7a6 # region TEXT cos[Emote.TextHello] = { id: Emote.TextHello typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_hello_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextGLHF] = { id: Emote.TextGLHF typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_glhf_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextGG] = { id: Emote.TextGG typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_well_played_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextOops] = { id: Emote.TextOops typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_oops_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } # endregion TEXT # region HEALING MYSTIC cos[Emote.HealingMysticHappy] = { id: Emote.HealingMysticHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_happy.img rsx: RSX.emote_healing_mystic_happy title: "So Happy!" name: i18next.t("cosmetics.emote_hm_happy_name") shopDescription: i18next.t("cosmetics.emote_hm_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticSad] = { id: Emote.HealingMysticSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_sad.img rsx: RSX.emote_healing_mystic_sad title: "So Sad!" name: i18next.t("cosmetics.emote_hm_sad_name") shopDescription: i18next.t("cosmetics.emote_hm_sad_desc") emoteOrder: EMOTE_ORDER_SAD factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticThumbsUp] = { id: Emote.HealingMysticThumbsUp typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_thumbs_up.img rsx: RSX.emote_healing_mystic_thumbs_up title: "Yay!" name: i18next.t("cosmetics.emote_hm_thumbs_up_name") shopDescription: i18next.t("cosmetics.emote_hm_thumbs_up_desc") emoteOrder: EMOTE_ORDER_TAUNT factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticConfused] = { id: Emote.HealingMysticConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_confused.img rsx: RSX.emote_healing_mystic_confused title: "Huh!?" name: i18next.t("cosmetics.emote_hm_surprise_name") shopDescription: i18next.t("cosmetics.emote_hm_surprise_desc") emoteOrder: EMOTE_ORDER_CONFUSED factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticBlink] = { id: Emote.HealingMysticBlink typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_blink.img rsx: RSX.emote_healing_mystic_blink title: "Blink" name: i18next.t("cosmetics.emote_hm_blink_name") shopDescription: i18next.t("cosmetics.emote_hm_blink_desc") emoteOrder: EMOTE_ORDER_BOW factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } # endregion HEALING MYSTIC # region ALPHA cos[Emote.OtherIcebladeDryad] = { id: Emote.OtherIcebladeDryad typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: false alwaysVisible: false img: RSX.emote_alpha_iceblade_dryad.img rsx: RSX.emote_alpha_iceblade_dryad title: "Peace!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherRook] = { id: Emote.OtherRook typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: true alwaysVisible: false img: RSX.emote_alpha_rook.img rsx: RSX.emote_alpha_rook title: "Yeah Baby!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherLightchaser] = { id: Emote.OtherLightchaser typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: false alwaysVisible: false img: RSX.emote_alpha_lightchaser.img rsx: RSX.emote_alpha_lightchaser title: "Blargh!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherSnowChaserHoliday2015] = { id: Emote.OtherSnowChaserHoliday2015 typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_neutral_snowchaser_holiday_2015.img rsx: RSX.emote_neutral_snowchaser_holiday_2015 title: "Happy Holidays!" name: i18next.t("cosmetics.emote_holiday_snowchaser_name") shopDescription: i18next.t("cosmetics.emote_holiday_snowchaser_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: true } # endregion ALPHA # region NEUTRAL cos[Emote.emote_mechaz0r_cannon_confused] = { id: Emote.emote_mechaz0r_cannon_confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_cannon_confused.img rsx: RSX.emote_mechaz0r_cannon_confused name: i18next.t("cosmetics.emote_cannon_mech_name") shopDescription: i18next.t("cosmetics.emote_cannon_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_chassis_angry] = { id: Emote.emote_mechaz0r_chassis_angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_chassis_angry.img rsx: RSX.emote_mechaz0r_chassis_angry name: i18next.t("cosmetics.emote_chassis_mech_name") shopDescription: i18next.t("cosmetics.emote_chassis_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_helm_taunt] = { id: Emote.emote_mechaz0r_helm_taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_helm_taunt.img rsx: RSX.emote_mechaz0r_helm_taunt name: i18next.t("cosmetics.emote_helm_mech_name") shopDescription: i18next.t("cosmetics.emote_helm_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_sad] = { id: Emote.emote_mechaz0r_sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_sad.img rsx: RSX.emote_mechaz0r_sad name: i18next.t("cosmetics.emote_mechaz0r_name") shopDescription: i18next.t("cosmetics.emote_mechaz0r_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_sword_frustrated] = { id: Emote.emote_mechaz0r_sword_frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_sword_frustrated.img rsx: RSX.emote_mechaz0r_sword_frustrated name: i18next.t("cosmetics.emote_sword_mech_name") shopDescription: i18next.t("cosmetics.emote_sword_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_wings_happy] = { id: Emote.emote_mechaz0r_wings_happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_wings_happy.img rsx: RSX.emote_mechaz0r_wings_happy name: i18next.t("cosmetics.emote_wings_mech_name") shopDescription: i18next.t("cosmetics.emote_wings_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_ladylocke] = { id: Emote.emote_ladylocke typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_ladylocke.img rsx: RSX.emote_ladylocke name: i18next.t("cosmetics.emote_lady_locke_name") shopDescription: i18next.t("cosmetics.emote_lady_locke_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_phalanxar_thumbsdown] = { id: Emote.emote_phalanxar_thumbsdown typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_phalanxar_thumbsdown.img rsx: RSX.emote_phalanxar_thumbsdown name: i18next.t("cosmetics.emote_phalanxar_name") shopDescription: i18next.t("cosmetics.emote_phalanxar_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_snowchaser_bow] = { id: Emote.emote_snowchaser_bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_snowchaser_bow.img rsx: RSX.emote_snowchaser_bow name: i18next.t("cosmetics.emote_snowchaser_bow_name") shopDescription: i18next.t("cosmetics.emote_snowchaser_bow_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_hollowgrovekeeper] = { id: Emote.emote_hollowgrovekeeper typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_hollowgrovekeeper.img rsx: RSX.emote_hollowgrovekeeper name: i18next.t("cosmetics.emote_hollow_grovekeeper_name") shopDescription: i18next.t("cosmetics.emote_hollow_grovekeeper_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_lightbender] = { id: Emote.emote_lightbender typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_lightbender.img rsx: RSX.emote_lightbender name: i18next.t("cosmetics.emote_lightbender_name") shopDescription: i18next.t("cosmetics.emote_lightbender_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_primusfist] = { id: Emote.emote_primusfist typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_primusfist.img rsx: RSX.emote_primusfist name: i18next.t("cosmetics.emote_primus_fist_name") shopDescription: i18next.t("cosmetics.emote_primus_fist_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_zenrui] = { id: Emote.emote_zenrui typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_zenrui.img rsx: RSX.emote_zenrui name: i18next.t("cosmetics.emote_zenrui_name") shopDescription: i18next.t("cosmetics.emote_zenrui_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_bow] = { id: Emote.emote_fog_bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_bow.img rsx: RSX.emote_fog_bow name: i18next.t("cosmetics.emote_fog_bow_name") shopDescription: i18next.t("cosmetics.emote_fog_bow_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_confused] = { id: Emote.emote_fog_confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_confused.img rsx: RSX.emote_fog_confused name: i18next.t("cosmetics.emote_fog_confused_name") shopDescription: i18next.t("cosmetics.emote_fog_confused_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_dead] = { id: Emote.emote_fog_dead typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_dead.img rsx: RSX.emote_fog_dead name: i18next.t("cosmetics.emote_fog_gg_name") shopDescription: i18next.t("cosmetics.emote_fog_gg_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_frustrated] = { id: Emote.emote_fog_frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_frustrated.img rsx: RSX.emote_fog_frustrated name: i18next.t("cosmetics.emote_fog_sweat_name") shopDescription: i18next.t("cosmetics.emote_fog_sweat_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_happy] = { id: Emote.emote_fog_happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_happy.img rsx: RSX.emote_fog_happy name: i18next.t("cosmetics.emote_fog_happy_name") shopDescription: i18next.t("cosmetics.emote_fog_happy_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sad] = { id: Emote.emote_fog_sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sad.img rsx: RSX.emote_fog_sad name: i18next.t("cosmetics.emote_fog_cry_name") shopDescription: i18next.t("cosmetics.emote_fog_cry_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sleep] = { id: Emote.emote_fog_sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sleep.img rsx: RSX.emote_fog_sleep name: i18next.t("cosmetics.emote_fog_sleep_name") shopDescription: i18next.t("cosmetics.emote_fog_sleep_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sunglasses] = { id: Emote.emote_fog_sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sunglasses.img rsx: RSX.emote_fog_sunglasses name: i18next.t("cosmetics.emote_fog_smile_name") shopDescription: i18next.t("cosmetics.emote_fog_smile_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_surprised] = { id: Emote.emote_fog_surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_surprised.img rsx: RSX.emote_fog_surprised name: i18next.t("cosmetics.emote_fog_surprised_name") shopDescription: i18next.t("cosmetics.emote_fog_surprised_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_taunt_alt] = { id: Emote.emote_fog_taunt_alt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_taunt_alt.img rsx: RSX.emote_fog_taunt_alt name: i18next.t("cosmetics.emote_fog_kiss_name") shopDescription: i18next.t("cosmetics.emote_fog_kiss_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_taunt] = { id: Emote.emote_fog_taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_taunt.img rsx: RSX.emote_fog_taunt name: i18next.t("cosmetics.emote_fog_wink_name") shopDescription: i18next.t("cosmetics.emote_fog_wink_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } # endregion NEUTRAL # region FACTION 1 cos[Emote.Faction1Taunt] = { id: Emote.Faction1Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_taunt.img rsx: RSX.emote_f1_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Angry] = { id: Emote.Faction1Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_angry.img rsx: RSX.emote_f1_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Confused] = { id: Emote.Faction1Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_confused.img rsx: RSX.emote_f1_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sad] = { id: Emote.Faction1Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sad.img rsx: RSX.emote_f1_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Frustrated] = { id: Emote.Faction1Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_frustrated.img rsx: RSX.emote_f1_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Surprised] = { id: Emote.Faction1Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_surprised.img rsx: RSX.emote_f1_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Bow] = { id: Emote.Faction1Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_bow.img rsx: RSX.emote_f1_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sleep] = { id: Emote.Faction1Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sleep.img rsx: RSX.emote_f1_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sunglasses] = { id: Emote.Faction1Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sunglasses.img rsx: RSX.emote_f1_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Happy] = { id: Emote.Faction1Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_basic_happy.img rsx: RSX.emote_basic_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: false } cos[Emote.Faction1Kiss] = { id: Emote.Faction1Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_kiss.img rsx: RSX.emote_f1_kiss title: "Kiss" name: i18next.t("cosmetics.emote_argeon_love_name") shopDescription: i18next.t("cosmetics.emote_argeon_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } # endregion FACTION 1 # region FACTION 2 cos[Emote.Faction2Taunt] = { id: Emote.Faction2Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_taunt.img rsx: RSX.emote_f2_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Happy] = { id: Emote.Faction2Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_happy.img rsx: RSX.emote_f2_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Confused] = { id: Emote.Faction2Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_confused.img rsx: RSX.emote_f2_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sad] = { id: Emote.Faction2Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sad.img rsx: RSX.emote_f2_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Frustrated] = { id: Emote.Faction2Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_frustrated.img rsx: RSX.emote_f2_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Surprised] = { id: Emote.Faction2Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_surprised.img rsx: RSX.emote_f2_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Bow] = { id: Emote.Faction2Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_bow.img rsx: RSX.emote_f2_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sleep] = { id: Emote.Faction2Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sleep.img rsx: RSX.emote_f2_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sunglasses] = { id: Emote.Faction2Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sunglasses.img rsx: RSX.emote_f2_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Angry] = { id: Emote.Faction2Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_basic_angry.img rsx: RSX.emote_basic_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: false } cos[Emote.Faction2Kiss] = { id: Emote.Faction2Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_kiss.img rsx: RSX.emote_f2_kiss title: "Kiss" name: i18next.t("cosmetics.emote_kaleos_love_name") shopDescription: i18next.t("cosmetics.emote_kaleos_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } # endregion FACTION 2 # region FACTION 3 cos[Emote.Faction3Taunt] = { id: Emote.Faction3Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_taunt.img rsx: RSX.emote_f3_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Happy] = { id: Emote.Faction3Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_happy.img rsx: RSX.emote_f3_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Angry] = { id: Emote.Faction3Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_angry.img rsx: RSX.emote_f3_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sad] = { id: Emote.Faction3Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sad.img rsx: RSX.emote_f3_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Frustrated] = { id: Emote.Faction3Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_frustrated.img rsx: RSX.emote_f3_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Surprised] = { id: Emote.Faction3Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_surprised.img rsx: RSX.emote_f3_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Bow] = { id: Emote.Faction3Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_bow.img rsx: RSX.emote_f3_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sleep] = { id: Emote.Faction3Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sleep.img rsx: RSX.emote_f3_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sunglasses] = { id: Emote.Faction3Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sunglasses.img rsx: RSX.emote_f3_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Confused] = { id: Emote.Faction3Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_basic_confused.img rsx: RSX.emote_basic_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: false } cos[Emote.Faction3Kiss] = { id: Emote.Faction3Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_kiss.img rsx: RSX.emote_f3_kiss title: "Kiss" name: i18next.t("cosmetics.emote_zirix_love_name") shopDescription: i18next.t("cosmetics.emote_zirix_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } # endregion FACTION 3 # region FACTION 4 cos[Emote.Faction4Taunt] = { id: Emote.Faction4Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_taunt.img rsx: RSX.emote_f4_teal_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Happy] = { id: Emote.Faction4Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_happy.img rsx: RSX.emote_f4_teal_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Angry] = { id: Emote.Faction4Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_angry.img rsx: RSX.emote_f4_teal_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Confused] = { id: Emote.Faction4Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_confused.img rsx: RSX.emote_f4_teal_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sad] = { id: Emote.Faction4Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sad.img rsx: RSX.emote_f4_teal_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Surprised] = { id: Emote.Faction4Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_surprised.img rsx: RSX.emote_f4_teal_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Bow] = { id: Emote.Faction4Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_bow.img rsx: RSX.emote_f4_teal_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sleep] = { id: Emote.Faction4Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sleep.img rsx: RSX.emote_f4_teal_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sunglasses] = { id: Emote.Faction4Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sunglasses.img rsx: RSX.emote_f4_teal_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Frustrated] = { id: Emote.Faction4Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_frustrated.img rsx: RSX.emote_f4_teal_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: false } cos[Emote.Faction4Kiss] = { id: Emote.Faction4Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_kiss.img rsx: RSX.emote_f4_teal_kiss title: "Kiss" name: i18next.t("cosmetics.emote_lilithe_love_name") shopDescription: i18next.t("cosmetics.emote_lilithe_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } # endregion FACTION 4 # region FACTION 5 cos[Emote.Faction5Taunt] = { id: Emote.Faction5Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_taunt.img rsx: RSX.emote_f5_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Happy] = { id: Emote.Faction5Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_happy.img rsx: RSX.emote_f5_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Angry] = { id: Emote.Faction5Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_angry.img rsx: RSX.emote_f5_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Confused] = { id: Emote.Faction5Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_confused.img rsx: RSX.emote_f5_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Frustrated] = { id: Emote.Faction5Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_frustrated.img rsx: RSX.emote_f5_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Surprised] = { id: Emote.Faction5Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_surprised.img rsx: RSX.emote_f5_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Bow] = { id: Emote.Faction5Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_bow.img rsx: RSX.emote_f5_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sleep] = { id: Emote.Faction5Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_sleep.img rsx: RSX.emote_f5_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sunglasses] = { id: Emote.Faction5Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_sunglasses.img rsx: RSX.emote_f5_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sad] = { id: Emote.Faction5Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_basic_sad.img rsx: RSX.emote_basic_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: false } cos[Emote.Faction5Kiss] = { id: Emote.Faction5Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_kiss.img rsx: RSX.emote_f5_kiss title: "Kiss" name: i18next.t("cosmetics.emote_vaath_love_name") shopDescription: i18next.t("cosmetics.emote_vaath_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } # endregion FACTION 5 # region FACTION 6 cos[Emote.Faction6Frustrated] = { id: Emote.Faction6Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_frustrated.img rsx: RSX.emote_f6_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Happy] = { id: Emote.Faction6Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_happy.img rsx: RSX.emote_f6_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Angry] = { id: Emote.Faction6Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_angry.img rsx: RSX.emote_f6_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Confused] = { id: Emote.Faction6Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_confused.img rsx: RSX.emote_f6_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sad] = { id: Emote.Faction6Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sad.img rsx: RSX.emote_f6_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Surprised] = { id: Emote.Faction6Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_surprised.img rsx: RSX.emote_f6_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Bow] = { id: Emote.Faction6Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_bow.img rsx: RSX.emote_f6_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sleep] = { id: Emote.Faction6Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sleep.img rsx: RSX.emote_f6_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sunglasses] = { id: Emote.Faction6Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sunglasses.img rsx: RSX.emote_f6_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Taunt] = { id: Emote.Faction6Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_taunt.img rsx: RSX.emote_f6_taunt title: "Taunt" name: i18next.t("cosmetics.emote_faie_love_name") shopDescription: i18next.t("cosmetics.emote_faie_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Kiss] = { id: Emote.Faction6Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_basic_kiss.img rsx: RSX.emote_basic_kiss title: "Kiss" name: i18next.t("cosmetics.emote_faie_kiss_name") shopDescription: i18next.t("cosmetics.emote_faie_kiss_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: false } # endregion FACTION 6 # region ALT GENERALS # region FACTION 1 ALT cos[Emote.Faction1AltTaunt] = { id: Emote.Faction1AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_taunt.img rsx: RSX.emote_f1_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ziran_wink_name") shopDescription: i18next.t("cosmetics.emote_ziran_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltAngry] = { id: Emote.Faction1AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_angry.img rsx: RSX.emote_f1_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_ziran_angry_name") shopDescription: i18next.t("cosmetics.emote_ziran_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltConfused] = { id: Emote.Faction1AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_confused.img rsx: RSX.emote_f1_alt_confused name: i18next.t("cosmetics.emote_ziran_confused_name") shopDescription: i18next.t("cosmetics.emote_ziran_confused_desc") shopDescription: "Umm..." emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSad] = { id: Emote.Faction1AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sad.img rsx: RSX.emote_f1_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_ziran_crying_name") shopDescription: i18next.t("cosmetics.emote_ziran_crying_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltFrustrated] = { id: Emote.Faction1AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_frustrated.img rsx: RSX.emote_f1_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ziran_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ziran_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSurprised] = { id: Emote.Faction1AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_surprised.img rsx: RSX.emote_f1_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ziran_surprised_name") shopDescription: i18next.t("cosmetics.emote_ziran_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltBow] = { id: Emote.Faction1AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_bow.img rsx: RSX.emote_f1_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_ziran_bow_name") shopDescription: i18next.t("cosmetics.emote_ziran_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSleep] = { id: Emote.Faction1AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sleep.img rsx: RSX.emote_f1_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ziran_sleep_name") shopDescription: i18next.t("cosmetics.emote_ziran_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSunglasses] = { id: Emote.Faction1AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sunglasses.img rsx: RSX.emote_f1_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ziran_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ziran_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltHappy] = { id: Emote.Faction1AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_happy.img rsx: RSX.emote_f1_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_ziran_happy_name") shopDescription: i18next.t("cosmetics.emote_ziran_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltKiss] = { id: Emote.Faction1AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_kiss.img rsx: RSX.emote_f1_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ziran_love_name") shopDescription: i18next.t("cosmetics.emote_ziran_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } # endregion FACTION 1 ALT # region FACTION 2 ALT cos[Emote.Faction2AltTaunt] = { id: Emote.Faction2AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_taunt.img rsx: RSX.emote_f2_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_reva_wink_name") shopDescription: i18next.t("cosmetics.emote_reva_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltHappy] = { id: Emote.Faction2AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_happy.img rsx: RSX.emote_f2_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_reva_happy_name") shopDescription: i18next.t("cosmetics.emote_reva_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltConfused] = { id: Emote.Faction2AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_confused.img rsx: RSX.emote_f2_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_reva_confused_name") shopDescription: i18next.t("cosmetics.emote_reva_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSad] = { id: Emote.Faction2AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sad.img rsx: RSX.emote_f2_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_reva_sad_name") shopDescription: i18next.t("cosmetics.emote_reva_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltFrustrated] = { id: Emote.Faction2AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_frustrated.img rsx: RSX.emote_f2_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_reva_frustrated_name") shopDescription: i18next.t("cosmetics.emote_reva_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSurprised] = { id: Emote.Faction2AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_surprised.img rsx: RSX.emote_f2_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_reva_surprised_name") shopDescription: i18next.t("cosmetics.emote_reva_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltBow] = { id: Emote.Faction2AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_bow.img rsx: RSX.emote_f2_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_reva_bow_name") shopDescription: i18next.t("cosmetics.emote_reva_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSleep] = { id: Emote.Faction2AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sleep.img rsx: RSX.emote_f2_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_reva_sleep_name") shopDescription: i18next.t("cosmetics.emote_reva_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSunglasses] = { id: Emote.Faction2AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sunglasses.img rsx: RSX.emote_f2_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_reva_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_reva_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltAngry] = { id: Emote.Faction2AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_angry.img rsx: RSX.emote_f2_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_reva_angry_name") shopDescription: i18next.t("cosmetics.emote_reva_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltKiss] = { id: Emote.Faction2AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_kiss.img rsx: RSX.emote_f2_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_reva_love_name") shopDescription: i18next.t("cosmetics.emote_reva_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } # endregion FACTION 2 ALT # region FACTION 3 ALT cos[Emote.Faction3AltTaunt] = { id: Emote.Faction3AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_taunt.img rsx: RSX.emote_f3_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_sajj_wink_name") shopDescription: i18next.t("cosmetics.emote_sajj_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltHappy] = { id: Emote.Faction3AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_happy.img rsx: RSX.emote_f3_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_sajj_happy_name") shopDescription: i18next.t("cosmetics.emote_sajj_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltAngry] = { id: Emote.Faction3AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_angry.img rsx: RSX.emote_f3_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_sajj_angry_name") shopDescription: i18next.t("cosmetics.emote_sajj_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSad] = { id: Emote.Faction3AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sad.img rsx: RSX.emote_f3_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_sajj_sad_name") shopDescription: i18next.t("cosmetics.emote_sajj_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltFrustrated] = { id: Emote.Faction3AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_frustrated.img rsx: RSX.emote_f3_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_sajj_frustrated_name") shopDescription: i18next.t("cosmetics.emote_sajj_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSurprised] = { id: Emote.Faction3AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_surprised.img rsx: RSX.emote_f3_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_sajj_surprised_name") shopDescription: i18next.t("cosmetics.emote_sajj_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltBow] = { id: Emote.Faction3AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_bow.img rsx: RSX.emote_f3_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_sajj_bow_name") shopDescription: i18next.t("cosmetics.emote_sajj_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSleep] = { id: Emote.Faction3AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sleep.img rsx: RSX.emote_f3_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_sajj_sleep_name") shopDescription: i18next.t("cosmetics.emote_sajj_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSunglasses] = { id: Emote.Faction3AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sunglasses.img rsx: RSX.emote_f3_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_sajj_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_sajj_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltConfused] = { id: Emote.Faction3AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_confused.img rsx: RSX.emote_f3_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_sajj_confused_name") shopDescription: i18next.t("cosmetics.emote_sajj_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltKiss] = { id: Emote.Faction3AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_kiss.img rsx: RSX.emote_f3_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_sajj_love_name") shopDescription: i18next.t("cosmetics.emote_sajj_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } # endregion FACTION 3 ALT # region FACTION 4 ALT cos[Emote.Faction4AltTaunt] = { id: Emote.Faction4AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_taunt.img rsx: RSX.emote_f4_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_cassyva_wink_name") shopDescription: i18next.t("cosmetics.emote_cassyva_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltHappy] = { id: Emote.Faction4AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_happy.img rsx: RSX.emote_f4_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_cassyva_happy_name") shopDescription: i18next.t("cosmetics.emote_cassyva_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltAngry] = { id: Emote.Faction4AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_angry.img rsx: RSX.emote_f4_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_cassyva_angry_name") shopDescription: i18next.t("cosmetics.emote_cassyva_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltConfused] = { id: Emote.Faction4AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_confused.img rsx: RSX.emote_f4_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_cassyva_confused_name") shopDescription: i18next.t("cosmetics.emote_cassyva_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSad] = { id: Emote.Faction4AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sad.img rsx: RSX.emote_f4_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_cassyva_sad_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSurprised] = { id: Emote.Faction4AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_surprised.img rsx: RSX.emote_f4_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_cassyva_surprised_name") shopDescription: i18next.t("cosmetics.emote_cassyva_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltBow] = { id: Emote.Faction4AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_bow.img rsx: RSX.emote_f4_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_cassyva_bow_name") shopDescription: i18next.t("cosmetics.emote_cassyva_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSleep] = { id: Emote.Faction4AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sleep.img rsx: RSX.emote_f4_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_cassyva_sleep_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSunglasses] = { id: Emote.Faction4AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sunglasses.img rsx: RSX.emote_f4_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_cassyva_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltFrustrated] = { id: Emote.Faction4AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_frustrated.img rsx: RSX.emote_f4_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_cassyva_frustrated_name") shopDescription: i18next.t("cosmetics.emote_cassyva_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltKiss] = { id: Emote.Faction4AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_kiss.img rsx: RSX.emote_f4_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_cassyva_love_name") shopDescription: i18next.t("cosmetics.emote_cassyva_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } # endregion FACTION 4 ALT # region FACTION 5 ALT cos[Emote.Faction5AltTaunt] = { id: Emote.Faction5AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_taunt.img rsx: RSX.emote_f5_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_starhorn_wink_name") shopDescription: i18next.t("cosmetics.emote_starhorn_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltHappy] = { id: Emote.Faction5AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_happy.img rsx: RSX.emote_f5_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_starhorn_happy_name") shopDescription: i18next.t("cosmetics.emote_starhorn_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltAngry] = { id: Emote.Faction5AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_angry.img rsx: RSX.emote_f5_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_starhorn_angry_name") shopDescription: i18next.t("cosmetics.emote_starhorn_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltConfused] = { id: Emote.Faction5AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_confused.img rsx: RSX.emote_f5_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_starhorn_confused_name") shopDescription: i18next.t("cosmetics.emote_starhorn_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltFrustrated] = { id: Emote.Faction5AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_frustrated.img rsx: RSX.emote_f5_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_starhorn_frustrated_name") shopDescription: i18next.t("cosmetics.emote_starhorn_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSurprised] = { id: Emote.Faction5AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_surprised.img rsx: RSX.emote_f5_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_starhorn_surprised_name") shopDescription: i18next.t("cosmetics.emote_starhorn_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltBow] = { id: Emote.Faction5AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_bow.img rsx: RSX.emote_f5_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_starhorn_bow_name") shopDescription: i18next.t("cosmetics.emote_starhorn_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSleep] = { id: Emote.Faction5AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sleep.img rsx: RSX.emote_f5_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_starhorn_sleep_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSunglasses] = { id: Emote.Faction5AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sunglasses.img rsx: RSX.emote_f5_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_starhorn_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSad] = { id: Emote.Faction5AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sad.img rsx: RSX.emote_f5_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_starhorn_sad_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltKiss] = { id: Emote.Faction5AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_kiss.img rsx: RSX.emote_f5_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_starhorn_love_name") shopDescription: i18next.t("cosmetics.emote_starhorn_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } # endregion FACTION 5 ALT # region FACTION 6 ALT cos[Emote.Faction6AltFrustrated] = { id: Emote.Faction6AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_frustrated.img rsx: RSX.emote_f6_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_kara_frustrated_name") shopDescription: i18next.t("cosmetics.emote_kara_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltHappy] = { id: Emote.Faction6AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_happy.img rsx: RSX.emote_f6_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_kara_happy_name") shopDescription: i18next.t("cosmetics.emote_kara_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltAngry] = { id: Emote.Faction6AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_angry.img rsx: RSX.emote_f6_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_kara_angry_name") shopDescription: i18next.t("cosmetics.emote_kara_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltConfused] = { id: Emote.Faction6AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_confused.img rsx: RSX.emote_f6_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_kara_confused_name") shopDescription: i18next.t("cosmetics.emote_kara_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSad] = { id: Emote.Faction6AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sad.img rsx: RSX.emote_f6_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_kara_sad_name") shopDescription: i18next.t("cosmetics.emote_kara_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSurprised] = { id: Emote.Faction6AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_surprised.img rsx: RSX.emote_f6_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_kara_surprised_name") shopDescription: i18next.t("cosmetics.emote_kara_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltBow] = { id: Emote.Faction6AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_bow.img rsx: RSX.emote_f6_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_kara_bow_name") shopDescription: i18next.t("cosmetics.emote_kara_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSleep] = { id: Emote.Faction6AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sleep.img rsx: RSX.emote_f6_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_kara_sleep_name") shopDescription: i18next.t("cosmetics.emote_kara_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSunglasses] = { id: Emote.Faction6AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sunglasses.img rsx: RSX.emote_f6_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_kara_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_kara_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltTaunt] = { id: Emote.Faction6AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_taunt.img rsx: RSX.emote_f6_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_kara_wink_name") shopDescription: i18next.t("cosmetics.emote_kara_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltKiss] = { id: Emote.Faction6AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_kiss.img rsx: RSX.emote_f6_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_kara_love_name") shopDescription: i18next.t("cosmetics.emote_kara_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } # endregion FACTION 6 ALT # endregion ALT GENERALS # region THIRD GENERALS # region FACTION 1 THIRD cos[Emote.Faction1ThirdTaunt] = { id: Emote.Faction1ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_taunt.img rsx: RSX.emote_f1_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_brome_wink_name") shopDescription: i18next.t("cosmetics.emote_brome_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdAngry] = { id: Emote.Faction1ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_angry.img rsx: RSX.emote_f1_third_angry title: "Angry" name: i18next.t("cosmetics.emote_brome_angry_name") shopDescription: i18next.t("cosmetics.emote_brome_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdConfused] = { id: Emote.Faction1ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_confused.img rsx: RSX.emote_f1_third_confused name: i18next.t("cosmetics.emote_brome_confused_name") shopDescription: i18next.t("cosmetics.emote_brome_confused_desc") shopDescription: "Umm..." emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSad] = { id: Emote.Faction1ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sad.img rsx: RSX.emote_f1_third_sad title: "Sad" name: i18next.t("cosmetics.emote_brome_crying_name") shopDescription: i18next.t("cosmetics.emote_brome_crying_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdFrustrated] = { id: Emote.Faction1ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_frustrated.img rsx: RSX.emote_f1_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_brome_frustrated_name") shopDescription: i18next.t("cosmetics.emote_brome_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSurprised] = { id: Emote.Faction1ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_surprised.img rsx: RSX.emote_f1_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_brome_surprised_name") shopDescription: i18next.t("cosmetics.emote_brome_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdBow] = { id: Emote.Faction1ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_bow.img rsx: RSX.emote_f1_third_bow title: "Bow" name: i18next.t("cosmetics.emote_brome_bow_name") shopDescription: i18next.t("cosmetics.emote_brome_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSleep] = { id: Emote.Faction1ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sleep.img rsx: RSX.emote_f1_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_brome_sleep_name") shopDescription: i18next.t("cosmetics.emote_brome_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSunglasses] = { id: Emote.Faction1ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sunglasses.img rsx: RSX.emote_f1_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_brome_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_brome_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdHappy] = { id: Emote.Faction1ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_happy.img rsx: RSX.emote_f1_third_happy title: "Happy" name: i18next.t("cosmetics.emote_brome_happy_name") shopDescription: i18next.t("cosmetics.emote_brome_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdKiss] = { id: Emote.Faction1ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_kiss.img rsx: RSX.emote_f1_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_brome_love_name") shopDescription: i18next.t("cosmetics.emote_brome_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 1 THIRD # region FACTION 2 THIRD cos[Emote.Faction2ThirdTaunt] = { id: Emote.Faction2ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_taunt.img rsx: RSX.emote_f2_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_shidai_wink_name") shopDescription: i18next.t("cosmetics.emote_shidai_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdHappy] = { id: Emote.Faction2ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_happy.img rsx: RSX.emote_f2_third_happy title: "Happy" name: i18next.t("cosmetics.emote_shidai_happy_name") shopDescription: i18next.t("cosmetics.emote_shidai_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdConfused] = { id: Emote.Faction2ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_confused.img rsx: RSX.emote_f2_third_confused title: "Confused" name: i18next.t("cosmetics.emote_shidai_confused_name") shopDescription: i18next.t("cosmetics.emote_shidai_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSad] = { id: Emote.Faction2ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sad.img rsx: RSX.emote_f2_third_sad title: "Sad" name: i18next.t("cosmetics.emote_shidai_sad_name") shopDescription: i18next.t("cosmetics.emote_shidai_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdFrustrated] = { id: Emote.Faction2ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_frustrated.img rsx: RSX.emote_f2_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_shidai_frustrated_name") shopDescription: i18next.t("cosmetics.emote_shidai_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSurprised] = { id: Emote.Faction2ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_surprised.img rsx: RSX.emote_f2_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_shidai_surprised_name") shopDescription: i18next.t("cosmetics.emote_shidai_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdBow] = { id: Emote.Faction2ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_bow.img rsx: RSX.emote_f2_third_bow title: "Bow" name: i18next.t("cosmetics.emote_shidai_bow_name") shopDescription: i18next.t("cosmetics.emote_shidai_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSleep] = { id: Emote.Faction2ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sleep.img rsx: RSX.emote_f2_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_shidai_sleep_name") shopDescription: i18next.t("cosmetics.emote_shidai_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSunglasses] = { id: Emote.Faction2ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sunglasses.img rsx: RSX.emote_f2_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_shidai_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_shidai_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdAngry] = { id: Emote.Faction2ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_angry.img rsx: RSX.emote_f2_third_angry title: "Angry" name: i18next.t("cosmetics.emote_shidai_angry_name") shopDescription: i18next.t("cosmetics.emote_shidai_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdKiss] = { id: Emote.Faction2ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_kiss.img rsx: RSX.emote_f2_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_shidai_love_name") shopDescription: i18next.t("cosmetics.emote_shidai_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 2 THIRD # region FACTION 3 THIRD cos[Emote.Faction3ThirdTaunt] = { id: Emote.Faction3ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_taunt.img rsx: RSX.emote_f3_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ciphyron_wink_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdHappy] = { id: Emote.Faction3ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_happy.img rsx: RSX.emote_f3_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ciphyron_happy_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdAngry] = { id: Emote.Faction3ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_angry.img rsx: RSX.emote_f3_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ciphyron_angry_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSad] = { id: Emote.Faction3ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sad.img rsx: RSX.emote_f3_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ciphyron_sad_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdFrustrated] = { id: Emote.Faction3ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_frustrated.img rsx: RSX.emote_f3_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ciphyron_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSurprised] = { id: Emote.Faction3ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_surprised.img rsx: RSX.emote_f3_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ciphyron_surprised_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdBow] = { id: Emote.Faction3ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_bow.img rsx: RSX.emote_f3_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ciphyron_bow_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSleep] = { id: Emote.Faction3ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sleep.img rsx: RSX.emote_f3_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ciphyron_sleep_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSunglasses] = { id: Emote.Faction3ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sunglasses.img rsx: RSX.emote_f3_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ciphyron_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdConfused] = { id: Emote.Faction3ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_confused.img rsx: RSX.emote_f3_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ciphyron_confused_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdKiss] = { id: Emote.Faction3ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_kiss.img rsx: RSX.emote_f3_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ciphyron_love_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 3 THIRD # region FACTION 4 THIRD cos[Emote.Faction4ThirdTaunt] = { id: Emote.Faction4ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_taunt.img rsx: RSX.emote_f4_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_maehv_wink_name") shopDescription: i18next.t("cosmetics.emote_maehv_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdHappy] = { id: Emote.Faction4ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_happy.img rsx: RSX.emote_f4_third_happy title: "Happy" name: i18next.t("cosmetics.emote_maehv_happy_name") shopDescription: i18next.t("cosmetics.emote_maehv_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdAngry] = { id: Emote.Faction4ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_angry.img rsx: RSX.emote_f4_third_angry title: "Angry" name: i18next.t("cosmetics.emote_maehv_angry_name") shopDescription: i18next.t("cosmetics.emote_maehv_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdConfused] = { id: Emote.Faction4ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_confused.img rsx: RSX.emote_f4_third_confused title: "Confused" name: i18next.t("cosmetics.emote_maehv_confused_name") shopDescription: i18next.t("cosmetics.emote_maehv_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSad] = { id: Emote.Faction4ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sad.img rsx: RSX.emote_f4_third_sad title: "Sad" name: i18next.t("cosmetics.emote_maehv_sad_name") shopDescription: i18next.t("cosmetics.emote_maehv_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSurprised] = { id: Emote.Faction4ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_surprised.img rsx: RSX.emote_f4_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_maehv_surprised_name") shopDescription: i18next.t("cosmetics.emote_maehv_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdBow] = { id: Emote.Faction4ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_bow.img rsx: RSX.emote_f4_third_bow title: "Bow" name: i18next.t("cosmetics.emote_maehv_bow_name") shopDescription: i18next.t("cosmetics.emote_maehv_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSleep] = { id: Emote.Faction4ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sleep.img rsx: RSX.emote_f4_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_maehv_sleep_name") shopDescription: i18next.t("cosmetics.emote_maehv_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSunglasses] = { id: Emote.Faction4ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sunglasses.img rsx: RSX.emote_f4_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_maehv_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_maehv_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdFrustrated] = { id: Emote.Faction4ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_frustrated.img rsx: RSX.emote_f4_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_maehv_frustrated_name") shopDescription: i18next.t("cosmetics.emote_maehv_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdKiss] = { id: Emote.Faction4ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_kiss.img rsx: RSX.emote_f4_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_maehv_love_name") shopDescription: i18next.t("cosmetics.emote_maehv_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 4 THIRD # region FACTION 5 THIRD cos[Emote.Faction5ThirdTaunt] = { id: Emote.Faction5ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_taunt.img rsx: RSX.emote_f5_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ragnora_wink_name") shopDescription: i18next.t("cosmetics.emote_ragnora_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdHappy] = { id: Emote.Faction5ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_happy.img rsx: RSX.emote_f5_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ragnora_happy_name") shopDescription: i18next.t("cosmetics.emote_ragnora_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdAngry] = { id: Emote.Faction5ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_angry.img rsx: RSX.emote_f5_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ragnora_angry_name") shopDescription: i18next.t("cosmetics.emote_ragnora_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdConfused] = { id: Emote.Faction5ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_confused.img rsx: RSX.emote_f5_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ragnora_confused_name") shopDescription: i18next.t("cosmetics.emote_ragnora_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdFrustrated] = { id: Emote.Faction5ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_frustrated.img rsx: RSX.emote_f5_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ragnora_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ragnora_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSurprised] = { id: Emote.Faction5ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_surprised.img rsx: RSX.emote_f5_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ragnora_surprised_name") shopDescription: i18next.t("cosmetics.emote_ragnora_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdBow] = { id: Emote.Faction5ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_bow.img rsx: RSX.emote_f5_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ragnora_bow_name") shopDescription: i18next.t("cosmetics.emote_ragnora_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSleep] = { id: Emote.Faction5ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sleep.img rsx: RSX.emote_f5_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ragnora_sleep_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSunglasses] = { id: Emote.Faction5ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sunglasses.img rsx: RSX.emote_f5_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ragnora_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSad] = { id: Emote.Faction5ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sad.img rsx: RSX.emote_f5_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ragnora_sad_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdKiss] = { id: Emote.Faction5ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_kiss.img rsx: RSX.emote_f5_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ragnora_love_name") shopDescription: i18next.t("cosmetics.emote_ragnora_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 5 THIRD # region FACTION 6 THIRD cos[Emote.Faction6ThirdFrustrated] = { id: Emote.Faction6ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_frustrated.img rsx: RSX.emote_f6_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ilena_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ilena_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdHappy] = { id: Emote.Faction6ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_happy.img rsx: RSX.emote_f6_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ilena_happy_name") shopDescription: i18next.t("cosmetics.emote_ilena_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdAngry] = { id: Emote.Faction6ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_angry.img rsx: RSX.emote_f6_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ilena_angry_name") shopDescription: i18next.t("cosmetics.emote_ilena_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdConfused] = { id: Emote.Faction6ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_confused.img rsx: RSX.emote_f6_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ilena_confused_name") shopDescription: i18next.t("cosmetics.emote_ilena_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSad] = { id: Emote.Faction6ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sad.img rsx: RSX.emote_f6_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ilena_sad_name") shopDescription: i18next.t("cosmetics.emote_ilena_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSurprised] = { id: Emote.Faction6ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_surprised.img rsx: RSX.emote_f6_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ilena_surprised_name") shopDescription: i18next.t("cosmetics.emote_ilena_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdBow] = { id: Emote.Faction6ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_bow.img rsx: RSX.emote_f6_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ilena_bow_name") shopDescription: i18next.t("cosmetics.emote_ilena_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSleep] = { id: Emote.Faction6ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sleep.img rsx: RSX.emote_f6_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ilena_sleep_name") shopDescription: i18next.t("cosmetics.emote_ilena_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSunglasses] = { id: Emote.Faction6ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sunglasses.img rsx: RSX.emote_f6_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ilena_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ilena_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdTaunt] = { id: Emote.Faction6ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_taunt.img rsx: RSX.emote_f6_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ilena_wink_name") shopDescription: i18next.t("cosmetics.emote_ilena_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdKiss] = { id: Emote.Faction6ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_kiss.img rsx: RSX.emote_f6_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ilena_love_name") shopDescription: i18next.t("cosmetics.emote_ilena_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 6 THIRD # endregion THIRD GENERALS # endregion emotes # region Battlemaps cos[BattleMap.Magmar] = { id: BattleMap.Magmar typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_magmar_name") shopDescription: i18next.t("cosmetics.battlemap_magmar_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_magmar.img rsx: RSX.shop_battle_map_magmar unlockable: false purchasable: true battleMapTemplateIndex: 7 } cos[BattleMap.Abyssian] = { id: BattleMap.Abyssian typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_abyssian_name") shopDescription: i18next.t("cosmetics.battlemap_abyssian_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_abyssian.img rsx: RSX.shop_battle_map_abyssian unlockable: false purchasable: true battleMapTemplateIndex: 8 } cos[BattleMap.Redrock] = { id: BattleMap.Redrock typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_redrock_name") shopDescription: i18next.t("cosmetics.battlemap_redrock_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_redrock.img rsx: RSX.shop_battle_map_redrock unlockable: false purchasable: true battleMapTemplateIndex: 9 } cos[BattleMap.Vanar] = { id: BattleMap.Vanar typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_vanar_name") shopDescription: i18next.t("cosmetics.battlemap_vanar_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_vanar.img rsx: RSX.shop_battle_map_vanar unlockable: false purchasable: true battleMapTemplateIndex: 10 } # endregion Battlemaps # endregion Cosmetics datas # Generate skus procedurally for cosmeticTypeKey,cosmeticsOfType of CosmeticsLookup if not cosmeticsOfType? or !_.isObject(cosmeticsOfType) continue cosmeticTypeId = CosmeticsTypeLookup[cosmeticTypeKey] if not cosmeticTypeId? continue for cosmeticKey,cosmeticId of cosmeticsOfType cosmeticData = cos[cosmeticId] if not cosmeticData? continue cosmeticData.sku = cosmeticTypeId + "-" + cosmeticKey + "-" + cosmeticId ## Generate default subTypes #for cosId,cosForSubtype of cos # if cosForSubtype.subType? # continue # if cosForSubtype.typeId == CosmeticsTypeLookup.Emote && cosForSubtype.factionId? # subType = "n/a" # if subType? # cosForSubtype.subType = subType # # cosForSubtype.subTypeId ?= "n/a" # setup caches CosmeticsFactory._cachedCosmetics = [] CosmeticsFactory._cachedCosmeticsForType = {} CosmeticsFactory._cachedCosmeticsForTypeAndFaction = {} CosmeticsFactory._cachedCosmeticsForTypeAndRarity = {} CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity = {} CosmeticsFactory._cachedCosmeticsForFaction = {} CosmeticsFactory._cachedCosmeticsForRarity = {} CosmeticsFactory._cachedCosmeticsForChestType = {} CosmeticsFactory._cachedCosmeticsForTypeAndSubType = {} CosmeticsFactory._cachedCosmeticSubTypesByType = {} CosmeticsFactory._cachedCardSkinsForCardId = {} CosmeticsFactory._cachedCardSkinIdsForCardId = {} # ensure that all cosmetic types, rarities, factions, and chest types have at least an empty array cosmeticTypes = Object.keys(CosmeticsTypeLookup) cosmeticChestTypes = Object.keys(CosmeticsChestTypeLookup) factionIds = Object.keys(Factions) rarityIds = Object.keys(Rarity) for cosmeticTypeKey in cosmeticTypes type = CosmeticsTypeLookup[cosmeticTypeKey] CosmeticsFactory._cachedCosmeticsForType[type] ?= [] CosmeticsFactory._cachedCosmeticSubTypesByType[type] ?= [] for factionIdKey in factionIds factionId = Factions[factionIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type][factionId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId][rarityId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type][rarityId] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type] ?= {} for factionIdKey in factionIds factionId = Factions[factionIdKey] CosmeticsFactory._cachedCosmeticsForFaction[factionId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForRarity[rarityId] ?= [] for cosmeticChestTypeKey in cosmeticChestTypes chestType = CosmeticsChestTypeLookup[cosmeticChestTypeKey] CosmeticsFactory._cachedCosmeticsForChestType[chestType] ?= [] # add all cosmetics to caches cosmeticIdKeys = Object.keys(CosmeticsFactory._cosmeticsById) for cosmeticIdKey of cosmeticIdKeys cosmeticId = cosmeticIdKeys[cosmeticIdKey] cosmeticData = CosmeticsFactory._cosmeticsById[cosmeticId] type = cosmeticData.typeId factionId = cosmeticData.factionId rarityId = cosmeticData.rarityId chestType = cosmeticData.chestType subType = cosmeticData.subTypeId CosmeticsFactory._cachedCosmetics.push(cosmeticData) if type? CosmeticsFactory._cachedCosmeticsForType[type].push(cosmeticData) if factionId? CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type][factionId].push(cosmeticData) if rarityId? CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type][rarityId].push(cosmeticData) if factionId? and rarityId? CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId][rarityId].push(cosmeticData) if subType? CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type][subType] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type][subType].push(cosmeticData) if not _.contains(CosmeticsFactory._cachedCosmeticSubTypesByType[type],subType) CosmeticsFactory._cachedCosmeticSubTypesByType[type].push(subType) if type == CosmeticsTypeLookup.CardSkin cardId = cosmeticData.cardId if cardId? CosmeticsFactory._cachedCardSkinsForCardId[cardId] ?= [] CosmeticsFactory._cachedCardSkinsForCardId[cardId].push(cosmeticData) CosmeticsFactory._cachedCardSkinIdsForCardId[cardId] ?= [] CosmeticsFactory._cachedCardSkinIdsForCardId[cardId].push(cosmeticData.id) if factionId? CosmeticsFactory._cachedCosmeticsForFaction[factionId].push(cosmeticData) if rarityId? CosmeticsFactory._cachedCosmeticsForRarity[rarityId].push(cosmeticData) if chestType? CosmeticsFactory._cachedCosmeticsForChestType[chestType].push(cosmeticData) # Generate default descriptions # TODO: Better language for shop descriptors _getEmotionDescriptor = (emoteOrder) -> if emoteOrder == EMOTE_ORDER_ANGRY return i18next.t("cosmetics.emote_anger") else if emoteOrder == EMOTE_ORDER_BOW return i18next.t("cosmetics.emote_respect") else if emoteOrder == EMOTE_ORDER_CONFUSED return i18next.t("cosmetics.emote_confusion") else if emoteOrder == EMOTE_ORDER_FRUSTRATED return i18next.t("cosmetics.emote_frustration") else if emoteOrder == EMOTE_ORDER_HAPPY return i18next.t("cosmetics.emote_happiness") else if emoteOrder == EMOTE_ORDER_SAD return i18next.t("cosmetics.emote_sadness") else if emoteOrder == EMOTE_ORDER_SLEEP return i18next.t("cosmetics.emote_impatience") else if emoteOrder == EMOTE_ORDER_SUNGLASSES return i18next.t("cosmetics.emote_style") else if emoteOrder == EMOTE_ORDER_SURPRISED return i18next.t("cosmetics.emote_surprise") else if emoteOrder == EMOTE_ORDER_TAUNT return i18next.t("cosmetics.emote_confidence") else if emoteOrder == EMOTE_ORDER_KISS return i18next.t("cosmetics.emote_love") else return i18next.t("cosmetics.emote_emotion") allCosForDesc = CosmeticsFactory.getAllCosmetics() for cosForDesc in allCosForDesc if cosForDesc.shopDescription? continue if cosForDesc.typeId == CosmeticsTypeLookup.CardBack cosForDesc.shopDescription = i18next.t("cosmetics.cardback_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.Scene cosForDesc.shopDescription = i18next.t("cosmetics.scene_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.ProfileIcon cosForDesc.shopDescription = i18next.t("cosmetics.icon_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.Emote generalDescriptor = "" if cosForDesc.generalId? if cosForDesc.generalId == Cards.Faction1.General then generalDescriptor = i18next.t("cosmetics.shop_emote_argeon") if cosForDesc.generalId == Cards.Faction1.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ziran") if cosForDesc.generalId == Cards.Faction1.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_brome") if cosForDesc.generalId == Cards.Faction2.General then generalDescriptor = i18next.t("cosmetics.shop_emote_kaleos") if cosForDesc.generalId == Cards.Faction2.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_reva") if cosForDesc.generalId == Cards.Faction2.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_shidai") if cosForDesc.generalId == Cards.Faction3.General then generalDescriptor = i18next.t("cosmetics.shop_emote_zirix") if cosForDesc.generalId == Cards.Faction3.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_sajj") if cosForDesc.generalId == Cards.Faction3.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ciphyron") if cosForDesc.generalId == Cards.Faction4.General then generalDescriptor = i18next.t("cosmetics.shop_emote_lilithe") if cosForDesc.generalId == Cards.Faction4.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_cassyva") if cosForDesc.generalId == Cards.Faction4.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_maehv") if cosForDesc.generalId == Cards.Faction5.General then generalDescriptor = i18next.t("cosmetics.shop_emote_vaath") if cosForDesc.generalId == Cards.Faction5.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_starhorn") if cosForDesc.generalId == Cards.Faction5.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ragnora") if cosForDesc.generalId == Cards.Faction6.General then generalDescriptor = i18next.t("cosmetics.shop_emote_faie") if cosForDesc.generalId == Cards.Faction6.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_kara") if cosForDesc.generalId == Cards.Faction6.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ilena") cosForDesc.shopDescription = i18next.t("cosmetics.shop_emote",{emote:_getEmotionDescriptor(cosForDesc.emoteOrder)},{general:generalDescriptor}) #cosForDesc.shopDescription = "Express your #{_getEmotionDescriptor(cosForDesc.emoteOrder)} in game#{generalDescriptor}" # Set default reward orders allCosForRewardOrder = CosmeticsFactory.getAllCosmetics() for cosForOrder in allCosForRewardOrder if not cosForOrder.rewardOrder? cosForOrder.rewardOrder = 0 module.exports = CosmeticsFactory
true
# do not add this file to any resource package # it is handled by special processing _ = require 'underscore' moment = require 'moment' RSX = require('app/data/resources') CosmeticsLookup = require './cosmeticsLookup' CosmeticsTypeLookup = require './cosmeticsTypeLookup' CosmeticsChestTypeLookup = require './cosmeticsChestTypeLookup' EmoteCategory = require './emoteCategory' Factions = require 'app/sdk/cards/factionsLookup' Rarity = require 'app/sdk/cards/rarityLookup' RarityFactory = require 'app/sdk/cards/rarityFactory' Cards = require 'app/sdk/cards/cardsLookup' i18next = require 'i18next' class CosmeticsFactory @_cosmeticsById: {} @cosmeticForIdentifier: (identifier) -> cosmeticData = @_cosmeticsById[identifier] if cosmeticData return cosmeticData @cosmeticForSku: (sku) -> cosmeticId = parseInt(sku.slice(sku.lastIndexOf("-")+1)) return @cosmeticForIdentifier(cosmeticId) @_cachedCosmetics: null @getAllCosmetics: () -> return @_cachedCosmetics @_cachedCosmeticsForType: null @cosmeticsForType: (cosmeticType) -> return @_cachedCosmeticsForType[cosmeticType] @_cachedCosmeticsForTypeAndFaction: null @cosmeticsForTypeAndFaction: (cosmeticType, factionId) -> return @_cachedCosmeticsForTypeAndFaction[cosmeticType][factionId] @_cachedCosmeticsForTypeAndRarity: null @cosmeticsForTypeAndRarity: (cosmeticType, rarityId) -> return @_cachedCosmeticsForTypeAndRarity[cosmeticType][rarityId] @_cachedCosmeticsForTypeAndFactionAndRarity: null @cosmeticsForTypeAndFactionAndRarity: (cosmeticType, factionId, rarityId) -> return @_cachedCosmeticsForTypeAndFactionAndRarity[cosmeticType][factionId][rarityId] @_cachedCosmeticsForFaction: null @cosmeticsForFaction: (factionId) -> return @_cachedCosmeticsForFaction[factionId] @_cachedCosmeticsForRarity: null @cosmeticsForRarity: (rarityId) -> return @_cachedCosmeticsForRarity[rarityId] @_cachedCosmeticsForChestType: null @cosmeticsForChestType: (chestType) -> return @_cachedCosmeticsForChestType[chestType] @_cachedCosmeticSubTypesByType: null @visibleCosmeticSubTypesForType: (cosmeticType) -> orderedSubTypes = [] # To do any manual ordering add a subtype to the if/else below, anything not in list will be appended if cosmeticType == CosmeticsTypeLookup.Emote orderedSubTypes = ["Lyonar","Songhai","Vetruvian","Abyssian","Magmar","Vanar","Neutral"] else if cosmeticType == CosmeticsTypeLookup.CardBack orderedSubTypes = [] else if cosmeticType == CosmeticsTypeLookup.ProfileIcon orderedSubTypes = ["Lyonar","Songhai","Vetruvian","Abyssian","Magmar","Vanar","Neutral"] else if cosmeticType == CosmeticsTypeLookup.Scene orderedSubTypes = [] # To hide a subtype, _.without it here # Append any subtypes that are not in the above list allSubtypesForType = @_cachedCosmeticSubTypesByType[cosmeticType] subTypesNotInOrderedList = _.difference(allSubtypesForType,orderedSubTypes) # Combine ordered and any missing subtypes visibleSubTypes = orderedSubTypes.concat(subTypesNotInOrderedList) return visibleSubTypes @_cachedLocalizedSubTypeTitles: null @localizedSubTypeTitle: (subTypeId) -> if not @_cachedLocalizedSubTypeTitles? @_cachedLocalizedSubTypeTitles = {} @_cachedLocalizedSubTypeTitles["all"] = i18next.t("shop.all_subcategories_title") @_cachedLocalizedSubTypeTitles["Lyonar"] = i18next.t("factions.faction_1_abbreviated_name") @_cachedLocalizedSubTypeTitles["Songhai"] = i18next.t("factions.faction_2_abbreviated_name") @_cachedLocalizedSubTypeTitles["Vetruvian"] = i18next.t("factions.faction_3_abbreviated_name") @_cachedLocalizedSubTypeTitles["Abyssian"] = i18next.t("factions.faction_4_abbreviated_name") @_cachedLocalizedSubTypeTitles["Magmar"] = i18next.t("factions.faction_5_abbreviated_name") @_cachedLocalizedSubTypeTitles["Vanar"] = i18next.t("factions.faction_6_abbreviated_name") @_cachedLocalizedSubTypeTitles["Neutral"] = i18next.t("factions.faction_neutral_abbreviated_name") @_cachedLocalizedSubTypeTitles["Emotes"] = i18next.t("shop.category_emotes_name") if @_cachedLocalizedSubTypeTitles[subTypeId]? return @_cachedLocalizedSubTypeTitles[subTypeId] else # console.warn "No localized string for subtype: " + subTypeId return subTypeId @_cachedCosmeticsForTypeAndSubType: null @cosmeticsForTypeAndSubtype: (type,subType) -> return @_cachedCosmeticsForTypeAndSubType[type][subType] @profileIconForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.ProfileIcon return cosmeticData else # return default profile icon return @cosmeticForIdentifier(@getDefaultProfileIconIdentifier()) @isIdentifierForProfileIcon: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.ProfileIcon @getDefaultProfileIconIdentifier: () -> return CosmeticsLookup.ProfileIcon.Tree @cardBackForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardBack return cosmeticData else # return default card back return @cosmeticForIdentifier(@getDefaultCardBackIdentifier()) @isIdentifierForCardBack: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardBack @getDefaultCardBackIdentifier: () -> return CosmeticsLookup.CardBack.Normal @sceneForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.Scene return cosmeticData else # return default card back return @cosmeticForIdentifier(@getDefaultSceneIdentifier()) @isIdentifierForScene: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.Scene @getDefaultSceneIdentifier: () -> return CosmeticsLookup.Scene.Frostfire @_cachedCardSkinsForCardId: null @cardSkinsForCard: (cardId) -> return @_cachedCardSkinsForCardId[cardId] || [] @_cachedCardSkinIdsForCardId: null @cardSkinIdsForCard: (cardId) -> return @_cachedCardSkinIdsForCardId[cardId] || [] @isIdentifierForCardSkin: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) return cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardSkin @injectSkinPropertiesIntoCard: (card, identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? and cosmeticData.typeId == CosmeticsTypeLookup.CardSkin # anim resource animResource = cosmeticData.animResource if animResource? then card.setBaseAnimResource(animResource) @cosmeticProductDataForIdentifier: (identifier) -> cosmeticData = @cosmeticForIdentifier(identifier) if cosmeticData? return @_mapCosmeticDataToProductData(cosmeticData) @cosmeticProductDataForType: (cosmeticType,cosmeticSubType) -> cosmeticDatas = null if cosmeticType? and not cosmeticSubType? cosmeticDatas = CosmeticsFactory.cosmeticsForType(cosmeticType) else if cosmeticType? and cosmeticSubType? cosmeticDatas = CosmeticsFactory.cosmeticsForTypeAndSubtype(cosmeticType,cosmeticSubType) else console.warn "No cosmetic type provided to CosmeticsFactory.cosmeticModelsForType" return [] cosmeticDatas = _.filter cosmeticDatas, (c)-> return c.purchasable && c.rarityId return _.map(cosmeticDatas,(cosmeticData) => return @_mapCosmeticDataToProductData(cosmeticData) ) @_mapCosmeticDataToProductData: (cosmeticData)-> rarityData = RarityFactory.rarityForIdentifier(cosmeticData.rarityId) cosmeticRSX = cosmeticData.rsx || {} cosmeticCoverRSX = cosmeticData.coverRSX || RSX.challenge_gate_010 cosmeticAnimResource = cosmeticData.animResource || {} return { id: cosmeticData.id sku: cosmeticData.sku steam_id: cosmeticData.id name: cosmeticData.name price: rarityData.cosmeticHardPrice rarity_id: cosmeticData.rarityId || Rarity.Common anim_resource: cosmeticAnimResource icon_image_url: cosmeticData.img icon_image_resource_name: cosmeticRSX.name cover_image_url: cosmeticCoverRSX.img cover_image_resource_name: cosmeticCoverRSX.name description: cosmeticData.shopDescription category_name: CosmeticsTypeLookup[cosmeticData.typeId] # TODO: player visible name category_id: cosmeticData.typeId sub_category_name: cosmeticData.subTypeId type: "cosmetic" faction_id: if !cosmeticData.factionId? or cosmeticData.factionId == Factions.Neutral then 0 else cosmeticData.factionId general_id: cosmeticData.generalId || 0 } @cosmeticResourcesForIdentifier: (identifier) -> resources = [] cosmeticData = @.cosmeticForIdentifier(identifier) if cosmeticData? if cosmeticData.rsx? then resources.push(cosmeticData.rsx) if cosmeticData.coverRSX? then resources.push(cosmeticData.coverRSX) if cosmeticData.glowOutlineRSX? then resources.push(cosmeticData.glowOutlineRSX) if cosmeticData.animResource? for animResourceKey in Object.keys(cosmeticData.animResource) animResourceName = cosmeticData.animResource[animResourceKey] if _.isString(animResourceName) rsx = RSX[animResourceName] if rsx? then resources.push(rsx) return resources @cosmeticProductAttrsForIdentifier: (identifier)-> cosmeticData = @.cosmeticForIdentifier(identifier) if cosmeticData return @._mapCosmeticDataToProductData(cosmeticData) else return null @cosmeticProductAttrsForSKU: (sku)-> cosmeticData = @.cosmeticForSku(sku) if cosmeticData return @._mapCosmeticDataToProductData(cosmeticData) else return null @nameForCosmeticTypeId: (cosmeticTypeId)-> if cosmeticTypeId == CosmeticsTypeLookup.Emote return "Emote" else if cosmeticTypeId == CosmeticsTypeLookup.CardBack return "Card Back" else if cosmeticTypeId == CosmeticsTypeLookup.ProfileIcon return "Profile Icon" else if cosmeticTypeId == CosmeticsTypeLookup.CardSkin return "Card Skin" else if cosmeticTypeId == CosmeticsTypeLookup.Scene return "Scene" else if cosmeticTypeId == CosmeticsTypeLookup.BattleMap return "Battle Map" else return null @nameForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return i18next.t("rarity.rarity_common") else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return i18next.t("rarity.rarity_rare") else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return i18next.t("rarity.rarity_epic") else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return i18next.t("mystery_crates.boss_crate_adjective") else if cosmeticCrateType == CosmeticsChestTypeLookup.Frostfire return i18next.t("mystery_crates.frostfire_adjective") else if cosmeticCrateType == CosmeticsChestTypeLookup.FrostfirePremium return i18next.t("mystery_crates.frostfire_premium_adjective") else return i18next.t("mystery_crates.gift_crate_adjective") @keySKUForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return "Common_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return "Rare_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return "Epic_Chest_Key" else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return "Boss_Chest_Key" else console.warn "Invalid cosmetic chest type provided to CosmeticsFactory.keySKUForCosmeticChestType" return "Invalid_Chest_Key" @descriptionForCosmeticChestType: (cosmeticCrateType)-> if cosmeticCrateType == CosmeticsChestTypeLookup.Common return [ i18next.t("cosmetics.common_mystery_crate_1"), i18next.t("cosmetics.common_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Rare return [ i18next.t("cosmetics.rare_mystery_crate_1"), i18next.t("cosmetics.rare_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Epic return [ i18next.t("cosmetics.epic_mystery_crate_1"), i18next.t("cosmetics.epic_mystery_crate_2") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Boss return [ i18next.t("cosmetics.boss_crate_1"), i18next.t("cosmetics.boss_crate_2"), i18next.t("cosmetics.boss_crate_3"), i18next.t("cosmetics.boss_crate_4") ].join("\n") else if cosmeticCrateType == CosmeticsChestTypeLookup.Frostfire return i18next.t("cosmetics.frostfire_crate") else if cosmeticCrateType == CosmeticsChestTypeLookup.FrostfirePremium return i18next.t("cosmetics.frostfire_premium_crate") else return i18next.t("cosmetics.generic_mystery_crate") # setup emote data cos = CosmeticsFactory._cosmeticsById ### EXAMPLE: cos[CosmeticsLookup.CardBacks.Shiny] = { id: CosmeticsLookup.CardBacks.Shiny # id of cosmetic that maps to cosmetics lookup enabled: true # whether cosmetic is enabled globally alwaysVisible: true # whether cosmetic is always visible to the user, whether they own it or not availableAt: moment.utc("2016-12-25").valueOf() # Optional factionId: Factions.Faction1 # if this cosmetic is limited to a faction # Optional generalId: Cards.Faction1.AltGeneral img: RSX.emote_basic_happy.img # img to use for showing emote label: "Hello" # text to use for text only emotes order: 0 # sorting order of cosmetic (shows in ascending order, i.e. all 0s, then all 1s) typeId: CosmeticsTypeLookup.CardBack # category of cosmetic subType: "Shiny" # Any string identifier, shown as the sub category in shop sku: "emote-200" # This is autogenerated, ctrl f: "Generate skus procedurally" chestType: CosmeticsChestTypeLookup.Common # TODO: is chest it unlocks in == rarity? rarityId: Rarity.Common rewardOrder: 0 # Rewards of a lower number (within a rarity) are always rewarded first from loot crates, defaults to 0 } ### # region COSMETICS ORDERING ORDER_EMOTES = 0 ORDER_CARD_BACKS = 1 ORDER_PROFILE_ICONS = 0 ORDER_MAIN_MENU_PLATES = 1 ORDER_CARD_SKINS = 2 ORDER_SCENES = 0 # endregion COSMETICS ORDERING # region EMOTE ORDERING EMOTE_ORDER_HAPPY = 0 EMOTE_ORDER_ANGRY = 1 EMOTE_ORDER_CONFUSED = 2 EMOTE_ORDER_SAD = 3 EMOTE_ORDER_TAUNT = 4 # wink EMOTE_ORDER_KISS = 5 # love EMOTE_ORDER_FRUSTRATED = 6 EMOTE_ORDER_SURPRISED = 7 EMOTE_ORDER_BOW = 8 EMOTE_ORDER_SLEEP = 9 EMOTE_ORDER_SUNGLASSES = 10 EMOTE_ORDER_CUSTOM = 11 # endregion EMOTE ORDERING # region Cosmetics datas # Shorthand the cosmetics lookups cl = CosmeticsLookup CardBack = cl.CardBack Emote = cl.Emote ProfileIcon = cl.ProfileIcon CardSkin = cl.CardSkin Scene = cl.Scene BattleMap = cl.BattleMap # region Scenes cos[Scene.MagaariEmberHighlands] = { id: Scene.MagaariEmberHighlands typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_magaari_name") shopDescription: i18next.t("cosmetics.scene_magaari_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "MagaariEmberHighlands" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.ObsidianWoods] = { id: Scene.ObsidianWoods typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_obsidian_woods_name") shopDescription: i18next.t("cosmetics.scene_obsidian_woods_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "ObsidianWoods" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Frostfire] = { id: Scene.Frostfire typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_frostfire_festival_name") shopDescription: i18next.t("cosmetics.scene_frostfire_festival_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "FrostfireMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Vetruvian] = { id: Scene.Vetruvian typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_city_of_kaero_name") shopDescription: i18next.t("cosmetics.scene_city_of_kaero_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "VetruvianMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } cos[Scene.Shimzar] = { id: Scene.Shimzar typeId: CosmeticsTypeLookup.Scene name: i18next.t("cosmetics.scene_unearthed_prophecy_name") shopDescription: i18next.t("cosmetics.scene_unearthed_prophecy_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Fixed pkgId: "ShimzarMainMenu" img: null # TODO rsx: null # TODO unlockable: false purchasable: false } # endregion Scenes # region Card Skins cos[CardSkin.Faction1GeneralTier2] = { id: CardSkin.Faction1GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_argeon_m2_name") shopDescription: i18next.t("cosmetics.skin_argeon_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1GeneralTier2GIF.img rsx: RSX.f1GeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.General skinNum: 1 animResource: { breathing: RSX.f1GeneralTier2Breathing.name idle: RSX.f1GeneralTier2Idle.name walk: RSX.f1GeneralTier2Run.name attack: RSX.f1GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1GeneralTier2Damage.name death: RSX.f1GeneralTier2Death.name castStart: RSX.f1GeneralTier2CastStart.name castEnd: RSX.f1GeneralTier2CastEnd.name castLoop: RSX.f1GeneralTier2CastLoop.name cast: RSX.f1GeneralTier2Cast.name } } cos[CardSkin.Faction1GeneralRogueLegacy] = { id: CardSkin.Faction1GeneralRogueLegacy typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_rogue_legacy_name") shopDescription: i18next.t("cosmetics.skin_rogue_legacy_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS img: RSX.f1GeneralRogueLegacyGIF.img rsx: RSX.f1GeneralRogueLegacyGIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction1.General skinNum: 2 animResource: { breathing: RSX.f1GeneralRogueLegacyBreathing.name idle: RSX.f1GeneralRogueLegacyIdle.name walk: RSX.f1GeneralRogueLegacyRun.name attack: RSX.f1GeneralRogueLegacyAttack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1GeneralRogueLegacyDamage.name death: RSX.f1GeneralRogueLegacyDeath.name castStart: RSX.f1GeneralRogueLegacyCastStart.name castEnd: RSX.f1GeneralRogueLegacyCastEnd.name castLoop: RSX.f1GeneralRogueLegacyCastLoop.name cast: RSX.f1GeneralRogueLegacyCast.name } } cos[CardSkin.Faction1AltGeneralTier2] = { id: CardSkin.Faction1AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ziran_m2_name") shopDescription: i18next.t("cosmetics.skin_ziran_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1AltGeneralTier2GIF.img rsx: RSX.f1AltGeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.AltGeneral skinNum: 1 animResource: { breathing : RSX.f1AltGeneralTier2Breathing.name idle : RSX.f1AltGeneralTier2Idle.name walk : RSX.f1AltGeneralTier2Run.name attack : RSX.f1AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.5 damage : RSX.f1AltGeneralTier2Hit.name death : RSX.f1AltGeneralTier2Death.name castStart : RSX.f1AltGeneralTier2CastStart.name castEnd : RSX.f1AltGeneralTier2CastEnd.name castLoop : RSX.f1AltGeneralTier2CastLoop.name cast : RSX.f1AltGeneralTier2Cast.name } } cos[CardSkin.Faction1IVGeneralTier2] = { id: CardSkin.Faction1IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_brome_m2_name") shopDescription: i18next.t("cosmetics.skin_brome_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f1IVGeneralTier2GIF.img rsx: RSX.f1IVGeneralTier2GIF factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction1.ThirdGeneral skinNum: 1 animResource: { breathing: RSX.f1IVGeneralTier2Breathing.name idle: RSX.f1IVGeneralTier2Idle.name walk: RSX.f1IVGeneralTier2Run.name attack: RSX.f1IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage: RSX.f1IVGeneralTier2Damage.name death: RSX.f1IVGeneralTier2Death.name castStart: RSX.f1IVGeneralTier2CastStart.name castEnd: RSX.f1IVGeneralTier2CastEnd.name castLoop: RSX.f1IVGeneralTier2CastLoop.name cast: RSX.f1IVGeneralTier2Cast.name } } cos[CardSkin.Faction2GeneralTier2] = { id: CardSkin.Faction2GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_kaleos_m2_name") shopDescription: i18next.t("cosmetics.skin_kaleos_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2GeneralTier2GIF.img rsx: RSX.f2GeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.General skinNum: 1 animResource: { breathing : RSX.f2GeneralTier2Breathing.name idle : RSX.f2GeneralTier2Idle.name walk : RSX.f2GeneralTier2Run.name attack : RSX.f2GeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2GeneralTier2Damage.name death : RSX.f2GeneralTier2Death.name castStart : RSX.f2GeneralTier2CastStart.name castEnd : RSX.f2GeneralTier2CastEnd.name castLoop : RSX.f2GeneralTier2CastLoop.name cast : RSX.f2GeneralTier2Cast.name } } cos[CardSkin.Faction2GeneralDogehai] = { id: CardSkin.Faction2GeneralDogehai typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_dogehai_name") shopDescription: i18next.t("cosmetics.skin_dogehai_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS img: RSX.f2GeneralDogehaiGIF.img rsx: RSX.f2GeneralDogehaiGIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction2.General skinNum: 2 animResource: { breathing : RSX.f2GeneralDogehaiBreathing.name idle : RSX.f2GeneralDogehaiIdle.name walk : RSX.f2GeneralDogehaiRun.name attack : RSX.f2GeneralDogehaiAttack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2GeneralDogehaiDamage.name death : RSX.f2GeneralDogehaiDeath.name castStart : RSX.f2GeneralDogehaiCastStart.name castEnd : RSX.f2GeneralDogehaiCastEnd.name castLoop : RSX.f2GeneralDogehaiCastLoop.name cast : RSX.f2GeneralDogehaiCast.name } } cos[CardSkin.Faction2AltGeneralTier2] = { id: CardSkin.Faction2AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_reva_m2_name") shopDescription: i18next.t("cosmetics.skin_reva_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2AltGeneralTier2GIF.img rsx: RSX.f2AltGeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.AltGeneral skinNum: 1 animResource: { breathing : RSX.f2AltGeneralTier2Breathing.name idle : RSX.f2AltGeneralTier2Idle.name walk : RSX.f2AltGeneralTier2Run.name attack : RSX.f2AltGeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 1.0 damage : RSX.f2AltGeneralTier2Hit.name death : RSX.f2AltGeneralTier2Death.name castStart : RSX.f2AltGeneralTier2CastStart.name castEnd : RSX.f2AltGeneralTier2CastEnd.name castLoop : RSX.f2AltGeneralTier2CastLoop.name cast : RSX.f2AltGeneralTier2Cast.name } } cos[CardSkin.Faction2IVGeneralTier2] = { id: CardSkin.Faction2IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_shidai_m2_name") shopDescription: i18next.t("cosmetics.skin_shidai_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f2IVGeneralTier2GIF.img rsx: RSX.f2IVGeneralTier2GIF factionId: Factions.Faction2 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction2.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f2IVGeneralTier2Breathing.name idle : RSX.f2IVGeneralTier2Idle.name walk : RSX.f2IVGeneralTier2Run.name attack : RSX.f2IVGeneralTier2Attack.name attackReleaseDelay: 0.2 attackDelay: 0.5 damage : RSX.f2IVGeneralTier2Damage.name death : RSX.f2IVGeneralTier2Death.name castStart : RSX.f2IVGeneralTier2CastStart.name castEnd : RSX.f2IVGeneralTier2CastEnd.name castLoop : RSX.f2IVGeneralTier2CastLoop.name cast : RSX.f2IVGeneralTier2Cast.name } } cos[CardSkin.Faction3GeneralTier2] = { id: CardSkin.Faction3GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zirix_m2_name") shopDescription: i18next.t("cosmetics.skin_zirix_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3GeneralTier2GIF.img rsx: RSX.f3GeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.General skinNum: 1 animResource: { breathing : RSX.f3GeneralTier2Breathing.name idle : RSX.f3GeneralTier2Idle.name walk : RSX.f3GeneralTier2Run.name attack : RSX.f3GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3GeneralTier2Damage.name death : RSX.f3GeneralTier2Death.name castStart : RSX.f3GeneralTier2CastStart.name castEnd : RSX.f3GeneralTier2CastEnd.name castLoop : RSX.f3GeneralTier2CastLoop.name cast : RSX.f3GeneralTier2Cast.name } } cos[CardSkin.Faction3GeneralFestive] = { id: CardSkin.Faction3GeneralFestive typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zirix_festive_name") shopDescription: i18next.t("cosmetics.skin_zirix_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f3GeneralFestiveGIF.img rsx: RSX.f3GeneralFestiveGIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction3.General skinNum: 2 animResource: { breathing : RSX.f3GeneralFestiveBreathing.name idle : RSX.f3GeneralFestiveIdle.name walk : RSX.f3GeneralFestiveRun.name attack : RSX.f3GeneralFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3GeneralFestiveDamage.name death : RSX.f3GeneralFestiveDeath.name castStart : RSX.f3GeneralFestiveCastStart.name castEnd : RSX.f3GeneralFestiveCastEnd.name castLoop : RSX.f3GeneralFestiveCastLoop.name cast : RSX.f3GeneralFestiveCast.name } } cos[CardSkin.Faction3AltGeneralTier2] = { id: CardSkin.Faction3AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_sajj_m2_name") shopDescription: i18next.t("cosmetics.skin_sajj_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3AltGeneralTier2GIF.img rsx: RSX.f3AltGeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.AltGeneral skinNum: 1 animResource: { breathing : RSX.f3AltGeneralTier2Breathing.name idle : RSX.f3AltGeneralTier2Idle.name walk : RSX.f3AltGeneralTier2Run.name attack : RSX.f3AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.f3AltGeneralTier2Hit.name death : RSX.f3AltGeneralTier2Death.name castStart : RSX.f3AltGeneralTier2CastStart.name castEnd : RSX.f3AltGeneralTier2CastEnd.name castLoop : RSX.f3AltGeneralTier2CastLoop.name cast : RSX.f3AltGeneralTier2Cast.name } } cos[CardSkin.Faction3IVGeneralTier2] = { id: CardSkin.Faction3IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ciphyron_m2_name") shopDescription: i18next.t("cosmetics.skin_ciphyron_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f3IVGeneralTier2GIF.img rsx: RSX.f3IVGeneralTier2GIF factionId: Factions.Faction3 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction3.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f3IVGeneralTier2Breathing.name idle : RSX.f3IVGeneralTier2Idle.name walk : RSX.f3IVGeneralTier2Run.name attack : RSX.f3IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.2 damage : RSX.f3IVGeneralTier2Damage.name death : RSX.f3IVGeneralTier2Death.name castStart : RSX.f3IVGeneralTier2CastStart.name castEnd : RSX.f3IVGeneralTier2CastEnd.name castLoop : RSX.f3IVGeneralTier2CastLoop.name cast : RSX.f3IVGeneralTier2Cast.name } } cos[CardSkin.Faction4GeneralTier2] = { id: CardSkin.Faction4GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_lilithe_m2_name") shopDescription: i18next.t("cosmetics.skin_lilithe_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4GeneralTier2GIF.img rsx: RSX.f4GeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.General skinNum: 1 animResource: { breathing : RSX.f4GeneralTier2Breathing.name idle : RSX.f4GeneralTier2Idle.name walk : RSX.f4GeneralTier2Run.name attack : RSX.f4GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage : RSX.f4GeneralTier2Damage.name death : RSX.f4GeneralTier2Death.name castStart : RSX.f4GeneralTier2CastStart.name castEnd : RSX.f4GeneralTier2CastEnd.name castLoop : RSX.f4GeneralTier2CastLoop.name cast : RSX.f4GeneralTier2Cast.name } } cos[CardSkin.Faction4AltGeneralTier2] = { id: CardSkin.Faction4AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_cassyva_m2_name") shopDescription: i18next.t("cosmetics.skin_cassyva_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4AltGeneralTier2GIF.img rsx: RSX.f4AltGeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.AltGeneral skinNum: 1 animResource: { breathing : RSX.f4AltGeneralTier2Breathing.name idle : RSX.f4AltGeneralTier2Idle.name walk : RSX.f4AltGeneralTier2Run.name attack : RSX.f4AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.5 damage : RSX.f4AltGeneralTier2Hit.name death : RSX.f4AltGeneralTier2Death.name castStart : RSX.f4AltGeneralTier2CastStart.name castEnd : RSX.f4AltGeneralTier2CastEnd.name castLoop : RSX.f4AltGeneralTier2CastLoop.name cast : RSX.f4AltGeneralTier2Cast.name } } cos[CardSkin.Faction4IVGeneralTier2] = { id: CardSkin.Faction4IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_maehv_m2_name") shopDescription: i18next.t("cosmetics.skin_maehv_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f4IVGeneralTier2GIF.img rsx: RSX.f4IVGeneralTier2GIF factionId: Factions.Faction4 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction4.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f4IVGeneralTier2Breathing.name idle : RSX.f4IVGeneralTier2Idle.name walk : RSX.f4IVGeneralTier2Run.name attack : RSX.f4IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.5 damage : RSX.f4IVGeneralTier2Damage.name death : RSX.f4IVGeneralTier2Death.name castStart : RSX.f4IVGeneralTier2CastStart.name castEnd : RSX.f4IVGeneralTier2CastEnd.name castLoop : RSX.f4IVGeneralTier2CastLoop.name cast : RSX.f4IVGeneralTier2Cast.name } } cos[CardSkin.Faction5GeneralTier2] = { id: CardSkin.Faction5GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_vaath_m2_name") shopDescription: i18next.t("cosmetics.skin_vaath_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5GeneralTier2GIF.img rsx: RSX.f5GeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.General skinNum: 1 animResource: { breathing : RSX.f5GeneralTier2Breathing.name idle : RSX.f5GeneralTier2Idle.name walk : RSX.f5GeneralTier2Run.name attack : RSX.f5GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f5GeneralTier2Damage.name death : RSX.f5GeneralTier2Death.name castStart : RSX.f5GeneralTier2CastStart.name castEnd : RSX.f5GeneralTier2CastEnd.name castLoop : RSX.f5GeneralTier2CastLoop.name cast : RSX.f5GeneralTier2Cast.name } } cos[CardSkin.Faction5AltGeneralTier2] = { id: CardSkin.Faction5AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_starhorn_m2_name") shopDescription: i18next.t("cosmetics.skin_starhorn_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5AltGeneralTier2GIF.img rsx: RSX.f5AltGeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.AltGeneral skinNum: 1 animResource: { breathing : RSX.f5AltGeneralTier2Breathing.name idle : RSX.f5AltGeneralTier2Idle.name walk : RSX.f5AltGeneralTier2Run.name attack : RSX.f5AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.f5AltGeneralTier2Hit.name death : RSX.f5AltGeneralTier2Death.name castStart : RSX.f5AltGeneralTier2CastStart.name castEnd : RSX.f5AltGeneralTier2CastEnd.name castLoop : RSX.f5AltGeneralTier2CastLoop.name cast : RSX.f5AltGeneralTier2Cast.name } } cos[CardSkin.Faction5IVGeneralTier2] = { id: CardSkin.Faction5IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ragnora_m2_name") shopDescription: i18next.t("cosmetics.skin_ragnora_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f5IVGeneralTier2GIF.img rsx: RSX.f5IVGeneralTier2GIF factionId: Factions.Faction5 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction5.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f5IVGeneralTier2Breathing.name idle : RSX.f5IVGeneralTier2Idle.name walk : RSX.f5IVGeneralTier2Run.name attack : RSX.f5IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f5IVGeneralTier2Damage.name death : RSX.f5IVGeneralTier2Death.name castStart : RSX.f5IVGeneralTier2CastStart.name castEnd : RSX.f5IVGeneralTier2CastEnd.name castLoop : RSX.f5IVGeneralTier2CastLoop.name cast : RSX.f5IVGeneralTier2Cast.name } } cos[CardSkin.Faction6GeneralTier2] = { id: CardSkin.Faction6GeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_faie_m2_name") shopDescription: i18next.t("cosmetics.skin_faie_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6GeneralTier2GIF.img rsx: RSX.f6GeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.General skinNum: 1 animResource: { breathing : RSX.f6GeneralTier2Breathing.name idle : RSX.f6GeneralTier2Idle.name walk : RSX.f6GeneralTier2Run.name attack : RSX.f6GeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6GeneralTier2Damage.name death : RSX.f6GeneralTier2Death.name castStart : RSX.f6GeneralTier2CastStart.name castEnd : RSX.f6GeneralTier2CastEnd.name castLoop : RSX.f6GeneralTier2CastLoop.name cast : RSX.f6GeneralTier2Cast.name } } cos[CardSkin.Faction6GeneralFestive] = { id: CardSkin.Faction6GeneralFestive typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_faie_festive_name") shopDescription: i18next.t("cosmetics.skin_faie_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f6GeneralFestiveGIF.img rsx: RSX.f6GeneralFestiveGIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction6.General skinNum: 2 animResource: { breathing : RSX.f6GeneralFestiveBreathing.name idle : RSX.f6GeneralFestiveIdle.name walk : RSX.f6GeneralFestiveRun.name attack : RSX.f6GeneralFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6GeneralFestiveDamage.name death : RSX.f6GeneralFestiveDeath.name castStart : RSX.f6GeneralFestiveCastStart.name castEnd : RSX.f6GeneralFestiveCastEnd.name castLoop : RSX.f6GeneralFestiveCastLoop.name cast : RSX.f6GeneralFestiveCast.name } } cos[CardSkin.Faction6AltGeneralTier2] = { id: CardSkin.Faction6AltGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_kara_m2_name") shopDescription: i18next.t("cosmetics.skin_kara_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6AltGeneralTier2GIF.img rsx: RSX.f6AltGeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.AltGeneral skinNum: 1 animResource: { breathing : RSX.f6AltGeneralTier2Breathing.name idle : RSX.f6AltGeneralTier2Idle.name walk : RSX.f6AltGeneralTier2Run.name attack : RSX.f6AltGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 1.2 damage : RSX.f6AltGeneralTier2Hit.name death : RSX.f6AltGeneralTier2Death.name castStart : RSX.f6AltGeneralTier2CastStart.name castEnd : RSX.f6AltGeneralTier2CastEnd.name castLoop : RSX.f6AltGeneralTier2CastLoop.name cast : RSX.f6AltGeneralTier2Cast.name } } cos[CardSkin.Faction6IVGeneralTier2] = { id: CardSkin.Faction6IVGeneralTier2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_ilena_m2_name") shopDescription: i18next.t("cosmetics.skin_ilena_m2_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "MK2 Generals" img: RSX.f6IVGeneralTier2GIF.img rsx: RSX.f6IVGeneralTier2GIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: false purchasable: true cardId: Cards.Faction6.ThirdGeneral skinNum: 1 animResource: { breathing : RSX.f6IVGeneralTier2Breathing.name idle : RSX.f6IVGeneralTier2Idle.name walk : RSX.f6IVGeneralTier2Run.name attack : RSX.f6IVGeneralTier2Attack.name attackReleaseDelay: 0.0 attackDelay: 0.65 damage : RSX.f6IVGeneralTier2Damage.name death : RSX.f6IVGeneralTier2Death.name castStart : RSX.f6IVGeneralTier2CastStart.name castEnd : RSX.f6IVGeneralTier2CastEnd.name castLoop : RSX.f6IVGeneralTier2CastLoop.name cast : RSX.f6IVGeneralTier2Cast.name } } cos[CardSkin.SarlacPrime] = { id: CardSkin.SarlacPrime typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_sarlac_prime_name") shopDescription: i18next.t("cosmetics.skin_sarlac_prime_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.SarlacTheEternal skinNum: 1 animResource: { breathing : RSX.neutralSarlacPrimeBreathing.name idle : RSX.neutralSarlacPrimeIdle.name walk : RSX.neutralSarlacPrimeRun.name attack : RSX.neutralSarlacPrimeAttack.name attackReleaseDelay: 0.0 attackDelay: .25 damage : RSX.neutralSarlacPrimeHit.name death : RSX.neutralSarlacPrimeDeath.name } } cos[CardSkin.KeeperOfTheValue] = { id: CardSkin.KeeperOfTheValue typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_keeper_name") shopDescription: i18next.t("cosmetics.skin_keeper_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.KeeperOfTheVale skinNum: 1 animResource: { breathing : RSX.neutralKeeperOfTheValueBreathing.name idle : RSX.neutralKeeperOfTheValueIdle.name walk : RSX.neutralKeeperOfTheValueRun.name attack : RSX.neutralKeeperOfTheValueAttack.name attackReleaseDelay: 0.0 attackDelay: 1.0 damage : RSX.neutralKeeperOfTheValueHit.name death : RSX.neutralKeeperOfTheValueDeath.name } } cos[CardSkin.Darkjammer] = { id: CardSkin.Darkjammer typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_darkjammer_name") shopDescription: i18next.t("cosmetics.skin_darkjammer_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.Spelljammer skinNum: 1 animResource: { breathing : RSX.neutralDarkjammerBreathing.name idle : RSX.neutralDarkjammerIdle.name walk : RSX.neutralDarkjammerRun.name attack : RSX.neutralDarkjammerAttack.name attackReleaseDelay: 0.0 attackDelay: .9 damage : RSX.neutralDarkjammerHit.name death : RSX.neutralDarkjammerDeath.name } } cos[CardSkin.FrostfireTiger] = { id: CardSkin.FrostfireTiger typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_frostfire_tiger_name") shopDescription: i18next.t("cosmetics.skin_frostfire_tiger_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.neutralFrostfireTigerGIF.img rsx: RSX.neutralFrostfireTigerGIF factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Neutral.SaberspineTiger skinNum: 1 animResource: { breathing : RSX.neutralFrostfireTigerBreathing.name idle : RSX.neutralFrostfireTigerIdle.name walk : RSX.neutralFrostfireTigerRun.name attack : RSX.neutralFrostfireTigerAttack.name attackReleaseDelay: 0.0 attackDelay: .4 damage : RSX.neutralFrostfireTigerHit.name death : RSX.neutralFrostfireTigerDeath.name } } cos[CardSkin.FestiveSnowchaser] = { id: CardSkin.FestiveSnowchaser typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_festive_snowchaser_name") shopDescription: i18next.t("cosmetics.skin_festive_snowchaser_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.f6FestiveSnowchaserGIF.img rsx: RSX.f6FestiveSnowchaserGIF factionId: Factions.Faction6 rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Faction6.WyrBeast skinNum: 1 animResource: { breathing : RSX.f6FestiveSnowchaserBreathing.name idle : RSX.f6FestiveSnowchaserIdle.name walk : RSX.f6FestiveSnowchaserRun.name attack : RSX.f6FestiveSnowchaserAttack.name attackReleaseDelay: 0.0 attackDelay: .3 damage : RSX.f6FestiveSnowchaserDamage.name death : RSX.f6FestiveSnowchaserDeath.name } } cos[CardSkin.ElyxMK2] = { id: CardSkin.ElyxMK2 typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Elyx Stormblade MK2" shopDescription: "Elyx Stormblade MK2" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Faction1 rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Faction1.ElyxStormblade skinNum: 1 animResource: { breathing : RSX.f1ElyxStormbladeMK2Breathing.name idle : RSX.f1ElyxStormbladeMK2Idle.name walk : RSX.f1ElyxStormbladeMK2Run.name attack : RSX.f1ElyxStormbladeMK2Attack.name attackReleaseDelay: 0.0 attackDelay: .3 damage : RSX.f1ElyxStormbladeMK2Hit.name death : RSX.f1ElyxStormbladeMK2Death.name } } cos[CardSkin.HealingMysticBN] = { id: CardSkin.HealingMysticBN typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PIaling Mystic Bandai PI:NAME:<NAME>END_PI" shopDescription: "Healing Mystic Bandai Namco" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.HealingMystic skinNum: 1 animResource: { breathing : RSX.neutralHealingMysticBNBreathing.name idle : RSX.neutralHealingMysticBNIdle.name walk : RSX.neutralHealingMysticBNRun.name attack : RSX.neutralHealingMysticBNAttack.name attackReleaseDelay: 0.0 attackDelay: 0.9 damage : RSX.neutralHealingMysticBNHit.name death : RSX.neutralHealingMysticBNDeath.name } } cos[CardSkin.HealingMysticTwitch] = { id: CardSkin.HealingMysticTwitch typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Healing Mystic Twitch" shopDescription: "Healing Mystic Twitch" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: false cardId: Cards.Neutral.HealingMystic skinNum: 2 animResource: { breathing : RSX.neutralhealingMysticTwitchBreathing.name idle : RSX.neutralhealingMysticTwitchIdle.name walk : RSX.neutralhealingMysticTwitchRun.name attack : RSX.neutralhealingMysticTwitchAttack.name attackReleaseDelay: 0.0 attackDelay: 0.9 damage : RSX.neutralhealingMysticTwitchHit.name death : RSX.neutralhealingMysticTwitchDeath.name } } cos[CardSkin.FestiveZyx] = { id: CardSkin.FestiveZyx typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: i18next.t("cosmetics.skin_zyx_festive_name") shopDescription: i18next.t("cosmetics.skin_zyx_festive_desc") enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Festive" img: RSX.neutralZyxFestiveGIF.img rsx: RSX.neutralZyxFestiveGIF factionId: Factions.Neutral rarityId: Rarity.Legendary unlockable: true purchasable: true cardId: Cards.Neutral.Zyx skinNum: 1 animResource: { breathing : RSX.neutralZyxFestiveBreathing.name idle : RSX.neutralZyxFestiveIdle.name walk : RSX.neutralZyxFestiveRun.name attack : RSX.neutralZyxFestiveAttack.name attackReleaseDelay: 0.0 attackDelay: .4 damage : RSX.neutralZyxFestiveHit.name death : RSX.neutralZyxFestiveDeath.name } } cos[CardSkin.MirkbloodDevourerBoss] = { id: CardSkin.MirkbloodDevourerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Umbra boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mirkbloodDevourerBossGIF.img rsx: RSX.mirkbloodDevourerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.MirkbloodDevourer skinNum: 1 animResource: { breathing : RSX.bossUmbraBreathing.name idle : RSX.bossUmbraIdle.name walk : RSX.bossUmbraRun.name attack : RSX.bossUmbraAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossUmbraHit.name death : RSX.bossUmbraDeath.name } } cos[CardSkin.DreadnoughtBoss] = { id: CardSkin.DreadnoughtBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Boreal Juggernaut boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.dreadnoughtBossGIF.img rsx: RSX.dreadnoughtBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Dreadnaught skinNum: 1 animResource: { breathing : RSX.bossBorealJuggernautBreathing.name idle : RSX.bossBorealJuggernautIdle.name walk : RSX.bossBorealJuggernautRun.name attack : RSX.bossBorealJuggernautAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossBorealJuggernautHit.name death : RSX.bossBorealJuggernautDeath.name } } cos[CardSkin.IroncladBoss] = { id: CardSkin.IroncladBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Ironclad" shopDescription: "This skin was used in the Cade the Desolator boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.ironcladBossGIF.img rsx: RSX.ironcladBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Ironclad skinNum: 1 animResource: { breathing : RSX.bossChaosKnightBreathing.name idle : RSX.bossChaosKnightIdle.name walk : RSX.bossChaosKnightRun.name attack : RSX.bossChaosKnightAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossChaosKnightHit.name death : RSX.bossChaosKnightDeath.name } } cos[CardSkin.ZendoBoss] = { id: CardSkin.ZendoBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Shinkage Zendo boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.zendoBossGIF.img rsx: RSX.zendoBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.GrandmasterZendo skinNum: 1 animResource: { breathing : RSX.bossShinkageZendoBreathing.name idle : RSX.bossShinkageZendoIdle.name walk : RSX.bossShinkageZendoRun.name attack : RSX.bossShinkageZendoAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossShinkageZendoHit.name death : RSX.bossShinkageZendoDeath.name } } cos[CardSkin.Z0rBoss] = { id: CardSkin.Z0rBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.z0rBossGIF.img rsx: RSX.z0rBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Z0r skinNum: 1 animResource: { breathing : RSX.bossDecepticleBreathing.name idle : RSX.bossDecepticleIdle.name walk : RSX.bossDecepticleRun.name attack : RSX.bossDecepticleAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleHit.name death : RSX.bossDecepticleDeath.name } } cos[CardSkin.Mechaz0rChassisBoss] = { id: CardSkin.Mechaz0rChassisBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Chassis of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rChassisBossGIF.img rsx: RSX.mechaz0rChassisBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rChassis skinNum: 1 animResource: { breathing : RSX.bossDecepticleChassisBreathing.name idle : RSX.bossDecepticleChassisIdle.name walk : RSX.bossDecepticleChassisRun.name attack : RSX.bossDecepticleChassisAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleChassisHit.name death : RSX.bossDecepticleChassisDeath.name } } cos[CardSkin.Mechaz0rHelmBoss] = { id: CardSkin.Mechaz0rHelmBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Helm of Mechaz0r" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rHelmBossGIF.img rsx: RSX.mechaz0rHelmBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rHelm skinNum: 1 animResource: { breathing : RSX.bossDecepticleHelmBreathing.name idle : RSX.bossDecepticleHelmIdle.name walk : RSX.bossDecepticleHelmRun.name attack : RSX.bossDecepticleHelmAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleHelmHit.name death : RSX.bossDecepticleHelmDeath.name } } cos[CardSkin.AlterRexxBoss] = { id: CardSkin.AlterRexxBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.alterRexxBossGIF.img rsx: RSX.alterRexxBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.AlterRexx skinNum: 1 animResource: { breathing : RSX.bossDecepticlePrimeBreathing.name idle : RSX.bossDecepticlePrimeIdle.name walk : RSX.bossDecepticlePrimeRun.name attack : RSX.bossDecepticlePrimeAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticlePrimeHit.name death : RSX.bossDecepticlePrimeDeath.name } } cos[CardSkin.Mechaz0rSwordBoss] = { id: CardSkin.Mechaz0rSwordBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rSwordBossGIF.img rsx: RSX.mechaz0rSwordBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rSword skinNum: 1 animResource: { breathing : RSX.bossDecepticleSwordBreathing.name idle : RSX.bossDecepticleSwordIdle.name walk : RSX.bossDecepticleSwordRun.name attack : RSX.bossDecepticleSwordAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleSwordHit.name death : RSX.bossDecepticleSwordDeath.name } } cos[CardSkin.Mechaz0rWingsBoss] = { id: CardSkin.Mechaz0rWingsBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the D3cepticle boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.mechaz0rWingsBossGIF.img rsx: RSX.mechaz0rWingsBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Mechaz0rWings skinNum: 1 animResource: { breathing : RSX.bossDecepticleWingsBreathing.name idle : RSX.bossDecepticleWingsIdle.name walk : RSX.bossDecepticleWingsRun.name attack : RSX.bossDecepticleWingsAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossDecepticleWingsHit.name death : RSX.bossDecepticleWingsDeath.name } } cos[CardSkin.ZukongBoss] = { id: CardSkin.ZukongBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Wu'jin the Trickster boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.zukongBossGIF.img rsx: RSX.zukongBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Zukong skinNum: 1 animResource: { breathing : RSX.bossWujinBreathing.name idle : RSX.bossWujinIdle.name walk : RSX.bossWujinRun.name attack : RSX.bossWujinAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWujinHit.name death : RSX.bossWujinDeath.name } } cos[CardSkin.WartalonBoss] = { id: CardSkin.WartalonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Solfist boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.wartalonBossGIF.img rsx: RSX.wartalonBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.WarTalon skinNum: 1 animResource: { breathing : RSX.bossSolfistBreathing.name idle : RSX.bossSolfistIdle.name walk : RSX.bossSolfistRun.name attack : RSX.bossSolfistAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSolfistHit.name death : RSX.bossSolfistDeath.name } } cos[CardSkin.EMPBoss] = { id: CardSkin.EMPBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Automaton 8 boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.empBossGIF.img rsx: RSX.empBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.EMP skinNum: 1 animResource: { breathing : RSX.bossEMPBreathing.name idle : RSX.bossEMPIdle.name walk : RSX.bossEMPRun.name attack : RSX.bossEMPAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossEMPHit.name death : RSX.bossEMPDeath.name } } cos[CardSkin.ArchonBoss] = { id: CardSkin.ArchonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Orias the Heretic boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.archonBossGIF.img rsx: RSX.archonBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.ArchonSpellbinder skinNum: 1 animResource: { breathing : RSX.bossOriasBreathing.name idle : RSX.bossOriasIdle.name walk : RSX.bossOriasRun.name attack : RSX.bossOriasAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossOriasHit.name death : RSX.bossOriasDeath.name } } cos[CardSkin.BastionBoss] = { id: CardSkin.BastionBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Orias the Heretic boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.bastionBossGIF.img rsx: RSX.bastionBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Bastion skinNum: 1 animResource: { breathing : RSX.bossOriasIdolBreathing.name idle : RSX.bossOriasIdolIdle.name walk : RSX.bossOriasIdolRun.name attack : RSX.bossOriasIdolAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossOriasIdolHit.name death : RSX.bossOriasIdolDeath.name } } cos[CardSkin.HighHandBoss] = { id: CardSkin.HighHandBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "The High Hand" shopDescription: "This skin was used in the Malyk boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.highHandBossGIF.img rsx: RSX.highHandBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.TheHighHand skinNum: 1 animResource: { breathing : RSX.bossMalykBreathing.name idle : RSX.bossMalykIdle.name walk : RSX.bossMalykRun.name attack : RSX.bossMalykAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossMalykHit.name death : RSX.bossMalykDeath.name } } cos[CardSkin.BlackSolusBoss] = { id: CardSkin.BlackSolusBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Black solus" shopDescription: "This skin was used in the Archonis boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.blackSolusBossGIF.img rsx: RSX.blackSolusBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.BlackSolus skinNum: 1 animResource: { breathing : RSX.bossManaManBreathing.name idle : RSX.bossManaManIdle.name walk : RSX.bossManaManRun.name attack : RSX.bossManaManAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossManaManDamage.name death : RSX.bossManaManDeath.name } } cos[CardSkin.CalculatorBoss] = { id: CardSkin.CalculatorBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Calculator" shopDescription: "This skin was used in the Paragon of Light boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.calculatorBossGIF.img rsx: RSX.calculatorBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Calculator skinNum: 1 animResource: { breathing : RSX.bossParagonBreathing.name idle : RSX.bossParagonIdle.name walk : RSX.bossParagonRun.name attack : RSX.bossParagonAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossParagonHit.name death : RSX.bossParagonDeath.name } } cos[CardSkin.ChakkramBoss] = { id: CardSkin.ChakkramBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Scion of the Void boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.chakkramBossGIF.img rsx: RSX.chakkramBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Chakkram skinNum: 1 animResource: { breathing : RSX.bossVampireBreathing.name idle : RSX.bossVampireIdle.name walk : RSX.bossVampireRun.name attack : RSX.bossVampireAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossVampireHit.name death : RSX.bossVampireDeath.name } } cos[CardSkin.KronBoss] = { id: CardSkin.KronBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the High Templar Kron boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.kronBossGIF.img rsx: RSX.kronBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.InquisitorKron skinNum: 1 animResource: { breathing : RSX.bossKronBreathing.name idle : RSX.bossKronIdle.name walk : RSX.bossKronRun.name attack : RSX.bossKronAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossKronHit.name death : RSX.bossKronDeath.name } } cos[CardSkin.MeltdownBoss] = { id: CardSkin.MeltdownBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Megapenti boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.meltdownBossGIF.img rsx: RSX.meltdownBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Meltdown skinNum: 1 animResource: { breathing : RSX.bossSerpentiBreathing.name idle : RSX.bossSerpentiIdle.name walk : RSX.bossSerpentiRun.name attack : RSX.bossSerpentiAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSerpentiHit.name death : RSX.bossSerpentiDeath.name } } cos[CardSkin.ArcaneDevourerBoss] = { id: CardSkin.ArcaneDevourerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Rin the Shadowsworn boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.arcaneDevourerBossGIF.img rsx: RSX.arcaneDevourerBossGIF factionId: Factions.Faction4 rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.ArcaneDevourer skinNum: 1 animResource: { breathing : RSX.bossWraithBreathing.name idle : RSX.bossWraithIdle.name walk : RSX.bossWraithRun.name attack : RSX.bossWraithAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWraithHit.name death : RSX.bossWraithDeath.name } } cos[CardSkin.TrinityWingBoss] = { id: CardSkin.TrinityWingBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Skfall Tyrant boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.trinityWingBossGIF.img rsx: RSX.trinityWingBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.TrinityWing skinNum: 1 animResource: { breathing : RSX.bossSkyfallTyrantBreathing.name idle : RSX.bossSkyfallTyrantIdle.name walk : RSX.bossSkyfallTyrantRun.name attack : RSX.bossSkyfallTyrantAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSkyfallTyrantHit.name death : RSX.bossSkyfallTyrantDeath.name } } cos[CardSkin.FuriosaBoss] = { id: CardSkin.FuriosaBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Cindera boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.furiosaBossGIF.img rsx: RSX.furiosaBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.Furosa skinNum: 1 animResource: { breathing : RSX.bossCinderaBreathing.name idle : RSX.bossCinderaIdle.name walk : RSX.bossCinderaRun.name attack : RSX.bossCinderaAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossCinderaHit.name death : RSX.bossCinderaDeath.name } } cos[CardSkin.ArclyteSentinelBoss] = { id: CardSkin.ArclyteSentinelBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Crystalline Champion boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.arclyteSentinelBossGIF.img rsx: RSX.arclyteSentinelBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.ArclyteSentinel skinNum: 1 animResource: { breathing : RSX.bossCrystalBreathing.name idle : RSX.bossCrystalIdle.name walk : RSX.bossCrystalRun.name attack : RSX.bossCrystalAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossCrystalDamage.name death : RSX.bossCrystalDeath.name } } cos[CardSkin.RancourBoss] = { id: CardSkin.RancourBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Xel boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.rancourBossGIF.img rsx: RSX.rancourBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Rancour skinNum: 1 animResource: { breathing : RSX.bossAntiswarmBreathing.name idle : RSX.bossAntiswarmIdle.name walk : RSX.bossAntiswarmRun.name attack : RSX.bossAntiswarmAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossAntiswarmHit.name death : RSX.bossAntiswarmDeath.name } } cos[CardSkin.SwornAvengerBoss] = { id: CardSkin.SwornAvengerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Skurge boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.swornAvengerBossGIF.img rsx: RSX.swornAvengerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.SwornAvenger skinNum: 1 animResource: { breathing : RSX.bossSkurgeBreathing.name idle : RSX.bossSkurgeIdle.name walk : RSX.bossSkurgeRun.name attack : RSX.bossSkurgeAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSkurgeHit.name death : RSX.bossSkurgeDeath.name } } cos[CardSkin.SwornDefenderBoss] = { id: CardSkin.SwornDefenderBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PIorn Defender" shopDescription: "This skin was used in the Skurge boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.swornDefenderBossGIF.img rsx: RSX.swornDefenderBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.SwornDefender skinNum: 1 animResource: { breathing : RSX.bossValiantBreathing.name idle : RSX.bossValiantIdle.name walk : RSX.bossValiantRun.name attack : RSX.bossValiantAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossValiantHit.name death : RSX.bossValiantDeath.name } } cos[CardSkin.QuartermasterGaujBoss] = { id: CardSkin.QuartermasterGaujBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Shadow Lord boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.quartermasterGaujBossGIF.img rsx: RSX.quartermasterGaujBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.QuartermasterGauj skinNum: 1 animResource: { breathing : RSX.bossShadowLordBreathing.name idle : RSX.bossShadowLordIdle.name walk : RSX.bossShadowLordRun.name attack : RSX.bossShadowLordAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossShadowLordHit.name death : RSX.bossShadowLordDeath.name } } cos[CardSkin.AlabasterTitanBoss] = { id: CardSkin.AlabasterTitanBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Archmagus Vol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.alabasterTitanBossGIF.img rsx: RSX.alabasterTitanBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.AlabasterTitan skinNum: 1 animResource: { breathing : RSX.bossGolBreathing.name idle : RSX.bossGolIdle.name walk : RSX.bossGolRun.name attack : RSX.bossGolAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossGolHit.name death : RSX.bossGolDeath.name } } cos[CardSkin.RadiantDragoonBoss] = { id: CardSkin.RadiantDragoonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Archmagus Vol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.radiantDragoonBossGIF.img rsx: RSX.radiantDragoonBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.RadiantDragoon skinNum: 1 animResource: { breathing : RSX.bossKaneBreathing.name idle : RSX.bossKaneIdle.name walk : RSX.bossKaneRun.name attack : RSX.bossKaneAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossKaneHit.name death : RSX.bossKaneDeath.name } } cos[CardSkin.TethermancerBoss] = { id: CardSkin.TethermancerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Taskmaster Beatrix boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.tethermancerBossGIF.img rsx: RSX.tethermancerBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Tethermancer skinNum: 1 animResource: { breathing : RSX.bossTaskmasterBreathing.name idle : RSX.bossTaskmasterIdle.name walk : RSX.bossTaskmasterRun.name attack : RSX.bossTaskmasterAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossTaskmasterHit.name death : RSX.bossTaskmasterDeath.name } } cos[CardSkin.DrogonBoss] = { id: CardSkin.DrogonBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "Drogon" shopDescription: "This skin was used in the Grym the Vengeful boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.drogonBossGIF.img rsx: RSX.drogonBossGIF factionId: Factions.Magmar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction5.Drogon skinNum: 1 animResource: { breathing : RSX.bossGrymBreathing.name idle : RSX.bossGrymIdle.name walk : RSX.bossGrymRun.name attack : RSX.bossGrymAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossGrymHit.name death : RSX.bossGrymDeath.name } } cos[CardSkin.PantheranBoss] = { id: CardSkin.PantheranBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PItheran" shopDescription: "This skin was used in the Nahlgol boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.pantheranBossGIF.img rsx: RSX.pantheranBossGIF factionId: Factions.Vetruvian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction3.Pantheran skinNum: 1 animResource: { breathing : RSX.bossSandPantherBreathing.name idle : RSX.bossSandPantherIdle.name walk : RSX.bossSandPantherRun.name attack : RSX.bossSandPantherAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSandPantherDamage.name death : RSX.bossSandPantherDeath.name } } cos[CardSkin.LysianBrawlerBoss] = { id: CardSkin.LysianBrawlerBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Wolfpunch boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.lysianBrawlerBossGIF.img rsx: RSX.lysianBrawlerBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.LysianBrawler skinNum: 1 animResource: { breathing : RSX.bossWolfpunchBreathing.name idle : RSX.bossWolfpunchIdle.name walk : RSX.bossWolfpunchRun.name attack : RSX.bossWolfpunchAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossWolfpunchDamage.name death : RSX.bossWolfpunchDeath.name } } cos[CardSkin.DeathKnellBoss] = { id: CardSkin.DeathKnellBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI Knell" shopDescription: "This skin was used in the Unhallowed boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.deathKnellBossGIF.img rsx: RSX.deathKnellBossGIF factionId: Factions.Abyssian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction4.DeathKnell skinNum: 1 animResource: { breathing : RSX.bossUnhallowedBreathing.name idle : RSX.bossUnhallowedIdle.name walk : RSX.bossUnhallowedRun.name attack : RSX.bossUnhallowedAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossUnhallowedHit.name death : RSX.bossUnhallowedDeath.name } } cos[CardSkin.DraugerLordBoss] = { id: CardSkin.DraugerLordBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Santaur the Terrible boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.draugerLordBossGIF.img rsx: RSX.draugerLordBossGIF factionId: Factions.Vanar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction6.PrismaticGiant skinNum: 1 animResource: { breathing : RSX.bossChristmasBreathing.name idle : RSX.bossChristmasIdle.name walk : RSX.bossChristmasRun.name attack : RSX.bossChristmasAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossChristmasDamage.name death : RSX.bossChristmasDeath.name } } cos[CardSkin.NightWatcherBoss] = { id: CardSkin.NightWatcherBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Legion boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.nightWatcherBossGIF.img rsx: RSX.nightWatcherBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.NightWatcher skinNum: 1 animResource: { breathing : RSX.bossLegionBreathing.name idle : RSX.bossLegionIdle.name walk : RSX.bossLegionRun.name attack : RSX.bossLegionAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossLegionHit.name death : RSX.bossLegionDeath.name } } cos[CardSkin.CalligrapherBoss] = { id: CardSkin.CalligrapherBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Harmony boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.calligrapherBossGIF.img rsx: RSX.calligrapherBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.Calligrapher skinNum: 1 animResource: { breathing : RSX.bossHarmonyBreathing.name idle : RSX.bossHarmonyIdle.name walk : RSX.bossHarmonyRun.name attack : RSX.bossHarmonyAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossHarmonyHit.name death : RSX.bossHarmonyDeath.name } } cos[CardSkin.PandoraBoss] = { id: CardSkin.PandoraBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Andromeda boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.pandoraBossGIF.img rsx: RSX.pandoraBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Pandora skinNum: 1 animResource: { breathing : RSX.bossAndromedaBreathing.name idle : RSX.bossAndromedaIdle.name walk : RSX.bossAndromedaRun.name attack : RSX.bossAndromedaAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossAndromedaHit.name death : RSX.bossAndromedaDeath.name } } cos[CardSkin.GrandmasterNoshRakBoss] = { id: CardSkin.GrandmasterNoshRakBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Invader boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.grandmasterNoshRakBossGIF.img rsx: RSX.grandmasterNoshRakBossGIF factionId: Factions.Vetruvian rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction3.GrandmasterNoshRak skinNum: 1 animResource: { breathing : RSX.bossInvaderBreathing.name idle : RSX.bossInvaderIdle.name walk : RSX.bossInvaderRun.name attack : RSX.bossInvaderAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossInvaderHit.name death : RSX.bossInvaderDeath.name } } cos[CardSkin.IroncliffeGuardianBoss] = { id: CardSkin.IroncliffeGuardianBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Invader boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.ironcliffeGuardianBossGIF.img rsx: RSX.ironcliffeGuardianBossGIF factionId: Factions.Lyonar rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction1.IroncliffeGuardian skinNum: 1 animResource: { breathing : RSX.bossProtectorBreathing.name idle : RSX.bossProtectorIdle.name walk : RSX.bossProtectorRun.name attack : RSX.bossProtectorAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossProtectorDamage.name death : RSX.bossProtectorDeath.name } } cos[CardSkin.CelestialPhantomBoss] = { id: CardSkin.CelestialPhantomBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Soulstealer boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.celestialPhantomBossGIF.img rsx: RSX.celestialPhantomBossGIF factionId: Factions.Songhai rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Faction2.CelestialPhantom skinNum: 1 animResource: { breathing : RSX.bossSoulstealerBreathing.name idle : RSX.bossSoulstealerIdle.name walk : RSX.bossSoulstealerRun.name attack : RSX.bossSoulstealerAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSoulstealerDamage.name death : RSX.bossSoulstealerDeath.name } } cos[CardSkin.GrailmasterBoss] = { id: CardSkin.GrailmasterBoss typeId: CosmeticsTypeLookup.CardSkin # category of cosmetic name: "PI:NAME:<NAME>END_PI" shopDescription: "This skin was used in the Kahlmar the Spell Eater boss battle" enabled: true alwaysVisible: true order: ORDER_CARD_SKINS subTypeId: "Boss" img: RSX.grailmasterBossGIF.img rsx: RSX.grailmasterBossGIF factionId: Factions.Neutral rarityId: Rarity.Epic unlockable: true purchasable: true cardId: Cards.Neutral.Grailmaster skinNum: 1 animResource: { breathing : RSX.bossSpelleaterBreathing.name idle : RSX.bossSpelleaterIdle.name walk : RSX.bossSpelleaterRun.name attack : RSX.bossSpelleaterAttack.name attackReleaseDelay: 0.0 attackDelay: 1.25 damage : RSX.bossSpelleaterHit.name death : RSX.bossSpelleaterDeath.name } } # endregion Card Skins # region Card Backs cos[CardBack.Normal] = { id: CardBack.Normal typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_classic_name") shopDescription: i18next.t("cosmetics.cardback_classic_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Common img: RSX.card_back.img rsx: RSX.card_back glowOutlineRSX: RSX.card_back_glow_outline unlockable: false purchasable: false } cos[CardBack.Agenor] = { id: CardBack.Agenor typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_redstark_name") shopDescription: i18next.t("cosmetics.cardback_redstark_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_agenor.img rsx: RSX.card_back_agenor glowOutlineRSX: RSX.card_back_agenor_glow_outline unlockable: false purchasable: true } cos[CardBack.Gauntlet] = { id: CardBack.Gauntlet typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_sienna_name") shopDescription: i18next.t("cosmetics.cardback_sienna_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_gauntlet.img rsx: RSX.card_back_gauntlet glowOutlineRSX: RSX.card_back_gauntlet_glow_outline unlockable: false purchasable: true } cos[CardBack.Magma] = { id: CardBack.Magma typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_dance_of_dreams_name") shopDescription: i18next.t("cosmetics.cardback_dance_of_dreams_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_magma.img rsx: RSX.card_back_magma glowOutlineRSX: RSX.card_back_magma_glow_outline unlockable: false purchasable: true } cos[CardBack.Shimzar] = { id: CardBack.Shimzar typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_shimzar_name") shopDescription: i18next.t("cosmetics.cardback_shimzar_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_shimzar.img rsx: RSX.card_back_shimzar glowOutlineRSX: RSX.card_back_shimzar_glow_outline unlockable: true purchasable: true } cos[CardBack.LyonarGears] = { id: CardBack.LyonarGears typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_azurite_name") shopDescription: i18next.t("cosmetics.cardback_azurite_desc") enabled: true alwaysVisible: true order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_lyonar_gears.img rsx: RSX.card_back_lyonar_gears glowOutlineRSX: RSX.card_back_lyonar_gears_glow_outline unlockable: false purchasable: true } cos[CardBack.HumbleBundle] = { id: CardBack.HumbleBundle typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_humble_bundle_name") shopDescription: i18next.t("cosmetics.cardback_humble_bundle_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_humblebundle.img rsx: RSX.card_back_humblebundle glowOutlineRSX: RSX.card_back_humblebundle_glow_outline unlockable: true purchasable: false } cos[CardBack.DawnDuelysts] = { id: CardBack.DawnDuelysts typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_dawn_of_duelysts_name") shopDescription: i18next.t("cosmetics.cardback_dawn_of_duelysts_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_dawnduelysts.img rsx: RSX.card_back_dawnduelysts glowOutlineRSX: RSX.card_back_dawnduelysts_glow_outline unlockable: true purchasable: false } cos[CardBack.Snowchaser] = { id: CardBack.Snowchaser typeId: CosmeticsTypeLookup.CardBack # category of cosmetic name: i18next.t("cosmetics.cardback_snowchaser_cup_name") shopDescription: i18next.t("cosmetics.cardback_snowchaser_cup_desc") enabled: true alwaysVisible: false order: ORDER_CARD_BACKS rarityId: Rarity.Epic img: RSX.card_back_snowchaser.img rsx: RSX.card_back_snowchaser glowOutlineRSX: RSX.card_back_snowchaser_glow_outline unlockable: true purchasable: true } # endregion Card Backs # region Profile Icons cos[ProfileIcon.Tree] = { id: ProfileIcon.Tree typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_tree_of_eyos_name") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Fixed img: RSX.portrait_tree.img rsx: RSX.portrait_tree unlockable: false purchasable: false } cos[ProfileIcon.abyssian_abyssalcrawler] = { id: ProfileIcon.abyssian_abyssalcrawler typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_abyssal_crawler_name") shopDescription: i18next.t("cosmetics.icon_abyssal_crawler_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_abyssalcrawler.img rsx: RSX.portrait_abyssian_abyssalcrawler unlockable: false purchasable: true } cos[ProfileIcon.abyssian_cassyvasoulreaper1] = { id: ProfileIcon.abyssian_cassyvasoulreaper1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_cassyva_name") shopDescription: i18next.t("cosmetics.icon_cassyva_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_cassyvasoulreaper1.img rsx: RSX.portrait_abyssian_cassyvasoulreaper1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_maehv1] = { id: ProfileIcon.abyssian_maehv1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_maehv_name") shopDescription: i18next.t("cosmetics.icon_maehv_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_maehv1.img rsx: RSX.portrait_abyssian_maehv1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_crest] = { id: ProfileIcon.abyssian_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_abyssian_crest_name") shopDescription: i18next.t("cosmetics.icon_abyssian_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_crest.img rsx: RSX.portrait_abyssian_crest unlockable: false purchasable: true } cos[ProfileIcon.abyssian_gloomchaser] = { id: ProfileIcon.abyssian_gloomchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_gloomchaser_name") shopDescription: i18next.t("cosmetics.icon_gloomchaser_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_gloomchaser.img rsx: RSX.portrait_abyssian_gloomchaser unlockable: false purchasable: true } cos[ProfileIcon.abyssian_kelainosister] = { id: ProfileIcon.abyssian_kelainosister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_shadow_sister_name") shopDescription: i18next.t("cosmetics.icon_shadow_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_kelainosister.img rsx: RSX.portrait_abyssian_kelainosister unlockable: false purchasable: true } cos[ProfileIcon.abyssian_lilithe1] = { id: ProfileIcon.abyssian_lilithe1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_lilithe_name") shopDescription: i18next.t("cosmetics.icon_lilithe_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_lilithe1.img rsx: RSX.portrait_abyssian_lilithe1 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_lilithe2] = { id: ProfileIcon.abyssian_lilithe2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_lilithe_mk2_name") shopDescription: i18next.t("cosmetics.icon_lilithe_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_lilithe2.img rsx: RSX.portrait_abyssian_lilithe2 unlockable: false purchasable: true } cos[ProfileIcon.abyssian_vorpalreaver] = { id: ProfileIcon.abyssian_vorpalreaver typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_vorpal_reaver_name") shopDescription: i18next.t("cosmetics.icon_vorpal_reaver_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_abyssian_vorpalreaver.img rsx: RSX.portrait_abyssian_vorpalreaver unlockable: false purchasable: true } cos[ProfileIcon.abyssian_wraithling] = { id: ProfileIcon.abyssian_wraithling typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" factionId: Factions.Faction4 enabled: true name: i18next.t("cosmetics.icon_wraithling_name") shopDescription: i18next.t("cosmetics.icon_wraithling_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_abyssian_wraithling.img rsx: RSX.portrait_abyssian_wraithling unlockable: false purchasable: true } cos[ProfileIcon.frostfire] = { id: ProfileIcon.frostfire typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_frostfire_2015_name") shopDescription: i18next.t("cosmetics.icon_frostfire_2015_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_frostfire.img rsx: RSX.portrait_frostfire unlockable: false purchasable: true } cos[ProfileIcon.lyonar_arclytesentinel] = { id: ProfileIcon.lyonar_arclytesentinel typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_arclyte_sentinel_name") shopDescription: i18next.t("cosmetics.icon_arclyte_sentinel_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_arclytesentinel.img rsx: RSX.portrait_lyonar_arclytesentinel unlockable: false purchasable: true } cos[ProfileIcon.lyonar_argeonhighmayne1] = { id: ProfileIcon.lyonar_argeonhighmayne1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_argeon_name") shopDescription: i18next.t("cosmetics.icon_argeon_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_argeonhighmayne1.img rsx: RSX.portrait_lyonar_argeonhighmayne1 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_argeonhighmayne2] = { id: ProfileIcon.lyonar_argeonhighmayne2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_argeon_mk2_name") shopDescription: i18next.t("cosmetics.icon_argeon_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_argeonhighmayne2.img rsx: RSX.portrait_lyonar_argeonhighmayne2 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_crest] = { id: ProfileIcon.lyonar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_lyonar_crest_name") shopDescription: i18next.t("cosmetics.icon_lyonar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_crest.img rsx: RSX.portrait_lyonar_crest unlockable: false purchasable: true } cos[ProfileIcon.lyonar_lightchaser] = { id: ProfileIcon.lyonar_lightchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_lightchaser_name") shopDescription: i18next.t("cosmetics.icon_lightchaser_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_lightchaser.img rsx: RSX.portrait_lyonar_lightchaser unlockable: false purchasable: true } cos[ProfileIcon.lyonar_silverguardknight] = { id: ProfileIcon.lyonar_silverguardknight typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_silverguard_knight_name") shopDescription: i18next.t("cosmetics.icon_silverguard_knight_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_silverguardknight.img rsx: RSX.portrait_lyonar_silverguardknight unlockable: false purchasable: true } cos[ProfileIcon.lyonar_steropesister] = { id: ProfileIcon.lyonar_steropesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_sun_sister_name") shopDescription: i18next.t("cosmetics.icon_sun_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_steropesister.img rsx: RSX.portrait_lyonar_steropesister unlockable: false purchasable: true } cos[ProfileIcon.lyonar_suntidemaiden] = { id: ProfileIcon.lyonar_suntidemaiden typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_suntide_maiden_name") shopDescription: i18next.t("cosmetics.icon_suntide_maiden_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_lyonar_suntidemaiden.img rsx: RSX.portrait_lyonar_suntidemaiden unlockable: false purchasable: true } cos[ProfileIcon.lyonar_windbladeadept] = { id: ProfileIcon.lyonar_windbladeadept typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_windblade_adept_name") shopDescription: i18next.t("cosmetics.icon_windblade_adept_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_windbladeadept.img rsx: RSX.portrait_lyonar_windbladeadept unlockable: false purchasable: true } cos[ProfileIcon.lyonar_ziransunforge1] = { id: ProfileIcon.lyonar_ziransunforge1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_ziran_name") shopDescription: i18next.t("cosmetics.icon_ziran_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_ziransunforge1.img rsx: RSX.portrait_lyonar_ziransunforge1 unlockable: false purchasable: true } cos[ProfileIcon.lyonar_brome1] = { id: ProfileIcon.lyonar_brome1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" factionId: Factions.Faction1 enabled: true name: i18next.t("cosmetics.icon_brome_name") shopDescription: i18next.t("cosmetics.icon_brome_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_lyonar_brome1.img rsx: RSX.portrait_lyonar_brome1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_crest] = { id: ProfileIcon.magmar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_magmar_crest_name") shopDescription: i18next.t("cosmetics.icon_magmar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_crest.img rsx: RSX.portrait_magmar_crest unlockable: false purchasable: true } cos[ProfileIcon.magmar_dreadnought] = { id: ProfileIcon.magmar_dreadnought typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_dreadnought_name") shopDescription: i18next.t("cosmetics.icon_dreadnought_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_dreadnought.img rsx: RSX.portrait_magmar_dreadnought unlockable: false purchasable: true } cos[ProfileIcon.magmar_elucidator] = { id: ProfileIcon.magmar_elucidator typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_elucidator_name") shopDescription: i18next.t("cosmetics.icon_elucidator_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_elucidator.img rsx: RSX.portrait_magmar_elucidator unlockable: false purchasable: true } cos[ProfileIcon.magmar_makantorwarbeast] = { id: ProfileIcon.magmar_makantorwarbeast typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_makantor_name") shopDescription: i18next.t("cosmetics.icon_makantor_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_makantorwarbeast.img rsx: RSX.portrait_magmar_makantorwarbeast unlockable: false purchasable: true } cos[ProfileIcon.magmar_phalanxar] = { id: ProfileIcon.magmar_phalanxar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_phalanxar_name") shopDescription: i18next.t("cosmetics.icon_phalanxar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_phalanxar.img rsx: RSX.portrait_magmar_phalanxar unlockable: false purchasable: true } cos[ProfileIcon.magmar_silitharelder] = { id: ProfileIcon.magmar_silitharelder typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_silithar_elder_name") shopDescription: i18next.t("cosmetics.icon_silithar_elder_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_silitharelder.img rsx: RSX.portrait_magmar_silitharelder unlockable: false purchasable: true } cos[ProfileIcon.magmar_starhorn1] = { id: ProfileIcon.magmar_starhorn1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_starhorn_1_name") shopDescription: i18next.t("cosmetics.icon_starhorn_1_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_starhorn1.img rsx: RSX.portrait_magmar_starhorn1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_starhorn2] = { id: ProfileIcon.magmar_starhorn2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_starhorn_2_name") shopDescription: i18next.t("cosmetics.icon_starhorn_2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_starhorn2.img rsx: RSX.portrait_magmar_starhorn2 unlockable: false purchasable: true } cos[ProfileIcon.magmar_ragnora1] = { id: ProfileIcon.magmar_ragnora1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_ragnora_name") shopDescription: i18next.t("cosmetics.icon_ragnora_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_ragnora1.img rsx: RSX.portrait_magmar_ragnora1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_taygetesister] = { id: ProfileIcon.magmar_taygetesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_taygete_name") shopDescription: i18next.t("cosmetics.icon_taygete_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_taygetesister.img rsx: RSX.portrait_magmar_taygetesister unlockable: false purchasable: true } cos[ProfileIcon.magmar_vaath1] = { id: ProfileIcon.magmar_vaath1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_vaath_name") shopDescription: i18next.t("cosmetics.icon_vaath_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_vaath1.img rsx: RSX.portrait_magmar_vaath1 unlockable: false purchasable: true } cos[ProfileIcon.magmar_vaath2] = { id: ProfileIcon.magmar_vaath2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_vaath_mk2_name") shopDescription: i18next.t("cosmetics.icon_vaath_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_magmar_vaath2.img rsx: RSX.portrait_magmar_vaath2 unlockable: false purchasable: true } cos[ProfileIcon.magmar_veteransilithar] = { id: ProfileIcon.magmar_veteransilithar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_veteran_silithar_name") shopDescription: i18next.t("cosmetics.icon_veteran_silithar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_veteransilithar.img rsx: RSX.portrait_magmar_veteransilithar unlockable: false purchasable: true } cos[ProfileIcon.magmar_youngsilithar] = { id: ProfileIcon.magmar_youngsilithar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Magmar" factionId: Factions.Faction5 enabled: true name: i18next.t("cosmetics.icon_young_silithar_name") shopDescription: i18next.t("cosmetics.icon_young_silithar_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_magmar_youngsilithar.img rsx: RSX.portrait_magmar_youngsilithar unlockable: false purchasable: true } cos[ProfileIcon.neutral_beastmaster] = { id: ProfileIcon.neutral_beastmaster typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_beastmaster_name") shopDescription: i18next.t("cosmetics.icon_beastmaster_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_beastmaster.img rsx: RSX.portrait_neutral_beastmaster unlockable: false purchasable: true } cos[ProfileIcon.neutral_cannonofmechaz0r] = { id: ProfileIcon.neutral_cannonofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_cannon_mech_name") shopDescription: i18next.t("cosmetics.icon_cannon_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_cannonofmechaz0r.img rsx: RSX.portrait_neutral_cannonofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_chassisofmechaz0r] = { id: ProfileIcon.neutral_chassisofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_chassis_mech_name") shopDescription: i18next.t("cosmetics.icon_chassis_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_chassisofmechaz0r.img rsx: RSX.portrait_neutral_chassisofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_gnasher] = { id: ProfileIcon.neutral_gnasher typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_gnasher_name") shopDescription: i18next.t("cosmetics.icon_gnasher_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_gnasher.img rsx: RSX.portrait_neutral_gnasher unlockable: false purchasable: true } cos[ProfileIcon.neutral_goldenmantella] = { id: ProfileIcon.neutral_goldenmantella typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_golden_mantella_name") shopDescription: i18next.t("cosmetics.icon_golden_mantella_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_goldenmantella.img rsx: RSX.portrait_neutral_goldenmantella unlockable: false purchasable: true } cos[ProfileIcon.neutral_grincher] = { id: ProfileIcon.neutral_grincher typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_grincher_name") shopDescription: i18next.t("cosmetics.icon_grincher_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_grincher.img rsx: RSX.portrait_neutral_grincher unlockable: false purchasable: true } cos[ProfileIcon.neutral_helmofmechaz0r] = { id: ProfileIcon.neutral_helmofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_helm_mech_name") shopDescription: i18next.t("cosmetics.icon_helm_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_helmofmechaz0r.img rsx: RSX.portrait_neutral_helmofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_hydrax1] = { id: ProfileIcon.neutral_hydrax1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_hydrax_name") shopDescription: i18next.t("cosmetics.icon_hydrax_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_hydrax1.img rsx: RSX.portrait_neutral_hydrax1 unlockable: false purchasable: true } cos[ProfileIcon.neutral_hydrax2] = { id: ProfileIcon.neutral_hydrax2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_hydrax_2_name") shopDescription: i18next.t("cosmetics.icon_hydrax_2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_hydrax2.img rsx: RSX.portrait_neutral_hydrax2 unlockable: false purchasable: true } cos[ProfileIcon.neutral_ion] = { id: ProfileIcon.neutral_ion typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_ion_name") shopDescription: i18next.t("cosmetics.icon_ion_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_ion.img rsx: RSX.portrait_neutral_ion unlockable: false purchasable: true } cos[ProfileIcon.neutral_ladylocke] = { id: ProfileIcon.neutral_ladylocke typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_lady_locke_name") shopDescription: i18next.t("cosmetics.icon_lady_locke_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_ladylocke.img rsx: RSX.portrait_neutral_ladylocke unlockable: false purchasable: true } cos[ProfileIcon.neutral_lkiansister] = { id: ProfileIcon.neutral_lkiansister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_sworn_sister_name") shopDescription: i18next.t("cosmetics.icon_sworn_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_lkiansister.img rsx: RSX.portrait_neutral_lkiansister unlockable: false purchasable: true } cos[ProfileIcon.neutral_mechaz0r] = { id: ProfileIcon.neutral_mechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_mechaz0r_name") shopDescription: i18next.t("cosmetics.icon_mechaz0r_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_mechaz0r.img rsx: RSX.portrait_neutral_mechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_nip] = { id: ProfileIcon.neutral_nip typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_dex_name") shopDescription: i18next.t("cosmetics.icon_dex_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_nip.img rsx: RSX.portrait_neutral_nip unlockable: false purchasable: true } cos[ProfileIcon.neutral_rawr] = { id: ProfileIcon.neutral_rawr typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rawr_name") shopDescription: i18next.t("cosmetics.icon_rawr_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rawr.img rsx: RSX.portrait_neutral_rawr unlockable: false purchasable: true } cos[ProfileIcon.neutral_rok] = { id: ProfileIcon.neutral_rok typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rok_name") shopDescription: i18next.t("cosmetics.icon_rok_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rok.img rsx: RSX.portrait_neutral_rok unlockable: false purchasable: true } cos[ProfileIcon.neutral_rook] = { id: ProfileIcon.neutral_rook typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_rook_name") shopDescription: i18next.t("cosmetics.icon_rook_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_rook.img rsx: RSX.portrait_neutral_rook unlockable: false purchasable: true } cos[ProfileIcon.neutral_silverbeak] = { id: ProfileIcon.neutral_silverbeak typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_silverbeak_name") shopDescription: i18next.t("cosmetics.icon_silverbeak_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_neutral_silverbeak.img rsx: RSX.portrait_neutral_silverbeak unlockable: false purchasable: true } cos[ProfileIcon.neutral_soboro] = { id: ProfileIcon.neutral_soboro typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_soboro_name") shopDescription: i18next.t("cosmetics.icon_soboro_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_soboro.img rsx: RSX.portrait_neutral_soboro unlockable: false purchasable: true } cos[ProfileIcon.neutral_swordofmechaz0r] = { id: ProfileIcon.neutral_swordofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_sword_mech_name") shopDescription: i18next.t("cosmetics.icon_sword_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_swordofmechaz0r.img rsx: RSX.portrait_neutral_swordofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_wingsofmechaz0r] = { id: ProfileIcon.neutral_wingsofmechaz0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_wings_mech_name") shopDescription: i18next.t("cosmetics.icon_wings_mech_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_wingsofmechaz0r.img rsx: RSX.portrait_neutral_wingsofmechaz0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_z0r] = { id: ProfileIcon.neutral_z0r typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_z0r_name") shopDescription: i18next.t("cosmetics.icon_z0r_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_z0r.img rsx: RSX.portrait_neutral_z0r unlockable: false purchasable: true } cos[ProfileIcon.neutral_zukong] = { id: ProfileIcon.neutral_zukong typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_zukong_name") shopDescription: i18next.t("cosmetics.icon_zukong_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_neutral_zukong.img rsx: RSX.portrait_neutral_zukong unlockable: false purchasable: true } cos[ProfileIcon.songhai_alkyonesister] = { id: ProfileIcon.songhai_alkyonesister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_storm_sister_name") shopDescription: i18next.t("cosmetics.icon_storm_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_alkyonesister.img rsx: RSX.portrait_songhai_alkyonesister unlockable: false purchasable: true } cos[ProfileIcon.songhai_crest] = { id: ProfileIcon.songhai_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_songhai_crest_name") shopDescription: i18next.t("cosmetics.icon_songhai_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_crest.img rsx: RSX.portrait_songhai_crest unlockable: false purchasable: true } cos[ProfileIcon.songhai_gorehorn] = { id: ProfileIcon.songhai_gorehorn typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_gorehorn_name") shopDescription: i18next.t("cosmetics.icon_gorehorn_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_gorehorn.img rsx: RSX.portrait_songhai_gorehorn unlockable: false purchasable: true } cos[ProfileIcon.songhai_grandmasterzendo] = { id: ProfileIcon.songhai_grandmasterzendo typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_zendo_name") shopDescription: i18next.t("cosmetics.icon_zendo_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_grandmasterzendo.img rsx: RSX.portrait_songhai_grandmasterzendo unlockable: false purchasable: true } cos[ProfileIcon.songhai_heartseeker] = { id: ProfileIcon.songhai_heartseeker typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_heartseeker_name") shopDescription: i18next.t("cosmetics.icon_heartseeker_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_heartseeker.img rsx: RSX.portrait_songhai_heartseeker unlockable: false purchasable: true } cos[ProfileIcon.songhai_kaidoassassin] = { id: ProfileIcon.songhai_kaidoassassin typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_kaido_assassin_name") shopDescription: i18next.t("cosmetics.icon_kaido_assassin_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_kaidoassassin.img rsx: RSX.portrait_songhai_kaidoassassin unlockable: false purchasable: true } cos[ProfileIcon.songhai_kaleosxaan1] = { id: ProfileIcon.songhai_kaleosxaan1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_kaleos_name") shopDescription: i18next.t("cosmetics.icon_kaleos_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_kaleosxaan1.img rsx: RSX.portrait_songhai_kaleosxaan1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_revaeventide1] = { id: ProfileIcon.songhai_revaeventide1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_reva_name") shopDescription: i18next.t("cosmetics.icon_reva_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_revaeventide1.img rsx: RSX.portrait_songhai_revaeventide1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_revaeventide2] = { id: ProfileIcon.songhai_revaeventide2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_reva_mk2_name") shopDescription: i18next.t("cosmetics.icon_reva_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_revaeventide2.img rsx: RSX.portrait_songhai_revaeventide2 unlockable: false purchasable: true } cos[ProfileIcon.songhai_shidai1] = { id: ProfileIcon.songhai_shidai1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_shidai_name") shopDescription: i18next.t("cosmetics.icon_shidai_name") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_shidai1.img rsx: RSX.portrait_songhai_shidai1 unlockable: false purchasable: true } cos[ProfileIcon.songhai_scarletviper] = { id: ProfileIcon.songhai_scarletviper typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_scarlet_viper_name") shopDescription: i18next.t("cosmetics.icon_scarlet_viper_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_scarletviper.img rsx: RSX.portrait_songhai_scarletviper unlockable: false purchasable: true } cos[ProfileIcon.songhai_tuskboar] = { id: ProfileIcon.songhai_tuskboar typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_tusk_boar_name") shopDescription: i18next.t("cosmetics.icon_tusk_boar_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_songhai_tuskboar.img rsx: RSX.portrait_songhai_tuskboar unlockable: false purchasable: true } cos[ProfileIcon.songhai_widowmaker] = { id: ProfileIcon.songhai_widowmaker typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" factionId: Factions.Faction2 enabled: true name: i18next.t("cosmetics.icon_widowmaker_name") shopDescription: i18next.t("cosmetics.icon_widowmaker_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_songhai_widowmaker.img rsx: RSX.portrait_songhai_widowmaker unlockable: false purchasable: true } cos[ProfileIcon.vanar_arcticdisplacer] = { id: ProfileIcon.vanar_arcticdisplacer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_arctic_displacer_name") shopDescription: i18next.t("cosmetics.icon_arctic_displacer_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_arcticdisplacer.img rsx: RSX.portrait_vanar_arcticdisplacer unlockable: false purchasable: true } cos[ProfileIcon.vanar_crest] = { id: ProfileIcon.vanar_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_vanar_crest_name") shopDescription: i18next.t("cosmetics.icon_vanar_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_crest.img rsx: RSX.portrait_vanar_crest unlockable: false purchasable: true } cos[ProfileIcon.vanar_draugarlord] = { id: ProfileIcon.vanar_draugarlord typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_draugar_lord_name") shopDescription: i18next.t("cosmetics.icon_draugar_lord_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_draugarlord.img rsx: RSX.portrait_vanar_draugarlord unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing_warbird] = { id: ProfileIcon.vanar_faiebloodwing_warbird typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_warbird_name") shopDescription: i18next.t("cosmetics.icon_warbird_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing_warbird.img rsx: RSX.portrait_vanar_faiebloodwing_warbird unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing1] = { id: ProfileIcon.vanar_faiebloodwing1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_faie_name") shopDescription: i18next.t("cosmetics.icon_faie_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing1.img rsx: RSX.portrait_vanar_faiebloodwing1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_faiebloodwing2] = { id: ProfileIcon.vanar_faiebloodwing2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_faie_mk2_name") shopDescription: i18next.t("cosmetics.icon_faie_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_faiebloodwing2.img rsx: RSX.portrait_vanar_faiebloodwing2 unlockable: false purchasable: true } cos[ProfileIcon.vanar_glacialelemental] = { id: ProfileIcon.vanar_glacialelemental typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_glacial_elemental_name") shopDescription: i18next.t("cosmetics.icon_glacial_elemental_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_glacialelemental.img rsx: RSX.portrait_vanar_glacialelemental unlockable: false purchasable: true } cos[ProfileIcon.vanar_hearthsister] = { id: ProfileIcon.vanar_hearthsister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_hearth_sister_name") shopDescription: i18next.t("cosmetics.icon_hearth_sister_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_hearthsister.img rsx: RSX.portrait_vanar_hearthsister unlockable: false purchasable: true } cos[ProfileIcon.vanar_icebladedryad] = { id: ProfileIcon.vanar_icebladedryad typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_iceblade_dryad_name") shopDescription: i18next.t("cosmetics.icon_iceblade_dryad_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_icebladedryad.img rsx: RSX.portrait_vanar_icebladedryad unlockable: false purchasable: true } cos[ProfileIcon.vanar_karawinterblade1] = { id: ProfileIcon.vanar_karawinterblade1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_kara_name") shopDescription: i18next.t("cosmetics.icon_kara_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_karawinterblade1.img rsx: RSX.portrait_vanar_karawinterblade1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_karawinterblade2] = { id: ProfileIcon.vanar_karawinterblade2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_kara_mk2_name") shopDescription: i18next.t("cosmetics.icon_kara_mk2_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_karawinterblade2.img rsx: RSX.portrait_vanar_karawinterblade2 unlockable: false purchasable: true } cos[ProfileIcon.vanar_ilena1] = { id: ProfileIcon.vanar_ilena1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_ilena_name") shopDescription: i18next.t("cosmetics.icon_ilena_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_ilena1.img rsx: RSX.portrait_vanar_ilena1 unlockable: false purchasable: true } cos[ProfileIcon.vanar_maiasister] = { id: ProfileIcon.vanar_maiasister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_wind_sister_name") shopDescription: i18next.t("cosmetics.icon_wind_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_maiasister.img rsx: RSX.portrait_vanar_maiasister unlockable: false purchasable: true } cos[ProfileIcon.vanar_razorback] = { id: ProfileIcon.vanar_razorback typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_razorback_name") shopDescription: i18next.t("cosmetics.icon_razorback_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_razorback.img rsx: RSX.portrait_vanar_razorback unlockable: false purchasable: true } cos[ProfileIcon.vanar_snowchaser] = { id: ProfileIcon.vanar_snowchaser typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_snowchaser_name") shopDescription: i18next.t("cosmetics.icon_snowchaser_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vanar_snowchaser.img rsx: RSX.portrait_vanar_snowchaser unlockable: false purchasable: true } cos[ProfileIcon.vanar_wolfraven] = { id: ProfileIcon.vanar_wolfraven typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" factionId: Factions.Faction6 enabled: true name: i18next.t("cosmetics.icon_wolfraven_name") shopDescription: i18next.t("cosmetics.icon_wolfraven_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vanar_wolfraven.img rsx: RSX.portrait_vanar_wolfraven unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_crest] = { id: ProfileIcon.vetruvian_crest typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_vetruvian_crest_name") shopDescription: i18next.t("cosmetics.icon_vetruvian_crest_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_crest.img rsx: RSX.portrait_vetruvian_crest unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_miragemaster] = { id: ProfileIcon.vetruvian_miragemaster typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_mirage_master_name") shopDescription: i18next.t("cosmetics.icon_mirage_master_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_miragemaster.img rsx: RSX.portrait_vetruvian_miragemaster unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_pax] = { id: ProfileIcon.vetruvian_pax typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_pax_name") shopDescription: i18next.t("cosmetics.icon_pax_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_pax.img rsx: RSX.portrait_vetruvian_pax unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_pyromancer] = { id: ProfileIcon.vetruvian_pyromancer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_pyromancer_name") shopDescription: i18next.t("cosmetics.icon_pyromancer_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_pyromancer.img rsx: RSX.portrait_vetruvian_pyromancer unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_rae] = { id: ProfileIcon.vetruvian_rae typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_rae_name") shopDescription: i18next.t("cosmetics.icon_rae_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_rae.img rsx: RSX.portrait_vetruvian_rae unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_saonsister] = { id: ProfileIcon.vetruvian_saonsister typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_sand_sister_name") shopDescription: i18next.t("cosmetics.icon_sand_sister_desc") rarityId: Rarity.Rare alwaysVisible: true img: RSX.portrait_vetruvian_saonsister.img rsx: RSX.portrait_vetruvian_saonsister unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_scionesssajj1] = { id: ProfileIcon.vetruvian_scionesssajj1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_sajj_name") shopDescription: i18next.t("cosmetics.icon_sajj_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_scionesssajj1.img rsx: RSX.portrait_vetruvian_scionesssajj1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_ciphyron1] = { id: ProfileIcon.vetruvian_ciphyron1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_ciphyron_name") shopDescription: i18next.t("cosmetics.icon_ciphyron_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_ciphyron1.img rsx: RSX.portrait_vetruvian_ciphyron1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_starfirescarab] = { id: ProfileIcon.vetruvian_starfirescarab typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_starfire_scarab_name") shopDescription: i18next.t("cosmetics.icon_starfire_scarab_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_starfirescarab.img rsx: RSX.portrait_vetruvian_starfirescarab unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_windshrike] = { id: ProfileIcon.vetruvian_windshrike typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_windshrike_name") shopDescription: i18next.t("cosmetics.icon_windshrike_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_windshrike.img rsx: RSX.portrait_vetruvian_windshrike unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_zirixstarstrider1] = { id: ProfileIcon.vetruvian_zirixstarstrider1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_zirix_name") shopDescription: i18next.t("cosmetics.icon_zirix_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_zirixstarstrider1.img rsx: RSX.portrait_vetruvian_zirixstarstrider1 unlockable: false purchasable: true } cos[ProfileIcon.vetruvian_zirixstarstrider2] = { id: ProfileIcon.vetruvian_zirixstarstrider2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" factionId: Factions.Faction3 enabled: true name: i18next.t("cosmetics.icon_zirix_mk2_name") shopDescription: i18next.t("cosmetics.icon_zirix_mk2_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_vetruvian_zirixstarstrider2.img rsx: RSX.portrait_vetruvian_zirixstarstrider2 unlockable: false purchasable: true } cos[ProfileIcon.Bloodmoon] = { id: ProfileIcon.Bloodmoon typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_bloodmoon_ruins_name") shopDescription: i18next.t("cosmetics.icon_bloodmoon_ruins_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_bloodmoon.img rsx: RSX.portrait_bloodmoon unlockable: false purchasable: false } cos[ProfileIcon.CrystalCaverns] = { id: ProfileIcon.CrystalCaverns typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_crystal_caverns_name") shopDescription: i18next.t("cosmetics.icon_crystal_caverns_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_crystal_caverns.img rsx: RSX.portrait_crystal_caverns unlockable: false purchasable: false } cos[ProfileIcon.Kaero] = { id: ProfileIcon.Kaero typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_kaero_name") shopDescription: i18next.t("cosmetics.icon_kaero_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_kaero.img rsx: RSX.portrait_kaero unlockable: false purchasable: false } cos[ProfileIcon.WhistlingBlade] = { id: ProfileIcon.WhistlingBlade typeId: CosmeticsTypeLookup.ProfileIcon subTypeId: "Neutral" name: i18next.t("cosmetics.icon_whistling_blades_name") shopDescription: i18next.t("cosmetics.icon_whistling_blades_desc") order: ORDER_PROFILE_ICONS enabled: true alwaysVisible: true rarityId: Rarity.Common img: RSX.portrait_whistling_blade.img rsx: RSX.portrait_whistling_blade unlockable: false purchasable: false } cos[ProfileIcon.obsidian_woods] = { id: ProfileIcon.obsidian_woods typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS enabled: true subTypeId: "Neutral" name: i18next.t("cosmetics.icon_obsidian_woods_name") shopDescription: i18next.t("cosmetics.icon_obsidian_woods_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_obsidian_woods.img rsx: RSX.portrait_obsidian_woods unlockable: false purchasable: false } cos[ProfileIcon.rashas_tomb] = { id: ProfileIcon.rashas_tomb typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS enabled: true subTypeId: "Neutral" name: i18next.t("cosmetics.icon_rashas_tomb_name") shopDescription: i18next.t("cosmetics.icon_rashas_tomb_desc") rarityId: Rarity.Common alwaysVisible: true img: RSX.portrait_rashas_tomb.img rsx: RSX.portrait_rashas_tomb unlockable: false purchasable: false } cos[ProfileIcon.grandmaster_icon] = { id: ProfileIcon.grandmaster_icon typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: i18next.t("cosmetics.icon_grandmaster_name") shopDescription: i18next.t("cosmetics.icon_grandmaster_desc") rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_grandmaster_portrait.img rsx: RSX.portrait_grandmaster_portrait unlockable: true purchasable: false } cos[ProfileIcon.tournament_dawnofduelysts1] = { id: ProfileIcon.tournament_dawnofduelysts1 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "Emperor Sargos" rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_tournament_dawnofduelysts1.img rsx: RSX.portrait_tournament_dawnofduelysts1 unlockable: false purchasable: true } cos[ProfileIcon.tournament_dawnofduelysts2] = { id: ProfileIcon.tournament_dawnofduelysts2 typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "The Coming of Rasha" shopDescription: "The Coming of Rasha" rarityId: Rarity.Common alwaysVisible: false img: RSX.portrait_tournament_dawnofduelysts2.img rsx: RSX.portrait_tournament_dawnofduelysts2 unlockable: false purchasable: true } cos[ProfileIcon.aer] = { id: ProfileIcon.aer typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "Aer Pridebeak" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_aer.img rsx: RSX.portrait_aer unlockable: false purchasable: true } cos[ProfileIcon.frizzing_mystic] = { id: ProfileIcon.frizzing_mystic typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "Frizzing Mystic" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_frizzing_mystic.img rsx: RSX.portrait_frizzing_mystic unlockable: false purchasable: true } cos[ProfileIcon.gibbet] = { id: ProfileIcon.gibbet typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "Gibbet" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_gibbet.img rsx: RSX.portrait_gibbet unlockable: false purchasable: true } cos[ProfileIcon.orbo] = { id: ProfileIcon.orbo typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "Orbo the Ostentatious" shopDescription: "Orbo the Ostentatious" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_orbo.img rsx: RSX.portrait_orbo unlockable: false purchasable: true } cos[ProfileIcon.canopic] = { id: ProfileIcon.canopic typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vetruvian" enabled: true name: "Fifth Canopic" shopDescription: "Fifth Canopic" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_canopic.img rsx: RSX.portrait_canopic unlockable: false purchasable: true } cos[ProfileIcon.veracity] = { id: ProfileIcon.veracity typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Vanar" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "Yggdra's Voracity" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_veracity.img rsx: RSX.portrait_veracity unlockable: false purchasable: true } cos[ProfileIcon.indominus] = { id: ProfileIcon.indominus typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Lyonar" enabled: true name: "Indominus" shopDescription: "Indominus" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_indominus.img rsx: RSX.portrait_indominus unlockable: false purchasable: true } cos[ProfileIcon.spriggen] = { id: ProfileIcon.spriggen typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "Spriggen" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_spriggen.img rsx: RSX.portrait_spriggen unlockable: false purchasable: true } cos[ProfileIcon.eternityPainter] = { id: ProfileIcon.eternityPainter typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Songhai" enabled: true name: "Eternity Painter" shopDescription: "Eternity Painter" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_eternityPainter.img rsx: RSX.portrait_eternityPainter unlockable: false purchasable: true } cos[ProfileIcon.skullProphet] = { id: ProfileIcon.skullProphet typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Abyssian" enabled: true name: "Skull Prophet" shopDescription: "Skull Prophet" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_skullProphet.img rsx: RSX.portrait_skullProphet unlockable: false purchasable: true } cos[ProfileIcon.sinisterSilhouette] = { id: ProfileIcon.sinisterSilhouette typeId: CosmeticsTypeLookup.ProfileIcon order: ORDER_PROFILE_ICONS subTypeId: "Neutral" enabled: true name: "PI:NAME:<NAME>END_PI" shopDescription: "PI:NAME:<NAME>END_PI" rarityId: Rarity.Rare alwaysVisible: false img: RSX.portrait_sinisterSilhouette.img rsx: RSX.portrait_sinisterSilhouette unlockable: false purchasable: true } # endregion Profile Icons # region emotes # Emotes were converted from prior format (from EmoteFactory) to this by executing these regex replaces: # https://gist.github.com/RobotRocker/13b08cd699b2a0242d9ae770dcdcb7a6 # region TEXT cos[Emote.TextHello] = { id: Emote.TextHello typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_hello_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextGLHF] = { id: Emote.TextGLHF typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_glhf_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextGG] = { id: Emote.TextGG typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_well_played_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } cos[Emote.TextOops] = { id: Emote.TextOops typeId: CosmeticsTypeLookup.Emote subTypeId: "Other" enabled: true alwaysVisible: true img: null rsx: null title: i18next.t("cosmetics.emote_oops_name") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Default rarityId: Rarity.Fixed unlockable: false purchasable: false } # endregion TEXT # region HEALING MYSTIC cos[Emote.HealingMysticHappy] = { id: Emote.HealingMysticHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_happy.img rsx: RSX.emote_healing_mystic_happy title: "So Happy!" name: i18next.t("cosmetics.emote_hm_happy_name") shopDescription: i18next.t("cosmetics.emote_hm_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticSad] = { id: Emote.HealingMysticSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_sad.img rsx: RSX.emote_healing_mystic_sad title: "So Sad!" name: i18next.t("cosmetics.emote_hm_sad_name") shopDescription: i18next.t("cosmetics.emote_hm_sad_desc") emoteOrder: EMOTE_ORDER_SAD factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticThumbsUp] = { id: Emote.HealingMysticThumbsUp typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_thumbs_up.img rsx: RSX.emote_healing_mystic_thumbs_up title: "Yay!" name: i18next.t("cosmetics.emote_hm_thumbs_up_name") shopDescription: i18next.t("cosmetics.emote_hm_thumbs_up_desc") emoteOrder: EMOTE_ORDER_TAUNT factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticConfused] = { id: Emote.HealingMysticConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_confused.img rsx: RSX.emote_healing_mystic_confused title: "Huh!?" name: i18next.t("cosmetics.emote_hm_surprise_name") shopDescription: i18next.t("cosmetics.emote_hm_surprise_desc") emoteOrder: EMOTE_ORDER_CONFUSED factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } cos[Emote.HealingMysticBlink] = { id: Emote.HealingMysticBlink typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_healing_mystic_blink.img rsx: RSX.emote_healing_mystic_blink title: "Blink" name: i18next.t("cosmetics.emote_hm_blink_name") shopDescription: i18next.t("cosmetics.emote_hm_blink_desc") emoteOrder: EMOTE_ORDER_BOW factionId: Factions.Neutral rarityId: Rarity.Epic category: EmoteCategory.Other unlockable: false purchasable: true } # endregion HEALING MYSTIC # region ALPHA cos[Emote.OtherIcebladeDryad] = { id: Emote.OtherIcebladeDryad typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: false alwaysVisible: false img: RSX.emote_alpha_iceblade_dryad.img rsx: RSX.emote_alpha_iceblade_dryad title: "Peace!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherRook] = { id: Emote.OtherRook typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: true alwaysVisible: false img: RSX.emote_alpha_rook.img rsx: RSX.emote_alpha_rook title: "Yeah Baby!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherLightchaser] = { id: Emote.OtherLightchaser typeId: CosmeticsTypeLookup.Emote subTypeId: "Alpha" enabled: false alwaysVisible: false img: RSX.emote_alpha_lightchaser.img rsx: RSX.emote_alpha_lightchaser title: "Blargh!" emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.OtherSnowChaserHoliday2015] = { id: Emote.OtherSnowChaserHoliday2015 typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_neutral_snowchaser_holiday_2015.img rsx: RSX.emote_neutral_snowchaser_holiday_2015 title: "Happy Holidays!" name: i18next.t("cosmetics.emote_holiday_snowchaser_name") shopDescription: i18next.t("cosmetics.emote_holiday_snowchaser_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: true } # endregion ALPHA # region NEUTRAL cos[Emote.emote_mechaz0r_cannon_confused] = { id: Emote.emote_mechaz0r_cannon_confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_cannon_confused.img rsx: RSX.emote_mechaz0r_cannon_confused name: i18next.t("cosmetics.emote_cannon_mech_name") shopDescription: i18next.t("cosmetics.emote_cannon_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_chassis_angry] = { id: Emote.emote_mechaz0r_chassis_angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_chassis_angry.img rsx: RSX.emote_mechaz0r_chassis_angry name: i18next.t("cosmetics.emote_chassis_mech_name") shopDescription: i18next.t("cosmetics.emote_chassis_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_helm_taunt] = { id: Emote.emote_mechaz0r_helm_taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_helm_taunt.img rsx: RSX.emote_mechaz0r_helm_taunt name: i18next.t("cosmetics.emote_helm_mech_name") shopDescription: i18next.t("cosmetics.emote_helm_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_sad] = { id: Emote.emote_mechaz0r_sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_sad.img rsx: RSX.emote_mechaz0r_sad name: i18next.t("cosmetics.emote_mechaz0r_name") shopDescription: i18next.t("cosmetics.emote_mechaz0r_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_sword_frustrated] = { id: Emote.emote_mechaz0r_sword_frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_sword_frustrated.img rsx: RSX.emote_mechaz0r_sword_frustrated name: i18next.t("cosmetics.emote_sword_mech_name") shopDescription: i18next.t("cosmetics.emote_sword_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_mechaz0r_wings_happy] = { id: Emote.emote_mechaz0r_wings_happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_mechaz0r_wings_happy.img rsx: RSX.emote_mechaz0r_wings_happy name: i18next.t("cosmetics.emote_wings_mech_name") shopDescription: i18next.t("cosmetics.emote_wings_mech_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_ladylocke] = { id: Emote.emote_ladylocke typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_ladylocke.img rsx: RSX.emote_ladylocke name: i18next.t("cosmetics.emote_lady_locke_name") shopDescription: i18next.t("cosmetics.emote_lady_locke_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_phalanxar_thumbsdown] = { id: Emote.emote_phalanxar_thumbsdown typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_phalanxar_thumbsdown.img rsx: RSX.emote_phalanxar_thumbsdown name: i18next.t("cosmetics.emote_phalanxar_name") shopDescription: i18next.t("cosmetics.emote_phalanxar_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Epic category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_snowchaser_bow] = { id: Emote.emote_snowchaser_bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: true img: RSX.emote_snowchaser_bow.img rsx: RSX.emote_snowchaser_bow name: i18next.t("cosmetics.emote_snowchaser_bow_name") shopDescription: i18next.t("cosmetics.emote_snowchaser_bow_desc") emoteOrder: EMOTE_ORDER_CUSTOM rarityId: Rarity.Rare category: EmoteCategory.Other factionId: Factions.Neutral unlockable: false purchasable: true } cos[Emote.emote_hollowgrovekeeper] = { id: Emote.emote_hollowgrovekeeper typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_hollowgrovekeeper.img rsx: RSX.emote_hollowgrovekeeper name: i18next.t("cosmetics.emote_hollow_grovekeeper_name") shopDescription: i18next.t("cosmetics.emote_hollow_grovekeeper_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_lightbender] = { id: Emote.emote_lightbender typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_lightbender.img rsx: RSX.emote_lightbender name: i18next.t("cosmetics.emote_lightbender_name") shopDescription: i18next.t("cosmetics.emote_lightbender_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_primusfist] = { id: Emote.emote_primusfist typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_primusfist.img rsx: RSX.emote_primusfist name: i18next.t("cosmetics.emote_primus_fist_name") shopDescription: i18next.t("cosmetics.emote_primus_fist_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_zenrui] = { id: Emote.emote_zenrui typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_zenrui.img rsx: RSX.emote_zenrui name: i18next.t("cosmetics.emote_zenrui_name") shopDescription: i18next.t("cosmetics.emote_zenrui_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_bow] = { id: Emote.emote_fog_bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_bow.img rsx: RSX.emote_fog_bow name: i18next.t("cosmetics.emote_fog_bow_name") shopDescription: i18next.t("cosmetics.emote_fog_bow_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_confused] = { id: Emote.emote_fog_confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_confused.img rsx: RSX.emote_fog_confused name: i18next.t("cosmetics.emote_fog_confused_name") shopDescription: i18next.t("cosmetics.emote_fog_confused_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_dead] = { id: Emote.emote_fog_dead typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_dead.img rsx: RSX.emote_fog_dead name: i18next.t("cosmetics.emote_fog_gg_name") shopDescription: i18next.t("cosmetics.emote_fog_gg_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_frustrated] = { id: Emote.emote_fog_frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_frustrated.img rsx: RSX.emote_fog_frustrated name: i18next.t("cosmetics.emote_fog_sweat_name") shopDescription: i18next.t("cosmetics.emote_fog_sweat_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_happy] = { id: Emote.emote_fog_happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_happy.img rsx: RSX.emote_fog_happy name: i18next.t("cosmetics.emote_fog_happy_name") shopDescription: i18next.t("cosmetics.emote_fog_happy_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sad] = { id: Emote.emote_fog_sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sad.img rsx: RSX.emote_fog_sad name: i18next.t("cosmetics.emote_fog_cry_name") shopDescription: i18next.t("cosmetics.emote_fog_cry_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sleep] = { id: Emote.emote_fog_sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sleep.img rsx: RSX.emote_fog_sleep name: i18next.t("cosmetics.emote_fog_sleep_name") shopDescription: i18next.t("cosmetics.emote_fog_sleep_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_sunglasses] = { id: Emote.emote_fog_sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_sunglasses.img rsx: RSX.emote_fog_sunglasses name: i18next.t("cosmetics.emote_fog_smile_name") shopDescription: i18next.t("cosmetics.emote_fog_smile_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_surprised] = { id: Emote.emote_fog_surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_surprised.img rsx: RSX.emote_fog_surprised name: i18next.t("cosmetics.emote_fog_surprised_name") shopDescription: i18next.t("cosmetics.emote_fog_surprised_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_taunt_alt] = { id: Emote.emote_fog_taunt_alt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_taunt_alt.img rsx: RSX.emote_fog_taunt_alt name: i18next.t("cosmetics.emote_fog_kiss_name") shopDescription: i18next.t("cosmetics.emote_fog_kiss_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } cos[Emote.emote_fog_taunt] = { id: Emote.emote_fog_taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Neutral" enabled: true alwaysVisible: false img: RSX.emote_fog_taunt.img rsx: RSX.emote_fog_taunt name: i18next.t("cosmetics.emote_fog_wink_name") shopDescription: i18next.t("cosmetics.emote_fog_wink_desc") emoteOrder: EMOTE_ORDER_CUSTOM category: EmoteCategory.Other factionId: Factions.Neutral unlockable: true purchasable: false } # endregion NEUTRAL # region FACTION 1 cos[Emote.Faction1Taunt] = { id: Emote.Faction1Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_taunt.img rsx: RSX.emote_f1_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Angry] = { id: Emote.Faction1Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_angry.img rsx: RSX.emote_f1_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Confused] = { id: Emote.Faction1Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_confused.img rsx: RSX.emote_f1_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sad] = { id: Emote.Faction1Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sad.img rsx: RSX.emote_f1_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Frustrated] = { id: Emote.Faction1Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_frustrated.img rsx: RSX.emote_f1_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Surprised] = { id: Emote.Faction1Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_surprised.img rsx: RSX.emote_f1_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Bow] = { id: Emote.Faction1Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_bow.img rsx: RSX.emote_f1_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sleep] = { id: Emote.Faction1Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sleep.img rsx: RSX.emote_f1_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Sunglasses] = { id: Emote.Faction1Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_sunglasses.img rsx: RSX.emote_f1_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } cos[Emote.Faction1Happy] = { id: Emote.Faction1Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_basic_happy.img rsx: RSX.emote_basic_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: false } cos[Emote.Faction1Kiss] = { id: Emote.Faction1Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_kiss.img rsx: RSX.emote_f1_kiss title: "Kiss" name: i18next.t("cosmetics.emote_argeon_love_name") shopDescription: i18next.t("cosmetics.emote_argeon_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.General unlockable: false purchasable: true } # endregion FACTION 1 # region FACTION 2 cos[Emote.Faction2Taunt] = { id: Emote.Faction2Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_taunt.img rsx: RSX.emote_f2_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Happy] = { id: Emote.Faction2Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_happy.img rsx: RSX.emote_f2_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Confused] = { id: Emote.Faction2Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_confused.img rsx: RSX.emote_f2_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sad] = { id: Emote.Faction2Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sad.img rsx: RSX.emote_f2_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Frustrated] = { id: Emote.Faction2Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_frustrated.img rsx: RSX.emote_f2_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Surprised] = { id: Emote.Faction2Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_surprised.img rsx: RSX.emote_f2_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Bow] = { id: Emote.Faction2Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_bow.img rsx: RSX.emote_f2_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sleep] = { id: Emote.Faction2Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sleep.img rsx: RSX.emote_f2_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Sunglasses] = { id: Emote.Faction2Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_sunglasses.img rsx: RSX.emote_f2_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } cos[Emote.Faction2Angry] = { id: Emote.Faction2Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_basic_angry.img rsx: RSX.emote_basic_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: false } cos[Emote.Faction2Kiss] = { id: Emote.Faction2Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_kiss.img rsx: RSX.emote_f2_kiss title: "Kiss" name: i18next.t("cosmetics.emote_kaleos_love_name") shopDescription: i18next.t("cosmetics.emote_kaleos_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.General unlockable: false purchasable: true } # endregion FACTION 2 # region FACTION 3 cos[Emote.Faction3Taunt] = { id: Emote.Faction3Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_taunt.img rsx: RSX.emote_f3_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Happy] = { id: Emote.Faction3Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_happy.img rsx: RSX.emote_f3_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Angry] = { id: Emote.Faction3Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_angry.img rsx: RSX.emote_f3_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sad] = { id: Emote.Faction3Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sad.img rsx: RSX.emote_f3_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Frustrated] = { id: Emote.Faction3Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_frustrated.img rsx: RSX.emote_f3_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Surprised] = { id: Emote.Faction3Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_surprised.img rsx: RSX.emote_f3_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Bow] = { id: Emote.Faction3Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_bow.img rsx: RSX.emote_f3_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sleep] = { id: Emote.Faction3Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sleep.img rsx: RSX.emote_f3_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Sunglasses] = { id: Emote.Faction3Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_sunglasses.img rsx: RSX.emote_f3_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } cos[Emote.Faction3Confused] = { id: Emote.Faction3Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_basic_confused.img rsx: RSX.emote_basic_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: false } cos[Emote.Faction3Kiss] = { id: Emote.Faction3Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_kiss.img rsx: RSX.emote_f3_kiss title: "Kiss" name: i18next.t("cosmetics.emote_zirix_love_name") shopDescription: i18next.t("cosmetics.emote_zirix_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.General unlockable: false purchasable: true } # endregion FACTION 3 # region FACTION 4 cos[Emote.Faction4Taunt] = { id: Emote.Faction4Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_taunt.img rsx: RSX.emote_f4_teal_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Happy] = { id: Emote.Faction4Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_happy.img rsx: RSX.emote_f4_teal_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Angry] = { id: Emote.Faction4Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_angry.img rsx: RSX.emote_f4_teal_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Confused] = { id: Emote.Faction4Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_confused.img rsx: RSX.emote_f4_teal_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sad] = { id: Emote.Faction4Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sad.img rsx: RSX.emote_f4_teal_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Surprised] = { id: Emote.Faction4Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_surprised.img rsx: RSX.emote_f4_teal_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Bow] = { id: Emote.Faction4Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_bow.img rsx: RSX.emote_f4_teal_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sleep] = { id: Emote.Faction4Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sleep.img rsx: RSX.emote_f4_teal_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Sunglasses] = { id: Emote.Faction4Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_sunglasses.img rsx: RSX.emote_f4_teal_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } cos[Emote.Faction4Frustrated] = { id: Emote.Faction4Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_frustrated.img rsx: RSX.emote_f4_teal_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: false } cos[Emote.Faction4Kiss] = { id: Emote.Faction4Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_teal_kiss.img rsx: RSX.emote_f4_teal_kiss title: "Kiss" name: i18next.t("cosmetics.emote_lilithe_love_name") shopDescription: i18next.t("cosmetics.emote_lilithe_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.General unlockable: false purchasable: true } # endregion FACTION 4 # region FACTION 5 cos[Emote.Faction5Taunt] = { id: Emote.Faction5Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_taunt.img rsx: RSX.emote_f5_taunt title: "Taunt" emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Happy] = { id: Emote.Faction5Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_happy.img rsx: RSX.emote_f5_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Angry] = { id: Emote.Faction5Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_angry.img rsx: RSX.emote_f5_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Confused] = { id: Emote.Faction5Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_confused.img rsx: RSX.emote_f5_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Frustrated] = { id: Emote.Faction5Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_frustrated.img rsx: RSX.emote_f5_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Surprised] = { id: Emote.Faction5Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_surprised.img rsx: RSX.emote_f5_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Bow] = { id: Emote.Faction5Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_bow.img rsx: RSX.emote_f5_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sleep] = { id: Emote.Faction5Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_sleep.img rsx: RSX.emote_f5_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sunglasses] = { id: Emote.Faction5Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_sunglasses.img rsx: RSX.emote_f5_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } cos[Emote.Faction5Sad] = { id: Emote.Faction5Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_basic_sad.img rsx: RSX.emote_basic_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: false } cos[Emote.Faction5Kiss] = { id: Emote.Faction5Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_kiss.img rsx: RSX.emote_f5_kiss title: "Kiss" name: i18next.t("cosmetics.emote_vaath_love_name") shopDescription: i18next.t("cosmetics.emote_vaath_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.General unlockable: false purchasable: true } # endregion FACTION 5 # region FACTION 6 cos[Emote.Faction6Frustrated] = { id: Emote.Faction6Frustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_frustrated.img rsx: RSX.emote_f6_frustrated title: "Frustrated" emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Happy] = { id: Emote.Faction6Happy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_happy.img rsx: RSX.emote_f6_happy title: "Happy" emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Angry] = { id: Emote.Faction6Angry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_angry.img rsx: RSX.emote_f6_angry title: "Angry" emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Confused] = { id: Emote.Faction6Confused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_confused.img rsx: RSX.emote_f6_confused title: "Confused" emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sad] = { id: Emote.Faction6Sad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sad.img rsx: RSX.emote_f6_sad title: "Sad" emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Surprised] = { id: Emote.Faction6Surprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_surprised.img rsx: RSX.emote_f6_surprised title: "Surprised" emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Bow] = { id: Emote.Faction6Bow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_bow.img rsx: RSX.emote_f6_bow title: "Bow" emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sleep] = { id: Emote.Faction6Sleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sleep.img rsx: RSX.emote_f6_sleep title: "Sleep" emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Sunglasses] = { id: Emote.Faction6Sunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_sunglasses.img rsx: RSX.emote_f6_sunglasses title: "Sunglasses" emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Taunt] = { id: Emote.Faction6Taunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_taunt.img rsx: RSX.emote_f6_taunt title: "Taunt" name: i18next.t("cosmetics.emote_faie_love_name") shopDescription: i18next.t("cosmetics.emote_faie_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: true } cos[Emote.Faction6Kiss] = { id: Emote.Faction6Kiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_basic_kiss.img rsx: RSX.emote_basic_kiss title: "Kiss" name: i18next.t("cosmetics.emote_faie_kiss_name") shopDescription: i18next.t("cosmetics.emote_faie_kiss_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.General unlockable: false purchasable: false } # endregion FACTION 6 # region ALT GENERALS # region FACTION 1 ALT cos[Emote.Faction1AltTaunt] = { id: Emote.Faction1AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_taunt.img rsx: RSX.emote_f1_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ziran_wink_name") shopDescription: i18next.t("cosmetics.emote_ziran_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltAngry] = { id: Emote.Faction1AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_angry.img rsx: RSX.emote_f1_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_ziran_angry_name") shopDescription: i18next.t("cosmetics.emote_ziran_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltConfused] = { id: Emote.Faction1AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_confused.img rsx: RSX.emote_f1_alt_confused name: i18next.t("cosmetics.emote_ziran_confused_name") shopDescription: i18next.t("cosmetics.emote_ziran_confused_desc") shopDescription: "Umm..." emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSad] = { id: Emote.Faction1AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sad.img rsx: RSX.emote_f1_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_ziran_crying_name") shopDescription: i18next.t("cosmetics.emote_ziran_crying_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltFrustrated] = { id: Emote.Faction1AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_frustrated.img rsx: RSX.emote_f1_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ziran_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ziran_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSurprised] = { id: Emote.Faction1AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_surprised.img rsx: RSX.emote_f1_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ziran_surprised_name") shopDescription: i18next.t("cosmetics.emote_ziran_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltBow] = { id: Emote.Faction1AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_bow.img rsx: RSX.emote_f1_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_ziran_bow_name") shopDescription: i18next.t("cosmetics.emote_ziran_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSleep] = { id: Emote.Faction1AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sleep.img rsx: RSX.emote_f1_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ziran_sleep_name") shopDescription: i18next.t("cosmetics.emote_ziran_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltSunglasses] = { id: Emote.Faction1AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_sunglasses.img rsx: RSX.emote_f1_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ziran_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ziran_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltHappy] = { id: Emote.Faction1AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_happy.img rsx: RSX.emote_f1_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_ziran_happy_name") shopDescription: i18next.t("cosmetics.emote_ziran_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction1AltKiss] = { id: Emote.Faction1AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_alt_kiss.img rsx: RSX.emote_f1_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ziran_love_name") shopDescription: i18next.t("cosmetics.emote_ziran_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.AltGeneral unlockable: false purchasable: true } # endregion FACTION 1 ALT # region FACTION 2 ALT cos[Emote.Faction2AltTaunt] = { id: Emote.Faction2AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_taunt.img rsx: RSX.emote_f2_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_reva_wink_name") shopDescription: i18next.t("cosmetics.emote_reva_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltHappy] = { id: Emote.Faction2AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_happy.img rsx: RSX.emote_f2_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_reva_happy_name") shopDescription: i18next.t("cosmetics.emote_reva_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltConfused] = { id: Emote.Faction2AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_confused.img rsx: RSX.emote_f2_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_reva_confused_name") shopDescription: i18next.t("cosmetics.emote_reva_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSad] = { id: Emote.Faction2AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sad.img rsx: RSX.emote_f2_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_reva_sad_name") shopDescription: i18next.t("cosmetics.emote_reva_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltFrustrated] = { id: Emote.Faction2AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_frustrated.img rsx: RSX.emote_f2_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_reva_frustrated_name") shopDescription: i18next.t("cosmetics.emote_reva_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSurprised] = { id: Emote.Faction2AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_surprised.img rsx: RSX.emote_f2_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_reva_surprised_name") shopDescription: i18next.t("cosmetics.emote_reva_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltBow] = { id: Emote.Faction2AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_bow.img rsx: RSX.emote_f2_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_reva_bow_name") shopDescription: i18next.t("cosmetics.emote_reva_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSleep] = { id: Emote.Faction2AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sleep.img rsx: RSX.emote_f2_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_reva_sleep_name") shopDescription: i18next.t("cosmetics.emote_reva_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltSunglasses] = { id: Emote.Faction2AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_sunglasses.img rsx: RSX.emote_f2_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_reva_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_reva_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltAngry] = { id: Emote.Faction2AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_angry.img rsx: RSX.emote_f2_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_reva_angry_name") shopDescription: i18next.t("cosmetics.emote_reva_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction2AltKiss] = { id: Emote.Faction2AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_alt_kiss.img rsx: RSX.emote_f2_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_reva_love_name") shopDescription: i18next.t("cosmetics.emote_reva_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.AltGeneral unlockable: false purchasable: true } # endregion FACTION 2 ALT # region FACTION 3 ALT cos[Emote.Faction3AltTaunt] = { id: Emote.Faction3AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_taunt.img rsx: RSX.emote_f3_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_sajj_wink_name") shopDescription: i18next.t("cosmetics.emote_sajj_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltHappy] = { id: Emote.Faction3AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_happy.img rsx: RSX.emote_f3_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_sajj_happy_name") shopDescription: i18next.t("cosmetics.emote_sajj_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltAngry] = { id: Emote.Faction3AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_angry.img rsx: RSX.emote_f3_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_sajj_angry_name") shopDescription: i18next.t("cosmetics.emote_sajj_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSad] = { id: Emote.Faction3AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sad.img rsx: RSX.emote_f3_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_sajj_sad_name") shopDescription: i18next.t("cosmetics.emote_sajj_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltFrustrated] = { id: Emote.Faction3AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_frustrated.img rsx: RSX.emote_f3_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_sajj_frustrated_name") shopDescription: i18next.t("cosmetics.emote_sajj_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSurprised] = { id: Emote.Faction3AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_surprised.img rsx: RSX.emote_f3_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_sajj_surprised_name") shopDescription: i18next.t("cosmetics.emote_sajj_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltBow] = { id: Emote.Faction3AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_bow.img rsx: RSX.emote_f3_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_sajj_bow_name") shopDescription: i18next.t("cosmetics.emote_sajj_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSleep] = { id: Emote.Faction3AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sleep.img rsx: RSX.emote_f3_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_sajj_sleep_name") shopDescription: i18next.t("cosmetics.emote_sajj_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltSunglasses] = { id: Emote.Faction3AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_sunglasses.img rsx: RSX.emote_f3_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_sajj_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_sajj_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltConfused] = { id: Emote.Faction3AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_confused.img rsx: RSX.emote_f3_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_sajj_confused_name") shopDescription: i18next.t("cosmetics.emote_sajj_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction3AltKiss] = { id: Emote.Faction3AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_alt_kiss.img rsx: RSX.emote_f3_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_sajj_love_name") shopDescription: i18next.t("cosmetics.emote_sajj_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.AltGeneral unlockable: false purchasable: true } # endregion FACTION 3 ALT # region FACTION 4 ALT cos[Emote.Faction4AltTaunt] = { id: Emote.Faction4AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_taunt.img rsx: RSX.emote_f4_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_cassyva_wink_name") shopDescription: i18next.t("cosmetics.emote_cassyva_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltHappy] = { id: Emote.Faction4AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_happy.img rsx: RSX.emote_f4_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_cassyva_happy_name") shopDescription: i18next.t("cosmetics.emote_cassyva_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltAngry] = { id: Emote.Faction4AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_angry.img rsx: RSX.emote_f4_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_cassyva_angry_name") shopDescription: i18next.t("cosmetics.emote_cassyva_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltConfused] = { id: Emote.Faction4AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_confused.img rsx: RSX.emote_f4_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_cassyva_confused_name") shopDescription: i18next.t("cosmetics.emote_cassyva_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSad] = { id: Emote.Faction4AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sad.img rsx: RSX.emote_f4_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_cassyva_sad_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSurprised] = { id: Emote.Faction4AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_surprised.img rsx: RSX.emote_f4_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_cassyva_surprised_name") shopDescription: i18next.t("cosmetics.emote_cassyva_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltBow] = { id: Emote.Faction4AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_bow.img rsx: RSX.emote_f4_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_cassyva_bow_name") shopDescription: i18next.t("cosmetics.emote_cassyva_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSleep] = { id: Emote.Faction4AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sleep.img rsx: RSX.emote_f4_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_cassyva_sleep_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltSunglasses] = { id: Emote.Faction4AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_sunglasses.img rsx: RSX.emote_f4_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_cassyva_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_cassyva_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltFrustrated] = { id: Emote.Faction4AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_frustrated.img rsx: RSX.emote_f4_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_cassyva_frustrated_name") shopDescription: i18next.t("cosmetics.emote_cassyva_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction4AltKiss] = { id: Emote.Faction4AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_alt_kiss.img rsx: RSX.emote_f4_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_cassyva_love_name") shopDescription: i18next.t("cosmetics.emote_cassyva_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.AltGeneral unlockable: false purchasable: true } # endregion FACTION 4 ALT # region FACTION 5 ALT cos[Emote.Faction5AltTaunt] = { id: Emote.Faction5AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_taunt.img rsx: RSX.emote_f5_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_starhorn_wink_name") shopDescription: i18next.t("cosmetics.emote_starhorn_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltHappy] = { id: Emote.Faction5AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_happy.img rsx: RSX.emote_f5_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_starhorn_happy_name") shopDescription: i18next.t("cosmetics.emote_starhorn_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltAngry] = { id: Emote.Faction5AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_angry.img rsx: RSX.emote_f5_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_starhorn_angry_name") shopDescription: i18next.t("cosmetics.emote_starhorn_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltConfused] = { id: Emote.Faction5AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_confused.img rsx: RSX.emote_f5_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_starhorn_confused_name") shopDescription: i18next.t("cosmetics.emote_starhorn_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltFrustrated] = { id: Emote.Faction5AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_frustrated.img rsx: RSX.emote_f5_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_starhorn_frustrated_name") shopDescription: i18next.t("cosmetics.emote_starhorn_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSurprised] = { id: Emote.Faction5AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_surprised.img rsx: RSX.emote_f5_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_starhorn_surprised_name") shopDescription: i18next.t("cosmetics.emote_starhorn_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltBow] = { id: Emote.Faction5AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_bow.img rsx: RSX.emote_f5_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_starhorn_bow_name") shopDescription: i18next.t("cosmetics.emote_starhorn_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSleep] = { id: Emote.Faction5AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sleep.img rsx: RSX.emote_f5_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_starhorn_sleep_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSunglasses] = { id: Emote.Faction5AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sunglasses.img rsx: RSX.emote_f5_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_starhorn_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltSad] = { id: Emote.Faction5AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_sad.img rsx: RSX.emote_f5_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_starhorn_sad_name") shopDescription: i18next.t("cosmetics.emote_starhorn_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction5AltKiss] = { id: Emote.Faction5AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_alt_kiss.img rsx: RSX.emote_f5_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_starhorn_love_name") shopDescription: i18next.t("cosmetics.emote_starhorn_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.AltGeneral unlockable: false purchasable: true } # endregion FACTION 5 ALT # region FACTION 6 ALT cos[Emote.Faction6AltFrustrated] = { id: Emote.Faction6AltFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_frustrated.img rsx: RSX.emote_f6_alt_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_kara_frustrated_name") shopDescription: i18next.t("cosmetics.emote_kara_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltHappy] = { id: Emote.Faction6AltHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_happy.img rsx: RSX.emote_f6_alt_happy title: "Happy" name: i18next.t("cosmetics.emote_kara_happy_name") shopDescription: i18next.t("cosmetics.emote_kara_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltAngry] = { id: Emote.Faction6AltAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_angry.img rsx: RSX.emote_f6_alt_angry title: "Angry" name: i18next.t("cosmetics.emote_kara_angry_name") shopDescription: i18next.t("cosmetics.emote_kara_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltConfused] = { id: Emote.Faction6AltConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_confused.img rsx: RSX.emote_f6_alt_confused title: "Confused" name: i18next.t("cosmetics.emote_kara_confused_name") shopDescription: i18next.t("cosmetics.emote_kara_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSad] = { id: Emote.Faction6AltSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sad.img rsx: RSX.emote_f6_alt_sad title: "Sad" name: i18next.t("cosmetics.emote_kara_sad_name") shopDescription: i18next.t("cosmetics.emote_kara_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSurprised] = { id: Emote.Faction6AltSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_surprised.img rsx: RSX.emote_f6_alt_surprised title: "Surprised" name: i18next.t("cosmetics.emote_kara_surprised_name") shopDescription: i18next.t("cosmetics.emote_kara_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltBow] = { id: Emote.Faction6AltBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_bow.img rsx: RSX.emote_f6_alt_bow title: "Bow" name: i18next.t("cosmetics.emote_kara_bow_name") shopDescription: i18next.t("cosmetics.emote_kara_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSleep] = { id: Emote.Faction6AltSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sleep.img rsx: RSX.emote_f6_alt_sleep title: "Sleep" name: i18next.t("cosmetics.emote_kara_sleep_name") shopDescription: i18next.t("cosmetics.emote_kara_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltSunglasses] = { id: Emote.Faction6AltSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_sunglasses.img rsx: RSX.emote_f6_alt_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_kara_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_kara_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltTaunt] = { id: Emote.Faction6AltTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_taunt.img rsx: RSX.emote_f6_alt_taunt title: "Taunt" name: i18next.t("cosmetics.emote_kara_wink_name") shopDescription: i18next.t("cosmetics.emote_kara_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } cos[Emote.Faction6AltKiss] = { id: Emote.Faction6AltKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_alt_kiss.img rsx: RSX.emote_f6_alt_kiss title: "Kiss" name: i18next.t("cosmetics.emote_kara_love_name") shopDescription: i18next.t("cosmetics.emote_kara_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.AltGeneral unlockable: false purchasable: true } # endregion FACTION 6 ALT # endregion ALT GENERALS # region THIRD GENERALS # region FACTION 1 THIRD cos[Emote.Faction1ThirdTaunt] = { id: Emote.Faction1ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_taunt.img rsx: RSX.emote_f1_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_brome_wink_name") shopDescription: i18next.t("cosmetics.emote_brome_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdAngry] = { id: Emote.Faction1ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_angry.img rsx: RSX.emote_f1_third_angry title: "Angry" name: i18next.t("cosmetics.emote_brome_angry_name") shopDescription: i18next.t("cosmetics.emote_brome_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdConfused] = { id: Emote.Faction1ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_confused.img rsx: RSX.emote_f1_third_confused name: i18next.t("cosmetics.emote_brome_confused_name") shopDescription: i18next.t("cosmetics.emote_brome_confused_desc") shopDescription: "Umm..." emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSad] = { id: Emote.Faction1ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sad.img rsx: RSX.emote_f1_third_sad title: "Sad" name: i18next.t("cosmetics.emote_brome_crying_name") shopDescription: i18next.t("cosmetics.emote_brome_crying_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdFrustrated] = { id: Emote.Faction1ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_frustrated.img rsx: RSX.emote_f1_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_brome_frustrated_name") shopDescription: i18next.t("cosmetics.emote_brome_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSurprised] = { id: Emote.Faction1ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_surprised.img rsx: RSX.emote_f1_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_brome_surprised_name") shopDescription: i18next.t("cosmetics.emote_brome_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdBow] = { id: Emote.Faction1ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_bow.img rsx: RSX.emote_f1_third_bow title: "Bow" name: i18next.t("cosmetics.emote_brome_bow_name") shopDescription: i18next.t("cosmetics.emote_brome_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSleep] = { id: Emote.Faction1ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sleep.img rsx: RSX.emote_f1_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_brome_sleep_name") shopDescription: i18next.t("cosmetics.emote_brome_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdSunglasses] = { id: Emote.Faction1ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_sunglasses.img rsx: RSX.emote_f1_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_brome_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_brome_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdHappy] = { id: Emote.Faction1ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_happy.img rsx: RSX.emote_f1_third_happy title: "Happy" name: i18next.t("cosmetics.emote_brome_happy_name") shopDescription: i18next.t("cosmetics.emote_brome_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction1ThirdKiss] = { id: Emote.Faction1ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Lyonar" enabled: true alwaysVisible: true img: RSX.emote_f1_third_kiss.img rsx: RSX.emote_f1_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_brome_love_name") shopDescription: i18next.t("cosmetics.emote_brome_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction1 generalId: Cards.Faction1.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 1 THIRD # region FACTION 2 THIRD cos[Emote.Faction2ThirdTaunt] = { id: Emote.Faction2ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_taunt.img rsx: RSX.emote_f2_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_shidai_wink_name") shopDescription: i18next.t("cosmetics.emote_shidai_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdHappy] = { id: Emote.Faction2ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_happy.img rsx: RSX.emote_f2_third_happy title: "Happy" name: i18next.t("cosmetics.emote_shidai_happy_name") shopDescription: i18next.t("cosmetics.emote_shidai_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdConfused] = { id: Emote.Faction2ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_confused.img rsx: RSX.emote_f2_third_confused title: "Confused" name: i18next.t("cosmetics.emote_shidai_confused_name") shopDescription: i18next.t("cosmetics.emote_shidai_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSad] = { id: Emote.Faction2ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sad.img rsx: RSX.emote_f2_third_sad title: "Sad" name: i18next.t("cosmetics.emote_shidai_sad_name") shopDescription: i18next.t("cosmetics.emote_shidai_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdFrustrated] = { id: Emote.Faction2ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_frustrated.img rsx: RSX.emote_f2_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_shidai_frustrated_name") shopDescription: i18next.t("cosmetics.emote_shidai_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSurprised] = { id: Emote.Faction2ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_surprised.img rsx: RSX.emote_f2_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_shidai_surprised_name") shopDescription: i18next.t("cosmetics.emote_shidai_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdBow] = { id: Emote.Faction2ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_bow.img rsx: RSX.emote_f2_third_bow title: "Bow" name: i18next.t("cosmetics.emote_shidai_bow_name") shopDescription: i18next.t("cosmetics.emote_shidai_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSleep] = { id: Emote.Faction2ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sleep.img rsx: RSX.emote_f2_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_shidai_sleep_name") shopDescription: i18next.t("cosmetics.emote_shidai_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdSunglasses] = { id: Emote.Faction2ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_sunglasses.img rsx: RSX.emote_f2_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_shidai_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_shidai_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdAngry] = { id: Emote.Faction2ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_angry.img rsx: RSX.emote_f2_third_angry title: "Angry" name: i18next.t("cosmetics.emote_shidai_angry_name") shopDescription: i18next.t("cosmetics.emote_shidai_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction2ThirdKiss] = { id: Emote.Faction2ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Songhai" enabled: true alwaysVisible: true img: RSX.emote_f2_third_kiss.img rsx: RSX.emote_f2_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_shidai_love_name") shopDescription: i18next.t("cosmetics.emote_shidai_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction2 generalId: Cards.Faction2.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 2 THIRD # region FACTION 3 THIRD cos[Emote.Faction3ThirdTaunt] = { id: Emote.Faction3ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_taunt.img rsx: RSX.emote_f3_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ciphyron_wink_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdHappy] = { id: Emote.Faction3ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_happy.img rsx: RSX.emote_f3_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ciphyron_happy_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdAngry] = { id: Emote.Faction3ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_angry.img rsx: RSX.emote_f3_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ciphyron_angry_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSad] = { id: Emote.Faction3ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sad.img rsx: RSX.emote_f3_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ciphyron_sad_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdFrustrated] = { id: Emote.Faction3ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_frustrated.img rsx: RSX.emote_f3_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ciphyron_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSurprised] = { id: Emote.Faction3ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_surprised.img rsx: RSX.emote_f3_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ciphyron_surprised_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdBow] = { id: Emote.Faction3ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_bow.img rsx: RSX.emote_f3_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ciphyron_bow_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSleep] = { id: Emote.Faction3ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sleep.img rsx: RSX.emote_f3_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ciphyron_sleep_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdSunglasses] = { id: Emote.Faction3ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_sunglasses.img rsx: RSX.emote_f3_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ciphyron_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdConfused] = { id: Emote.Faction3ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_confused.img rsx: RSX.emote_f3_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ciphyron_confused_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction3ThirdKiss] = { id: Emote.Faction3ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vetruvian" enabled: true alwaysVisible: true img: RSX.emote_f3_third_kiss.img rsx: RSX.emote_f3_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ciphyron_love_name") shopDescription: i18next.t("cosmetics.emote_ciphyron_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction3 generalId: Cards.Faction3.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 3 THIRD # region FACTION 4 THIRD cos[Emote.Faction4ThirdTaunt] = { id: Emote.Faction4ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_taunt.img rsx: RSX.emote_f4_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_maehv_wink_name") shopDescription: i18next.t("cosmetics.emote_maehv_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdHappy] = { id: Emote.Faction4ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_happy.img rsx: RSX.emote_f4_third_happy title: "Happy" name: i18next.t("cosmetics.emote_maehv_happy_name") shopDescription: i18next.t("cosmetics.emote_maehv_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdAngry] = { id: Emote.Faction4ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_angry.img rsx: RSX.emote_f4_third_angry title: "Angry" name: i18next.t("cosmetics.emote_maehv_angry_name") shopDescription: i18next.t("cosmetics.emote_maehv_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdConfused] = { id: Emote.Faction4ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_confused.img rsx: RSX.emote_f4_third_confused title: "Confused" name: i18next.t("cosmetics.emote_maehv_confused_name") shopDescription: i18next.t("cosmetics.emote_maehv_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSad] = { id: Emote.Faction4ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sad.img rsx: RSX.emote_f4_third_sad title: "Sad" name: i18next.t("cosmetics.emote_maehv_sad_name") shopDescription: i18next.t("cosmetics.emote_maehv_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSurprised] = { id: Emote.Faction4ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_surprised.img rsx: RSX.emote_f4_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_maehv_surprised_name") shopDescription: i18next.t("cosmetics.emote_maehv_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdBow] = { id: Emote.Faction4ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_bow.img rsx: RSX.emote_f4_third_bow title: "Bow" name: i18next.t("cosmetics.emote_maehv_bow_name") shopDescription: i18next.t("cosmetics.emote_maehv_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSleep] = { id: Emote.Faction4ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sleep.img rsx: RSX.emote_f4_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_maehv_sleep_name") shopDescription: i18next.t("cosmetics.emote_maehv_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdSunglasses] = { id: Emote.Faction4ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_sunglasses.img rsx: RSX.emote_f4_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_maehv_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_maehv_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdFrustrated] = { id: Emote.Faction4ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_frustrated.img rsx: RSX.emote_f4_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_maehv_frustrated_name") shopDescription: i18next.t("cosmetics.emote_maehv_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction4ThirdKiss] = { id: Emote.Faction4ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Abyssian" enabled: true alwaysVisible: true img: RSX.emote_f4_third_kiss.img rsx: RSX.emote_f4_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_maehv_love_name") shopDescription: i18next.t("cosmetics.emote_maehv_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction4 generalId: Cards.Faction4.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 4 THIRD # region FACTION 5 THIRD cos[Emote.Faction5ThirdTaunt] = { id: Emote.Faction5ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_taunt.img rsx: RSX.emote_f5_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ragnora_wink_name") shopDescription: i18next.t("cosmetics.emote_ragnora_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdHappy] = { id: Emote.Faction5ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_happy.img rsx: RSX.emote_f5_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ragnora_happy_name") shopDescription: i18next.t("cosmetics.emote_ragnora_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdAngry] = { id: Emote.Faction5ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_angry.img rsx: RSX.emote_f5_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ragnora_angry_name") shopDescription: i18next.t("cosmetics.emote_ragnora_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdConfused] = { id: Emote.Faction5ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_confused.img rsx: RSX.emote_f5_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ragnora_confused_name") shopDescription: i18next.t("cosmetics.emote_ragnora_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdFrustrated] = { id: Emote.Faction5ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_frustrated.img rsx: RSX.emote_f5_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ragnora_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ragnora_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSurprised] = { id: Emote.Faction5ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_surprised.img rsx: RSX.emote_f5_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ragnora_surprised_name") shopDescription: i18next.t("cosmetics.emote_ragnora_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdBow] = { id: Emote.Faction5ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_bow.img rsx: RSX.emote_f5_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ragnora_bow_name") shopDescription: i18next.t("cosmetics.emote_ragnora_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSleep] = { id: Emote.Faction5ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sleep.img rsx: RSX.emote_f5_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ragnora_sleep_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSunglasses] = { id: Emote.Faction5ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sunglasses.img rsx: RSX.emote_f5_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ragnora_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdSad] = { id: Emote.Faction5ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_sad.img rsx: RSX.emote_f5_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ragnora_sad_name") shopDescription: i18next.t("cosmetics.emote_ragnora_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction5ThirdKiss] = { id: Emote.Faction5ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Magmar" enabled: true alwaysVisible: true img: RSX.emote_f5_third_kiss.img rsx: RSX.emote_f5_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ragnora_love_name") shopDescription: i18next.t("cosmetics.emote_ragnora_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction5 generalId: Cards.Faction5.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 5 THIRD # region FACTION 6 THIRD cos[Emote.Faction6ThirdFrustrated] = { id: Emote.Faction6ThirdFrustrated typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_frustrated.img rsx: RSX.emote_f6_third_frustrated title: "Frustrated" name: i18next.t("cosmetics.emote_ilena_frustrated_name") shopDescription: i18next.t("cosmetics.emote_ilena_frustrated_desc") emoteOrder: EMOTE_ORDER_FRUSTRATED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdHappy] = { id: Emote.Faction6ThirdHappy typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_happy.img rsx: RSX.emote_f6_third_happy title: "Happy" name: i18next.t("cosmetics.emote_ilena_happy_name") shopDescription: i18next.t("cosmetics.emote_ilena_happy_desc") emoteOrder: EMOTE_ORDER_HAPPY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdAngry] = { id: Emote.Faction6ThirdAngry typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_angry.img rsx: RSX.emote_f6_third_angry title: "Angry" name: i18next.t("cosmetics.emote_ilena_angry_name") shopDescription: i18next.t("cosmetics.emote_ilena_angry_desc") emoteOrder: EMOTE_ORDER_ANGRY rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdConfused] = { id: Emote.Faction6ThirdConfused typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_confused.img rsx: RSX.emote_f6_third_confused title: "Confused" name: i18next.t("cosmetics.emote_ilena_confused_name") shopDescription: i18next.t("cosmetics.emote_ilena_confused_desc") emoteOrder: EMOTE_ORDER_CONFUSED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSad] = { id: Emote.Faction6ThirdSad typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sad.img rsx: RSX.emote_f6_third_sad title: "Sad" name: i18next.t("cosmetics.emote_ilena_sad_name") shopDescription: i18next.t("cosmetics.emote_ilena_sad_desc") emoteOrder: EMOTE_ORDER_SAD rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSurprised] = { id: Emote.Faction6ThirdSurprised typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_surprised.img rsx: RSX.emote_f6_third_surprised title: "Surprised" name: i18next.t("cosmetics.emote_ilena_surprised_name") shopDescription: i18next.t("cosmetics.emote_ilena_surprised_desc") emoteOrder: EMOTE_ORDER_SURPRISED rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdBow] = { id: Emote.Faction6ThirdBow typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_bow.img rsx: RSX.emote_f6_third_bow title: "Bow" name: i18next.t("cosmetics.emote_ilena_bow_name") shopDescription: i18next.t("cosmetics.emote_ilena_bow_desc") emoteOrder: EMOTE_ORDER_BOW rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSleep] = { id: Emote.Faction6ThirdSleep typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sleep.img rsx: RSX.emote_f6_third_sleep title: "Sleep" name: i18next.t("cosmetics.emote_ilena_sleep_name") shopDescription: i18next.t("cosmetics.emote_ilena_sleep_desc") emoteOrder: EMOTE_ORDER_SLEEP rarityId: Rarity.Rare category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdSunglasses] = { id: Emote.Faction6ThirdSunglasses typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_sunglasses.img rsx: RSX.emote_f6_third_sunglasses title: "Sunglasses" name: i18next.t("cosmetics.emote_ilena_sunglasses_name") shopDescription: i18next.t("cosmetics.emote_ilena_sunglasses_desc") emoteOrder: EMOTE_ORDER_SUNGLASSES rarityId: Rarity.Epic category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdTaunt] = { id: Emote.Faction6ThirdTaunt typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_taunt.img rsx: RSX.emote_f6_third_taunt title: "Taunt" name: i18next.t("cosmetics.emote_ilena_wink_name") shopDescription: i18next.t("cosmetics.emote_ilena_wink_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } cos[Emote.Faction6ThirdKiss] = { id: Emote.Faction6ThirdKiss typeId: CosmeticsTypeLookup.Emote subTypeId: "Vanar" enabled: true alwaysVisible: true img: RSX.emote_f6_third_kiss.img rsx: RSX.emote_f6_third_kiss title: "Kiss" name: i18next.t("cosmetics.emote_ilena_love_name") shopDescription: i18next.t("cosmetics.emote_ilena_love_desc") emoteOrder: EMOTE_ORDER_TAUNT rarityId: Rarity.Common category: EmoteCategory.Faction factionId: Factions.Faction6 generalId: Cards.Faction6.ThirdGeneral unlockable: false purchasable: true } # endregion FACTION 6 THIRD # endregion THIRD GENERALS # endregion emotes # region Battlemaps cos[BattleMap.Magmar] = { id: BattleMap.Magmar typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_magmar_name") shopDescription: i18next.t("cosmetics.battlemap_magmar_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_magmar.img rsx: RSX.shop_battle_map_magmar unlockable: false purchasable: true battleMapTemplateIndex: 7 } cos[BattleMap.Abyssian] = { id: BattleMap.Abyssian typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_abyssian_name") shopDescription: i18next.t("cosmetics.battlemap_abyssian_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_abyssian.img rsx: RSX.shop_battle_map_abyssian unlockable: false purchasable: true battleMapTemplateIndex: 8 } cos[BattleMap.Redrock] = { id: BattleMap.Redrock typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_redrock_name") shopDescription: i18next.t("cosmetics.battlemap_redrock_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_redrock.img rsx: RSX.shop_battle_map_redrock unlockable: false purchasable: true battleMapTemplateIndex: 9 } cos[BattleMap.Vanar] = { id: BattleMap.Vanar typeId: CosmeticsTypeLookup.BattleMap name: i18next.t("cosmetics.battlemap_vanar_name") shopDescription: i18next.t("cosmetics.battlemap_vanar_desc") enabled: true alwaysVisible: true order: ORDER_SCENES rarityId: Rarity.Legendary img: RSX.shop_battle_map_vanar.img rsx: RSX.shop_battle_map_vanar unlockable: false purchasable: true battleMapTemplateIndex: 10 } # endregion Battlemaps # endregion Cosmetics datas # Generate skus procedurally for cosmeticTypeKey,cosmeticsOfType of CosmeticsLookup if not cosmeticsOfType? or !_.isObject(cosmeticsOfType) continue cosmeticTypeId = CosmeticsTypeLookup[cosmeticTypeKey] if not cosmeticTypeId? continue for cosmeticKey,cosmeticId of cosmeticsOfType cosmeticData = cos[cosmeticId] if not cosmeticData? continue cosmeticData.sku = cosmeticTypeId + "-" + cosmeticKey + "-" + cosmeticId ## Generate default subTypes #for cosId,cosForSubtype of cos # if cosForSubtype.subType? # continue # if cosForSubtype.typeId == CosmeticsTypeLookup.Emote && cosForSubtype.factionId? # subType = "n/a" # if subType? # cosForSubtype.subType = subType # # cosForSubtype.subTypeId ?= "n/a" # setup caches CosmeticsFactory._cachedCosmetics = [] CosmeticsFactory._cachedCosmeticsForType = {} CosmeticsFactory._cachedCosmeticsForTypeAndFaction = {} CosmeticsFactory._cachedCosmeticsForTypeAndRarity = {} CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity = {} CosmeticsFactory._cachedCosmeticsForFaction = {} CosmeticsFactory._cachedCosmeticsForRarity = {} CosmeticsFactory._cachedCosmeticsForChestType = {} CosmeticsFactory._cachedCosmeticsForTypeAndSubType = {} CosmeticsFactory._cachedCosmeticSubTypesByType = {} CosmeticsFactory._cachedCardSkinsForCardId = {} CosmeticsFactory._cachedCardSkinIdsForCardId = {} # ensure that all cosmetic types, rarities, factions, and chest types have at least an empty array cosmeticTypes = Object.keys(CosmeticsTypeLookup) cosmeticChestTypes = Object.keys(CosmeticsChestTypeLookup) factionIds = Object.keys(Factions) rarityIds = Object.keys(Rarity) for cosmeticTypeKey in cosmeticTypes type = CosmeticsTypeLookup[cosmeticTypeKey] CosmeticsFactory._cachedCosmeticsForType[type] ?= [] CosmeticsFactory._cachedCosmeticSubTypesByType[type] ?= [] for factionIdKey in factionIds factionId = Factions[factionIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type][factionId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId][rarityId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type][rarityId] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type] ?= {} for factionIdKey in factionIds factionId = Factions[factionIdKey] CosmeticsFactory._cachedCosmeticsForFaction[factionId] ?= [] for rarityIdKey in rarityIds rarityId = Rarity[rarityIdKey] CosmeticsFactory._cachedCosmeticsForRarity[rarityId] ?= [] for cosmeticChestTypeKey in cosmeticChestTypes chestType = CosmeticsChestTypeLookup[cosmeticChestTypeKey] CosmeticsFactory._cachedCosmeticsForChestType[chestType] ?= [] # add all cosmetics to caches cosmeticIdKeys = Object.keys(CosmeticsFactory._cosmeticsById) for cosmeticIdKey of cosmeticIdKeys cosmeticId = cosmeticIdKeys[cosmeticIdKey] cosmeticData = CosmeticsFactory._cosmeticsById[cosmeticId] type = cosmeticData.typeId factionId = cosmeticData.factionId rarityId = cosmeticData.rarityId chestType = cosmeticData.chestType subType = cosmeticData.subTypeId CosmeticsFactory._cachedCosmetics.push(cosmeticData) if type? CosmeticsFactory._cachedCosmeticsForType[type].push(cosmeticData) if factionId? CosmeticsFactory._cachedCosmeticsForTypeAndFaction[type][factionId].push(cosmeticData) if rarityId? CosmeticsFactory._cachedCosmeticsForTypeAndRarity[type][rarityId].push(cosmeticData) if factionId? and rarityId? CosmeticsFactory._cachedCosmeticsForTypeAndFactionAndRarity[type][factionId][rarityId].push(cosmeticData) if subType? CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type][subType] ?= [] CosmeticsFactory._cachedCosmeticsForTypeAndSubType[type][subType].push(cosmeticData) if not _.contains(CosmeticsFactory._cachedCosmeticSubTypesByType[type],subType) CosmeticsFactory._cachedCosmeticSubTypesByType[type].push(subType) if type == CosmeticsTypeLookup.CardSkin cardId = cosmeticData.cardId if cardId? CosmeticsFactory._cachedCardSkinsForCardId[cardId] ?= [] CosmeticsFactory._cachedCardSkinsForCardId[cardId].push(cosmeticData) CosmeticsFactory._cachedCardSkinIdsForCardId[cardId] ?= [] CosmeticsFactory._cachedCardSkinIdsForCardId[cardId].push(cosmeticData.id) if factionId? CosmeticsFactory._cachedCosmeticsForFaction[factionId].push(cosmeticData) if rarityId? CosmeticsFactory._cachedCosmeticsForRarity[rarityId].push(cosmeticData) if chestType? CosmeticsFactory._cachedCosmeticsForChestType[chestType].push(cosmeticData) # Generate default descriptions # TODO: Better language for shop descriptors _getEmotionDescriptor = (emoteOrder) -> if emoteOrder == EMOTE_ORDER_ANGRY return i18next.t("cosmetics.emote_anger") else if emoteOrder == EMOTE_ORDER_BOW return i18next.t("cosmetics.emote_respect") else if emoteOrder == EMOTE_ORDER_CONFUSED return i18next.t("cosmetics.emote_confusion") else if emoteOrder == EMOTE_ORDER_FRUSTRATED return i18next.t("cosmetics.emote_frustration") else if emoteOrder == EMOTE_ORDER_HAPPY return i18next.t("cosmetics.emote_happiness") else if emoteOrder == EMOTE_ORDER_SAD return i18next.t("cosmetics.emote_sadness") else if emoteOrder == EMOTE_ORDER_SLEEP return i18next.t("cosmetics.emote_impatience") else if emoteOrder == EMOTE_ORDER_SUNGLASSES return i18next.t("cosmetics.emote_style") else if emoteOrder == EMOTE_ORDER_SURPRISED return i18next.t("cosmetics.emote_surprise") else if emoteOrder == EMOTE_ORDER_TAUNT return i18next.t("cosmetics.emote_confidence") else if emoteOrder == EMOTE_ORDER_KISS return i18next.t("cosmetics.emote_love") else return i18next.t("cosmetics.emote_emotion") allCosForDesc = CosmeticsFactory.getAllCosmetics() for cosForDesc in allCosForDesc if cosForDesc.shopDescription? continue if cosForDesc.typeId == CosmeticsTypeLookup.CardBack cosForDesc.shopDescription = i18next.t("cosmetics.cardback_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.Scene cosForDesc.shopDescription = i18next.t("cosmetics.scene_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.ProfileIcon cosForDesc.shopDescription = i18next.t("cosmetics.icon_desc") else if cosForDesc.typeId == CosmeticsTypeLookup.Emote generalDescriptor = "" if cosForDesc.generalId? if cosForDesc.generalId == Cards.Faction1.General then generalDescriptor = i18next.t("cosmetics.shop_emote_argeon") if cosForDesc.generalId == Cards.Faction1.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ziran") if cosForDesc.generalId == Cards.Faction1.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_brome") if cosForDesc.generalId == Cards.Faction2.General then generalDescriptor = i18next.t("cosmetics.shop_emote_kaleos") if cosForDesc.generalId == Cards.Faction2.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_reva") if cosForDesc.generalId == Cards.Faction2.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_shidai") if cosForDesc.generalId == Cards.Faction3.General then generalDescriptor = i18next.t("cosmetics.shop_emote_zirix") if cosForDesc.generalId == Cards.Faction3.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_sajj") if cosForDesc.generalId == Cards.Faction3.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ciphyron") if cosForDesc.generalId == Cards.Faction4.General then generalDescriptor = i18next.t("cosmetics.shop_emote_lilithe") if cosForDesc.generalId == Cards.Faction4.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_cassyva") if cosForDesc.generalId == Cards.Faction4.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_maehv") if cosForDesc.generalId == Cards.Faction5.General then generalDescriptor = i18next.t("cosmetics.shop_emote_vaath") if cosForDesc.generalId == Cards.Faction5.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_starhorn") if cosForDesc.generalId == Cards.Faction5.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ragnora") if cosForDesc.generalId == Cards.Faction6.General then generalDescriptor = i18next.t("cosmetics.shop_emote_faie") if cosForDesc.generalId == Cards.Faction6.AltGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_kara") if cosForDesc.generalId == Cards.Faction6.ThirdGeneral then generalDescriptor = i18next.t("cosmetics.shop_emote_ilena") cosForDesc.shopDescription = i18next.t("cosmetics.shop_emote",{emote:_getEmotionDescriptor(cosForDesc.emoteOrder)},{general:generalDescriptor}) #cosForDesc.shopDescription = "Express your #{_getEmotionDescriptor(cosForDesc.emoteOrder)} in game#{generalDescriptor}" # Set default reward orders allCosForRewardOrder = CosmeticsFactory.getAllCosmetics() for cosForOrder in allCosForRewardOrder if not cosForOrder.rewardOrder? cosForOrder.rewardOrder = 0 module.exports = CosmeticsFactory
[ { "context": "ject.freeze [\n {\n _id: 'user1'\n username: 'user1'\n password: 'password1'\n profile: name: 'Te", "end": 74, "score": 0.9973582029342651, "start": 69, "tag": "USERNAME", "value": "user1" }, { "context": "_id: 'user1'\n username: 'user1'\n password: ...
tests/fixtures/users.coffee
aramk/meteor-events
3
Fixtures.users = Object.freeze [ { _id: 'user1' username: 'user1' password: 'password1' profile: name: 'Test User' roles: ['reader'] } { _id: 'user2' username: 'user2' password: 'password2' profile: name: 'Test User 2' roles: ['reader', 'writer'] } ]
48879
Fixtures.users = Object.freeze [ { _id: 'user1' username: 'user1' password: '<PASSWORD>' profile: name: 'Test User' roles: ['reader'] } { _id: 'user2' username: 'user2' password: '<PASSWORD>' profile: name: 'Test User 2' roles: ['reader', 'writer'] } ]
true
Fixtures.users = Object.freeze [ { _id: 'user1' username: 'user1' password: 'PI:PASSWORD:<PASSWORD>END_PI' profile: name: 'Test User' roles: ['reader'] } { _id: 'user2' username: 'user2' password: 'PI:PASSWORD:<PASSWORD>END_PI' profile: name: 'Test User 2' roles: ['reader', 'writer'] } ]
[ { "context": " path.join(buildDir, 'installer')\n authors: 'Chase Sillevis'\n loadingGif: path.resolve(__dirname, '..', ", "end": 3007, "score": 0.9998917579650879, "start": 2993, "tag": "NAME", "value": "Chase Sillevis" }, { "context": " iconUrl: 'https://raw.githubus...
build/Gruntfile.coffee
DeviaVir/inbox-web
1
fs = require 'fs' path = require 'path' os = require 'os' # Add support for obselete APIs of vm module so we can make some third-party # modules work under node v0.11.x. require 'vm-compatibility-layer' _ = require 'underscore-plus' packageJson = require '../package.json' # Shim harmony collections in case grunt was invoked without harmony # collections enabled _.extend(global, require('harmony-collections')) unless global.WeakMap? module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-download-atom-shell') grunt.loadNpmTasks('grunt-atom-shell-installer') grunt.loadTasks('tasks') # This allows all subsequent paths to the relative to the root of the repo grunt.file.setBase(path.resolve('..')) if not grunt.option('verbose') grunt.log.writeln = (args...) -> grunt.log grunt.log.write = (args...) -> grunt.log [major, minor, patch] = packageJson.version.split('.') tmpDir = os.tmpdir() appName = if process.platform is 'darwin' then 'Inbox.app' else 'Inbox' buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') buildDir = path.resolve(buildDir) installDir = grunt.option('install-dir') home = if process.platform is 'win32' then process.env.USERPROFILE else process.env.HOME atomShellDownloadDir = path.join(home, '.atom', 'atom-shell') symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') shellAppDir = path.join(buildDir, appName) if process.platform is 'win32' contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') installDir ?= path.join(process.env.ProgramFiles, appName) killCommand = 'taskkill /F /IM inbox.exe' else if process.platform is 'darwin' contentsDir = path.join(shellAppDir, 'Contents') appDir = path.join(contentsDir, 'Resources', 'app') installDir ?= path.join('/Applications', appName) killCommand = 'pkill -9 inbox' else contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') installDir ?= process.env.INSTALL_PREFIX ? '/usr/local' killCommand ='pkill -9 inbox' installDir = path.resolve(installDir) coffeeConfig = glob_to_multiple: expand: true src: [ 'src/**/*.coffee' 'exports/**/*.coffee' 'static/**/*.coffee' ] dest: appDir ext: '.js' grunt.initConfig pkg: grunt.file.readJSON('package.json') atom: {appDir, appName, symbolsDir, buildDir, contentsDir, installDir, shellAppDir} docsOutputDir: 'docs/output' coffee: coffeeConfig 'download-atom-shell': version: packageJson.atomShellVersion outputDir: 'atom-shell' downloadDir: atomShellDownloadDir rebuild: true # rebuild native modules after atom-shell is updated token: process.env.ATOM_ACCESS_TOKEN 'create-windows-installer': appDirectory: shellAppDir outputDirectory: path.join(buildDir, 'installer') authors: 'Chase Sillevis' loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif') iconUrl: 'https://raw.githubusercontent.com/deviavir/inbox-web/master/resources/win/inbox.ico' setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'inbox.ico') remoteReleases: 'https://atom.io/api/updates' shell: 'kill-atom': command: killCommand options: stdout: false stderr: false failOnError: false grunt.registerTask('compile', ['coffee']) ciTasks = ['output-disk-space', 'download-atom-shell', 'download-atom-shell-chromedriver', 'build'] ciTasks.push('dump-symbols') if process.platform isnt 'win32' ciTasks.push('set-version', 'check-licenses') ciTasks.push('mkdeb') if process.platform is 'linux' ciTasks.push('create-windows-installer') if process.platform is 'win32' ciTasks.push('codesign') ciTasks.push('publish-build') grunt.registerTask('ci', ciTasks) defaultTasks = ['download-atom-shell', 'download-atom-shell-chromedriver', 'build', 'set-version'] defaultTasks.push 'install' unless process.platform is 'linux' grunt.registerTask('default', defaultTasks)
181087
fs = require 'fs' path = require 'path' os = require 'os' # Add support for obselete APIs of vm module so we can make some third-party # modules work under node v0.11.x. require 'vm-compatibility-layer' _ = require 'underscore-plus' packageJson = require '../package.json' # Shim harmony collections in case grunt was invoked without harmony # collections enabled _.extend(global, require('harmony-collections')) unless global.WeakMap? module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-download-atom-shell') grunt.loadNpmTasks('grunt-atom-shell-installer') grunt.loadTasks('tasks') # This allows all subsequent paths to the relative to the root of the repo grunt.file.setBase(path.resolve('..')) if not grunt.option('verbose') grunt.log.writeln = (args...) -> grunt.log grunt.log.write = (args...) -> grunt.log [major, minor, patch] = packageJson.version.split('.') tmpDir = os.tmpdir() appName = if process.platform is 'darwin' then 'Inbox.app' else 'Inbox' buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') buildDir = path.resolve(buildDir) installDir = grunt.option('install-dir') home = if process.platform is 'win32' then process.env.USERPROFILE else process.env.HOME atomShellDownloadDir = path.join(home, '.atom', 'atom-shell') symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') shellAppDir = path.join(buildDir, appName) if process.platform is 'win32' contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') installDir ?= path.join(process.env.ProgramFiles, appName) killCommand = 'taskkill /F /IM inbox.exe' else if process.platform is 'darwin' contentsDir = path.join(shellAppDir, 'Contents') appDir = path.join(contentsDir, 'Resources', 'app') installDir ?= path.join('/Applications', appName) killCommand = 'pkill -9 inbox' else contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') installDir ?= process.env.INSTALL_PREFIX ? '/usr/local' killCommand ='pkill -9 inbox' installDir = path.resolve(installDir) coffeeConfig = glob_to_multiple: expand: true src: [ 'src/**/*.coffee' 'exports/**/*.coffee' 'static/**/*.coffee' ] dest: appDir ext: '.js' grunt.initConfig pkg: grunt.file.readJSON('package.json') atom: {appDir, appName, symbolsDir, buildDir, contentsDir, installDir, shellAppDir} docsOutputDir: 'docs/output' coffee: coffeeConfig 'download-atom-shell': version: packageJson.atomShellVersion outputDir: 'atom-shell' downloadDir: atomShellDownloadDir rebuild: true # rebuild native modules after atom-shell is updated token: process.env.ATOM_ACCESS_TOKEN 'create-windows-installer': appDirectory: shellAppDir outputDirectory: path.join(buildDir, 'installer') authors: '<NAME>' loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif') iconUrl: 'https://raw.githubusercontent.com/deviavir/inbox-web/master/resources/win/inbox.ico' setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'inbox.ico') remoteReleases: 'https://atom.io/api/updates' shell: 'kill-atom': command: killCommand options: stdout: false stderr: false failOnError: false grunt.registerTask('compile', ['coffee']) ciTasks = ['output-disk-space', 'download-atom-shell', 'download-atom-shell-chromedriver', 'build'] ciTasks.push('dump-symbols') if process.platform isnt 'win32' ciTasks.push('set-version', 'check-licenses') ciTasks.push('mkdeb') if process.platform is 'linux' ciTasks.push('create-windows-installer') if process.platform is 'win32' ciTasks.push('codesign') ciTasks.push('publish-build') grunt.registerTask('ci', ciTasks) defaultTasks = ['download-atom-shell', 'download-atom-shell-chromedriver', 'build', 'set-version'] defaultTasks.push 'install' unless process.platform is 'linux' grunt.registerTask('default', defaultTasks)
true
fs = require 'fs' path = require 'path' os = require 'os' # Add support for obselete APIs of vm module so we can make some third-party # modules work under node v0.11.x. require 'vm-compatibility-layer' _ = require 'underscore-plus' packageJson = require '../package.json' # Shim harmony collections in case grunt was invoked without harmony # collections enabled _.extend(global, require('harmony-collections')) unless global.WeakMap? module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-coffee') grunt.loadNpmTasks('grunt-shell') grunt.loadNpmTasks('grunt-download-atom-shell') grunt.loadNpmTasks('grunt-atom-shell-installer') grunt.loadTasks('tasks') # This allows all subsequent paths to the relative to the root of the repo grunt.file.setBase(path.resolve('..')) if not grunt.option('verbose') grunt.log.writeln = (args...) -> grunt.log grunt.log.write = (args...) -> grunt.log [major, minor, patch] = packageJson.version.split('.') tmpDir = os.tmpdir() appName = if process.platform is 'darwin' then 'Inbox.app' else 'Inbox' buildDir = grunt.option('build-dir') ? path.join(tmpDir, 'atom-build') buildDir = path.resolve(buildDir) installDir = grunt.option('install-dir') home = if process.platform is 'win32' then process.env.USERPROFILE else process.env.HOME atomShellDownloadDir = path.join(home, '.atom', 'atom-shell') symbolsDir = path.join(buildDir, 'Atom.breakpad.syms') shellAppDir = path.join(buildDir, appName) if process.platform is 'win32' contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') installDir ?= path.join(process.env.ProgramFiles, appName) killCommand = 'taskkill /F /IM inbox.exe' else if process.platform is 'darwin' contentsDir = path.join(shellAppDir, 'Contents') appDir = path.join(contentsDir, 'Resources', 'app') installDir ?= path.join('/Applications', appName) killCommand = 'pkill -9 inbox' else contentsDir = shellAppDir appDir = path.join(shellAppDir, 'resources', 'app') installDir ?= process.env.INSTALL_PREFIX ? '/usr/local' killCommand ='pkill -9 inbox' installDir = path.resolve(installDir) coffeeConfig = glob_to_multiple: expand: true src: [ 'src/**/*.coffee' 'exports/**/*.coffee' 'static/**/*.coffee' ] dest: appDir ext: '.js' grunt.initConfig pkg: grunt.file.readJSON('package.json') atom: {appDir, appName, symbolsDir, buildDir, contentsDir, installDir, shellAppDir} docsOutputDir: 'docs/output' coffee: coffeeConfig 'download-atom-shell': version: packageJson.atomShellVersion outputDir: 'atom-shell' downloadDir: atomShellDownloadDir rebuild: true # rebuild native modules after atom-shell is updated token: process.env.ATOM_ACCESS_TOKEN 'create-windows-installer': appDirectory: shellAppDir outputDirectory: path.join(buildDir, 'installer') authors: 'PI:NAME:<NAME>END_PI' loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif') iconUrl: 'https://raw.githubusercontent.com/deviavir/inbox-web/master/resources/win/inbox.ico' setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'inbox.ico') remoteReleases: 'https://atom.io/api/updates' shell: 'kill-atom': command: killCommand options: stdout: false stderr: false failOnError: false grunt.registerTask('compile', ['coffee']) ciTasks = ['output-disk-space', 'download-atom-shell', 'download-atom-shell-chromedriver', 'build'] ciTasks.push('dump-symbols') if process.platform isnt 'win32' ciTasks.push('set-version', 'check-licenses') ciTasks.push('mkdeb') if process.platform is 'linux' ciTasks.push('create-windows-installer') if process.platform is 'win32' ciTasks.push('codesign') ciTasks.push('publish-build') grunt.registerTask('ci', ciTasks) defaultTasks = ['download-atom-shell', 'download-atom-shell-chromedriver', 'build', 'set-version'] defaultTasks.push 'install' unless process.platform is 'linux' grunt.registerTask('default', defaultTasks)
[ { "context": " down along the road met a nicens little boy named baby tuckoo...\\n\\nHis father told him that story: his fa", "end": 3464, "score": 0.7299613952636719, "start": 3458, "tag": "NAME", "value": "baby t" }, { "context": "s baby tuckoo. The moocow came down the road where ...
js/lesson_plans.coffee
khl2bb/LearnBlockChain
0
--- --- root = exports ? this root.lessons = 1: 0: startingText: "Writing in Markdown is not that hard!" renderedAnswer: "<p>Writing in Markdown is <em>not</em> that hard!</p>" 1: startingText: "I will complete these lessons!" renderedAnswer: "<p>I <strong>will</strong> complete these lessons!</p>" 2: startingText: "\"Of course,\" she whispered. Then, she shouted: \"All I need is a little moxie!\"" renderedAnswer: "<p>\"<em>Of course</em>,\" she whispered. Then, she shouted: \"All I need is <strong>a little moxie</strong>!\"</p>" 3: startingText: "If you're thinking to yourself, This is unbelievable, you'd probably be right." renderedAnswer: "<p>If you're thinking to yourself, <strong><em>This is unbelievable</em></strong>, you'd probably be right.</p>" 2: 0: startingText: "Header one\nHeader two\nHeader three\nHeader four\nHeader five\nHeader six" renderedAnswer:"<h1>Header one</h1>\n<h2>Header two</h2>\n<h3>Header three</h3>\n<h4>Header four</h4>\n<h5>Header five</h5>\n<h6>Header six</h6>" 1: startingText: "Colombian Symbolism in One Hundred Years of Solitude\n\nHere's some words about the book _One Hundred Years..._." renderedAnswer: "<h4>Colombian Symbolism in <em>One Hundred Years of Solitude</em></h4>\n<p>Here's some words about the book <em>One Hundred Years...</em>.</p>" 3: 0: startingText: "Search for it.()" renderedAnswer:"<p><a href=\"http://www.google.com\">Search for it.</a></p>" 1: startingText: "You're really, really going to want to see this." renderedAnswer: "<p><a href=\"http://www.dailykitten.com\">You're <strong>really, really</strong> going to want to see this.</a></p>" 2: startingText: "The Latest News from the BBC" renderedAnswer: "<h4>The Latest News from <a href=\"http://www.bbc.com/news\">the BBC</a></h4>" 3: startingText: "Do you want to [see something fun][]?\n\nWell, do I have [the website for you][another fun place]!" renderedAnswer: "<p>Do you want to <a href=\"http://www.zombo.com\">see something fun</a>?</p>\n<p>Well, do I have <a href=\"http://www.stumbleupon.com\">the website for you</a>!</p>" 4: 0: startingText: "[](http://octodex.github.com/images/octdrey-catburn.jpg)" renderedAnswer:"<p><img src=\"http://octodex.github.com/images/octdrey-catburn.jpg\" alt=\"A representation of Octdrey Catburn\"></p>" 1: startingText: "[The first father][]\n\n[The second first father][Second Father]" renderedAnswer: "<p><img src=\"http://octodex.github.com/images/founding-father.jpg\" alt=\"The first father\"></p>\n<p><img src=\"http://octodex.github.com/images/foundingfather_v2.png\" alt=\"The second first father\"></p>" 5: 0: startingText: "I read this interesting quote the other day:\n\n\"Her eyes had called him and his soul had leaped at the call. To live, to err, to fall, to triumph, to recreate life out of life!\"" renderedAnswer:"<p>I read this interesting quote the other day:</p>\n<blockquote>\n<p>\"Her eyes had called him and his soul had leaped at the call. To live, to err, to fall, to triumph, to recreate life out of life!\"</p>\n</blockquote>" 1: startingText: "\n>Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named baby tuckoo...\n\nHis father told him that story: his father looked at him through a glass: he had a hairy face.\n\nHe was baby tuckoo. The moocow came down the road where Betty Byrne lived: she sold lemon platt." renderedAnswer: "<blockquote>\n<p>Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named baby tuckoo...</p>\n<p>His father told him that story: his father looked at him through a glass: he had a hairy face.</p>\n<p>He was baby tuckoo. The moocow came down the road where Betty Byrne lived: she sold lemon platt.</p>\n</blockquote>" 2: startingText: "He left her quickly, fearing that her intimacy might turn to jibing and wishing to be out of the way before she offered her ware to another, a tourist from England or a student of Trinity. Grafton Street, along which he walked, prolonged that moment of discouraged poverty. In the roadway at the head of the street a slab was set to the memory of Wolfe Tone and he remembered having been present with his father at its laying. He remembered with bitterness that scene of tawdry tribute. There were four French delegates in a brake and one, a plump smiling young man, held, wedged on a stick, a card on which were printed the words: VIVE L'IRLANDE!" renderedAnswer: "<blockquote>\n<p>He left her quickly, fearing that her intimacy might turn to jibing and wishing to be out of the way before she offered her ware to another, a tourist from England or a student of Trinity. Grafton Street, along which he walked, prolonged that moment of discouraged poverty. In the roadway at the head of the street a slab was set to the memory of Wolfe Tone and he remembered having been present with his father at its laying. He remembered with bitterness that scene of tawdry tribute. There were four French delegates in a brake and one, a plump smiling young man, held, wedged on a stick, a card on which were printed the words: <em>VIVE L'IRLANDE</em>!</p>\n</blockquote>" 6: 0: startingText: "Flour, Cheese, Tomatoes" renderedAnswer: "<ul>\n<li>Flour</li>\n<li>Cheese</li>\n<li>Tomatoes</li>\n</ul>" 1: startingText: "Cut the cheese, Slice the tomatoes, Rub the tomatoes in flour" renderedAnswer: "<ol>\n<li>Cut the cheese</li>\n<li>Slice the tomatoes</li>\n<li>Rub the tomatoes in flour</li>\n</ol>" 2: startingText: "* Azalea (Ericaceae Rhododendron)\n* Chrysanthemum (Anthemideae Chrysanthemum)\n* Dahlia (Coreopsideae Dahlia)" renderedAnswer: "<ul>\n<li>Azalea (<em>Ericaceae Rhododendron</em>)</li>\n<li>Chrysanthemum (<em>Anthemideae Chrysanthemum</em>)</li>\n<li>Dahlia (<em>Coreopsideae Dahlia</em>)</li>\n</ul>" 3: startingText: "* Calculus, A professor, Has no hair, Often wears green\n* Castafiore, An opera singer, Has white hair, Is possibly mentally unwell" renderedAnswer: "<ul>\n<li>Calculus<ul>\n<li>A professor</li>\n<li>Has no hair</li>\n<li>Often wears green</li>\n</ul>\n</li>\n<li>Castafiore<ul>\n<li>An opera singer</li>\n<li>Has white hair</li>\n<li>Is possibly mentally unwell</li>\n</ul>\n</li>\n</ul>" 4: startingText: "1. Cut the cheese\n * Make sure that the cheese is cut into little triangles.\n\n2. Slice the tomatoes\n * Be careful when holding the knife.\n * For more help on tomato slicing, see Thomas Jefferson's seminal essay _Tom Ate Those_." renderedAnswer: "<ol>\n<li><p>Cut the cheese</p>\n<p>Make sure that the cheese is cut into little triangles.</p>\n</li>\n<li><p>Slice the tomatoes</p>\n<p>Be careful when holding the knife.</p>\n<p>For more help on tomato slicing, see Thomas Jefferson's seminal essay <em>Tom Ate Those</em>.</p>\n</li>\n</ol>" 7: 0: startingText: "We pictured the meek mild creatures where\nThey dwelt in their strawy pen,\nNor did it occur to one of us there\nTo doubt they were kneeling then." renderedAnswer: "<p>We pictured the meek mild creatures where<br>They dwelt in their strawy pen,<br>Nor did it occur to one of us there<br>To doubt they were kneeling then.</p>" 1: startingText: "1. Crack three eggs over a bowl.\n\n Now, you're going to want to crack the eggs in such a way that you don't make a mess.\n\n If you _do_ make a mess, use a towel to clean it up!\n\n2. Pour a gallon of milk into the bowl.\n\n Basically, take the same guidance as above: don't be messy, but if you are, clean it up!" renderedAnswer: "<ol>\n<li><p>Crack three eggs over a bowl.<br>Now, you're going to want to crack the eggs in such a way that you don't make a mess.<br>If you <em>do</em> make a mess, use a towel to clean it up!</p>\n</li>\n<li><p>Pour a gallon of milk into the bowl.<br>Basically, take the same guidance as above: don't be messy, but if you are, clean it up!</p>\n</li>\n</ol>"
114331
--- --- root = exports ? this root.lessons = 1: 0: startingText: "Writing in Markdown is not that hard!" renderedAnswer: "<p>Writing in Markdown is <em>not</em> that hard!</p>" 1: startingText: "I will complete these lessons!" renderedAnswer: "<p>I <strong>will</strong> complete these lessons!</p>" 2: startingText: "\"Of course,\" she whispered. Then, she shouted: \"All I need is a little moxie!\"" renderedAnswer: "<p>\"<em>Of course</em>,\" she whispered. Then, she shouted: \"All I need is <strong>a little moxie</strong>!\"</p>" 3: startingText: "If you're thinking to yourself, This is unbelievable, you'd probably be right." renderedAnswer: "<p>If you're thinking to yourself, <strong><em>This is unbelievable</em></strong>, you'd probably be right.</p>" 2: 0: startingText: "Header one\nHeader two\nHeader three\nHeader four\nHeader five\nHeader six" renderedAnswer:"<h1>Header one</h1>\n<h2>Header two</h2>\n<h3>Header three</h3>\n<h4>Header four</h4>\n<h5>Header five</h5>\n<h6>Header six</h6>" 1: startingText: "Colombian Symbolism in One Hundred Years of Solitude\n\nHere's some words about the book _One Hundred Years..._." renderedAnswer: "<h4>Colombian Symbolism in <em>One Hundred Years of Solitude</em></h4>\n<p>Here's some words about the book <em>One Hundred Years...</em>.</p>" 3: 0: startingText: "Search for it.()" renderedAnswer:"<p><a href=\"http://www.google.com\">Search for it.</a></p>" 1: startingText: "You're really, really going to want to see this." renderedAnswer: "<p><a href=\"http://www.dailykitten.com\">You're <strong>really, really</strong> going to want to see this.</a></p>" 2: startingText: "The Latest News from the BBC" renderedAnswer: "<h4>The Latest News from <a href=\"http://www.bbc.com/news\">the BBC</a></h4>" 3: startingText: "Do you want to [see something fun][]?\n\nWell, do I have [the website for you][another fun place]!" renderedAnswer: "<p>Do you want to <a href=\"http://www.zombo.com\">see something fun</a>?</p>\n<p>Well, do I have <a href=\"http://www.stumbleupon.com\">the website for you</a>!</p>" 4: 0: startingText: "[](http://octodex.github.com/images/octdrey-catburn.jpg)" renderedAnswer:"<p><img src=\"http://octodex.github.com/images/octdrey-catburn.jpg\" alt=\"A representation of Octdrey Catburn\"></p>" 1: startingText: "[The first father][]\n\n[The second first father][Second Father]" renderedAnswer: "<p><img src=\"http://octodex.github.com/images/founding-father.jpg\" alt=\"The first father\"></p>\n<p><img src=\"http://octodex.github.com/images/foundingfather_v2.png\" alt=\"The second first father\"></p>" 5: 0: startingText: "I read this interesting quote the other day:\n\n\"Her eyes had called him and his soul had leaped at the call. To live, to err, to fall, to triumph, to recreate life out of life!\"" renderedAnswer:"<p>I read this interesting quote the other day:</p>\n<blockquote>\n<p>\"Her eyes had called him and his soul had leaped at the call. To live, to err, to fall, to triumph, to recreate life out of life!\"</p>\n</blockquote>" 1: startingText: "\n>Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named <NAME>uckoo...\n\nHis father told him that story: his father looked at him through a glass: he had a hairy face.\n\nHe was baby tuckoo. The moocow came down the road where <NAME> lived: she sold lemon platt." renderedAnswer: "<blockquote>\n<p>Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named <NAME>aby tuckoo...</p>\n<p>His father told him that story: his father looked at him through a glass: he had a hairy face.</p>\n<p>He was baby tuckoo. The moocow came down the road where <NAME> lived: she sold lemon platt.</p>\n</blockquote>" 2: startingText: "He left her quickly, fearing that her intimacy might turn to jibing and wishing to be out of the way before she offered her ware to another, a tourist from England or a student of Trinity. Grafton Street, along which he walked, prolonged that moment of discouraged poverty. In the roadway at the head of the street a slab was set to the memory of <NAME> and he remembered having been present with his father at its laying. He remembered with bitterness that scene of tawdry tribute. There were four French delegates in a brake and one, a plump smiling young man, held, wedged on a stick, a card on which were printed the words: VIVE L'IRL<NAME>DE!" renderedAnswer: "<blockquote>\n<p>He left her quickly, fearing that her intimacy might turn to jibing and wishing to be out of the way before she offered her ware to another, a tourist from England or a student of Trinity. Grafton Street, along which he walked, prolonged that moment of discouraged poverty. In the roadway at the head of the street a slab was set to the memory of <NAME> and he remembered having been present with his father at its laying. He remembered with bitterness that scene of tawdry tribute. There were four French delegates in a brake and one, a plump smiling young man, held, wedged on a stick, a card on which were printed the words: <em>VIVE L'IRLANDE</em>!</p>\n</blockquote>" 6: 0: startingText: "Flour, Cheese, Tomatoes" renderedAnswer: "<ul>\n<li>Flour</li>\n<li>Cheese</li>\n<li>Tomatoes</li>\n</ul>" 1: startingText: "Cut the cheese, Slice the tomatoes, Rub the tomatoes in flour" renderedAnswer: "<ol>\n<li>Cut the cheese</li>\n<li>Slice the tomatoes</li>\n<li>Rub the tomatoes in flour</li>\n</ol>" 2: startingText: "* Azalea (Ericaceae Rhododendron)\n* Chrysanthemum (Anthemideae Chrysanthemum)\n* Dahlia (Coreopsideae Dahlia)" renderedAnswer: "<ul>\n<li>Azalea (<em>Ericaceae Rhododendron</em>)</li>\n<li>Chrysanthemum (<em>Anthemideae Chrysanthemum</em>)</li>\n<li>Dahlia (<em>Coreopsideae Dahlia</em>)</li>\n</ul>" 3: startingText: "* Calculus, A professor, Has no hair, Often wears green\n* Castafiore, An opera singer, Has white hair, Is possibly mentally unwell" renderedAnswer: "<ul>\n<li>Calculus<ul>\n<li>A professor</li>\n<li>Has no hair</li>\n<li>Often wears green</li>\n</ul>\n</li>\n<li>Castafiore<ul>\n<li>An opera singer</li>\n<li>Has white hair</li>\n<li>Is possibly mentally unwell</li>\n</ul>\n</li>\n</ul>" 4: startingText: "1. Cut the cheese\n * Make sure that the cheese is cut into little triangles.\n\n2. Slice the tomatoes\n * Be careful when holding the knife.\n * For more help on tomato slicing, see <NAME>'s seminal essay _Tom Ate Those_." renderedAnswer: "<ol>\n<li><p>Cut the cheese</p>\n<p>Make sure that the cheese is cut into little triangles.</p>\n</li>\n<li><p>Slice the tomatoes</p>\n<p>Be careful when holding the knife.</p>\n<p>For more help on tomato slicing, see <NAME>'s seminal essay <em>Tom Ate Those</em>.</p>\n</li>\n</ol>" 7: 0: startingText: "We pictured the meek mild creatures where\nThey dwelt in their strawy pen,\nNor did it occur to one of us there\nTo doubt they were kneeling then." renderedAnswer: "<p>We pictured the meek mild creatures where<br>They dwelt in their strawy pen,<br>Nor did it occur to one of us there<br>To doubt they were kneeling then.</p>" 1: startingText: "1. Crack three eggs over a bowl.\n\n Now, you're going to want to crack the eggs in such a way that you don't make a mess.\n\n If you _do_ make a mess, use a towel to clean it up!\n\n2. Pour a gallon of milk into the bowl.\n\n Basically, take the same guidance as above: don't be messy, but if you are, clean it up!" renderedAnswer: "<ol>\n<li><p>Crack three eggs over a bowl.<br>Now, you're going to want to crack the eggs in such a way that you don't make a mess.<br>If you <em>do</em> make a mess, use a towel to clean it up!</p>\n</li>\n<li><p>Pour a gallon of milk into the bowl.<br>Basically, take the same guidance as above: don't be messy, but if you are, clean it up!</p>\n</li>\n</ol>"
true
--- --- root = exports ? this root.lessons = 1: 0: startingText: "Writing in Markdown is not that hard!" renderedAnswer: "<p>Writing in Markdown is <em>not</em> that hard!</p>" 1: startingText: "I will complete these lessons!" renderedAnswer: "<p>I <strong>will</strong> complete these lessons!</p>" 2: startingText: "\"Of course,\" she whispered. Then, she shouted: \"All I need is a little moxie!\"" renderedAnswer: "<p>\"<em>Of course</em>,\" she whispered. Then, she shouted: \"All I need is <strong>a little moxie</strong>!\"</p>" 3: startingText: "If you're thinking to yourself, This is unbelievable, you'd probably be right." renderedAnswer: "<p>If you're thinking to yourself, <strong><em>This is unbelievable</em></strong>, you'd probably be right.</p>" 2: 0: startingText: "Header one\nHeader two\nHeader three\nHeader four\nHeader five\nHeader six" renderedAnswer:"<h1>Header one</h1>\n<h2>Header two</h2>\n<h3>Header three</h3>\n<h4>Header four</h4>\n<h5>Header five</h5>\n<h6>Header six</h6>" 1: startingText: "Colombian Symbolism in One Hundred Years of Solitude\n\nHere's some words about the book _One Hundred Years..._." renderedAnswer: "<h4>Colombian Symbolism in <em>One Hundred Years of Solitude</em></h4>\n<p>Here's some words about the book <em>One Hundred Years...</em>.</p>" 3: 0: startingText: "Search for it.()" renderedAnswer:"<p><a href=\"http://www.google.com\">Search for it.</a></p>" 1: startingText: "You're really, really going to want to see this." renderedAnswer: "<p><a href=\"http://www.dailykitten.com\">You're <strong>really, really</strong> going to want to see this.</a></p>" 2: startingText: "The Latest News from the BBC" renderedAnswer: "<h4>The Latest News from <a href=\"http://www.bbc.com/news\">the BBC</a></h4>" 3: startingText: "Do you want to [see something fun][]?\n\nWell, do I have [the website for you][another fun place]!" renderedAnswer: "<p>Do you want to <a href=\"http://www.zombo.com\">see something fun</a>?</p>\n<p>Well, do I have <a href=\"http://www.stumbleupon.com\">the website for you</a>!</p>" 4: 0: startingText: "[](http://octodex.github.com/images/octdrey-catburn.jpg)" renderedAnswer:"<p><img src=\"http://octodex.github.com/images/octdrey-catburn.jpg\" alt=\"A representation of Octdrey Catburn\"></p>" 1: startingText: "[The first father][]\n\n[The second first father][Second Father]" renderedAnswer: "<p><img src=\"http://octodex.github.com/images/founding-father.jpg\" alt=\"The first father\"></p>\n<p><img src=\"http://octodex.github.com/images/foundingfather_v2.png\" alt=\"The second first father\"></p>" 5: 0: startingText: "I read this interesting quote the other day:\n\n\"Her eyes had called him and his soul had leaped at the call. To live, to err, to fall, to triumph, to recreate life out of life!\"" renderedAnswer:"<p>I read this interesting quote the other day:</p>\n<blockquote>\n<p>\"Her eyes had called him and his soul had leaped at the call. To live, to err, to fall, to triumph, to recreate life out of life!\"</p>\n</blockquote>" 1: startingText: "\n>Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named PI:NAME:<NAME>END_PIuckoo...\n\nHis father told him that story: his father looked at him through a glass: he had a hairy face.\n\nHe was baby tuckoo. The moocow came down the road where PI:NAME:<NAME>END_PI lived: she sold lemon platt." renderedAnswer: "<blockquote>\n<p>Once upon a time and a very good time it was there was a moocow coming down along the road and this moocow that was coming down along the road met a nicens little boy named PI:NAME:<NAME>END_PIaby tuckoo...</p>\n<p>His father told him that story: his father looked at him through a glass: he had a hairy face.</p>\n<p>He was baby tuckoo. The moocow came down the road where PI:NAME:<NAME>END_PI lived: she sold lemon platt.</p>\n</blockquote>" 2: startingText: "He left her quickly, fearing that her intimacy might turn to jibing and wishing to be out of the way before she offered her ware to another, a tourist from England or a student of Trinity. Grafton Street, along which he walked, prolonged that moment of discouraged poverty. In the roadway at the head of the street a slab was set to the memory of PI:NAME:<NAME>END_PI and he remembered having been present with his father at its laying. He remembered with bitterness that scene of tawdry tribute. There were four French delegates in a brake and one, a plump smiling young man, held, wedged on a stick, a card on which were printed the words: VIVE L'IRLPI:NAME:<NAME>END_PIDE!" renderedAnswer: "<blockquote>\n<p>He left her quickly, fearing that her intimacy might turn to jibing and wishing to be out of the way before she offered her ware to another, a tourist from England or a student of Trinity. Grafton Street, along which he walked, prolonged that moment of discouraged poverty. In the roadway at the head of the street a slab was set to the memory of PI:NAME:<NAME>END_PI and he remembered having been present with his father at its laying. He remembered with bitterness that scene of tawdry tribute. There were four French delegates in a brake and one, a plump smiling young man, held, wedged on a stick, a card on which were printed the words: <em>VIVE L'IRLANDE</em>!</p>\n</blockquote>" 6: 0: startingText: "Flour, Cheese, Tomatoes" renderedAnswer: "<ul>\n<li>Flour</li>\n<li>Cheese</li>\n<li>Tomatoes</li>\n</ul>" 1: startingText: "Cut the cheese, Slice the tomatoes, Rub the tomatoes in flour" renderedAnswer: "<ol>\n<li>Cut the cheese</li>\n<li>Slice the tomatoes</li>\n<li>Rub the tomatoes in flour</li>\n</ol>" 2: startingText: "* Azalea (Ericaceae Rhododendron)\n* Chrysanthemum (Anthemideae Chrysanthemum)\n* Dahlia (Coreopsideae Dahlia)" renderedAnswer: "<ul>\n<li>Azalea (<em>Ericaceae Rhododendron</em>)</li>\n<li>Chrysanthemum (<em>Anthemideae Chrysanthemum</em>)</li>\n<li>Dahlia (<em>Coreopsideae Dahlia</em>)</li>\n</ul>" 3: startingText: "* Calculus, A professor, Has no hair, Often wears green\n* Castafiore, An opera singer, Has white hair, Is possibly mentally unwell" renderedAnswer: "<ul>\n<li>Calculus<ul>\n<li>A professor</li>\n<li>Has no hair</li>\n<li>Often wears green</li>\n</ul>\n</li>\n<li>Castafiore<ul>\n<li>An opera singer</li>\n<li>Has white hair</li>\n<li>Is possibly mentally unwell</li>\n</ul>\n</li>\n</ul>" 4: startingText: "1. Cut the cheese\n * Make sure that the cheese is cut into little triangles.\n\n2. Slice the tomatoes\n * Be careful when holding the knife.\n * For more help on tomato slicing, see PI:NAME:<NAME>END_PI's seminal essay _Tom Ate Those_." renderedAnswer: "<ol>\n<li><p>Cut the cheese</p>\n<p>Make sure that the cheese is cut into little triangles.</p>\n</li>\n<li><p>Slice the tomatoes</p>\n<p>Be careful when holding the knife.</p>\n<p>For more help on tomato slicing, see PI:NAME:<NAME>END_PI's seminal essay <em>Tom Ate Those</em>.</p>\n</li>\n</ol>" 7: 0: startingText: "We pictured the meek mild creatures where\nThey dwelt in their strawy pen,\nNor did it occur to one of us there\nTo doubt they were kneeling then." renderedAnswer: "<p>We pictured the meek mild creatures where<br>They dwelt in their strawy pen,<br>Nor did it occur to one of us there<br>To doubt they were kneeling then.</p>" 1: startingText: "1. Crack three eggs over a bowl.\n\n Now, you're going to want to crack the eggs in such a way that you don't make a mess.\n\n If you _do_ make a mess, use a towel to clean it up!\n\n2. Pour a gallon of milk into the bowl.\n\n Basically, take the same guidance as above: don't be messy, but if you are, clean it up!" renderedAnswer: "<ol>\n<li><p>Crack three eggs over a bowl.<br>Now, you're going to want to crack the eggs in such a way that you don't make a mess.<br>If you <em>do</em> make a mess, use a towel to clean it up!</p>\n</li>\n<li><p>Pour a gallon of milk into the bowl.<br>Basically, take the same guidance as above: don't be messy, but if you are, clean it up!</p>\n</li>\n</ol>"
[ { "context": "###\nThe MIT License\n\nCopyright (c) 2015 Juan Cruz Viotti. https://jviotti.github.io.\n\nPermission is hereby", "end": 56, "score": 0.9998115301132202, "start": 40, "tag": "NAME", "value": "Juan Cruz Viotti" } ]
lib/utils.coffee
jviotti/wary
1
### The MIT License Copyright (c) 2015 Juan Cruz Viotti. https://jviotti.github.io. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ### _ = require('lodash') Promise = require('bluebird') fs = Promise.promisifyAll(require('fs')) ###* # @summary Map trough object values using a promise iterator # @function # @protected # # @param {Object} object - input object # @param {Function} iterator - promised iterator # # @returns {Promise<Object>} mapped object # # @example # utils.promiseMapValues # a: 1 # b: 2 # , (n) -> # Promise.try -> # return n * 3 # .then (result) -> # console.log(result) ### exports.promiseMapValues = (object, iterator) -> Promise.props(_.mapValues(object, iterator))
214662
### The MIT License Copyright (c) 2015 <NAME>. https://jviotti.github.io. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ### _ = require('lodash') Promise = require('bluebird') fs = Promise.promisifyAll(require('fs')) ###* # @summary Map trough object values using a promise iterator # @function # @protected # # @param {Object} object - input object # @param {Function} iterator - promised iterator # # @returns {Promise<Object>} mapped object # # @example # utils.promiseMapValues # a: 1 # b: 2 # , (n) -> # Promise.try -> # return n * 3 # .then (result) -> # console.log(result) ### exports.promiseMapValues = (object, iterator) -> Promise.props(_.mapValues(object, iterator))
true
### The MIT License Copyright (c) 2015 PI:NAME:<NAME>END_PI. https://jviotti.github.io. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ### _ = require('lodash') Promise = require('bluebird') fs = Promise.promisifyAll(require('fs')) ###* # @summary Map trough object values using a promise iterator # @function # @protected # # @param {Object} object - input object # @param {Function} iterator - promised iterator # # @returns {Promise<Object>} mapped object # # @example # utils.promiseMapValues # a: 1 # b: 2 # , (n) -> # Promise.try -> # return n * 3 # .then (result) -> # console.log(result) ### exports.promiseMapValues = (object, iterator) -> Promise.props(_.mapValues(object, iterator))
[ { "context": "email.test =\n match:\n flags: 'g'\n sample: 'johnny@gmail.com tommy92@mail.co.nz don.+.juan_julio@sanjuan.io kz", "end": 526, "score": 0.9998931884765625, "start": 510, "tag": "EMAIL", "value": "johnny@gmail.com" }, { "context": "atch:\n flags: 'g'\n sampl...
node_modules/xemplar/lib/patterns/information.coffee
DORCAS12345/lamisplus-angular
0
patterns = email: /[\w!#$%&'*+/=?^`{|}~-]+(?:\.[\w!#$%&'*+/=?^`{|}~-]+)*@(?:[a-z\d](?:[a-z\d-]*[a-z\d])?\.)+(?:[a-z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b/i phone: us: /(?:[\(])?([2-9]\d{2})(?:[\)])?(?:[\.-])?(\d{3})(?:[\.-])?(\d{4})/ credit_card: /(^(4|5)\d{3}-?\d{4}-?\d{4}-?\d{4}|(4|5)\d{15})|(^(6011)-?\d{4}-?\d{4}-?\d{4}|(6011)-?\d{12})|(^((3\d{3}))-\d{6}-\d{5}|^((3\d{14})))/ zip_code: /\d{5}((?:-)?\d{4})?/ patterns.email.test = match: flags: 'g' sample: 'johnny@gmail.com tommy92@mail.co.nz don.+.juan_julio@sanjuan.io kz@asdfsds.asdf.asdf' expected: ['johnny@gmail.com','tommy92@mail.co.nz','don.+.juan_julio@sanjuan.io'] test: shouldntMatch: ['i','','-','kz@asdfsds.asdf.asdf'] shouldMatch: ['johnny@gmail.com','tommy92@mail.co.nz','don.+.juan_julio@sanjuan.io'] patterns.phone.us.test = match: flags: 'g' sample: '4805555545 (480)-555-5545 480-555-5545 (480)555-5545 (480)-5555545 480.555.5545' expected: ['4805555545','(480)-555-5545','480-555-5545','(480)555-5545','(480)-5555545','480.555.5545'] test: shouldntMatch: ['i','','-','2.1','48055-555-45'] shouldMatch: ['4805555545','(480)-555-5545','480-555-5545','(480)555-5545','(480)-5555545','480.555.5545'] patterns.zip_code.test = match: flags: 'g' sample: '85249 90210-1234 902101234 - i -1234' expected: ['85249','90210-1234','902101234'] test: shouldntMatch: ['i','','-','2.1','-1234'] shouldMatch: ['85249','90210-1234','902101234'] module.exports = patterns
132942
patterns = email: /[\w!#$%&'*+/=?^`{|}~-]+(?:\.[\w!#$%&'*+/=?^`{|}~-]+)*@(?:[a-z\d](?:[a-z\d-]*[a-z\d])?\.)+(?:[a-z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b/i phone: us: /(?:[\(])?([2-9]\d{2})(?:[\)])?(?:[\.-])?(\d{3})(?:[\.-])?(\d{4})/ credit_card: /(^(4|5)\d{3}-?\d{4}-?\d{4}-?\d{4}|(4|5)\d{15})|(^(6011)-?\d{4}-?\d{4}-?\d{4}|(6011)-?\d{12})|(^((3\d{3}))-\d{6}-\d{5}|^((3\d{14})))/ zip_code: /\d{5}((?:-)?\d{4})?/ patterns.email.test = match: flags: 'g' sample: '<EMAIL> <EMAIL> <EMAIL> <EMAIL>' expected: ['<EMAIL>','<EMAIL>','<EMAIL>'] test: shouldntMatch: ['i','','-','<EMAIL>'] shouldMatch: ['<EMAIL>','<EMAIL>','<EMAIL>'] patterns.phone.us.test = match: flags: 'g' sample: '4805555545 (480)-555-5545 480-555-5545 (480)555-5545 (480)-5555545 480.555.5545' expected: ['4805555545','(480)-555-5545','480-555-5545','(480)555-5545','(480)-5555545','480.555.5545'] test: shouldntMatch: ['i','','-','2.1','48055-555-45'] shouldMatch: ['4805555545','(480)-555-5545','480-555-5545','(480)555-5545','(480)-5555545','480.555.5545'] patterns.zip_code.test = match: flags: 'g' sample: '85249 90210-1234 902101234 - i -1234' expected: ['85249','90210-1234','902101234'] test: shouldntMatch: ['i','','-','2.1','-1234'] shouldMatch: ['85249','90210-1234','902101234'] module.exports = patterns
true
patterns = email: /[\w!#$%&'*+/=?^`{|}~-]+(?:\.[\w!#$%&'*+/=?^`{|}~-]+)*@(?:[a-z\d](?:[a-z\d-]*[a-z\d])?\.)+(?:[a-z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b/i phone: us: /(?:[\(])?([2-9]\d{2})(?:[\)])?(?:[\.-])?(\d{3})(?:[\.-])?(\d{4})/ credit_card: /(^(4|5)\d{3}-?\d{4}-?\d{4}-?\d{4}|(4|5)\d{15})|(^(6011)-?\d{4}-?\d{4}-?\d{4}|(6011)-?\d{12})|(^((3\d{3}))-\d{6}-\d{5}|^((3\d{14})))/ zip_code: /\d{5}((?:-)?\d{4})?/ patterns.email.test = match: flags: 'g' sample: 'PI:EMAIL:<EMAIL>END_PI PI:EMAIL:<EMAIL>END_PI PI:EMAIL:<EMAIL>END_PI PI:EMAIL:<EMAIL>END_PI' expected: ['PI:EMAIL:<EMAIL>END_PI','PI:EMAIL:<EMAIL>END_PI','PI:EMAIL:<EMAIL>END_PI'] test: shouldntMatch: ['i','','-','PI:EMAIL:<EMAIL>END_PI'] shouldMatch: ['PI:EMAIL:<EMAIL>END_PI','PI:EMAIL:<EMAIL>END_PI','PI:EMAIL:<EMAIL>END_PI'] patterns.phone.us.test = match: flags: 'g' sample: '4805555545 (480)-555-5545 480-555-5545 (480)555-5545 (480)-5555545 480.555.5545' expected: ['4805555545','(480)-555-5545','480-555-5545','(480)555-5545','(480)-5555545','480.555.5545'] test: shouldntMatch: ['i','','-','2.1','48055-555-45'] shouldMatch: ['4805555545','(480)-555-5545','480-555-5545','(480)555-5545','(480)-5555545','480.555.5545'] patterns.zip_code.test = match: flags: 'g' sample: '85249 90210-1234 902101234 - i -1234' expected: ['85249','90210-1234','902101234'] test: shouldntMatch: ['i','','-','2.1','-1234'] shouldMatch: ['85249','90210-1234','902101234'] module.exports = patterns
[ { "context": "e.log window.atob(sitcon_secret)\n console.log \"SGVsbG8lMkMlMjAlRTUlQTYlODIlRTYlOUUlOUMlRTQlQkQlQTAlRTYlOTglQUYlRTUlQUQlQjglRTclOTQlOUYlRUYlQkMlOEMlRTYlQUQlQTElRTglQkYlOEUlRTUlOEElQTAlRTUlODUlQTUlRTQlQjklOEIlRTUlQkUlOEMlRTUlOEQlQjMlRTUlQjAlODclRTYlODglOTAlRTclQUIlOEIlRTclOUElODQlMjBTSVRDT04lMj...
coffeescripts/main.coffee
sitcon-tw/2014
1
### # Preload Elements ### $window = $(window) $dom = $("html") screenWidth = $window.width() screenHeight = $window.height() $menu = $("#main-menu ul") $menuItems = $menu.children('.item') $menuItem = [ $($menuItems[0]) $($menuItems[1]) $($menuItems[2]) $($menuItems[3]) $($menuItems[4]) $($menuItems[5]) ] $sections = { "#about": $("#about") "#location": $("#location") "#speaker": $("#speaker") "#schedule": $("#schedule") "#sponsor": $("#sponsor") "#team": $("#team") } ### # Media Query in JS ### tablet = Modernizr.mq("(min-width: 48em)") pc = Modernizr.mq("(min-width: 64em)") # Location $mapCanva = document.querySelector("#map-canva") ### # Helper ### resetMenuActiveItem = ()-> $menuItems.removeClass "active" setMenuActiveItem = (index) -> resetMenuActiveItem() $menuItem[index].addClass "active" hash = $menuItem[index].children('a').attr('href') ga('send', 'pageview', "/2014/#{hash}") $window.on 'resize', ()-> screenWidth = $window.width() screenHeight = $window.height() ### # Navigation ### $menu.on "click", "a", (e) -> targetScrollTop = $sections[e.target.hash].offset().top $window.scrollTo(targetScrollTop - 55, 1000) ga('send', 'pageview', "/2014/#{e.target.hash}") e.preventDefault() ### # About Section ### ### # Location ### loadMap = ()-> mapLatLng = new google.maps.LatLng(25.0410096, 121.6118796) mapOptions = { center: mapLatLng zoom: 15 scrollwheel: false } map = new google.maps.Map($mapCanva, mapOptions) marker = new google.maps.Marker { position: mapLatLng map: map icon: "images/map_pin.png" } ### # Schedule ### $sections["#schedule"].on "click", ".session.block", (e)-> $(e.currentTarget).attr("tabindex", -1).focus() ### # Parallax Scrolling ### SECTIONS = { LANDING: 0 NAVIGATION: 1 ABOUT: 2 LOCATION: 3 SPEAKER: 4 SCHEDULE: 5 SPONSOR: 6 TEAM: 7 } page = sections.create({ autoSectionHeight: false }) page.on 'changed', (current, previous)-> pageID = current.element.id if pageID is "landing" $menu.parent().removeClass "fixed" $dom.removeClass "fixed" else $menu.parent().addClass "fixed" $dom.addClass "fixed" page.section SECTIONS.LANDING, (section) -> transitions = [] scrollDownNotice = document.querySelector("#scroll-down-notice") section.on "scrollIn", () -> resetMenuActiveItem() transitions.push { target: scrollDownNotice start: 100 end: 120 key: 'opacity' from: 1 to: 0 } if pc section.transitions(transitions) page.section SECTIONS.NAVIGATION, (section) -> section.on "scrollIn", (way)-> setMenuActiveItem(0) page.section SECTIONS.ABOUT, (section) -> transitions = [] aboutDescription = document.querySelector("#about-description") sitconJiangElements = [document.querySelector("#about"), document.querySelector("#about .overlay.cg")] section.on "scrollIn", ()-> setMenuActiveItem(0) transitions.push { target: aboutDescription start: 0 end: 100 key: 'transform' from: 100 to: 35 format: "translateY(%spx)" afterCalculate: (val) -> return (val / 100) * screenHeight } for element in sitconJiangElements transitions.push { target: element start: 0 end: 100 key: 'background-position-y' from: -100 to: 40 format: "%spx" afterCalculate: (val) -> return (val / 100) * screenHeight } if pc section.transitions(transitions) page.section SECTIONS.LOCATION, (section) -> transitions = [] sitconJiangAtMap = document.querySelector("#sitcon-jiang-at-map") section.on "scrollIn", ()-> setMenuActiveItem(1) transitions.push { target: sitconJiangAtMap start: 0 end: 100 key: 'transform' from: -50 to: 0 format: "translateY(%spx)" afterCalculate: (val) -> val = (val / 100) * screenHeight } if pc section.transitions(transitions) page.section SECTIONS.SPEAKER, (section) -> transitions = [] speakers = $("#speaker .speaker") speakersCount = speakers.length for speaker, index in speakers start = 20 + index * (100 / speakersCount) transitions.push { target: speaker start: start end: start + 50 key: 'opacity' from: 0 to: 1 } transitions.push { target: speaker start: start end: start + 50 key: 'transform' from: 100 to: 0 format: "translateY(%spx)" afterCalculate: (val) -> val = (val / 100) * screenWidth } section.on "scrollIn", ()-> setMenuActiveItem(2) if tablet section.transitions(transitions) page.section SECTIONS.SCHEDULE, (section) -> transitions = [] section.on "scrollIn", ()-> setMenuActiveItem(3) section.transitions(transitions) page.section SECTIONS.SPONSOR, (section) -> section.on "scrollIn", ()-> setMenuActiveItem(4) page.section SECTIONS.TEAM, (section) -> section.on "scrollIn", ()-> setMenuActiveItem(5) ### # Onload ### $window.ready ()-> page.init() loadMap() if window.btoa # If your browser didn't support, I am sorry... window.sitcon_secret = window.btoa " _______________________ _ __\n / __/ _/_ __/ ___/ __ \/ |/ /\n _\ \_/ / / / / /__/ /_/ / / \n/___/___/ /_/ \___/\____/_/|_/ " console.log window.atob(sitcon_secret) console.log "SGVsbG8lMkMlMjAlRTUlQTYlODIlRTYlOUUlOUMlRTQlQkQlQTAlRTYlOTglQUYlRTUlQUQlQjglRTclOTQlOUYlRUYlQkMlOEMlRTYlQUQlQTElRTglQkYlOEUlRTUlOEElQTAlRTUlODUlQTUlRTQlQjklOEIlRTUlQkUlOEMlRTUlOEQlQjMlRTUlQjAlODclRTYlODglOTAlRTclQUIlOEIlRTclOUElODQlMjBTSVRDT04lMjAlRTUlQjglQjglRTUlODIlOTklRTclQjUlODQlRTUlODglQTUlRUYlQkMlOEQlRTglQTYlOTYlRTglQTYlQkElRTUlQjAlOEYlRTclQjUlODQlRUYlQkMlOEMlRTclODIlQkElRTUlQkUlODAlRTUlQkUlOEMlRTclOUElODQlMjBTSVRDT04lMjAlRTglODglODclRTclOUIlQjglRTklOTclOUMlRTYlQjQlQkIlRTUlOEIlOTUlRTUlODclQkElRTQlQjglODAlRTQlQkIlQkQlRTUlOEElOUIlRUYlQkMlOEMlRTUlQTYlODIlRTYlOUUlOUMlRTYlOTglQUYlRTYlQTUlQUQlRTclOTUlOEMlRTQlQkElQkElRTUlQTMlQUIlRUYlQkMlOEMlRTQlQjklOUYlRTYlQUQlQTElRTglQkYlOEUlRTYlODglOTAlRTclODIlQkElRTYlODglOTElRTUlODAlOTElRTclOUElODQlRTklQTElQTclRTUlOTUlOEYlRTMlODAlODIlMjAlRTclOUIlQjQlRTYlOEUlQTUlRTUlOUMlQTglMjBGYWNlYm9vayUyMCVFNCVCOCU4QSVFOCU4MSVBRiVFNyVCNSVBMSVFOCU5MiVCQyVFNiU5OSU4MiVFNSU4RCVCMyVFNSU4RiVBRiVFRiVCQyU5QWh0dHAlM0ElMkYlMkZmYi5tZSUyRmVsY3Q5NjIw"
181098
### # Preload Elements ### $window = $(window) $dom = $("html") screenWidth = $window.width() screenHeight = $window.height() $menu = $("#main-menu ul") $menuItems = $menu.children('.item') $menuItem = [ $($menuItems[0]) $($menuItems[1]) $($menuItems[2]) $($menuItems[3]) $($menuItems[4]) $($menuItems[5]) ] $sections = { "#about": $("#about") "#location": $("#location") "#speaker": $("#speaker") "#schedule": $("#schedule") "#sponsor": $("#sponsor") "#team": $("#team") } ### # Media Query in JS ### tablet = Modernizr.mq("(min-width: 48em)") pc = Modernizr.mq("(min-width: 64em)") # Location $mapCanva = document.querySelector("#map-canva") ### # Helper ### resetMenuActiveItem = ()-> $menuItems.removeClass "active" setMenuActiveItem = (index) -> resetMenuActiveItem() $menuItem[index].addClass "active" hash = $menuItem[index].children('a').attr('href') ga('send', 'pageview', "/2014/#{hash}") $window.on 'resize', ()-> screenWidth = $window.width() screenHeight = $window.height() ### # Navigation ### $menu.on "click", "a", (e) -> targetScrollTop = $sections[e.target.hash].offset().top $window.scrollTo(targetScrollTop - 55, 1000) ga('send', 'pageview', "/2014/#{e.target.hash}") e.preventDefault() ### # About Section ### ### # Location ### loadMap = ()-> mapLatLng = new google.maps.LatLng(25.0410096, 121.6118796) mapOptions = { center: mapLatLng zoom: 15 scrollwheel: false } map = new google.maps.Map($mapCanva, mapOptions) marker = new google.maps.Marker { position: mapLatLng map: map icon: "images/map_pin.png" } ### # Schedule ### $sections["#schedule"].on "click", ".session.block", (e)-> $(e.currentTarget).attr("tabindex", -1).focus() ### # Parallax Scrolling ### SECTIONS = { LANDING: 0 NAVIGATION: 1 ABOUT: 2 LOCATION: 3 SPEAKER: 4 SCHEDULE: 5 SPONSOR: 6 TEAM: 7 } page = sections.create({ autoSectionHeight: false }) page.on 'changed', (current, previous)-> pageID = current.element.id if pageID is "landing" $menu.parent().removeClass "fixed" $dom.removeClass "fixed" else $menu.parent().addClass "fixed" $dom.addClass "fixed" page.section SECTIONS.LANDING, (section) -> transitions = [] scrollDownNotice = document.querySelector("#scroll-down-notice") section.on "scrollIn", () -> resetMenuActiveItem() transitions.push { target: scrollDownNotice start: 100 end: 120 key: 'opacity' from: 1 to: 0 } if pc section.transitions(transitions) page.section SECTIONS.NAVIGATION, (section) -> section.on "scrollIn", (way)-> setMenuActiveItem(0) page.section SECTIONS.ABOUT, (section) -> transitions = [] aboutDescription = document.querySelector("#about-description") sitconJiangElements = [document.querySelector("#about"), document.querySelector("#about .overlay.cg")] section.on "scrollIn", ()-> setMenuActiveItem(0) transitions.push { target: aboutDescription start: 0 end: 100 key: 'transform' from: 100 to: 35 format: "translateY(%spx)" afterCalculate: (val) -> return (val / 100) * screenHeight } for element in sitconJiangElements transitions.push { target: element start: 0 end: 100 key: 'background-position-y' from: -100 to: 40 format: "%spx" afterCalculate: (val) -> return (val / 100) * screenHeight } if pc section.transitions(transitions) page.section SECTIONS.LOCATION, (section) -> transitions = [] sitconJiangAtMap = document.querySelector("#sitcon-jiang-at-map") section.on "scrollIn", ()-> setMenuActiveItem(1) transitions.push { target: sitconJiangAtMap start: 0 end: 100 key: 'transform' from: -50 to: 0 format: "translateY(%spx)" afterCalculate: (val) -> val = (val / 100) * screenHeight } if pc section.transitions(transitions) page.section SECTIONS.SPEAKER, (section) -> transitions = [] speakers = $("#speaker .speaker") speakersCount = speakers.length for speaker, index in speakers start = 20 + index * (100 / speakersCount) transitions.push { target: speaker start: start end: start + 50 key: 'opacity' from: 0 to: 1 } transitions.push { target: speaker start: start end: start + 50 key: 'transform' from: 100 to: 0 format: "translateY(%spx)" afterCalculate: (val) -> val = (val / 100) * screenWidth } section.on "scrollIn", ()-> setMenuActiveItem(2) if tablet section.transitions(transitions) page.section SECTIONS.SCHEDULE, (section) -> transitions = [] section.on "scrollIn", ()-> setMenuActiveItem(3) section.transitions(transitions) page.section SECTIONS.SPONSOR, (section) -> section.on "scrollIn", ()-> setMenuActiveItem(4) page.section SECTIONS.TEAM, (section) -> section.on "scrollIn", ()-> setMenuActiveItem(5) ### # Onload ### $window.ready ()-> page.init() loadMap() if window.btoa # If your browser didn't support, I am sorry... window.sitcon_secret = window.btoa " _______________________ _ __\n / __/ _/_ __/ ___/ __ \/ |/ /\n _\ \_/ / / / / /__/ /_/ / / \n/___/___/ /_/ \___/\____/_/|_/ " console.log window.atob(sitcon_secret) console.log "<KEY>"
true
### # Preload Elements ### $window = $(window) $dom = $("html") screenWidth = $window.width() screenHeight = $window.height() $menu = $("#main-menu ul") $menuItems = $menu.children('.item') $menuItem = [ $($menuItems[0]) $($menuItems[1]) $($menuItems[2]) $($menuItems[3]) $($menuItems[4]) $($menuItems[5]) ] $sections = { "#about": $("#about") "#location": $("#location") "#speaker": $("#speaker") "#schedule": $("#schedule") "#sponsor": $("#sponsor") "#team": $("#team") } ### # Media Query in JS ### tablet = Modernizr.mq("(min-width: 48em)") pc = Modernizr.mq("(min-width: 64em)") # Location $mapCanva = document.querySelector("#map-canva") ### # Helper ### resetMenuActiveItem = ()-> $menuItems.removeClass "active" setMenuActiveItem = (index) -> resetMenuActiveItem() $menuItem[index].addClass "active" hash = $menuItem[index].children('a').attr('href') ga('send', 'pageview', "/2014/#{hash}") $window.on 'resize', ()-> screenWidth = $window.width() screenHeight = $window.height() ### # Navigation ### $menu.on "click", "a", (e) -> targetScrollTop = $sections[e.target.hash].offset().top $window.scrollTo(targetScrollTop - 55, 1000) ga('send', 'pageview', "/2014/#{e.target.hash}") e.preventDefault() ### # About Section ### ### # Location ### loadMap = ()-> mapLatLng = new google.maps.LatLng(25.0410096, 121.6118796) mapOptions = { center: mapLatLng zoom: 15 scrollwheel: false } map = new google.maps.Map($mapCanva, mapOptions) marker = new google.maps.Marker { position: mapLatLng map: map icon: "images/map_pin.png" } ### # Schedule ### $sections["#schedule"].on "click", ".session.block", (e)-> $(e.currentTarget).attr("tabindex", -1).focus() ### # Parallax Scrolling ### SECTIONS = { LANDING: 0 NAVIGATION: 1 ABOUT: 2 LOCATION: 3 SPEAKER: 4 SCHEDULE: 5 SPONSOR: 6 TEAM: 7 } page = sections.create({ autoSectionHeight: false }) page.on 'changed', (current, previous)-> pageID = current.element.id if pageID is "landing" $menu.parent().removeClass "fixed" $dom.removeClass "fixed" else $menu.parent().addClass "fixed" $dom.addClass "fixed" page.section SECTIONS.LANDING, (section) -> transitions = [] scrollDownNotice = document.querySelector("#scroll-down-notice") section.on "scrollIn", () -> resetMenuActiveItem() transitions.push { target: scrollDownNotice start: 100 end: 120 key: 'opacity' from: 1 to: 0 } if pc section.transitions(transitions) page.section SECTIONS.NAVIGATION, (section) -> section.on "scrollIn", (way)-> setMenuActiveItem(0) page.section SECTIONS.ABOUT, (section) -> transitions = [] aboutDescription = document.querySelector("#about-description") sitconJiangElements = [document.querySelector("#about"), document.querySelector("#about .overlay.cg")] section.on "scrollIn", ()-> setMenuActiveItem(0) transitions.push { target: aboutDescription start: 0 end: 100 key: 'transform' from: 100 to: 35 format: "translateY(%spx)" afterCalculate: (val) -> return (val / 100) * screenHeight } for element in sitconJiangElements transitions.push { target: element start: 0 end: 100 key: 'background-position-y' from: -100 to: 40 format: "%spx" afterCalculate: (val) -> return (val / 100) * screenHeight } if pc section.transitions(transitions) page.section SECTIONS.LOCATION, (section) -> transitions = [] sitconJiangAtMap = document.querySelector("#sitcon-jiang-at-map") section.on "scrollIn", ()-> setMenuActiveItem(1) transitions.push { target: sitconJiangAtMap start: 0 end: 100 key: 'transform' from: -50 to: 0 format: "translateY(%spx)" afterCalculate: (val) -> val = (val / 100) * screenHeight } if pc section.transitions(transitions) page.section SECTIONS.SPEAKER, (section) -> transitions = [] speakers = $("#speaker .speaker") speakersCount = speakers.length for speaker, index in speakers start = 20 + index * (100 / speakersCount) transitions.push { target: speaker start: start end: start + 50 key: 'opacity' from: 0 to: 1 } transitions.push { target: speaker start: start end: start + 50 key: 'transform' from: 100 to: 0 format: "translateY(%spx)" afterCalculate: (val) -> val = (val / 100) * screenWidth } section.on "scrollIn", ()-> setMenuActiveItem(2) if tablet section.transitions(transitions) page.section SECTIONS.SCHEDULE, (section) -> transitions = [] section.on "scrollIn", ()-> setMenuActiveItem(3) section.transitions(transitions) page.section SECTIONS.SPONSOR, (section) -> section.on "scrollIn", ()-> setMenuActiveItem(4) page.section SECTIONS.TEAM, (section) -> section.on "scrollIn", ()-> setMenuActiveItem(5) ### # Onload ### $window.ready ()-> page.init() loadMap() if window.btoa # If your browser didn't support, I am sorry... window.sitcon_secret = window.btoa " _______________________ _ __\n / __/ _/_ __/ ___/ __ \/ |/ /\n _\ \_/ / / / / /__/ /_/ / / \n/___/___/ /_/ \___/\____/_/|_/ " console.log window.atob(sitcon_secret) console.log "PI:KEY:<KEY>END_PI"
[ { "context": " the same ID', () ->\n anAccount = new Account 'foobar', 'Foo Bar'\n otherAccount = new Account 'fooba", "end": 171, "score": 0.9420756697654724, "start": 165, "tag": "USERNAME", "value": "foobar" }, { "context": "oobar', 'Foo Bar'\n otherAccount = new Account ...
test/dummy/spec/javascripts/Account_spec.js.coffee
railsc0d0r/global8ball_game
0
#= require game/Account Account = global8ball.Account describe 'Account', () -> it 'equals another account with the same ID', () -> anAccount = new Account 'foobar', 'Foo Bar' otherAccount = new Account 'foobar', 'Bar Foo' expect(anAccount.equals otherAccount).toBeTruthy() it 'does not equal another account with a different ID', () -> anAccount = new Account 'foobar', 'Foo Bar' otherAccount = new Account 'barfoo', 'Bar Foo' expect(anAccount.equals otherAccount).toBeFalsy() it 'stringifies numeric IDs', -> anAccount = new Account 9001, 'Son Goku' otherAccount = new Account '9001', 'Son Goku' expect(anAccount.equals otherAccount).toBeTruthy()
220369
#= require game/Account Account = global8ball.Account describe 'Account', () -> it 'equals another account with the same ID', () -> anAccount = new Account 'foobar', 'Foo Bar' otherAccount = new Account 'foobar', 'Bar Foo' expect(anAccount.equals otherAccount).toBeTruthy() it 'does not equal another account with a different ID', () -> anAccount = new Account 'foobar', 'Foo Bar' otherAccount = new Account 'barfoo', 'Bar Foo' expect(anAccount.equals otherAccount).toBeFalsy() it 'stringifies numeric IDs', -> anAccount = new Account 9001, '<NAME>' otherAccount = new Account '9001', '<NAME>' expect(anAccount.equals otherAccount).toBeTruthy()
true
#= require game/Account Account = global8ball.Account describe 'Account', () -> it 'equals another account with the same ID', () -> anAccount = new Account 'foobar', 'Foo Bar' otherAccount = new Account 'foobar', 'Bar Foo' expect(anAccount.equals otherAccount).toBeTruthy() it 'does not equal another account with a different ID', () -> anAccount = new Account 'foobar', 'Foo Bar' otherAccount = new Account 'barfoo', 'Bar Foo' expect(anAccount.equals otherAccount).toBeFalsy() it 'stringifies numeric IDs', -> anAccount = new Account 9001, 'PI:NAME:<NAME>END_PI' otherAccount = new Account '9001', 'PI:NAME:<NAME>END_PI' expect(anAccount.equals otherAccount).toBeTruthy()
[ { "context": "l\n eventType = null\n context =\n name: \"Jonas\"\n iWasClicked: (view, context, event) ->\n ", "end": 510, "score": 0.9993677139282227, "start": 505, "tag": "NAME", "value": "Jonas" }, { "context": "ct(nodeName).to.eql(\"A\")\n expect(name).to.eql...
test/integration/events.spec.coffee
jnicklas/serenade.js
1
require './../spec_helper' describe 'Events', -> beforeEach -> @setupDom() it 'attaches an event which calls the context action when triggered', -> context = { iWasClicked: -> @clicked = true } @render 'div[event:click=iWasClicked]', context @fireEvent @body.querySelector('div'), 'click' expect(context.clicked).to.be.ok it 'sends in context, element and event when action is triggered', -> nodeName = null name = null eventType = null context = name: "Jonas" iWasClicked: (view, context, event) -> nodeName = view.nodeName name = context.name eventType = event.type @render 'div\n\ta[event:click=iWasClicked]', context @fireEvent @body.querySelector('a'), 'click' expect(nodeName).to.eql("A") expect(name).to.eql("Jonas") expect(eventType).to.eql("click") it 'sends in the element that the event was bound to, not where it was triggered', -> nodeName = null context = iWasClicked: (view) -> nodeName = view.nodeName @render 'div[event:click=iWasClicked]\n\ta', context @fireEvent @body.querySelector('a'), 'click' expect(nodeName).to.eql("DIV")
212655
require './../spec_helper' describe 'Events', -> beforeEach -> @setupDom() it 'attaches an event which calls the context action when triggered', -> context = { iWasClicked: -> @clicked = true } @render 'div[event:click=iWasClicked]', context @fireEvent @body.querySelector('div'), 'click' expect(context.clicked).to.be.ok it 'sends in context, element and event when action is triggered', -> nodeName = null name = null eventType = null context = name: "<NAME>" iWasClicked: (view, context, event) -> nodeName = view.nodeName name = context.name eventType = event.type @render 'div\n\ta[event:click=iWasClicked]', context @fireEvent @body.querySelector('a'), 'click' expect(nodeName).to.eql("A") expect(name).to.eql("<NAME>") expect(eventType).to.eql("click") it 'sends in the element that the event was bound to, not where it was triggered', -> nodeName = null context = iWasClicked: (view) -> nodeName = view.nodeName @render 'div[event:click=iWasClicked]\n\ta', context @fireEvent @body.querySelector('a'), 'click' expect(nodeName).to.eql("DIV")
true
require './../spec_helper' describe 'Events', -> beforeEach -> @setupDom() it 'attaches an event which calls the context action when triggered', -> context = { iWasClicked: -> @clicked = true } @render 'div[event:click=iWasClicked]', context @fireEvent @body.querySelector('div'), 'click' expect(context.clicked).to.be.ok it 'sends in context, element and event when action is triggered', -> nodeName = null name = null eventType = null context = name: "PI:NAME:<NAME>END_PI" iWasClicked: (view, context, event) -> nodeName = view.nodeName name = context.name eventType = event.type @render 'div\n\ta[event:click=iWasClicked]', context @fireEvent @body.querySelector('a'), 'click' expect(nodeName).to.eql("A") expect(name).to.eql("PI:NAME:<NAME>END_PI") expect(eventType).to.eql("click") it 'sends in the element that the event was bound to, not where it was triggered', -> nodeName = null context = iWasClicked: (view) -> nodeName = view.nodeName @render 'div[event:click=iWasClicked]\n\ta', context @fireEvent @body.querySelector('a'), 'click' expect(nodeName).to.eql("DIV")
[ { "context": "# @author Justin Lau <justin@tclau.com>\n# @copyright Copyright (c) 201", "end": 23, "score": 0.9998646378517151, "start": 13, "tag": "NAME", "value": "Justin Lau" }, { "context": "# @author Justin Lau <justin@tclau.com>\n# @copyright Copyright (c) 2014 Justin Lau...
src/scripts/directives/ui-iconpicker.coffee
Sontan/ui-iconpicker
27
# @author Justin Lau <justin@tclau.com> # @copyright Copyright (c) 2014 Justin Lau <justin@tclau.com> # @license The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # umd = (root, factory) -> # AMD if typeof define is "function" and define.amd? define("directives/ui-iconpicker", [ "angular" "services/IconGroupCollection" "templates/iconpicker" ], factory); # Non-AMD else factory(root.angular); umd this, (angular) -> # Register Angular Module module = angular.module("ui-iconpicker/directives/ui-iconpicker", [ "ui-iconpicker/services/IconGroupCollection" "ui-iconpicker/templates/iconpicker" ]); module.directive "uiIconpicker", [ "IconGroupCollection" (IconGroupCollection) -> replace: true restrict: "E" scope: name : "@" model : "=?ngModel" templateUrl: "templates/iconpicker.html" link: ($scope, $element, attrs) -> $scope.availableIconClasses = (new IconGroupCollection(attrs.groups)).getClassArray(); $scope.iconClass = attrs.value ? $scope.availableIconClasses[0]; # setup two way bindings between $scope.iconClass and $scope.model # when ng-model is found in the DOM attribute. if attrs.ngModel $scope.model = $scope[attrs.ngModel]; $scope.$watch "iconClass", -> $scope.model = $scope.iconClass; $scope.$watch "model", -> $scope.iconClass = $scope.model; $scope.$dropdownButton = $element.find("button").eq(0); $scope.disabled = attrs.disabled?; ]
213520
# @author <NAME> <<EMAIL>> # @copyright Copyright (c) 2014 <NAME> <<EMAIL>> # @license The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # umd = (root, factory) -> # AMD if typeof define is "function" and define.amd? define("directives/ui-iconpicker", [ "angular" "services/IconGroupCollection" "templates/iconpicker" ], factory); # Non-AMD else factory(root.angular); umd this, (angular) -> # Register Angular Module module = angular.module("ui-iconpicker/directives/ui-iconpicker", [ "ui-iconpicker/services/IconGroupCollection" "ui-iconpicker/templates/iconpicker" ]); module.directive "uiIconpicker", [ "IconGroupCollection" (IconGroupCollection) -> replace: true restrict: "E" scope: name : "@" model : "=?ngModel" templateUrl: "templates/iconpicker.html" link: ($scope, $element, attrs) -> $scope.availableIconClasses = (new IconGroupCollection(attrs.groups)).getClassArray(); $scope.iconClass = attrs.value ? $scope.availableIconClasses[0]; # setup two way bindings between $scope.iconClass and $scope.model # when ng-model is found in the DOM attribute. if attrs.ngModel $scope.model = $scope[attrs.ngModel]; $scope.$watch "iconClass", -> $scope.model = $scope.iconClass; $scope.$watch "model", -> $scope.iconClass = $scope.model; $scope.$dropdownButton = $element.find("button").eq(0); $scope.disabled = attrs.disabled?; ]
true
# @author PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> # @copyright Copyright (c) 2014 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> # @license The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # umd = (root, factory) -> # AMD if typeof define is "function" and define.amd? define("directives/ui-iconpicker", [ "angular" "services/IconGroupCollection" "templates/iconpicker" ], factory); # Non-AMD else factory(root.angular); umd this, (angular) -> # Register Angular Module module = angular.module("ui-iconpicker/directives/ui-iconpicker", [ "ui-iconpicker/services/IconGroupCollection" "ui-iconpicker/templates/iconpicker" ]); module.directive "uiIconpicker", [ "IconGroupCollection" (IconGroupCollection) -> replace: true restrict: "E" scope: name : "@" model : "=?ngModel" templateUrl: "templates/iconpicker.html" link: ($scope, $element, attrs) -> $scope.availableIconClasses = (new IconGroupCollection(attrs.groups)).getClassArray(); $scope.iconClass = attrs.value ? $scope.availableIconClasses[0]; # setup two way bindings between $scope.iconClass and $scope.model # when ng-model is found in the DOM attribute. if attrs.ngModel $scope.model = $scope[attrs.ngModel]; $scope.$watch "iconClass", -> $scope.model = $scope.iconClass; $scope.$watch "model", -> $scope.iconClass = $scope.model; $scope.$dropdownButton = $element.find("button").eq(0); $scope.disabled = attrs.disabled?; ]
[ { "context": "t-a-uuid-probably'\n meshblu_auth_token: 'totally-a-token'\n Accept: \"application/json, text/plain,", "end": 966, "score": 0.997692883014679, "start": 951, "tag": "PASSWORD", "value": "totally-a-token" } ]
test/device-service-spec.coffee
octoblu/blu-web
3
describe 'DeviceService', -> beforeEach -> module 'blu', ($provide) => return inject ($httpBackend, DeviceService) => @sut = DeviceService @httpBackend = $httpBackend it 'should exist', -> expect(@sut).to.exist describe '->getDevice', -> it 'should be a function', -> expect(@sut.getDevice).to.be.a 'function' it 'should call get device with auth headers', -> @httpBackend.expectGET('https://meshblu.octoblu.com/devices/uuid', { meshblu_auth_uuid: 'uuid' meshblu_auth_token: 'token' Accept: "application/json, text/plain, */*" }).respond(devices: []) @sut.getDevice('uuid', 'token') @httpBackend.flush() it 'should call get device with other auth headers', -> @httpBackend.expectGET('https://meshblu.octoblu.com/devices/not-a-uuid-probably', { meshblu_auth_uuid: 'not-a-uuid-probably' meshblu_auth_token: 'totally-a-token' Accept: "application/json, text/plain, */*" }).respond(devices: []) @sut.getDevice('not-a-uuid-probably', 'totally-a-token') @httpBackend.flush() it 'should call get device and return a device', -> @httpBackend .expectGET 'https://meshblu.octoblu.com/devices/not-a-uuid-probably' .respond { devices: [{foo: 'mine-shaft-inverts'}] } @sut.getDevice 'not-a-uuid-probably', 'totally-a-token' .then (device)=> expect(device).to.deep.equal {foo: 'mine-shaft-inverts'} @httpBackend.flush()
87288
describe 'DeviceService', -> beforeEach -> module 'blu', ($provide) => return inject ($httpBackend, DeviceService) => @sut = DeviceService @httpBackend = $httpBackend it 'should exist', -> expect(@sut).to.exist describe '->getDevice', -> it 'should be a function', -> expect(@sut.getDevice).to.be.a 'function' it 'should call get device with auth headers', -> @httpBackend.expectGET('https://meshblu.octoblu.com/devices/uuid', { meshblu_auth_uuid: 'uuid' meshblu_auth_token: 'token' Accept: "application/json, text/plain, */*" }).respond(devices: []) @sut.getDevice('uuid', 'token') @httpBackend.flush() it 'should call get device with other auth headers', -> @httpBackend.expectGET('https://meshblu.octoblu.com/devices/not-a-uuid-probably', { meshblu_auth_uuid: 'not-a-uuid-probably' meshblu_auth_token: '<PASSWORD>' Accept: "application/json, text/plain, */*" }).respond(devices: []) @sut.getDevice('not-a-uuid-probably', 'totally-a-token') @httpBackend.flush() it 'should call get device and return a device', -> @httpBackend .expectGET 'https://meshblu.octoblu.com/devices/not-a-uuid-probably' .respond { devices: [{foo: 'mine-shaft-inverts'}] } @sut.getDevice 'not-a-uuid-probably', 'totally-a-token' .then (device)=> expect(device).to.deep.equal {foo: 'mine-shaft-inverts'} @httpBackend.flush()
true
describe 'DeviceService', -> beforeEach -> module 'blu', ($provide) => return inject ($httpBackend, DeviceService) => @sut = DeviceService @httpBackend = $httpBackend it 'should exist', -> expect(@sut).to.exist describe '->getDevice', -> it 'should be a function', -> expect(@sut.getDevice).to.be.a 'function' it 'should call get device with auth headers', -> @httpBackend.expectGET('https://meshblu.octoblu.com/devices/uuid', { meshblu_auth_uuid: 'uuid' meshblu_auth_token: 'token' Accept: "application/json, text/plain, */*" }).respond(devices: []) @sut.getDevice('uuid', 'token') @httpBackend.flush() it 'should call get device with other auth headers', -> @httpBackend.expectGET('https://meshblu.octoblu.com/devices/not-a-uuid-probably', { meshblu_auth_uuid: 'not-a-uuid-probably' meshblu_auth_token: 'PI:PASSWORD:<PASSWORD>END_PI' Accept: "application/json, text/plain, */*" }).respond(devices: []) @sut.getDevice('not-a-uuid-probably', 'totally-a-token') @httpBackend.flush() it 'should call get device and return a device', -> @httpBackend .expectGET 'https://meshblu.octoblu.com/devices/not-a-uuid-probably' .respond { devices: [{foo: 'mine-shaft-inverts'}] } @sut.getDevice 'not-a-uuid-probably', 'totally-a-token' .then (device)=> expect(device).to.deep.equal {foo: 'mine-shaft-inverts'} @httpBackend.flush()
[ { "context": "###\n * fs-filesysteminfo\n * https://github.com/cookch10/node-fs-filesysteminfo\n *\n * Copyright (c) 2016 ", "end": 57, "score": 0.9996155500411987, "start": 49, "tag": "USERNAME", "value": "cookch10" }, { "context": "0/node-fs-filesysteminfo\n *\n * Copyright (c)...
src/index.coffee
cookch10/node-fs-filesysteminfo
4
### * fs-filesysteminfo * https://github.com/cookch10/node-fs-filesysteminfo * * Copyright (c) 2016 Christopher M. Cook * Licensed under the MIT license. ### "use strict" IO = require("./fs-filesysteminfo.js").Util.System.IO exports.FileSystemInfo = IO.FileSystemInfo exports.DirectoryInfo = IO.DirectoryInfo exports.FileInfo = IO.FileInfo
9233
### * fs-filesysteminfo * https://github.com/cookch10/node-fs-filesysteminfo * * Copyright (c) 2016 <NAME> * Licensed under the MIT license. ### "use strict" IO = require("./fs-filesysteminfo.js").Util.System.IO exports.FileSystemInfo = IO.FileSystemInfo exports.DirectoryInfo = IO.DirectoryInfo exports.FileInfo = IO.FileInfo
true
### * fs-filesysteminfo * https://github.com/cookch10/node-fs-filesysteminfo * * Copyright (c) 2016 PI:NAME:<NAME>END_PI * Licensed under the MIT license. ### "use strict" IO = require("./fs-filesysteminfo.js").Util.System.IO exports.FileSystemInfo = IO.FileSystemInfo exports.DirectoryInfo = IO.DirectoryInfo exports.FileInfo = IO.FileInfo
[ { "context": "@options.key_sep)\n\t\t\tkey = new RegExp \"^#{_.last(s)+b+c}$\"\n\t\t\n\t\tif !_.isRegExp(key)\n\t\t\t@emit \"error\", new E", "end": 3185, "score": 0.7752351760864258, "start": 3180, "tag": "KEY", "value": "b+c}$" } ]
src/resource.coffee
tyler-johnson/json-toolkit
2
### # This file provides a basic JSON object handling ### json = require '../main' _ = require 'underscore' fs = require 'fs' SRPClass = require('./SRPClass') class JSONResource extends SRPClass constructor: (v, options) -> @options = _.defaults options, from_file: false, key_sep: ":", pretty_output: false, indent: "\t" # Default vars @data = {} do_ready = _.once () => @isReady = true @emit "ready" # Deal with "watching" @watching = {} @on "change", (key, val) => if _.has(@watching, key) then @watching[key].call(null, key, val) # Handle input unless v then do_ready() # Is string and is filename if _.isString(v) and @options.from_file @file = v # Check if it exists because we don't care if it doesn't fs.exists v, (exists) => if exists @load v, (err) => if err then @emit "error", err else do_ready() else do_ready() # Otherwise have load handle it else @load v do_ready() get: (key) -> unless key then return @data if _.isString(key) then keys = @_sepPath key else if _.isArray(key) and key.length then keys = key else return @emit "error", new Error "Expecting string or array." current = @data failed = _.find _.initial(keys), (item) -> if _.has(current, item) then return !(current = current[item]) else return true if failed then return undefined else return current[_.last(keys)] set: (key, val) -> if _.isString(key) and key then keys = @_sepPath key else if _.isArray(key) and key.length then keys = key else return @emit "error", new Error "Expecting string or array for key." current = @data; # Traverse the tree. Stop right before the last key failed = _.some _.initial(keys), (item) => # If it doesn't exist, make it an object unless _.has(current, item) then current[item] = {} # If it does exists, isn't the last key (can't be), and isn't an object, error up as a safety unless _.isObject(current[item]) @emit "error", new Error("The key `#{item}` exists, but setting the value failed because it isn't a traversable object.") return true # Reset the current variable current = current[item] return false # Finally, set some bitches unless failed current[_.last(keys)] = val @emit "change", keys.join(@options.key_sep), val test: (key, value) -> val = @get key if _.isString(value) then return typeof val is value else if _.isFunction(value) then return value.call null, val else if _.isRegExp(value) then return val.test(value) else return value is val match: (key) -> stars = /([\\])?(\*\*?)/i one = "([^#{@options.key_sep}]*)" two = "(.*)" matches = [] start = null rmatch = (str) -> m = stars.exec(str) unless m then return [ str, "", "" ] a = str.slice 0, m.index b = if m[1] then m[2] else if m[2] is "*" then one else if m[2] is "**" then two else m[0] c = rmatch(str.slice(m.index + m[0].length)).join("") return [ a, b, c ] if _.isString(key) [ a, b, c ] = rmatch(key) s = a.split(@options.key_sep) start = _.initial(s).join(@options.key_sep) key = new RegExp "^#{_.last(s)+b+c}$" if !_.isRegExp(key) @emit "error", new Error("Expecting string or regex.") return [] reach = (obj, base) => base = if base then base + @options.key_sep else "" _.each obj, (v, k) -> k = base + k if key.test(k) then matches.push k if _.isObject(v) then reach v, k value = @get(start) if _.isObject(value) then reach(value) else matches = [ "" ] matches = _.map matches, (m) => return start + @options.key_sep + m return matches replace: (key, val) -> @each key, (x, k) => if _.isFunction(val) then v = val @get(k), k else v = val @set k, v each: (key, cb) -> if _.isFunction(key) then [cb, key] = [key, null] ms = @match key or "**" _.each ms, (k) => cb(@get(k), k, ms) watch: (key, cb) -> if _.isFunction(key) and !cb then [cb, key] = [key, "**"] unless _.isFunction(cb) and _.isString(key) then return keep = _.chain(@match(key)).map((k) -> return [ k, cb ]).object().value() _.extend @watching, keep # return first matched key find: (val) -> key = null _find = (obj, base) => base = if base then base + @options.key_sep else "" _.some obj, (item, k) => k = base + k if _.isEqual(val, item) then return key = k else if _.isObject(item) then _find item, k _find(@data) return key # returns all matched keys search: (val) -> keys = [] _find = (obj, base) => base = if base then base + @options.key_sep else "" _.each obj, (item, key) => key = base + key if _.isEqual(val, item) then keys.push key if _.isObject(item) then _find item, key _find(@data) return keys load: (data, cb) -> old = @toObject() if _.isFunction cb return json.parseFile data, (err, obj) => if err then cb err else _.extend @data, obj cb null, old @emit "load", old try if _.isString data then data = json.parse data _.extend @data, data catch e then return @emit "error", e @emit "load", old return old save: (file, cb) -> if _.isFunction(file) then [cb, file] = [file, @file] unless file then file = @file or null indent = if @options.pretty_output then @options.indent else null json.saveJSON @data, file, indent, (err) => if err if cb then cb err else @emit "error", err else @file = file if cb then cb() @emit "save", file toPrettyString: (indent) -> indent ?= @options.indent return json.prettify @data, indent toString: () -> return json.stringify @data toJSON: () -> return @toObject() toObject: () -> return _.clone(@data) _sepPath: (p) -> return _.compact p.split @options.key_sep module.exports = JSONResource
116503
### # This file provides a basic JSON object handling ### json = require '../main' _ = require 'underscore' fs = require 'fs' SRPClass = require('./SRPClass') class JSONResource extends SRPClass constructor: (v, options) -> @options = _.defaults options, from_file: false, key_sep: ":", pretty_output: false, indent: "\t" # Default vars @data = {} do_ready = _.once () => @isReady = true @emit "ready" # Deal with "watching" @watching = {} @on "change", (key, val) => if _.has(@watching, key) then @watching[key].call(null, key, val) # Handle input unless v then do_ready() # Is string and is filename if _.isString(v) and @options.from_file @file = v # Check if it exists because we don't care if it doesn't fs.exists v, (exists) => if exists @load v, (err) => if err then @emit "error", err else do_ready() else do_ready() # Otherwise have load handle it else @load v do_ready() get: (key) -> unless key then return @data if _.isString(key) then keys = @_sepPath key else if _.isArray(key) and key.length then keys = key else return @emit "error", new Error "Expecting string or array." current = @data failed = _.find _.initial(keys), (item) -> if _.has(current, item) then return !(current = current[item]) else return true if failed then return undefined else return current[_.last(keys)] set: (key, val) -> if _.isString(key) and key then keys = @_sepPath key else if _.isArray(key) and key.length then keys = key else return @emit "error", new Error "Expecting string or array for key." current = @data; # Traverse the tree. Stop right before the last key failed = _.some _.initial(keys), (item) => # If it doesn't exist, make it an object unless _.has(current, item) then current[item] = {} # If it does exists, isn't the last key (can't be), and isn't an object, error up as a safety unless _.isObject(current[item]) @emit "error", new Error("The key `#{item}` exists, but setting the value failed because it isn't a traversable object.") return true # Reset the current variable current = current[item] return false # Finally, set some bitches unless failed current[_.last(keys)] = val @emit "change", keys.join(@options.key_sep), val test: (key, value) -> val = @get key if _.isString(value) then return typeof val is value else if _.isFunction(value) then return value.call null, val else if _.isRegExp(value) then return val.test(value) else return value is val match: (key) -> stars = /([\\])?(\*\*?)/i one = "([^#{@options.key_sep}]*)" two = "(.*)" matches = [] start = null rmatch = (str) -> m = stars.exec(str) unless m then return [ str, "", "" ] a = str.slice 0, m.index b = if m[1] then m[2] else if m[2] is "*" then one else if m[2] is "**" then two else m[0] c = rmatch(str.slice(m.index + m[0].length)).join("") return [ a, b, c ] if _.isString(key) [ a, b, c ] = rmatch(key) s = a.split(@options.key_sep) start = _.initial(s).join(@options.key_sep) key = new RegExp "^#{_.last(s)+<KEY>" if !_.isRegExp(key) @emit "error", new Error("Expecting string or regex.") return [] reach = (obj, base) => base = if base then base + @options.key_sep else "" _.each obj, (v, k) -> k = base + k if key.test(k) then matches.push k if _.isObject(v) then reach v, k value = @get(start) if _.isObject(value) then reach(value) else matches = [ "" ] matches = _.map matches, (m) => return start + @options.key_sep + m return matches replace: (key, val) -> @each key, (x, k) => if _.isFunction(val) then v = val @get(k), k else v = val @set k, v each: (key, cb) -> if _.isFunction(key) then [cb, key] = [key, null] ms = @match key or "**" _.each ms, (k) => cb(@get(k), k, ms) watch: (key, cb) -> if _.isFunction(key) and !cb then [cb, key] = [key, "**"] unless _.isFunction(cb) and _.isString(key) then return keep = _.chain(@match(key)).map((k) -> return [ k, cb ]).object().value() _.extend @watching, keep # return first matched key find: (val) -> key = null _find = (obj, base) => base = if base then base + @options.key_sep else "" _.some obj, (item, k) => k = base + k if _.isEqual(val, item) then return key = k else if _.isObject(item) then _find item, k _find(@data) return key # returns all matched keys search: (val) -> keys = [] _find = (obj, base) => base = if base then base + @options.key_sep else "" _.each obj, (item, key) => key = base + key if _.isEqual(val, item) then keys.push key if _.isObject(item) then _find item, key _find(@data) return keys load: (data, cb) -> old = @toObject() if _.isFunction cb return json.parseFile data, (err, obj) => if err then cb err else _.extend @data, obj cb null, old @emit "load", old try if _.isString data then data = json.parse data _.extend @data, data catch e then return @emit "error", e @emit "load", old return old save: (file, cb) -> if _.isFunction(file) then [cb, file] = [file, @file] unless file then file = @file or null indent = if @options.pretty_output then @options.indent else null json.saveJSON @data, file, indent, (err) => if err if cb then cb err else @emit "error", err else @file = file if cb then cb() @emit "save", file toPrettyString: (indent) -> indent ?= @options.indent return json.prettify @data, indent toString: () -> return json.stringify @data toJSON: () -> return @toObject() toObject: () -> return _.clone(@data) _sepPath: (p) -> return _.compact p.split @options.key_sep module.exports = JSONResource
true
### # This file provides a basic JSON object handling ### json = require '../main' _ = require 'underscore' fs = require 'fs' SRPClass = require('./SRPClass') class JSONResource extends SRPClass constructor: (v, options) -> @options = _.defaults options, from_file: false, key_sep: ":", pretty_output: false, indent: "\t" # Default vars @data = {} do_ready = _.once () => @isReady = true @emit "ready" # Deal with "watching" @watching = {} @on "change", (key, val) => if _.has(@watching, key) then @watching[key].call(null, key, val) # Handle input unless v then do_ready() # Is string and is filename if _.isString(v) and @options.from_file @file = v # Check if it exists because we don't care if it doesn't fs.exists v, (exists) => if exists @load v, (err) => if err then @emit "error", err else do_ready() else do_ready() # Otherwise have load handle it else @load v do_ready() get: (key) -> unless key then return @data if _.isString(key) then keys = @_sepPath key else if _.isArray(key) and key.length then keys = key else return @emit "error", new Error "Expecting string or array." current = @data failed = _.find _.initial(keys), (item) -> if _.has(current, item) then return !(current = current[item]) else return true if failed then return undefined else return current[_.last(keys)] set: (key, val) -> if _.isString(key) and key then keys = @_sepPath key else if _.isArray(key) and key.length then keys = key else return @emit "error", new Error "Expecting string or array for key." current = @data; # Traverse the tree. Stop right before the last key failed = _.some _.initial(keys), (item) => # If it doesn't exist, make it an object unless _.has(current, item) then current[item] = {} # If it does exists, isn't the last key (can't be), and isn't an object, error up as a safety unless _.isObject(current[item]) @emit "error", new Error("The key `#{item}` exists, but setting the value failed because it isn't a traversable object.") return true # Reset the current variable current = current[item] return false # Finally, set some bitches unless failed current[_.last(keys)] = val @emit "change", keys.join(@options.key_sep), val test: (key, value) -> val = @get key if _.isString(value) then return typeof val is value else if _.isFunction(value) then return value.call null, val else if _.isRegExp(value) then return val.test(value) else return value is val match: (key) -> stars = /([\\])?(\*\*?)/i one = "([^#{@options.key_sep}]*)" two = "(.*)" matches = [] start = null rmatch = (str) -> m = stars.exec(str) unless m then return [ str, "", "" ] a = str.slice 0, m.index b = if m[1] then m[2] else if m[2] is "*" then one else if m[2] is "**" then two else m[0] c = rmatch(str.slice(m.index + m[0].length)).join("") return [ a, b, c ] if _.isString(key) [ a, b, c ] = rmatch(key) s = a.split(@options.key_sep) start = _.initial(s).join(@options.key_sep) key = new RegExp "^#{_.last(s)+PI:KEY:<KEY>END_PI" if !_.isRegExp(key) @emit "error", new Error("Expecting string or regex.") return [] reach = (obj, base) => base = if base then base + @options.key_sep else "" _.each obj, (v, k) -> k = base + k if key.test(k) then matches.push k if _.isObject(v) then reach v, k value = @get(start) if _.isObject(value) then reach(value) else matches = [ "" ] matches = _.map matches, (m) => return start + @options.key_sep + m return matches replace: (key, val) -> @each key, (x, k) => if _.isFunction(val) then v = val @get(k), k else v = val @set k, v each: (key, cb) -> if _.isFunction(key) then [cb, key] = [key, null] ms = @match key or "**" _.each ms, (k) => cb(@get(k), k, ms) watch: (key, cb) -> if _.isFunction(key) and !cb then [cb, key] = [key, "**"] unless _.isFunction(cb) and _.isString(key) then return keep = _.chain(@match(key)).map((k) -> return [ k, cb ]).object().value() _.extend @watching, keep # return first matched key find: (val) -> key = null _find = (obj, base) => base = if base then base + @options.key_sep else "" _.some obj, (item, k) => k = base + k if _.isEqual(val, item) then return key = k else if _.isObject(item) then _find item, k _find(@data) return key # returns all matched keys search: (val) -> keys = [] _find = (obj, base) => base = if base then base + @options.key_sep else "" _.each obj, (item, key) => key = base + key if _.isEqual(val, item) then keys.push key if _.isObject(item) then _find item, key _find(@data) return keys load: (data, cb) -> old = @toObject() if _.isFunction cb return json.parseFile data, (err, obj) => if err then cb err else _.extend @data, obj cb null, old @emit "load", old try if _.isString data then data = json.parse data _.extend @data, data catch e then return @emit "error", e @emit "load", old return old save: (file, cb) -> if _.isFunction(file) then [cb, file] = [file, @file] unless file then file = @file or null indent = if @options.pretty_output then @options.indent else null json.saveJSON @data, file, indent, (err) => if err if cb then cb err else @emit "error", err else @file = file if cb then cb() @emit "save", file toPrettyString: (indent) -> indent ?= @options.indent return json.prettify @data, indent toString: () -> return json.stringify @data toJSON: () -> return @toObject() toObject: () -> return _.clone(@data) _sepPath: (p) -> return _.compact p.split @options.key_sep module.exports = JSONResource
[ { "context": "r = robot.brain.userForId \"1\",\n name: \"mocha\"\n email: \"mocha@example.com\"\n ", "end": 764, "score": 0.5681964755058289, "start": 759, "tag": "NAME", "value": "mocha" }, { "context": "1\",\n name: \"mocha\"\n em...
test/command_spec.coffee
Furchin/hubot-tangocard-highfive
0
# Hubot classes Robot = require "hubot/src/robot" TextMessage = require("hubot/src/message").TextMessage path = require 'path' # Load assertion methods to this scope { expect } = require 'chai' nock = require 'nock' nock.disableNetConnect() # Globals robot = user = {} # Test environment variables process.env.HUBOT_HIGHFIVE_CHAT_SERVICE = 'dummy' process.env.PORT = 8088 process.env.HUBOT_HOSTNAME = 'http://localhost:8088' # Create a robot, load our script prep = (done) -> robot = new Robot path.resolve(__dirname), 'shell', yes, 'TestHubot' robot.adapter.on 'connected', -> # Project script robot.loadFile path.resolve('.'), 'index.coffee' # Some test users user = robot.brain.userForId "1", name: "mocha" email: "mocha@example.com" room: "#mocha" robot.brain.userForId '2', name: 'foo' email: 'foo@example.com' room: '#mocha' done() robot.run() cleanup = -> robot.server.close() robot.shutdown() nock.cleanAll() # Message/response helper message_response = (msg, evt, expecter) -> robot.adapter.on evt, expecter robot.adapter.receive new TextMessage user, "TestHubot #{msg}" # Test help output describe 'help', -> beforeEach prep afterEach cleanup it 'should have 4', (done) -> expect(robot.helpCommands()).to.have.length 4 do done it 'should parse help', (done) -> help = robot.helpCommands() expected = [ 'hubot highfive @<user> $<amount> for <awesome thing> - makes a loud announcement and sends the user an Amazon.com giftcard', 'hubot highfive @<user> for <awesome thing> - makes a loud announcement in a public chatroom', 'hubot highfive config - show URL for configuration UI', 'hubot highfive stats - show stats about high-fives', ] expect(expected).to.contain(x) for x in help do done # Mock out the tangocard API process.env.HUBOT_TANGOCARD_ROOTURL = 'http://tango.example.com/' process.env.HUBOT_TANGOCARD_CUSTOMER = 'Foo' process.env.HUBOT_TANGOCARD_ACCOUNT = 'Bar' # Test the Tango Card API implementation describe 'Tango Card', -> beforeEach (done) -> nock('http://tango.example.com') .filteringPath /Authorization=[^&]*/g, 'Authorization=FOOBAR' .get('/accounts/Foo/Bar?Authorization=FOOBAR') .reply 200, success: true account: available_balance: 100 .post('/cc_fund?Authorization=FOOBAR') .reply 200, success: true .post('/orders?Authorization=FOOBAR') .reply 200, success: true order: delivered_at: 'now' reward: number: '123' nock('http://jsonip.com') .get('/') .reply 200, ip: '0.0.0.0' prep done afterEach cleanup it 'should announce the gift card', (done) -> message_response 'highfive @foo $25 for something', 'send', (e,strs) -> unless strs.match /woo/i expect(strs).to.match /.*\$25.*card.*/i do done it 'should refuse to send too much money in one day', (done) -> process.env.HUBOT_HIGHFIVE_DAILY_LIMIT = 30 message_response 'highfive @foo $20 for nothing', 'send', (e,strs) -> return unless strs.match /\$20/ message_response 'highfive @foo $15 for nothing', 'reply', (e,strs) -> if strs.indexOf('$15') == -1 expect(strs).to.match /.*sorry.*\$20.*\$30/i delete process.env.HUBOT_HIGHFIVE_DAILY_LIMIT do done # Test the command itself describe 'highfive', -> beforeEach prep afterEach cleanup it "shouldn't let you high-five yourself", (done) -> message_response 'highfive @mocha for nothing', 'reply', (e,strs) -> expect(strs).to.contain 'clapping' do done it "shouldn't let you send huge gifts", (done) -> message_response 'highfive @foo $5000 for nothing', 'reply', (e,strs) -> expect(strs).to.match /\$5000.*smaller.*150/i do done it 'should mention the right limit when refusing to order a card', (done) -> process.env.HUBOT_HIGHFIVE_AWARD_LIMIT = 20 message_response 'highfive @foo $30 for nothing', 'reply', (e, strs) -> delete process.env.HUBOT_HIGHFIVE_AWARD_LIMIT expect(strs).to.contain '$30' do done it 'should refuse to send a card if awards are disabled', (done) -> process.env.HUBOT_HIGHFIVE_AWARD_LIMIT = 0 message_response 'highfive @foo $10 for nothing', 'reply', (e,strs) -> delete process.env.HUBOT_HIGHFIVE_AWARD_LIMIT expect(strs).to.contain 'disabled' do done it 'should make some noise', (done) -> message_response 'highfive @foo for something', 'send', (e,strs) -> expect(strs).to.match /woo/i expect(strs).to.contain 'foo' expect(strs).to.contain 'mocha' expect(strs).to.match /\.gif/i do done it "should complain if it can't find a user", (done) -> message_response 'highfive @bar for nothing', 'reply', (e,strs) -> expect(strs).to.equal "Who's @bar?" do done it "should be okay with 'for' or not", (done) -> message_response 'highfive @foo something', 'send', (e,strs) -> expect(strs).to.match /woo/i expect(strs).to.contain 'foo' expect(strs).to.contain 'mocha' expect(strs).to.match /\.gif/i do done describe 'config', -> beforeEach prep afterEach cleanup it "should respond", (done) -> message_response 'highfive config', 'reply', (e,strs) -> expect(strs).to.match /localhost:8088\/highfive\/$/ do done
121947
# Hubot classes Robot = require "hubot/src/robot" TextMessage = require("hubot/src/message").TextMessage path = require 'path' # Load assertion methods to this scope { expect } = require 'chai' nock = require 'nock' nock.disableNetConnect() # Globals robot = user = {} # Test environment variables process.env.HUBOT_HIGHFIVE_CHAT_SERVICE = 'dummy' process.env.PORT = 8088 process.env.HUBOT_HOSTNAME = 'http://localhost:8088' # Create a robot, load our script prep = (done) -> robot = new Robot path.resolve(__dirname), 'shell', yes, 'TestHubot' robot.adapter.on 'connected', -> # Project script robot.loadFile path.resolve('.'), 'index.coffee' # Some test users user = robot.brain.userForId "1", name: "<NAME>" email: "<EMAIL>" room: "#mocha" robot.brain.userForId '2', name: '<NAME>' email: '<EMAIL>' room: '#mocha' done() robot.run() cleanup = -> robot.server.close() robot.shutdown() nock.cleanAll() # Message/response helper message_response = (msg, evt, expecter) -> robot.adapter.on evt, expecter robot.adapter.receive new TextMessage user, "TestHubot #{msg}" # Test help output describe 'help', -> beforeEach prep afterEach cleanup it 'should have 4', (done) -> expect(robot.helpCommands()).to.have.length 4 do done it 'should parse help', (done) -> help = robot.helpCommands() expected = [ 'hubot highfive @<user> $<amount> for <awesome thing> - makes a loud announcement and sends the user an Amazon.com giftcard', 'hubot highfive @<user> for <awesome thing> - makes a loud announcement in a public chatroom', 'hubot highfive config - show URL for configuration UI', 'hubot highfive stats - show stats about high-fives', ] expect(expected).to.contain(x) for x in help do done # Mock out the tangocard API process.env.HUBOT_TANGOCARD_ROOTURL = 'http://tango.example.com/' process.env.HUBOT_TANGOCARD_CUSTOMER = 'Foo' process.env.HUBOT_TANGOCARD_ACCOUNT = 'Bar' # Test the Tango Card API implementation describe 'Tango Card', -> beforeEach (done) -> nock('http://tango.example.com') .filteringPath /Authorization=[^&]*/g, 'Authorization=FOOBAR' .get('/accounts/Foo/Bar?Authorization=FOOBAR') .reply 200, success: true account: available_balance: 100 .post('/cc_fund?Authorization=FOOBAR') .reply 200, success: true .post('/orders?Authorization=FOOBAR') .reply 200, success: true order: delivered_at: 'now' reward: number: '123' nock('http://jsonip.com') .get('/') .reply 200, ip: '0.0.0.0' prep done afterEach cleanup it 'should announce the gift card', (done) -> message_response 'highfive @foo $25 for something', 'send', (e,strs) -> unless strs.match /woo/i expect(strs).to.match /.*\$25.*card.*/i do done it 'should refuse to send too much money in one day', (done) -> process.env.HUBOT_HIGHFIVE_DAILY_LIMIT = 30 message_response 'highfive @foo $20 for nothing', 'send', (e,strs) -> return unless strs.match /\$20/ message_response 'highfive @foo $15 for nothing', 'reply', (e,strs) -> if strs.indexOf('$15') == -1 expect(strs).to.match /.*sorry.*\$20.*\$30/i delete process.env.HUBOT_HIGHFIVE_DAILY_LIMIT do done # Test the command itself describe 'highfive', -> beforeEach prep afterEach cleanup it "shouldn't let you high-five yourself", (done) -> message_response 'highfive @mocha for nothing', 'reply', (e,strs) -> expect(strs).to.contain 'clapping' do done it "shouldn't let you send huge gifts", (done) -> message_response 'highfive @foo $5000 for nothing', 'reply', (e,strs) -> expect(strs).to.match /\$5000.*smaller.*150/i do done it 'should mention the right limit when refusing to order a card', (done) -> process.env.HUBOT_HIGHFIVE_AWARD_LIMIT = 20 message_response 'highfive @foo $30 for nothing', 'reply', (e, strs) -> delete process.env.HUBOT_HIGHFIVE_AWARD_LIMIT expect(strs).to.contain '$30' do done it 'should refuse to send a card if awards are disabled', (done) -> process.env.HUBOT_HIGHFIVE_AWARD_LIMIT = 0 message_response 'highfive @foo $10 for nothing', 'reply', (e,strs) -> delete process.env.HUBOT_HIGHFIVE_AWARD_LIMIT expect(strs).to.contain 'disabled' do done it 'should make some noise', (done) -> message_response 'highfive @foo for something', 'send', (e,strs) -> expect(strs).to.match /woo/i expect(strs).to.contain 'foo' expect(strs).to.contain 'mocha' expect(strs).to.match /\.gif/i do done it "should complain if it can't find a user", (done) -> message_response 'highfive @bar for nothing', 'reply', (e,strs) -> expect(strs).to.equal "Who's @bar?" do done it "should be okay with 'for' or not", (done) -> message_response 'highfive @foo something', 'send', (e,strs) -> expect(strs).to.match /woo/i expect(strs).to.contain 'foo' expect(strs).to.contain 'mocha' expect(strs).to.match /\.gif/i do done describe 'config', -> beforeEach prep afterEach cleanup it "should respond", (done) -> message_response 'highfive config', 'reply', (e,strs) -> expect(strs).to.match /localhost:8088\/highfive\/$/ do done
true
# Hubot classes Robot = require "hubot/src/robot" TextMessage = require("hubot/src/message").TextMessage path = require 'path' # Load assertion methods to this scope { expect } = require 'chai' nock = require 'nock' nock.disableNetConnect() # Globals robot = user = {} # Test environment variables process.env.HUBOT_HIGHFIVE_CHAT_SERVICE = 'dummy' process.env.PORT = 8088 process.env.HUBOT_HOSTNAME = 'http://localhost:8088' # Create a robot, load our script prep = (done) -> robot = new Robot path.resolve(__dirname), 'shell', yes, 'TestHubot' robot.adapter.on 'connected', -> # Project script robot.loadFile path.resolve('.'), 'index.coffee' # Some test users user = robot.brain.userForId "1", name: "PI:NAME:<NAME>END_PI" email: "PI:EMAIL:<EMAIL>END_PI" room: "#mocha" robot.brain.userForId '2', name: 'PI:NAME:<NAME>END_PI' email: 'PI:EMAIL:<EMAIL>END_PI' room: '#mocha' done() robot.run() cleanup = -> robot.server.close() robot.shutdown() nock.cleanAll() # Message/response helper message_response = (msg, evt, expecter) -> robot.adapter.on evt, expecter robot.adapter.receive new TextMessage user, "TestHubot #{msg}" # Test help output describe 'help', -> beforeEach prep afterEach cleanup it 'should have 4', (done) -> expect(robot.helpCommands()).to.have.length 4 do done it 'should parse help', (done) -> help = robot.helpCommands() expected = [ 'hubot highfive @<user> $<amount> for <awesome thing> - makes a loud announcement and sends the user an Amazon.com giftcard', 'hubot highfive @<user> for <awesome thing> - makes a loud announcement in a public chatroom', 'hubot highfive config - show URL for configuration UI', 'hubot highfive stats - show stats about high-fives', ] expect(expected).to.contain(x) for x in help do done # Mock out the tangocard API process.env.HUBOT_TANGOCARD_ROOTURL = 'http://tango.example.com/' process.env.HUBOT_TANGOCARD_CUSTOMER = 'Foo' process.env.HUBOT_TANGOCARD_ACCOUNT = 'Bar' # Test the Tango Card API implementation describe 'Tango Card', -> beforeEach (done) -> nock('http://tango.example.com') .filteringPath /Authorization=[^&]*/g, 'Authorization=FOOBAR' .get('/accounts/Foo/Bar?Authorization=FOOBAR') .reply 200, success: true account: available_balance: 100 .post('/cc_fund?Authorization=FOOBAR') .reply 200, success: true .post('/orders?Authorization=FOOBAR') .reply 200, success: true order: delivered_at: 'now' reward: number: '123' nock('http://jsonip.com') .get('/') .reply 200, ip: '0.0.0.0' prep done afterEach cleanup it 'should announce the gift card', (done) -> message_response 'highfive @foo $25 for something', 'send', (e,strs) -> unless strs.match /woo/i expect(strs).to.match /.*\$25.*card.*/i do done it 'should refuse to send too much money in one day', (done) -> process.env.HUBOT_HIGHFIVE_DAILY_LIMIT = 30 message_response 'highfive @foo $20 for nothing', 'send', (e,strs) -> return unless strs.match /\$20/ message_response 'highfive @foo $15 for nothing', 'reply', (e,strs) -> if strs.indexOf('$15') == -1 expect(strs).to.match /.*sorry.*\$20.*\$30/i delete process.env.HUBOT_HIGHFIVE_DAILY_LIMIT do done # Test the command itself describe 'highfive', -> beforeEach prep afterEach cleanup it "shouldn't let you high-five yourself", (done) -> message_response 'highfive @mocha for nothing', 'reply', (e,strs) -> expect(strs).to.contain 'clapping' do done it "shouldn't let you send huge gifts", (done) -> message_response 'highfive @foo $5000 for nothing', 'reply', (e,strs) -> expect(strs).to.match /\$5000.*smaller.*150/i do done it 'should mention the right limit when refusing to order a card', (done) -> process.env.HUBOT_HIGHFIVE_AWARD_LIMIT = 20 message_response 'highfive @foo $30 for nothing', 'reply', (e, strs) -> delete process.env.HUBOT_HIGHFIVE_AWARD_LIMIT expect(strs).to.contain '$30' do done it 'should refuse to send a card if awards are disabled', (done) -> process.env.HUBOT_HIGHFIVE_AWARD_LIMIT = 0 message_response 'highfive @foo $10 for nothing', 'reply', (e,strs) -> delete process.env.HUBOT_HIGHFIVE_AWARD_LIMIT expect(strs).to.contain 'disabled' do done it 'should make some noise', (done) -> message_response 'highfive @foo for something', 'send', (e,strs) -> expect(strs).to.match /woo/i expect(strs).to.contain 'foo' expect(strs).to.contain 'mocha' expect(strs).to.match /\.gif/i do done it "should complain if it can't find a user", (done) -> message_response 'highfive @bar for nothing', 'reply', (e,strs) -> expect(strs).to.equal "Who's @bar?" do done it "should be okay with 'for' or not", (done) -> message_response 'highfive @foo something', 'send', (e,strs) -> expect(strs).to.match /woo/i expect(strs).to.contain 'foo' expect(strs).to.contain 'mocha' expect(strs).to.match /\.gif/i do done describe 'config', -> beforeEach prep afterEach cleanup it "should respond", (done) -> message_response 'highfive config', 'reply', (e,strs) -> expect(strs).to.match /localhost:8088\/highfive\/$/ do done
[ { "context": "ey for reading/writing to local storage\n key: 'weather-locations'\n\n # Refresh period for caching updates\n # ", "end": 229, "score": 0.983734130859375, "start": 212, "tag": "KEY", "value": "weather-locations" } ]
assets/config.coffee
thelucre/weather
0
### Global App Config ### module.exports = # Schema for user-defined preferences settings: units: 'imperial' # Local storage settings cache: # Key for reading/writing to local storage key: 'weather-locations' # Refresh period for caching updates # If weather data for a given unit system is younger than this time # the cache will be used period: 2*60 # 2 minutes # Key for saving the userunits preference settings: 'weather-settings' # OpenWeather API settings api: root: '//api.openweathermap.org/data/2.5/' key: OPENWEATHER_KEY # pulled in from .env file at root during webpack build # Default Unity office locations locations: [ { label: 'San Francisco', slug: 'san-francisco' } { label: 'Seattle', slug: 'seattle' } { label: 'Vancouver', slug: 'vancouver' } { label: 'Austin', slug: 'austin' } { label: 'Montreal', slug: 'montreal' } { label: 'Pereira', slug: 'pereira' } { label: 'Seoul', slug: 'seoul' } { label: 'Shanghai', slug: 'shanghai' } { label: 'Singapore', slug: 'singapore' } { label: 'Tokyo', slug: 'tokyo' } { label: 'Brighton', slug: 'brighton' } { label: 'Bristol', slug: 'bristol' } { label: 'Stratford-upon-Avon', slug: 'stratford-upon-avon' } { label: 'London', slug: 'london' } { label: 'Grenoble', slug: 'grenoble' } { label: 'Copenhagen', slug: 'copenhagen' } { label: 'Berlin', slug: 'berlin' } { label: 'Moscow', slug: 'moscow' } { label: 'Helsinki', slug: 'helsinki' } { label: 'Kaunas', slug: 'kaunas' } { label: 'Odessa', slug: 'odessa' } { label: 'Paris', slug: 'paris' } { label: 'Stockholm', slug: 'stockholm' } { label: 'Vilnius', slug: 'vilnius' } ]
140562
### Global App Config ### module.exports = # Schema for user-defined preferences settings: units: 'imperial' # Local storage settings cache: # Key for reading/writing to local storage key: '<KEY>' # Refresh period for caching updates # If weather data for a given unit system is younger than this time # the cache will be used period: 2*60 # 2 minutes # Key for saving the userunits preference settings: 'weather-settings' # OpenWeather API settings api: root: '//api.openweathermap.org/data/2.5/' key: OPENWEATHER_KEY # pulled in from .env file at root during webpack build # Default Unity office locations locations: [ { label: 'San Francisco', slug: 'san-francisco' } { label: 'Seattle', slug: 'seattle' } { label: 'Vancouver', slug: 'vancouver' } { label: 'Austin', slug: 'austin' } { label: 'Montreal', slug: 'montreal' } { label: 'Pereira', slug: 'pereira' } { label: 'Seoul', slug: 'seoul' } { label: 'Shanghai', slug: 'shanghai' } { label: 'Singapore', slug: 'singapore' } { label: 'Tokyo', slug: 'tokyo' } { label: 'Brighton', slug: 'brighton' } { label: 'Bristol', slug: 'bristol' } { label: 'Stratford-upon-Avon', slug: 'stratford-upon-avon' } { label: 'London', slug: 'london' } { label: 'Grenoble', slug: 'grenoble' } { label: 'Copenhagen', slug: 'copenhagen' } { label: 'Berlin', slug: 'berlin' } { label: 'Moscow', slug: 'moscow' } { label: 'Helsinki', slug: 'helsinki' } { label: 'Kaunas', slug: 'kaunas' } { label: 'Odessa', slug: 'odessa' } { label: 'Paris', slug: 'paris' } { label: 'Stockholm', slug: 'stockholm' } { label: 'Vilnius', slug: 'vilnius' } ]
true
### Global App Config ### module.exports = # Schema for user-defined preferences settings: units: 'imperial' # Local storage settings cache: # Key for reading/writing to local storage key: 'PI:KEY:<KEY>END_PI' # Refresh period for caching updates # If weather data for a given unit system is younger than this time # the cache will be used period: 2*60 # 2 minutes # Key for saving the userunits preference settings: 'weather-settings' # OpenWeather API settings api: root: '//api.openweathermap.org/data/2.5/' key: OPENWEATHER_KEY # pulled in from .env file at root during webpack build # Default Unity office locations locations: [ { label: 'San Francisco', slug: 'san-francisco' } { label: 'Seattle', slug: 'seattle' } { label: 'Vancouver', slug: 'vancouver' } { label: 'Austin', slug: 'austin' } { label: 'Montreal', slug: 'montreal' } { label: 'Pereira', slug: 'pereira' } { label: 'Seoul', slug: 'seoul' } { label: 'Shanghai', slug: 'shanghai' } { label: 'Singapore', slug: 'singapore' } { label: 'Tokyo', slug: 'tokyo' } { label: 'Brighton', slug: 'brighton' } { label: 'Bristol', slug: 'bristol' } { label: 'Stratford-upon-Avon', slug: 'stratford-upon-avon' } { label: 'London', slug: 'london' } { label: 'Grenoble', slug: 'grenoble' } { label: 'Copenhagen', slug: 'copenhagen' } { label: 'Berlin', slug: 'berlin' } { label: 'Moscow', slug: 'moscow' } { label: 'Helsinki', slug: 'helsinki' } { label: 'Kaunas', slug: 'kaunas' } { label: 'Odessa', slug: 'odessa' } { label: 'Paris', slug: 'paris' } { label: 'Stockholm', slug: 'stockholm' } { label: 'Vilnius', slug: 'vilnius' } ]
[ { "context": "me) \"top message\" \"bottom message\"\n#\n# Author:\n# lilybethshields\n# waynegraham\n\nUtil = require 'util'\n\nmemes =\n ", "end": 295, "score": 0.9980314373970032, "start": 280, "tag": "USERNAME", "value": "lilybethshields" }, { "context": "ottom message\"\n#\n...
src/memes.coffee
waynegraham/hubot-memes
6
# Description: # Meme generator # # Dependencies: # None # # Configuration: # None # # Commands: # hubot meme list - List of memes and their codes # hubot meme show - Show all memes and their codes # hubot meme me (meme) "top message" "bottom message" # # Author: # lilybethshields # waynegraham Util = require 'util' memes = "aag": "Ancient Aliens Guy", "ackbar":"Ackbar (It's a trap)", "afraid": "'Afraid to Ask'", "alwaysonbeat": "Always On Beat", "ants": "Do You Want Ants? (archer)", "awesome": "Socially Awesome Penguin", "awesome-awkward": "Socially Awesome Awkward Penguin", "awkward": "Socially Awkward Penguin", "awkward-awesome": "Socially Awkward Awesome Penguin", "bad": "You Should Feel Bad", "badchoice": "Milk Was a Bad Choice (anchorman)", "bd": "Butthurt Dweller", "biw": "BABY Insanity Wolf", "blb": "Bad Luck Brian", "boat": "I should buy a boat cat", "both": "Why Not Both?", "bs": "This is Bull, Shark", "buzz": "X, X Everywhere", "captain": "I'm the captain now", "cb": "Confession Bear", "cbg": "Comic Book Guy", "ch": "Captain Hindsight", "chosen": "You Were the Chosen One!", "crazypills": "I Feel Like I'm Taking Crazy Pills", "dodgson": "See? Nobody Cares", "doge": "Doge", "dsm": "Dating Site Murderer", "dwight": "Schrute Facts", "elf": "You Sit on a Throne of Lies", "ermg": "Ermahgerd", "fa": "Forever Alone", "fbf": "Foul Bachelor Frog", "fetch": "Stop Trying to Make Fetch Happen", "fmr": "F*** Me, Right?", "fry": "Futurama Fry", "fwp": "First World Problems", "ggg": "Goog Guy Greg", "hipster": "Hipster Barista", "icanhas": "I can Has Cheezburger", "inigo": "Inigo Montoya", "interesting": "The Most Interesting Man in the World", "its-happening": "It's Happening", "ive": "Jony Ive Redesigns Things", "iw": "Insanity Wolf", "jetpack": "Jetpack Guy / Nothing to Do Here", "joker": "It's Simple, Kill the Batman", "jw": "Probably Not a Good Idea", "keanu": "Conspiracy Keanu", "kermit": "But That's None of My Business", "live": "Do It Live!", "ll": "Laughing Lizard", "mmm": "Minor Mistake Marvin", "money": "Shut Up and Take My Money!", "mordor": "One Does Not Simply Walk into Mordor", "morpheus": "Matrix Morpheus", "oag": "Overly Attached Girlfriend", "officespace": "That Would be Great", "older": "An Older Code Sir, But It Checks Out", "oprah": "Oprah You Get a Car", "philosoraptor": "Philosoraptor", "red": "Oh, Is that what we're going to do today?", "regret": "I Immediately Regret This Decision (anchorman)", "remembers": "Pepperidge Farm Remembers", "sad-biden": "Sad Joe Biden", "sad-boehner": "Sad John Boehner", "sad-bush": "Sad George Bush", "sad-clinton": "Sad Bill Clinton", "sad-obama": "Sad Barack Obama", "sadfrog": "Sad Frog / Feels Bad Man", "sarcasticbear": "Sarcastic Bear", "sb": "Scumbag Brain", "sf": "Sealed Fate", "ski": "Super Cool Ski Instructor (You're gonna have a bad time)", "sohappy": "I Would Be So Happy", "sohot": "So Hot Right Now", "ss": "Scumbag Steve", "success": "Success Kid", "tenguy": "[10] Guy", "toohigh": "The Rent is Too Damn High", "tried": "At Least You Tried", "winter": "Prepare yourselves, winter is coming", "wonka": "Condescending Wonka", "xy": "X all the Y", "yallgot": "Y'All Got Anymore of", "yodawg": "Xzibit Yo Dawg", "yuno": "Y U NO?" checkCode = (meme, memes) -> return meme of memes module.exports = (robot) -> meme_choices = (meme for _, meme of memes).sort().join('|') robot.respond /meme list/i, (msg) -> memelist = '' memelist += "#{code} - #{meme}\n" for code, meme of memes msg.send memelist robot.respond /meme show/i, (msg) -> memelist = '' memelist += "http://memegen.link/#{code}/#{escape(code)}/#{escape(meme)}.jpg\n" for code, meme of memes msg.send memelist robot.respond /meme me ([\w-]+) ([\"\“\”][^\"\“\”]+[\"\“\”]) ([\"\“\”][^\"\“\”]+[\"\“\”])/i, (msg) -> meme = if checkCode(msg.match[1].toLowerCase(), memes) then msg.match[1].toLowerCase() else 'doge' top = msg.match[2].replace(/"|“|”/g, '').trim().replace(/\s+/g, '-').replace(/\’/g, '\'') bottom = msg.match[3].replace(/"|“|”/g, '').trim().replace(/\s+/g, '-').replace(/\’/g, '\'') msg.send "http://memegen.link/#{meme}/#{escape(top)}/#{escape(bottom)}.jpg"
39143
# Description: # Meme generator # # Dependencies: # None # # Configuration: # None # # Commands: # hubot meme list - List of memes and their codes # hubot meme show - Show all memes and their codes # hubot meme me (meme) "top message" "bottom message" # # Author: # lilybethshields # waynegraham Util = require 'util' memes = "aag": "Ancient Aliens Guy", "ackbar":"Ackbar (It's a trap)", "afraid": "'Afraid to Ask'", "alwaysonbeat": "Always On Beat", "ants": "Do You Want Ants? (archer)", "awesome": "Socially Awesome Penguin", "awesome-awkward": "Socially Awesome Awkward Penguin", "awkward": "Socially Awkward Penguin", "awkward-awesome": "Socially Awkward Awesome Penguin", "bad": "You Should Feel Bad", "badchoice": "Milk Was a Bad Choice (anchorman)", "bd": "<NAME>", "biw": "BABY Insanity Wolf", "blb": "Bad Luck Brian", "boat": "I should buy a boat cat", "both": "Why Not Both?", "bs": "This is Bull, Shark", "buzz": "X, X Everywhere", "captain": "I'm the captain now", "cb": "Confession Bear", "cbg": "Comic Book Guy", "ch": "Captain Hindsight", "chosen": "You Were the Chosen One!", "crazypills": "I Feel Like I'm Taking Crazy Pills", "dodgson": "See? Nobody Cares", "doge": "Doge", "dsm": "Dating Site Murderer", "dwight": "Schrute Facts", "elf": "You Sit on a Throne of Lies", "ermg": "<NAME>", "fa": "Forever Alone", "fbf": "Foul Bachelor Frog", "fetch": "Stop Trying to Make Fetch Happen", "fmr": "F*** Me, Right?", "fry": "<NAME>", "fwp": "First World Problems", "ggg": "G<NAME>", "hipster": "<NAME>", "icanhas": "I can Has Che<NAME>", "inigo": "In<NAME>", "interesting": "The Most Interesting Man in the World", "its-happening": "It's Happening", "ive": "J<NAME> Ive Redesigns Things", "iw": "Insanity Wolf", "jetpack": "Jetpack Guy / Nothing to Do Here", "joker": "It's Simple, Kill the Batman", "jw": "Probably Not a Good Idea", "keanu": "Conspir<NAME>", "kermit": "But That's None of My Business", "live": "Do It Live!", "ll": "Laughing Lizard", "mmm": "<NAME>", "money": "Shut Up and Take My Money!", "mordor": "One Does Not Simply Walk into Mordor", "morpheus": "Matrix Morpheus", "oag": "Overly Attached Girlfriend", "officespace": "That Would be Great", "older": "An Older Code Sir, But It Checks Out", "oprah": "Oprah You Get a Car", "philosoraptor": "Philosoraptor", "red": "Oh, Is that what we're going to do today?", "regret": "I Immediately Regret This Decision (anchorman)", "remembers": "Pepperidge Farm Remembers", "sad-biden": "Sad <NAME> Biden", "sad-boehner": "Sad <NAME>", "sad-bush": "Sad <NAME>ush", "sad-clinton": "<NAME>", "sad-obama": "Sad Barack Obama", "sadfrog": "Sad Frog / Feels Bad Man", "sarcasticbear": "Sarcastic Bear", "sb": "Sc<NAME>", "sf": "Sealed Fate", "ski": "Super Cool Ski Instructor (You're gonna have a bad time)", "sohappy": "I Would Be So Happy", "sohot": "So Hot Right Now", "ss": "<NAME>", "success": "Success Kid", "tenguy": "[10] Guy", "toohigh": "The Rent is Too Damn High", "tried": "At Least You Tried", "winter": "Prepare yourselves, winter is coming", "wonka": "Condescending Wonka", "xy": "X all the Y", "yallgot": "Y'All Got Anymore of", "yodawg": "Xzibit Yo Dawg", "yuno": "Y U NO?" checkCode = (meme, memes) -> return meme of memes module.exports = (robot) -> meme_choices = (meme for _, meme of memes).sort().join('|') robot.respond /meme list/i, (msg) -> memelist = '' memelist += "#{code} - #{meme}\n" for code, meme of memes msg.send memelist robot.respond /meme show/i, (msg) -> memelist = '' memelist += "http://memegen.link/#{code}/#{escape(code)}/#{escape(meme)}.jpg\n" for code, meme of memes msg.send memelist robot.respond /meme me ([\w-]+) ([\"\“\”][^\"\“\”]+[\"\“\”]) ([\"\“\”][^\"\“\”]+[\"\“\”])/i, (msg) -> meme = if checkCode(msg.match[1].toLowerCase(), memes) then msg.match[1].toLowerCase() else 'doge' top = msg.match[2].replace(/"|“|”/g, '').trim().replace(/\s+/g, '-').replace(/\’/g, '\'') bottom = msg.match[3].replace(/"|“|”/g, '').trim().replace(/\s+/g, '-').replace(/\’/g, '\'') msg.send "http://memegen.link/#{meme}/#{escape(top)}/#{escape(bottom)}.jpg"
true
# Description: # Meme generator # # Dependencies: # None # # Configuration: # None # # Commands: # hubot meme list - List of memes and their codes # hubot meme show - Show all memes and their codes # hubot meme me (meme) "top message" "bottom message" # # Author: # lilybethshields # waynegraham Util = require 'util' memes = "aag": "Ancient Aliens Guy", "ackbar":"Ackbar (It's a trap)", "afraid": "'Afraid to Ask'", "alwaysonbeat": "Always On Beat", "ants": "Do You Want Ants? (archer)", "awesome": "Socially Awesome Penguin", "awesome-awkward": "Socially Awesome Awkward Penguin", "awkward": "Socially Awkward Penguin", "awkward-awesome": "Socially Awkward Awesome Penguin", "bad": "You Should Feel Bad", "badchoice": "Milk Was a Bad Choice (anchorman)", "bd": "PI:NAME:<NAME>END_PI", "biw": "BABY Insanity Wolf", "blb": "Bad Luck Brian", "boat": "I should buy a boat cat", "both": "Why Not Both?", "bs": "This is Bull, Shark", "buzz": "X, X Everywhere", "captain": "I'm the captain now", "cb": "Confession Bear", "cbg": "Comic Book Guy", "ch": "Captain Hindsight", "chosen": "You Were the Chosen One!", "crazypills": "I Feel Like I'm Taking Crazy Pills", "dodgson": "See? Nobody Cares", "doge": "Doge", "dsm": "Dating Site Murderer", "dwight": "Schrute Facts", "elf": "You Sit on a Throne of Lies", "ermg": "PI:NAME:<NAME>END_PI", "fa": "Forever Alone", "fbf": "Foul Bachelor Frog", "fetch": "Stop Trying to Make Fetch Happen", "fmr": "F*** Me, Right?", "fry": "PI:NAME:<NAME>END_PI", "fwp": "First World Problems", "ggg": "GPI:NAME:<NAME>END_PI", "hipster": "PI:NAME:<NAME>END_PI", "icanhas": "I can Has ChePI:NAME:<NAME>END_PI", "inigo": "InPI:NAME:<NAME>END_PI", "interesting": "The Most Interesting Man in the World", "its-happening": "It's Happening", "ive": "JPI:NAME:<NAME>END_PI Ive Redesigns Things", "iw": "Insanity Wolf", "jetpack": "Jetpack Guy / Nothing to Do Here", "joker": "It's Simple, Kill the Batman", "jw": "Probably Not a Good Idea", "keanu": "ConspirPI:NAME:<NAME>END_PI", "kermit": "But That's None of My Business", "live": "Do It Live!", "ll": "Laughing Lizard", "mmm": "PI:NAME:<NAME>END_PI", "money": "Shut Up and Take My Money!", "mordor": "One Does Not Simply Walk into Mordor", "morpheus": "Matrix Morpheus", "oag": "Overly Attached Girlfriend", "officespace": "That Would be Great", "older": "An Older Code Sir, But It Checks Out", "oprah": "Oprah You Get a Car", "philosoraptor": "Philosoraptor", "red": "Oh, Is that what we're going to do today?", "regret": "I Immediately Regret This Decision (anchorman)", "remembers": "Pepperidge Farm Remembers", "sad-biden": "Sad PI:NAME:<NAME>END_PI Biden", "sad-boehner": "Sad PI:NAME:<NAME>END_PI", "sad-bush": "Sad PI:NAME:<NAME>END_PIush", "sad-clinton": "PI:NAME:<NAME>END_PI", "sad-obama": "Sad Barack Obama", "sadfrog": "Sad Frog / Feels Bad Man", "sarcasticbear": "Sarcastic Bear", "sb": "ScPI:NAME:<NAME>END_PI", "sf": "Sealed Fate", "ski": "Super Cool Ski Instructor (You're gonna have a bad time)", "sohappy": "I Would Be So Happy", "sohot": "So Hot Right Now", "ss": "PI:NAME:<NAME>END_PI", "success": "Success Kid", "tenguy": "[10] Guy", "toohigh": "The Rent is Too Damn High", "tried": "At Least You Tried", "winter": "Prepare yourselves, winter is coming", "wonka": "Condescending Wonka", "xy": "X all the Y", "yallgot": "Y'All Got Anymore of", "yodawg": "Xzibit Yo Dawg", "yuno": "Y U NO?" checkCode = (meme, memes) -> return meme of memes module.exports = (robot) -> meme_choices = (meme for _, meme of memes).sort().join('|') robot.respond /meme list/i, (msg) -> memelist = '' memelist += "#{code} - #{meme}\n" for code, meme of memes msg.send memelist robot.respond /meme show/i, (msg) -> memelist = '' memelist += "http://memegen.link/#{code}/#{escape(code)}/#{escape(meme)}.jpg\n" for code, meme of memes msg.send memelist robot.respond /meme me ([\w-]+) ([\"\“\”][^\"\“\”]+[\"\“\”]) ([\"\“\”][^\"\“\”]+[\"\“\”])/i, (msg) -> meme = if checkCode(msg.match[1].toLowerCase(), memes) then msg.match[1].toLowerCase() else 'doge' top = msg.match[2].replace(/"|“|”/g, '').trim().replace(/\s+/g, '-').replace(/\’/g, '\'') bottom = msg.match[3].replace(/"|“|”/g, '').trim().replace(/\s+/g, '-').replace(/\’/g, '\'') msg.send "http://memegen.link/#{meme}/#{escape(top)}/#{escape(bottom)}.jpg"
[ { "context": "n object\n\t###\n\tget: (playerId) ->\n\t\ttokenKey = keyPrefix() + playerId\n\t\t@redis.hgetallAsync(tokenKey) # re", "end": 3326, "score": 0.8051453232765198, "start": 3320, "tag": "KEY", "value": "Prefix" }, { "context": "} token id\n\t###\n\tgetId: (playerId) ->\n\t...
server/redis/r-tokenmanager.coffee
willroberts/duelyst
5
_ = require 'underscore' Promise = require 'bluebird' moment = require 'moment' crypto = require 'crypto' uuid = require 'node-uuid' warlock = require '@counterplay/warlock' Logger = require '../../app/common/logger.coffee' config = require '../../config/config.js' GameType = require '../../app/sdk/gameType.coffee' env = config.get("env") # Returns the Redis key prefix used keyPrefix = () -> return "#{env}:matchmaking:tokens" ###* # Generate a 'matchmaking' token id # id is returned the client for listening to errors on (via Firebase) # @return {String} url safe token id ### createTokenId = () -> id = new Buffer(uuid.v4()).toString('base64') id.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, "") return id ###* # Class 'RedisTokenManager' # Manages player 'matchmaking' tokens in Redis # Each player has only a single token in existance at any given time # Tokens are stored as hashes (objects) in Redis ### class RedisTokenManager ###* # Constructor # @param {Object} redis, a promisified redis connection ### constructor: (redis) -> # TODO: add check to ensure Redis client is already promisified @redis = redis @locker = Promise.promisifyAll(warlock(redis)) return ###* # Generate a 'matchmaking' token object which will be stored in redis # We can set some defaults here or add extra stuff # @param {Object} options # @return {Object} matchmaking token object ### create: (opts = {}) -> token = {} token.id = createTokenId() token.createdAt = Date.now() token.userId = opts.userId token.name = opts.name token.rank = opts.rank token.deck = opts.deck token.factionId = opts.factionId token.gameType = opts.gameType or GameType.Ranked token.inviteId = opts.inviteId or null token.cardBackId = opts.cardBackId or null token.deckValue = opts.deckValue or 0 token.lastOpponentId = opts.lastOpponentId or null token.ticketId = opts.ticketId or null if opts.battleMapIndexes token.battleMapIndexes = opts.battleMapIndexes token.riftRating = opts.riftRating or null return token ###* # Save the token to Redis # We can set some defaults here or add extra stuff # @param {Object} token # @return {Promise} Redis 'OK' ### add: (token) -> playerId = token.userId tokenKey = keyPrefix() + playerId if token.deck? then token.deck = JSON.stringify(token.deck) if token.battleMapIndexes? then token.battleMapIndexes = JSON.stringify(token.battleMapIndexes) return @redis.hmsetAsync(tokenKey, token) ###* # Remove the token or tokens from Redis in single op # @param {String|Array} playerId or array of playerIds # @return {Promise} number of elements removed ### remove: (playerIds) -> args = [] if _.isArray(playerIds) _.each playerIds, (playerId) -> tokenKey = keyPrefix() + playerId args.push(tokenKey) else tokenKey = keyPrefix() + playerIds args.push(tokenKey) return @redis.delAsync(args) ###* # Does the player have a token # ie. they are waiting for a game (queue or friendly) # @param {String} playerId # @return {Promise} true or false ### exists: (playerId) -> tokenKey = keyPrefix() + playerId return @redis.existsAsync(tokenKey) ###* # Get the token object from Redis # @param {String} playerId # @return {Promise} token object ### get: (playerId) -> tokenKey = keyPrefix() + playerId @redis.hgetallAsync(tokenKey) # return entire token object .then (token) -> # TODO: There might be other data that we want to convert to correct format here if token? if token.deck? token.deck = JSON.parse(token.deck) if token.battleMapIndexes? token.battleMapIndexes = JSON.parse(token.battleMapIndexes) return token else return null ###* # Get the token's id from Redis # @param {String} playerId # @return {Promise} token id ### getId: (playerId) -> tokenKey = keyPrefix() + playerId return @redis.hgetAsync(tokenKey,"id") # return token id only ###* # Get the token's parameter (deck, rank, etc) from Redis # @param {String} playerId # @param {String} the parameter we want to retrieve # @return {Promise} token id ### getParameter: (playerId, param) -> tokenKey = keyPrefix() + playerId return @redis.hgetAsync(tokenKey,param) # return specified token param only ###* # Lock the player's token to signal it is in use # @param {String} playerId # @param {Integer} ttl (in seconds) on the lock # @return {Promise} unlock function if lock acquired ### lock: (playerId, ttl = 5000) -> return @locker.lockAsync(playerId, ttl) ###* # Check if a player's token is locked # @param {String} playerId # @return {Promise} bool if lock is set ### isLocked: (playerId) -> return @locker.isLockedAsync(playerId) ###* # Export a factory ### module.exports = exports = (redis, opts) -> TokenManager = new RedisTokenManager(redis, opts) return TokenManager
101409
_ = require 'underscore' Promise = require 'bluebird' moment = require 'moment' crypto = require 'crypto' uuid = require 'node-uuid' warlock = require '@counterplay/warlock' Logger = require '../../app/common/logger.coffee' config = require '../../config/config.js' GameType = require '../../app/sdk/gameType.coffee' env = config.get("env") # Returns the Redis key prefix used keyPrefix = () -> return "#{env}:matchmaking:tokens" ###* # Generate a 'matchmaking' token id # id is returned the client for listening to errors on (via Firebase) # @return {String} url safe token id ### createTokenId = () -> id = new Buffer(uuid.v4()).toString('base64') id.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, "") return id ###* # Class 'RedisTokenManager' # Manages player 'matchmaking' tokens in Redis # Each player has only a single token in existance at any given time # Tokens are stored as hashes (objects) in Redis ### class RedisTokenManager ###* # Constructor # @param {Object} redis, a promisified redis connection ### constructor: (redis) -> # TODO: add check to ensure Redis client is already promisified @redis = redis @locker = Promise.promisifyAll(warlock(redis)) return ###* # Generate a 'matchmaking' token object which will be stored in redis # We can set some defaults here or add extra stuff # @param {Object} options # @return {Object} matchmaking token object ### create: (opts = {}) -> token = {} token.id = createTokenId() token.createdAt = Date.now() token.userId = opts.userId token.name = opts.name token.rank = opts.rank token.deck = opts.deck token.factionId = opts.factionId token.gameType = opts.gameType or GameType.Ranked token.inviteId = opts.inviteId or null token.cardBackId = opts.cardBackId or null token.deckValue = opts.deckValue or 0 token.lastOpponentId = opts.lastOpponentId or null token.ticketId = opts.ticketId or null if opts.battleMapIndexes token.battleMapIndexes = opts.battleMapIndexes token.riftRating = opts.riftRating or null return token ###* # Save the token to Redis # We can set some defaults here or add extra stuff # @param {Object} token # @return {Promise} Redis 'OK' ### add: (token) -> playerId = token.userId tokenKey = keyPrefix() + playerId if token.deck? then token.deck = JSON.stringify(token.deck) if token.battleMapIndexes? then token.battleMapIndexes = JSON.stringify(token.battleMapIndexes) return @redis.hmsetAsync(tokenKey, token) ###* # Remove the token or tokens from Redis in single op # @param {String|Array} playerId or array of playerIds # @return {Promise} number of elements removed ### remove: (playerIds) -> args = [] if _.isArray(playerIds) _.each playerIds, (playerId) -> tokenKey = keyPrefix() + playerId args.push(tokenKey) else tokenKey = keyPrefix() + playerIds args.push(tokenKey) return @redis.delAsync(args) ###* # Does the player have a token # ie. they are waiting for a game (queue or friendly) # @param {String} playerId # @return {Promise} true or false ### exists: (playerId) -> tokenKey = keyPrefix() + playerId return @redis.existsAsync(tokenKey) ###* # Get the token object from Redis # @param {String} playerId # @return {Promise} token object ### get: (playerId) -> tokenKey = key<KEY>() + playerId @redis.hgetallAsync(tokenKey) # return entire token object .then (token) -> # TODO: There might be other data that we want to convert to correct format here if token? if token.deck? token.deck = JSON.parse(token.deck) if token.battleMapIndexes? token.battleMapIndexes = JSON.parse(token.battleMapIndexes) return token else return null ###* # Get the token's id from Redis # @param {String} playerId # @return {Promise} token id ### getId: (playerId) -> tokenKey = <KEY>() + playerId return @redis.hgetAsync(tokenKey,"id") # return token id only ###* # Get the token's parameter (deck, rank, etc) from Redis # @param {String} playerId # @param {String} the parameter we want to retrieve # @return {Promise} token id ### getParameter: (playerId, param) -> tokenKey = key<KEY>() + playerId return @redis.hgetAsync(tokenKey,param) # return specified token param only ###* # Lock the player's token to signal it is in use # @param {String} playerId # @param {Integer} ttl (in seconds) on the lock # @return {Promise} unlock function if lock acquired ### lock: (playerId, ttl = 5000) -> return @locker.lockAsync(playerId, ttl) ###* # Check if a player's token is locked # @param {String} playerId # @return {Promise} bool if lock is set ### isLocked: (playerId) -> return @locker.isLockedAsync(playerId) ###* # Export a factory ### module.exports = exports = (redis, opts) -> TokenManager = new RedisTokenManager(redis, opts) return TokenManager
true
_ = require 'underscore' Promise = require 'bluebird' moment = require 'moment' crypto = require 'crypto' uuid = require 'node-uuid' warlock = require '@counterplay/warlock' Logger = require '../../app/common/logger.coffee' config = require '../../config/config.js' GameType = require '../../app/sdk/gameType.coffee' env = config.get("env") # Returns the Redis key prefix used keyPrefix = () -> return "#{env}:matchmaking:tokens" ###* # Generate a 'matchmaking' token id # id is returned the client for listening to errors on (via Firebase) # @return {String} url safe token id ### createTokenId = () -> id = new Buffer(uuid.v4()).toString('base64') id.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, "") return id ###* # Class 'RedisTokenManager' # Manages player 'matchmaking' tokens in Redis # Each player has only a single token in existance at any given time # Tokens are stored as hashes (objects) in Redis ### class RedisTokenManager ###* # Constructor # @param {Object} redis, a promisified redis connection ### constructor: (redis) -> # TODO: add check to ensure Redis client is already promisified @redis = redis @locker = Promise.promisifyAll(warlock(redis)) return ###* # Generate a 'matchmaking' token object which will be stored in redis # We can set some defaults here or add extra stuff # @param {Object} options # @return {Object} matchmaking token object ### create: (opts = {}) -> token = {} token.id = createTokenId() token.createdAt = Date.now() token.userId = opts.userId token.name = opts.name token.rank = opts.rank token.deck = opts.deck token.factionId = opts.factionId token.gameType = opts.gameType or GameType.Ranked token.inviteId = opts.inviteId or null token.cardBackId = opts.cardBackId or null token.deckValue = opts.deckValue or 0 token.lastOpponentId = opts.lastOpponentId or null token.ticketId = opts.ticketId or null if opts.battleMapIndexes token.battleMapIndexes = opts.battleMapIndexes token.riftRating = opts.riftRating or null return token ###* # Save the token to Redis # We can set some defaults here or add extra stuff # @param {Object} token # @return {Promise} Redis 'OK' ### add: (token) -> playerId = token.userId tokenKey = keyPrefix() + playerId if token.deck? then token.deck = JSON.stringify(token.deck) if token.battleMapIndexes? then token.battleMapIndexes = JSON.stringify(token.battleMapIndexes) return @redis.hmsetAsync(tokenKey, token) ###* # Remove the token or tokens from Redis in single op # @param {String|Array} playerId or array of playerIds # @return {Promise} number of elements removed ### remove: (playerIds) -> args = [] if _.isArray(playerIds) _.each playerIds, (playerId) -> tokenKey = keyPrefix() + playerId args.push(tokenKey) else tokenKey = keyPrefix() + playerIds args.push(tokenKey) return @redis.delAsync(args) ###* # Does the player have a token # ie. they are waiting for a game (queue or friendly) # @param {String} playerId # @return {Promise} true or false ### exists: (playerId) -> tokenKey = keyPrefix() + playerId return @redis.existsAsync(tokenKey) ###* # Get the token object from Redis # @param {String} playerId # @return {Promise} token object ### get: (playerId) -> tokenKey = keyPI:KEY:<KEY>END_PI() + playerId @redis.hgetallAsync(tokenKey) # return entire token object .then (token) -> # TODO: There might be other data that we want to convert to correct format here if token? if token.deck? token.deck = JSON.parse(token.deck) if token.battleMapIndexes? token.battleMapIndexes = JSON.parse(token.battleMapIndexes) return token else return null ###* # Get the token's id from Redis # @param {String} playerId # @return {Promise} token id ### getId: (playerId) -> tokenKey = PI:KEY:<KEY>END_PI() + playerId return @redis.hgetAsync(tokenKey,"id") # return token id only ###* # Get the token's parameter (deck, rank, etc) from Redis # @param {String} playerId # @param {String} the parameter we want to retrieve # @return {Promise} token id ### getParameter: (playerId, param) -> tokenKey = keyPI:KEY:<KEY>END_PI() + playerId return @redis.hgetAsync(tokenKey,param) # return specified token param only ###* # Lock the player's token to signal it is in use # @param {String} playerId # @param {Integer} ttl (in seconds) on the lock # @return {Promise} unlock function if lock acquired ### lock: (playerId, ttl = 5000) -> return @locker.lockAsync(playerId, ttl) ###* # Check if a player's token is locked # @param {String} playerId # @return {Promise} bool if lock is set ### isLocked: (playerId) -> return @locker.isLockedAsync(playerId) ###* # Export a factory ### module.exports = exports = (redis, opts) -> TokenManager = new RedisTokenManager(redis, opts) return TokenManager
[ { "context": " .visit(\"http://localhost:3434/jquery.html?email=brian@cypress.io\")\n\n context \"issue #272: responses which are nev", "end": 2992, "score": 0.9999134540557861, "start": 2976, "tag": "EMAIL", "value": "brian@cypress.io" } ]
packages/server/test/support/fixtures/projects/e2e/cypress/integration/visit_spec.coffee
Everworks/cypress
3
describe "visits", -> it "scrolls automatically to div with id=foo", -> cy .visit("/hash.html#foo") .window().its("scrollY").should("eq", 1000) it "can load an http page with a huge amount of elements without timing out", -> cy.visit("http://localhost:3434/elements.html", {timeout: 5000}) it "can load a local file with a huge amount of elements without timing out", -> cy.visit("/elements.html", {timeout: 5000}) context "issue #225: hash urls", -> rand = Math.random() it "can visit a hash url and loads", -> cy .visit("/hash.html#foo", {timeout: 5000}) .window().then (win) -> win[rand] = true it "can visit the same hash url and loads", -> cy .visit("/hash.html#foo", {timeout: 5000}) .window().then (win) -> expect(win[rand]).to.be.undefined it "can visit a different hash url and loads", -> count = 0 urls = [] {origin} = Cypress.Location.create(window.location.href) cy.on "window:load", -> urls.push cy.getRemoteLocation("href") count += 1 cy ## about:blank yes (1) .visit("/hash.html?foo#bar") ## yes (2) .visit("/hash.html?foo#foo") ## no (2) .window().its("scrollY").should("eq", 1000) .visit("/hash.html?bar#bar") ## yes (3) .window().its("scrollY").should("eq", 0) .visit("/index.html?bar#bar") ## yes (4) .visit("/index.html?baz#bar") ## yes (5) .visit("/index.html#bar") ## yes (6) .visit("/index.html") ## yes (7) .visit("/index.html#baz") ## no (7) .visit("/index.html#") ## no (7) .then -> expect(count).to.eq(7) expect(urls).to.deep.eq([ "about:blank" origin + "/hash.html?foo#bar" origin + "/hash.html?bar#bar" origin + "/index.html?bar#bar" origin + "/index.html?baz#bar" origin + "/index.html#bar" origin + "/index.html" ]) context "issue #230: User Agent headers", -> beforeEach -> cy.visit("http://localhost:3434/agent.html") it "submits user agent on cy.visit", -> cy.get("#agent").invoke("text").then (text) -> ua = JSON.parse(text) expect(navigator.userAgent).to.deep.eq(ua.source) it "submits user agent on page load", -> cy .get("a").click() .get("#agent").invoke("text").then (text) -> ua = JSON.parse(text) expect(navigator.userAgent).to.deep.eq(ua.source) it "submits user agent on cy.request", -> cy .request("http://localhost:3434/agent.json") .its("body") .then (body) -> expect(navigator.userAgent).to.deep.eq(body.agent.source) context "issue #255: url with like two domain", -> it "passes", -> cy .visit("http://localhost:3434/index.html") .visit("http://localhost:3434/jquery.html?email=brian@cypress.io") context "issue #272: responses which are never ended still send valid html", -> it "handles no response errors on the initial visit", -> cy .visit("http://localhost:3434/response_never_finishes") .contains("Cypress errored attempting to make an http request to this url") it "handles no response errors when not initially visiting", -> cy .visit("http://localhost:3434/index.html") .visit("http://localhost:3434/response_never_finishes") .contains("Cypress errored attempting to make an http request to this url") context "issue #309: request accept header not set", -> it "sets accept header to text/html,*/*", -> cy .visit("http://localhost:3434/headers.html") .get("#headers").invoke("text").then (text) -> headers = JSON.parse(text) expect(headers.accept).to.eq("text/html,*/*") expect(headers.host).to.eq("localhost:3434")
17040
describe "visits", -> it "scrolls automatically to div with id=foo", -> cy .visit("/hash.html#foo") .window().its("scrollY").should("eq", 1000) it "can load an http page with a huge amount of elements without timing out", -> cy.visit("http://localhost:3434/elements.html", {timeout: 5000}) it "can load a local file with a huge amount of elements without timing out", -> cy.visit("/elements.html", {timeout: 5000}) context "issue #225: hash urls", -> rand = Math.random() it "can visit a hash url and loads", -> cy .visit("/hash.html#foo", {timeout: 5000}) .window().then (win) -> win[rand] = true it "can visit the same hash url and loads", -> cy .visit("/hash.html#foo", {timeout: 5000}) .window().then (win) -> expect(win[rand]).to.be.undefined it "can visit a different hash url and loads", -> count = 0 urls = [] {origin} = Cypress.Location.create(window.location.href) cy.on "window:load", -> urls.push cy.getRemoteLocation("href") count += 1 cy ## about:blank yes (1) .visit("/hash.html?foo#bar") ## yes (2) .visit("/hash.html?foo#foo") ## no (2) .window().its("scrollY").should("eq", 1000) .visit("/hash.html?bar#bar") ## yes (3) .window().its("scrollY").should("eq", 0) .visit("/index.html?bar#bar") ## yes (4) .visit("/index.html?baz#bar") ## yes (5) .visit("/index.html#bar") ## yes (6) .visit("/index.html") ## yes (7) .visit("/index.html#baz") ## no (7) .visit("/index.html#") ## no (7) .then -> expect(count).to.eq(7) expect(urls).to.deep.eq([ "about:blank" origin + "/hash.html?foo#bar" origin + "/hash.html?bar#bar" origin + "/index.html?bar#bar" origin + "/index.html?baz#bar" origin + "/index.html#bar" origin + "/index.html" ]) context "issue #230: User Agent headers", -> beforeEach -> cy.visit("http://localhost:3434/agent.html") it "submits user agent on cy.visit", -> cy.get("#agent").invoke("text").then (text) -> ua = JSON.parse(text) expect(navigator.userAgent).to.deep.eq(ua.source) it "submits user agent on page load", -> cy .get("a").click() .get("#agent").invoke("text").then (text) -> ua = JSON.parse(text) expect(navigator.userAgent).to.deep.eq(ua.source) it "submits user agent on cy.request", -> cy .request("http://localhost:3434/agent.json") .its("body") .then (body) -> expect(navigator.userAgent).to.deep.eq(body.agent.source) context "issue #255: url with like two domain", -> it "passes", -> cy .visit("http://localhost:3434/index.html") .visit("http://localhost:3434/jquery.html?email=<EMAIL>") context "issue #272: responses which are never ended still send valid html", -> it "handles no response errors on the initial visit", -> cy .visit("http://localhost:3434/response_never_finishes") .contains("Cypress errored attempting to make an http request to this url") it "handles no response errors when not initially visiting", -> cy .visit("http://localhost:3434/index.html") .visit("http://localhost:3434/response_never_finishes") .contains("Cypress errored attempting to make an http request to this url") context "issue #309: request accept header not set", -> it "sets accept header to text/html,*/*", -> cy .visit("http://localhost:3434/headers.html") .get("#headers").invoke("text").then (text) -> headers = JSON.parse(text) expect(headers.accept).to.eq("text/html,*/*") expect(headers.host).to.eq("localhost:3434")
true
describe "visits", -> it "scrolls automatically to div with id=foo", -> cy .visit("/hash.html#foo") .window().its("scrollY").should("eq", 1000) it "can load an http page with a huge amount of elements without timing out", -> cy.visit("http://localhost:3434/elements.html", {timeout: 5000}) it "can load a local file with a huge amount of elements without timing out", -> cy.visit("/elements.html", {timeout: 5000}) context "issue #225: hash urls", -> rand = Math.random() it "can visit a hash url and loads", -> cy .visit("/hash.html#foo", {timeout: 5000}) .window().then (win) -> win[rand] = true it "can visit the same hash url and loads", -> cy .visit("/hash.html#foo", {timeout: 5000}) .window().then (win) -> expect(win[rand]).to.be.undefined it "can visit a different hash url and loads", -> count = 0 urls = [] {origin} = Cypress.Location.create(window.location.href) cy.on "window:load", -> urls.push cy.getRemoteLocation("href") count += 1 cy ## about:blank yes (1) .visit("/hash.html?foo#bar") ## yes (2) .visit("/hash.html?foo#foo") ## no (2) .window().its("scrollY").should("eq", 1000) .visit("/hash.html?bar#bar") ## yes (3) .window().its("scrollY").should("eq", 0) .visit("/index.html?bar#bar") ## yes (4) .visit("/index.html?baz#bar") ## yes (5) .visit("/index.html#bar") ## yes (6) .visit("/index.html") ## yes (7) .visit("/index.html#baz") ## no (7) .visit("/index.html#") ## no (7) .then -> expect(count).to.eq(7) expect(urls).to.deep.eq([ "about:blank" origin + "/hash.html?foo#bar" origin + "/hash.html?bar#bar" origin + "/index.html?bar#bar" origin + "/index.html?baz#bar" origin + "/index.html#bar" origin + "/index.html" ]) context "issue #230: User Agent headers", -> beforeEach -> cy.visit("http://localhost:3434/agent.html") it "submits user agent on cy.visit", -> cy.get("#agent").invoke("text").then (text) -> ua = JSON.parse(text) expect(navigator.userAgent).to.deep.eq(ua.source) it "submits user agent on page load", -> cy .get("a").click() .get("#agent").invoke("text").then (text) -> ua = JSON.parse(text) expect(navigator.userAgent).to.deep.eq(ua.source) it "submits user agent on cy.request", -> cy .request("http://localhost:3434/agent.json") .its("body") .then (body) -> expect(navigator.userAgent).to.deep.eq(body.agent.source) context "issue #255: url with like two domain", -> it "passes", -> cy .visit("http://localhost:3434/index.html") .visit("http://localhost:3434/jquery.html?email=PI:EMAIL:<EMAIL>END_PI") context "issue #272: responses which are never ended still send valid html", -> it "handles no response errors on the initial visit", -> cy .visit("http://localhost:3434/response_never_finishes") .contains("Cypress errored attempting to make an http request to this url") it "handles no response errors when not initially visiting", -> cy .visit("http://localhost:3434/index.html") .visit("http://localhost:3434/response_never_finishes") .contains("Cypress errored attempting to make an http request to this url") context "issue #309: request accept header not set", -> it "sets accept header to text/html,*/*", -> cy .visit("http://localhost:3434/headers.html") .get("#headers").invoke("text").then (text) -> headers = JSON.parse(text) expect(headers.accept).to.eq("text/html,*/*") expect(headers.host).to.eq("localhost:3434")
[ { "context": " assert.isNotNull ent\n eql 'Bo André Tenström', ent.display_name\n\n describe 'initFromSelfEnt", "end": 437, "score": 0.9998834729194641, "start": 420, "tag": "NAME", "value": "Bo André Tenström" }, { "context": " assert.isNotNull e\n...
test/test-entity-init.coffee
cwonrails/yakyak
4,508
init = require './init.json' entity = require '../src/ui/models/entity' describe 'entity', -> beforeEach -> entity._reset() describe 'initFromEntities', -> it 'populates lookup', -> added = entity._initFromEntities init.entities eql 2, added eql 2, entity.count() ent = entity['12230235892'] assert.isNotNull ent eql 'Bo André Tenström', ent.display_name describe 'initFromSelfEntity', -> it 'adds entity to lookup', -> e = entity._initFromSelfEntity init.self_entity assert.isNotNull e assert 'Martin Algesten', e.display_name assert.strictEqual e, entity['10964681753'] it 'adds entity as .self', -> e = entity._initFromSelfEntity init.self_entity assert.isNotNull e assert 'Martin Algesten', e.display_name assert.strictEqual e, entity.self it 'ensures isSelf works', -> entity._initFromSelfEntity init.self_entity eql true, entity.isSelf '10964681753' it 'keeps the self entity even if merged', -> entity._initFromSelfEntity init.self_entity entity.add { id: {gaia_id:'10964681753', chat_id:'10964681753'} testing: 'panda' } e = entity['10964681753'] assert.isNotNull e eql 'Martin Algesten', e.display_name eql 'panda', e.testing assert.isTrue entity.isSelf '10964681753'
122245
init = require './init.json' entity = require '../src/ui/models/entity' describe 'entity', -> beforeEach -> entity._reset() describe 'initFromEntities', -> it 'populates lookup', -> added = entity._initFromEntities init.entities eql 2, added eql 2, entity.count() ent = entity['12230235892'] assert.isNotNull ent eql '<NAME>', ent.display_name describe 'initFromSelfEntity', -> it 'adds entity to lookup', -> e = entity._initFromSelfEntity init.self_entity assert.isNotNull e assert '<NAME>', e.display_name assert.strictEqual e, entity['10964681753'] it 'adds entity as .self', -> e = entity._initFromSelfEntity init.self_entity assert.isNotNull e assert '<NAME>', e.display_name assert.strictEqual e, entity.self it 'ensures isSelf works', -> entity._initFromSelfEntity init.self_entity eql true, entity.isSelf '10964681753' it 'keeps the self entity even if merged', -> entity._initFromSelfEntity init.self_entity entity.add { id: {gaia_id:'10964681753', chat_id:'10964681753'} testing: 'panda' } e = entity['10964681753'] assert.isNotNull e eql '<NAME>', e.display_name eql 'panda', e.testing assert.isTrue entity.isSelf '10964681753'
true
init = require './init.json' entity = require '../src/ui/models/entity' describe 'entity', -> beforeEach -> entity._reset() describe 'initFromEntities', -> it 'populates lookup', -> added = entity._initFromEntities init.entities eql 2, added eql 2, entity.count() ent = entity['12230235892'] assert.isNotNull ent eql 'PI:NAME:<NAME>END_PI', ent.display_name describe 'initFromSelfEntity', -> it 'adds entity to lookup', -> e = entity._initFromSelfEntity init.self_entity assert.isNotNull e assert 'PI:NAME:<NAME>END_PI', e.display_name assert.strictEqual e, entity['10964681753'] it 'adds entity as .self', -> e = entity._initFromSelfEntity init.self_entity assert.isNotNull e assert 'PI:NAME:<NAME>END_PI', e.display_name assert.strictEqual e, entity.self it 'ensures isSelf works', -> entity._initFromSelfEntity init.self_entity eql true, entity.isSelf '10964681753' it 'keeps the self entity even if merged', -> entity._initFromSelfEntity init.self_entity entity.add { id: {gaia_id:'10964681753', chat_id:'10964681753'} testing: 'panda' } e = entity['10964681753'] assert.isNotNull e eql 'PI:NAME:<NAME>END_PI', e.display_name eql 'panda', e.testing assert.isTrue entity.isSelf '10964681753'
[ { "context": "##\n backbone-mongo.js 0.6.10\n Copyright (c) 2013 Vidigami - https://github.com/vidigami/backbone-mongo\n Li", "end": 60, "score": 0.9993670582771301, "start": 52, "tag": "NAME", "value": "Vidigami" }, { "context": " Copyright (c) 2013 Vidigami - https://github.com/...
src/lib/connection_queries.coffee
vidigami/backbone-mongo
1
### backbone-mongo.js 0.6.10 Copyright (c) 2013 Vidigami - https://github.com/vidigami/backbone-mongo License: MIT (http://www.opensource.org/licenses/mit-license.php) ### module.exports = [ 'slaveOk', 'slave_ok' 'maxPoolSize', 'poolSize' 'autoReconnect', 'auto_reconnect' 'ssl' 'replicaSet', 'rs_name' 'reconnectWait' 'retries' 'readSecondary', 'read_secondary' 'fsync' 'journal' 'safe' 'nativeParser', 'native_parser' 'connectTimeoutMS', 'socketTimeoutMS' 'w' 'authSource' 'wtimeoutMS' 'readPreference' 'readPreferenceTags' # unsupported # 'minPoolSize', 'maxIdleTimeMS', 'waitQueueMultiple', 'waitQueueTimeoutMS', 'uuidRepresentation' ]
143511
### backbone-mongo.js 0.6.10 Copyright (c) 2013 <NAME> - https://github.com/vidigami/backbone-mongo License: MIT (http://www.opensource.org/licenses/mit-license.php) ### module.exports = [ 'slaveOk', 'slave_ok' 'maxPoolSize', 'poolSize' 'autoReconnect', 'auto_reconnect' 'ssl' 'replicaSet', 'rs_name' 'reconnectWait' 'retries' 'readSecondary', 'read_secondary' 'fsync' 'journal' 'safe' 'nativeParser', 'native_parser' 'connectTimeoutMS', 'socketTimeoutMS' 'w' 'authSource' 'wtimeoutMS' 'readPreference' 'readPreferenceTags' # unsupported # 'minPoolSize', 'maxIdleTimeMS', 'waitQueueMultiple', 'waitQueueTimeoutMS', 'uuidRepresentation' ]
true
### backbone-mongo.js 0.6.10 Copyright (c) 2013 PI:NAME:<NAME>END_PI - https://github.com/vidigami/backbone-mongo License: MIT (http://www.opensource.org/licenses/mit-license.php) ### module.exports = [ 'slaveOk', 'slave_ok' 'maxPoolSize', 'poolSize' 'autoReconnect', 'auto_reconnect' 'ssl' 'replicaSet', 'rs_name' 'reconnectWait' 'retries' 'readSecondary', 'read_secondary' 'fsync' 'journal' 'safe' 'nativeParser', 'native_parser' 'connectTimeoutMS', 'socketTimeoutMS' 'w' 'authSource' 'wtimeoutMS' 'readPreference' 'readPreferenceTags' # unsupported # 'minPoolSize', 'maxIdleTimeMS', 'waitQueueMultiple', 'waitQueueTimeoutMS', 'uuidRepresentation' ]
[ { "context": " subject.search(type: 'Patient', query: {name: 'maud'}).then((-> done()))\n null\n\n it \"CRUD\", (", "end": 903, "score": 0.9570697546005249, "start": 899, "tag": "NAME", "value": "maud" } ]
src/spec.coffee
william-vw/fhir.js
349
tu = require('../src/testUtils') assert = require('assert') Chance = require('chance') exports.baseUrl = 'http://hapi.fhir.org/baseDstu3' exports.spec_for = (title, impl, baseUrl)-> chance = new Chance() genPatient = ()-> resourceType: "Patient" text:{ status: "generated", div: "<div>Generated</div>"} identifier: [ use: "usual" label: "MRN" system: "urn:oid:1.2.36.146.595.217.0.1" value: chance.ssn() period: { start: "2001-05-06"} assigner: { display: "Acme Healthcare"} ] name: [ {use: "official", family: chance.last(), given: [chance.first(), chance.first()]} ] describe title, -> @timeout(10000) q = {defer: impl.defer} buildStep = tu.stepBuilder(q) checkStep = tu.checkStep(q) subject = impl(baseUrl: baseUrl) it "search", (done) -> subject.search(type: 'Patient', query: {name: 'maud'}).then((-> done())) null it "CRUD", (done) -> console.log("#{title} SPEC") fail = (err)-> done(new Error(JSON.stringify(err))) preparePt = buildStep 'pt', (next, st)-> next(genPatient()) createPt = buildStep 'createPt', (next, st)-> success = (resp)-> id = resp.data.id.split("/_history/")[0] st.pid = id next(resp) subject.create(resource: st.pt).then(success,fail) checkCreatePt = checkStep 'createPt', (st, resp)-> cpt = resp.data assert.notEqual(cpt.id, null) assert.deepEqual(cpt.name[0].family, st.pt.name[0].family) readPt = buildStep 'readPt', (next, st)-> subject.read(type: 'Patient', id: st.pid).then(next,fail) checkReadPt = checkStep 'readPt', (st, resp)-> readPt = resp.data assert.deepEqual(readPt.name[0].family[0], st.pt.name[0].family[0]) updatePt = buildStep 'updatePt', (next, st)-> pt = st.createPt.data pt.name[0].family[0] = chance.last() subject.update(resource: pt).then(next, fail) checkUpdatePt = checkStep 'updatePt', (st, resp)-> updatePt = resp.data createPt = st.createPt.data assert.deepEqual(updatePt.name[0].family[0], createPt.name[0].family[0]) deletePt = buildStep 'deletePt', (next, st)-> createPt = st.createPt.data subject.delete(resource: {resourceType: 'Patient', id: createPt.id}).then(next, fail); preparePt({}) .then createPt .then checkCreatePt .then readPt .then checkReadPt .then updatePt .then checkUpdatePt .then deletePt .then (-> done()) null
165683
tu = require('../src/testUtils') assert = require('assert') Chance = require('chance') exports.baseUrl = 'http://hapi.fhir.org/baseDstu3' exports.spec_for = (title, impl, baseUrl)-> chance = new Chance() genPatient = ()-> resourceType: "Patient" text:{ status: "generated", div: "<div>Generated</div>"} identifier: [ use: "usual" label: "MRN" system: "urn:oid:1.2.36.146.595.217.0.1" value: chance.ssn() period: { start: "2001-05-06"} assigner: { display: "Acme Healthcare"} ] name: [ {use: "official", family: chance.last(), given: [chance.first(), chance.first()]} ] describe title, -> @timeout(10000) q = {defer: impl.defer} buildStep = tu.stepBuilder(q) checkStep = tu.checkStep(q) subject = impl(baseUrl: baseUrl) it "search", (done) -> subject.search(type: 'Patient', query: {name: '<NAME>'}).then((-> done())) null it "CRUD", (done) -> console.log("#{title} SPEC") fail = (err)-> done(new Error(JSON.stringify(err))) preparePt = buildStep 'pt', (next, st)-> next(genPatient()) createPt = buildStep 'createPt', (next, st)-> success = (resp)-> id = resp.data.id.split("/_history/")[0] st.pid = id next(resp) subject.create(resource: st.pt).then(success,fail) checkCreatePt = checkStep 'createPt', (st, resp)-> cpt = resp.data assert.notEqual(cpt.id, null) assert.deepEqual(cpt.name[0].family, st.pt.name[0].family) readPt = buildStep 'readPt', (next, st)-> subject.read(type: 'Patient', id: st.pid).then(next,fail) checkReadPt = checkStep 'readPt', (st, resp)-> readPt = resp.data assert.deepEqual(readPt.name[0].family[0], st.pt.name[0].family[0]) updatePt = buildStep 'updatePt', (next, st)-> pt = st.createPt.data pt.name[0].family[0] = chance.last() subject.update(resource: pt).then(next, fail) checkUpdatePt = checkStep 'updatePt', (st, resp)-> updatePt = resp.data createPt = st.createPt.data assert.deepEqual(updatePt.name[0].family[0], createPt.name[0].family[0]) deletePt = buildStep 'deletePt', (next, st)-> createPt = st.createPt.data subject.delete(resource: {resourceType: 'Patient', id: createPt.id}).then(next, fail); preparePt({}) .then createPt .then checkCreatePt .then readPt .then checkReadPt .then updatePt .then checkUpdatePt .then deletePt .then (-> done()) null
true
tu = require('../src/testUtils') assert = require('assert') Chance = require('chance') exports.baseUrl = 'http://hapi.fhir.org/baseDstu3' exports.spec_for = (title, impl, baseUrl)-> chance = new Chance() genPatient = ()-> resourceType: "Patient" text:{ status: "generated", div: "<div>Generated</div>"} identifier: [ use: "usual" label: "MRN" system: "urn:oid:1.2.36.146.595.217.0.1" value: chance.ssn() period: { start: "2001-05-06"} assigner: { display: "Acme Healthcare"} ] name: [ {use: "official", family: chance.last(), given: [chance.first(), chance.first()]} ] describe title, -> @timeout(10000) q = {defer: impl.defer} buildStep = tu.stepBuilder(q) checkStep = tu.checkStep(q) subject = impl(baseUrl: baseUrl) it "search", (done) -> subject.search(type: 'Patient', query: {name: 'PI:NAME:<NAME>END_PI'}).then((-> done())) null it "CRUD", (done) -> console.log("#{title} SPEC") fail = (err)-> done(new Error(JSON.stringify(err))) preparePt = buildStep 'pt', (next, st)-> next(genPatient()) createPt = buildStep 'createPt', (next, st)-> success = (resp)-> id = resp.data.id.split("/_history/")[0] st.pid = id next(resp) subject.create(resource: st.pt).then(success,fail) checkCreatePt = checkStep 'createPt', (st, resp)-> cpt = resp.data assert.notEqual(cpt.id, null) assert.deepEqual(cpt.name[0].family, st.pt.name[0].family) readPt = buildStep 'readPt', (next, st)-> subject.read(type: 'Patient', id: st.pid).then(next,fail) checkReadPt = checkStep 'readPt', (st, resp)-> readPt = resp.data assert.deepEqual(readPt.name[0].family[0], st.pt.name[0].family[0]) updatePt = buildStep 'updatePt', (next, st)-> pt = st.createPt.data pt.name[0].family[0] = chance.last() subject.update(resource: pt).then(next, fail) checkUpdatePt = checkStep 'updatePt', (st, resp)-> updatePt = resp.data createPt = st.createPt.data assert.deepEqual(updatePt.name[0].family[0], createPt.name[0].family[0]) deletePt = buildStep 'deletePt', (next, st)-> createPt = st.createPt.data subject.delete(resource: {resourceType: 'Patient', id: createPt.id}).then(next, fail); preparePt({}) .then createPt .then checkCreatePt .then readPt .then checkReadPt .then updatePt .then checkUpdatePt .then deletePt .then (-> done()) null
[ { "context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission", "end": 18, "score": 0.9993663430213928, "start": 12, "tag": "NAME", "value": "Joyent" } ]
test/simple/test-repl-autolibs.coffee
lxe/io.coffee
0
# Copyright Joyent, Inc. and other Node contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. # A stream to push an array into a REPL ArrayStream = -> @run = (data) -> self = this data.forEach (line) -> self.emit "data", line + "\n" return return return test1 = -> gotWrite = false putIn.write = (data) -> gotWrite = true if data.length # inspect output matches repl output assert.equal data, util.inspect(require("fs"), null, 2, false) + "\n" # globally added lib matches required lib assert.equal global.fs, require("fs") test2() return assert not gotWrite putIn.run ["fs"] assert gotWrite return test2 = -> gotWrite = false putIn.write = (data) -> gotWrite = true if data.length # repl response error message assert.equal data, "{}\n" # original value wasn't overwritten assert.equal val, global.url return val = {} global.url = val assert not gotWrite putIn.run ["url"] assert gotWrite return assert = require("assert") util = require("util") repl = require("repl") util.inherits ArrayStream, require("stream").Stream ArrayStream::readable = true ArrayStream::writable = true ArrayStream::resume = -> ArrayStream::write = -> putIn = new ArrayStream testMe = repl.start("", putIn, null, true) test1()
107590
# Copyright <NAME>, Inc. and other Node contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. # A stream to push an array into a REPL ArrayStream = -> @run = (data) -> self = this data.forEach (line) -> self.emit "data", line + "\n" return return return test1 = -> gotWrite = false putIn.write = (data) -> gotWrite = true if data.length # inspect output matches repl output assert.equal data, util.inspect(require("fs"), null, 2, false) + "\n" # globally added lib matches required lib assert.equal global.fs, require("fs") test2() return assert not gotWrite putIn.run ["fs"] assert gotWrite return test2 = -> gotWrite = false putIn.write = (data) -> gotWrite = true if data.length # repl response error message assert.equal data, "{}\n" # original value wasn't overwritten assert.equal val, global.url return val = {} global.url = val assert not gotWrite putIn.run ["url"] assert gotWrite return assert = require("assert") util = require("util") repl = require("repl") util.inherits ArrayStream, require("stream").Stream ArrayStream::readable = true ArrayStream::writable = true ArrayStream::resume = -> ArrayStream::write = -> putIn = new ArrayStream testMe = repl.start("", putIn, null, true) test1()
true
# Copyright PI:NAME:<NAME>END_PI, Inc. and other Node contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. # A stream to push an array into a REPL ArrayStream = -> @run = (data) -> self = this data.forEach (line) -> self.emit "data", line + "\n" return return return test1 = -> gotWrite = false putIn.write = (data) -> gotWrite = true if data.length # inspect output matches repl output assert.equal data, util.inspect(require("fs"), null, 2, false) + "\n" # globally added lib matches required lib assert.equal global.fs, require("fs") test2() return assert not gotWrite putIn.run ["fs"] assert gotWrite return test2 = -> gotWrite = false putIn.write = (data) -> gotWrite = true if data.length # repl response error message assert.equal data, "{}\n" # original value wasn't overwritten assert.equal val, global.url return val = {} global.url = val assert not gotWrite putIn.run ["url"] assert gotWrite return assert = require("assert") util = require("util") repl = require("repl") util.inherits ArrayStream, require("stream").Stream ArrayStream::readable = true ArrayStream::writable = true ArrayStream::resume = -> ArrayStream::write = -> putIn = new ArrayStream testMe = repl.start("", putIn, null, true) test1()
[ { "context": " apost = new PostClass [{text: \"woot\"}], {name: \"bob\"}\n assert.equal apost.authorName(), \"bob\"\n ", "end": 1148, "score": 0.6509196162223816, "start": 1145, "tag": "NAME", "value": "bob" }, { "context": "key, value) -> @data[key] = value\n\n name = -> \...
node_modules/dependable/test/test.coffee
headNshoulders/mean_openShift
2
{container} = require '../index' assert = require 'assert' fs = require 'fs' os = require 'os' path = require 'path' describe 'inject', -> it 'should create a container', -> deps = container() it 'should return module without deps', -> Abc = -> "abc" deps = container() deps.register "abc", Abc assert.equal deps.get("abc"), "abc" it 'should get a single dependency', -> Stuff = (names) -> names[0] Names = () -> ["one", "two"] deps = container() deps.register "stuff", Stuff deps.register "names", Names assert.equal deps.get("stuff"), "one" it 'should resovle multiple dependencies', -> post = (Comments, Users) -> class Post constructor: (@comments, @author) -> authorName: -> Users.getName @author firstCommentText: -> Comments.getText @comments[0] comments = -> getText: (obj) -> obj.text users = -> getName: (obj) -> obj.name deps = container() deps.register "Post", post deps.register "Users", users deps.register "Comments", comments PostClass = deps.get "Post" apost = new PostClass [{text: "woot"}], {name: "bob"} assert.equal apost.authorName(), "bob" assert.equal apost.firstCommentText(), "woot" it 'should let me use different databases for different collections (pass in info)', -> db = (data) -> data: data get: (key) -> @data[key] set: (key, value) -> @data[key] = value name = -> "bob" people = (name, db) -> name: name add: (person) -> db.set person.name, person find: (name) -> db.get name places = (name, db) -> name: name add: (place) -> db.set place.name, place find: (name) -> db.get name deps = container() deps.register "name", name deps.register "people", people deps.register "places", places peopleDb = db {} placesDb = db {} peoplez = deps.get "people", {db: peopleDb} placez = deps.get "places", {db: placesDb} assert.equal peoplez.name, "bob" assert.equal placez.name, "bob" peoplez.add {name: "one"} placez.add {name: "two"} assert.ok peoplez.find "one" assert.ok !placez.find "one" assert.ok placez.find "two" assert.ok !peoplez.find "two" it 'should get nested dependencies', -> gpa = -> age: 86 dad = (gpa) -> age: gpa.age - 20 son = (dad) -> age: dad.age - 20 deps = container() deps.register "gpa", gpa deps.register "dad", dad deps.register "son", son ason = deps.get "son" assert.equal ason.age, 46 it 'should throw error on circular dependency', -> one = (two) -> two + 1 two = (one) -> one + 2 deps = container() deps.register "one", one deps.register "two", two try aone = deps.get "one" catch e err = e assert.ok err it "should NOT throw circular dependency error if two modules require the same thing", -> deps = container() deps.register "name", -> "bob" deps.register "one", (name) -> name + " one" deps.register "two", (name) -> name + " two" deps.register "all", (one, two) -> one.name + " " + two.name try all = deps.get "all" catch e assert.ok false, "should not have thrown error" it "should throw error if it cant find dependency", -> deps = container() try deps.get "one" catch e err = e assert.ok err it "should throw error if it cant find dependency of dependency", -> deps = container() deps.register "one", (two) -> "one" try deps.get "one" catch e err = e assert.ok err it 'should let you get multiple dependencies at once, injector style', (done) -> deps = container() deps.register "name", -> "bob" deps.register "one", (name) -> name + " one" deps.register "two", (name) -> name + " two" deps.resolve (one, two) -> assert.ok one assert.ok two assert.equal one, "bob one" assert.equal two, "bob two" done() it 'should return the SAME instance to everyone', -> deps = container() deps.register "asdf", -> {woot: "hi"} deps.register "a", (asdf) -> asdf.a = "a" deps.register "b", (asdf) -> asdf.b = "b" asdf = deps.get "asdf" a = deps.get 'a' b = deps.get 'b' assert.equal asdf.a, "a" assert.equal asdf.b, "b" it 'should inject the container (_container)', -> deps = container() assert.equal deps.get('_container'), deps describe 'cache', -> it 'should re-use the same instance', -> deps = container() deps.register "a", -> {one: "one"} a = deps.get "a" assert.deepEqual a, {one: "one"} assert.notEqual a, {one: "one"} a2 = deps.get "a" assert.equal a, a2 describe 'overrides', -> it 'should override a dependency', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" a = deps.get "a", {b: "henry"} assert.equal a.value, "henry" it 'should not cache when you override', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" overridenA = deps.get "a", {b: "henry"} a = deps.get "a" assert.notEqual a.value, "henry", 'it cached the override value' assert.equal a.value, "b" it 'should ignore the cache when you override', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" a = deps.get "a" overridenA = deps.get "a", {b: "henry"} assert.notEqual overridenA.value, "b", 'it used the cached value' assert.equal overridenA.value, "henry" it 'should override on resolve', (done) -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" deps.resolve {b: "bob"}, (a) -> assert.equal a.value, "bob" done() describe 'file helpers', -> it 'should let you register a file', (done) -> afile = path.join os.tmpDir(), "A.js" acode = """ module.exports = function() { return 'a' } """ bfile = path.join os.tmpDir(), "B.js" bcode = """ module.exports = function(A) { return A + 'b' } """ fs.writeFile afile, acode, (err) -> assert.ifError (err) deps = container() deps.load afile a = deps.get 'A' assert.equal a, 'a' fs.writeFile bfile, bcode, (err) -> assert.ifError (err) deps.load bfile b = deps.get 'B' assert.equal b, 'ab' done() it 'should let you register a whole directory', (done) -> dir = path.join os.tmpDir(), "testinject" afile = path.join dir, "A.js" acode = """ module.exports = function() { return 'a' } """ bfile = path.join dir, "B.js" bcode = """ module.exports = function(A) { return A + 'b' } """ fs.mkdir dir, (err) -> # ignore err, if it already exists fs.writeFile afile, acode, (err) -> assert.ifError (err) fs.writeFile bfile, bcode, (err) -> assert.ifError (err) deps = container() deps.load dir b = deps.get 'B' assert.equal b, 'ab' done() it 'should let you load a file without an extension' it 'should load a folder with a file with parse errors without accidentally trying to load the folder as a file' it 'should not crash if trying to load something as a file without an extension (crashed on fs.stat)' describe 'simple dependencies', -> it 'doesnt have to be a function. objects work too', -> deps = container() deps.register "a", "a" assert.equal deps.get("a"), "a" describe 'registering a hash', -> it 'should register a hash of key : dep pairs', -> deps = container() deps.register { a: "a" b: "b" } assert.equal deps.get("a"), "a" assert.equal deps.get("b"), "b" describe 'nested containers', -> it 'should inherit deps from the parent' describe 'maybe', -> it 'should support objects/data instead of functions?' it 'should support optional dependencies?'
139918
{container} = require '../index' assert = require 'assert' fs = require 'fs' os = require 'os' path = require 'path' describe 'inject', -> it 'should create a container', -> deps = container() it 'should return module without deps', -> Abc = -> "abc" deps = container() deps.register "abc", Abc assert.equal deps.get("abc"), "abc" it 'should get a single dependency', -> Stuff = (names) -> names[0] Names = () -> ["one", "two"] deps = container() deps.register "stuff", Stuff deps.register "names", Names assert.equal deps.get("stuff"), "one" it 'should resovle multiple dependencies', -> post = (Comments, Users) -> class Post constructor: (@comments, @author) -> authorName: -> Users.getName @author firstCommentText: -> Comments.getText @comments[0] comments = -> getText: (obj) -> obj.text users = -> getName: (obj) -> obj.name deps = container() deps.register "Post", post deps.register "Users", users deps.register "Comments", comments PostClass = deps.get "Post" apost = new PostClass [{text: "woot"}], {name: "<NAME>"} assert.equal apost.authorName(), "bob" assert.equal apost.firstCommentText(), "woot" it 'should let me use different databases for different collections (pass in info)', -> db = (data) -> data: data get: (key) -> @data[key] set: (key, value) -> @data[key] = value name = -> "<NAME>" people = (name, db) -> name: name add: (person) -> db.set person.name, person find: (name) -> db.get name places = (name, db) -> name: name add: (place) -> db.set place.name, place find: (name) -> db.get name deps = container() deps.register "name", name deps.register "people", people deps.register "places", places peopleDb = db {} placesDb = db {} peoplez = deps.get "people", {db: peopleDb} placez = deps.get "places", {db: placesDb} assert.equal peoplez.name, "<NAME>" assert.equal placez.name, "<NAME>" peoplez.add {name: "<NAME>"} placez.add {name: "two"} assert.ok peoplez.find "one" assert.ok !placez.find "one" assert.ok placez.find "two" assert.ok !peoplez.find "two" it 'should get nested dependencies', -> gpa = -> age: 86 dad = (gpa) -> age: gpa.age - 20 son = (dad) -> age: dad.age - 20 deps = container() deps.register "gpa", gpa deps.register "dad", dad deps.register "son", son ason = deps.get "son" assert.equal ason.age, 46 it 'should throw error on circular dependency', -> one = (two) -> two + 1 two = (one) -> one + 2 deps = container() deps.register "one", one deps.register "two", two try aone = deps.get "one" catch e err = e assert.ok err it "should NOT throw circular dependency error if two modules require the same thing", -> deps = container() deps.register "name", -> "bob" deps.register "one", (name) -> name + " one" deps.register "two", (name) -> name + " two" deps.register "all", (one, two) -> one.name + " " + two.name try all = deps.get "all" catch e assert.ok false, "should not have thrown error" it "should throw error if it cant find dependency", -> deps = container() try deps.get "one" catch e err = e assert.ok err it "should throw error if it cant find dependency of dependency", -> deps = container() deps.register "one", (two) -> "one" try deps.get "one" catch e err = e assert.ok err it 'should let you get multiple dependencies at once, injector style', (done) -> deps = container() deps.register "name", -> "bob" deps.register "one", (name) -> name + " one" deps.register "two", (name) -> name + " two" deps.resolve (one, two) -> assert.ok one assert.ok two assert.equal one, "bob one" assert.equal two, "bob two" done() it 'should return the SAME instance to everyone', -> deps = container() deps.register "asdf", -> {woot: "hi"} deps.register "a", (asdf) -> asdf.a = "a" deps.register "b", (asdf) -> asdf.b = "b" asdf = deps.get "asdf" a = deps.get 'a' b = deps.get 'b' assert.equal asdf.a, "a" assert.equal asdf.b, "b" it 'should inject the container (_container)', -> deps = container() assert.equal deps.get('_container'), deps describe 'cache', -> it 'should re-use the same instance', -> deps = container() deps.register "a", -> {one: "one"} a = deps.get "a" assert.deepEqual a, {one: "one"} assert.notEqual a, {one: "one"} a2 = deps.get "a" assert.equal a, a2 describe 'overrides', -> it 'should override a dependency', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" a = deps.get "a", {b: "<NAME>"} assert.equal a.value, "henry" it 'should not cache when you override', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" overridenA = deps.get "a", {b: "<NAME>"} a = deps.get "a" assert.notEqual a.value, "<NAME>", 'it cached the override value' assert.equal a.value, "b" it 'should ignore the cache when you override', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" a = deps.get "a" overridenA = deps.get "a", {b: "<NAME>"} assert.notEqual overridenA.value, "b", 'it used the cached value' assert.equal overridenA.value, "<NAME>" it 'should override on resolve', (done) -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" deps.resolve {b: "bob"}, (a) -> assert.equal a.value, "bob" done() describe 'file helpers', -> it 'should let you register a file', (done) -> afile = path.join os.tmpDir(), "A.js" acode = """ module.exports = function() { return 'a' } """ bfile = path.join os.tmpDir(), "B.js" bcode = """ module.exports = function(A) { return A + 'b' } """ fs.writeFile afile, acode, (err) -> assert.ifError (err) deps = container() deps.load afile a = deps.get 'A' assert.equal a, 'a' fs.writeFile bfile, bcode, (err) -> assert.ifError (err) deps.load bfile b = deps.get 'B' assert.equal b, 'ab' done() it 'should let you register a whole directory', (done) -> dir = path.join os.tmpDir(), "testinject" afile = path.join dir, "A.js" acode = """ module.exports = function() { return 'a' } """ bfile = path.join dir, "B.js" bcode = """ module.exports = function(A) { return A + 'b' } """ fs.mkdir dir, (err) -> # ignore err, if it already exists fs.writeFile afile, acode, (err) -> assert.ifError (err) fs.writeFile bfile, bcode, (err) -> assert.ifError (err) deps = container() deps.load dir b = deps.get 'B' assert.equal b, 'ab' done() it 'should let you load a file without an extension' it 'should load a folder with a file with parse errors without accidentally trying to load the folder as a file' it 'should not crash if trying to load something as a file without an extension (crashed on fs.stat)' describe 'simple dependencies', -> it 'doesnt have to be a function. objects work too', -> deps = container() deps.register "a", "a" assert.equal deps.get("a"), "a" describe 'registering a hash', -> it 'should register a hash of key : dep pairs', -> deps = container() deps.register { a: "a" b: "b" } assert.equal deps.get("a"), "a" assert.equal deps.get("b"), "b" describe 'nested containers', -> it 'should inherit deps from the parent' describe 'maybe', -> it 'should support objects/data instead of functions?' it 'should support optional dependencies?'
true
{container} = require '../index' assert = require 'assert' fs = require 'fs' os = require 'os' path = require 'path' describe 'inject', -> it 'should create a container', -> deps = container() it 'should return module without deps', -> Abc = -> "abc" deps = container() deps.register "abc", Abc assert.equal deps.get("abc"), "abc" it 'should get a single dependency', -> Stuff = (names) -> names[0] Names = () -> ["one", "two"] deps = container() deps.register "stuff", Stuff deps.register "names", Names assert.equal deps.get("stuff"), "one" it 'should resovle multiple dependencies', -> post = (Comments, Users) -> class Post constructor: (@comments, @author) -> authorName: -> Users.getName @author firstCommentText: -> Comments.getText @comments[0] comments = -> getText: (obj) -> obj.text users = -> getName: (obj) -> obj.name deps = container() deps.register "Post", post deps.register "Users", users deps.register "Comments", comments PostClass = deps.get "Post" apost = new PostClass [{text: "woot"}], {name: "PI:NAME:<NAME>END_PI"} assert.equal apost.authorName(), "bob" assert.equal apost.firstCommentText(), "woot" it 'should let me use different databases for different collections (pass in info)', -> db = (data) -> data: data get: (key) -> @data[key] set: (key, value) -> @data[key] = value name = -> "PI:NAME:<NAME>END_PI" people = (name, db) -> name: name add: (person) -> db.set person.name, person find: (name) -> db.get name places = (name, db) -> name: name add: (place) -> db.set place.name, place find: (name) -> db.get name deps = container() deps.register "name", name deps.register "people", people deps.register "places", places peopleDb = db {} placesDb = db {} peoplez = deps.get "people", {db: peopleDb} placez = deps.get "places", {db: placesDb} assert.equal peoplez.name, "PI:NAME:<NAME>END_PI" assert.equal placez.name, "PI:NAME:<NAME>END_PI" peoplez.add {name: "PI:NAME:<NAME>END_PI"} placez.add {name: "two"} assert.ok peoplez.find "one" assert.ok !placez.find "one" assert.ok placez.find "two" assert.ok !peoplez.find "two" it 'should get nested dependencies', -> gpa = -> age: 86 dad = (gpa) -> age: gpa.age - 20 son = (dad) -> age: dad.age - 20 deps = container() deps.register "gpa", gpa deps.register "dad", dad deps.register "son", son ason = deps.get "son" assert.equal ason.age, 46 it 'should throw error on circular dependency', -> one = (two) -> two + 1 two = (one) -> one + 2 deps = container() deps.register "one", one deps.register "two", two try aone = deps.get "one" catch e err = e assert.ok err it "should NOT throw circular dependency error if two modules require the same thing", -> deps = container() deps.register "name", -> "bob" deps.register "one", (name) -> name + " one" deps.register "two", (name) -> name + " two" deps.register "all", (one, two) -> one.name + " " + two.name try all = deps.get "all" catch e assert.ok false, "should not have thrown error" it "should throw error if it cant find dependency", -> deps = container() try deps.get "one" catch e err = e assert.ok err it "should throw error if it cant find dependency of dependency", -> deps = container() deps.register "one", (two) -> "one" try deps.get "one" catch e err = e assert.ok err it 'should let you get multiple dependencies at once, injector style', (done) -> deps = container() deps.register "name", -> "bob" deps.register "one", (name) -> name + " one" deps.register "two", (name) -> name + " two" deps.resolve (one, two) -> assert.ok one assert.ok two assert.equal one, "bob one" assert.equal two, "bob two" done() it 'should return the SAME instance to everyone', -> deps = container() deps.register "asdf", -> {woot: "hi"} deps.register "a", (asdf) -> asdf.a = "a" deps.register "b", (asdf) -> asdf.b = "b" asdf = deps.get "asdf" a = deps.get 'a' b = deps.get 'b' assert.equal asdf.a, "a" assert.equal asdf.b, "b" it 'should inject the container (_container)', -> deps = container() assert.equal deps.get('_container'), deps describe 'cache', -> it 'should re-use the same instance', -> deps = container() deps.register "a", -> {one: "one"} a = deps.get "a" assert.deepEqual a, {one: "one"} assert.notEqual a, {one: "one"} a2 = deps.get "a" assert.equal a, a2 describe 'overrides', -> it 'should override a dependency', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" a = deps.get "a", {b: "PI:NAME:<NAME>END_PI"} assert.equal a.value, "henry" it 'should not cache when you override', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" overridenA = deps.get "a", {b: "PI:NAME:<NAME>END_PI"} a = deps.get "a" assert.notEqual a.value, "PI:NAME:<NAME>END_PI", 'it cached the override value' assert.equal a.value, "b" it 'should ignore the cache when you override', -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" a = deps.get "a" overridenA = deps.get "a", {b: "PI:NAME:<NAME>END_PI"} assert.notEqual overridenA.value, "b", 'it used the cached value' assert.equal overridenA.value, "PI:NAME:<NAME>END_PI" it 'should override on resolve', (done) -> deps = container() deps.register "a", (b) -> value: b deps.register "b", "b" deps.resolve {b: "bob"}, (a) -> assert.equal a.value, "bob" done() describe 'file helpers', -> it 'should let you register a file', (done) -> afile = path.join os.tmpDir(), "A.js" acode = """ module.exports = function() { return 'a' } """ bfile = path.join os.tmpDir(), "B.js" bcode = """ module.exports = function(A) { return A + 'b' } """ fs.writeFile afile, acode, (err) -> assert.ifError (err) deps = container() deps.load afile a = deps.get 'A' assert.equal a, 'a' fs.writeFile bfile, bcode, (err) -> assert.ifError (err) deps.load bfile b = deps.get 'B' assert.equal b, 'ab' done() it 'should let you register a whole directory', (done) -> dir = path.join os.tmpDir(), "testinject" afile = path.join dir, "A.js" acode = """ module.exports = function() { return 'a' } """ bfile = path.join dir, "B.js" bcode = """ module.exports = function(A) { return A + 'b' } """ fs.mkdir dir, (err) -> # ignore err, if it already exists fs.writeFile afile, acode, (err) -> assert.ifError (err) fs.writeFile bfile, bcode, (err) -> assert.ifError (err) deps = container() deps.load dir b = deps.get 'B' assert.equal b, 'ab' done() it 'should let you load a file without an extension' it 'should load a folder with a file with parse errors without accidentally trying to load the folder as a file' it 'should not crash if trying to load something as a file without an extension (crashed on fs.stat)' describe 'simple dependencies', -> it 'doesnt have to be a function. objects work too', -> deps = container() deps.register "a", "a" assert.equal deps.get("a"), "a" describe 'registering a hash', -> it 'should register a hash of key : dep pairs', -> deps = container() deps.register { a: "a" b: "b" } assert.equal deps.get("a"), "a" assert.equal deps.get("b"), "b" describe 'nested containers', -> it 'should inherit deps from the parent' describe 'maybe', -> it 'should support objects/data instead of functions?' it 'should support optional dependencies?'
[ { "context": "atom.config.get('jenkins.username'),\n password: atom.config.get('jenkins.password')\n }\n\n rest.get(url, options)", "end": 353, "score": 0.9893333315849304, "start": 338, "tag": "PASSWORD", "value": "atom.config.get" } ]
lib/jenkins-gateway.coffee
benmills/atom-jenkins
0
{View} = require 'atom' rest = require 'restler' xml2js = require 'xml2js' _ = require "lodash" _checkConfig = () -> atom.config.get('jenkins.username') && atom.config.get('jenkins.password') && atom.config.get('jenkins.ccxmlUrl') _get = (url, cb) -> options = { username: atom.config.get('jenkins.username'), password: atom.config.get('jenkins.password') } rest.get(url, options).on 'complete', (data) => cb(data) module.exports = { getBuildOutput: (url, cb) -> if !_checkConfig() cb("please define jenkins.username, jenkins.password, and jenkins.ccxmlUrl in your atom config file.", "") else _get url, (data) -> cb(undefined, data) getFailingBuilds: (cb) -> if !_checkConfig() cb("please define jenkins.username, jenkins.password, and jenkins.ccxmlUrl in your atom config file.", []) return failedBuilds = [] #_get "https://ci.braintreepayments.com/view/Venmo%20Touch/cc.xml", (data) -> _get atom.config.get("jenkins.ccxmlUrl"), (data) -> xml2js.parseString data, (err, result) => if err console.log(err) console.log(data) cb("failed to reach jenkins.ccxmlUrl #{atom.config.get("jenkins.ccxmlUrl")}", []) else _(result.Projects.Project).forEach (project) => if project.$.lastBuildStatus != "Success" failedBuilds.push(project.$) cb(undefined, failedBuilds) }
223941
{View} = require 'atom' rest = require 'restler' xml2js = require 'xml2js' _ = require "lodash" _checkConfig = () -> atom.config.get('jenkins.username') && atom.config.get('jenkins.password') && atom.config.get('jenkins.ccxmlUrl') _get = (url, cb) -> options = { username: atom.config.get('jenkins.username'), password: <PASSWORD>('jenkins.password') } rest.get(url, options).on 'complete', (data) => cb(data) module.exports = { getBuildOutput: (url, cb) -> if !_checkConfig() cb("please define jenkins.username, jenkins.password, and jenkins.ccxmlUrl in your atom config file.", "") else _get url, (data) -> cb(undefined, data) getFailingBuilds: (cb) -> if !_checkConfig() cb("please define jenkins.username, jenkins.password, and jenkins.ccxmlUrl in your atom config file.", []) return failedBuilds = [] #_get "https://ci.braintreepayments.com/view/Venmo%20Touch/cc.xml", (data) -> _get atom.config.get("jenkins.ccxmlUrl"), (data) -> xml2js.parseString data, (err, result) => if err console.log(err) console.log(data) cb("failed to reach jenkins.ccxmlUrl #{atom.config.get("jenkins.ccxmlUrl")}", []) else _(result.Projects.Project).forEach (project) => if project.$.lastBuildStatus != "Success" failedBuilds.push(project.$) cb(undefined, failedBuilds) }
true
{View} = require 'atom' rest = require 'restler' xml2js = require 'xml2js' _ = require "lodash" _checkConfig = () -> atom.config.get('jenkins.username') && atom.config.get('jenkins.password') && atom.config.get('jenkins.ccxmlUrl') _get = (url, cb) -> options = { username: atom.config.get('jenkins.username'), password: PI:PASSWORD:<PASSWORD>END_PI('jenkins.password') } rest.get(url, options).on 'complete', (data) => cb(data) module.exports = { getBuildOutput: (url, cb) -> if !_checkConfig() cb("please define jenkins.username, jenkins.password, and jenkins.ccxmlUrl in your atom config file.", "") else _get url, (data) -> cb(undefined, data) getFailingBuilds: (cb) -> if !_checkConfig() cb("please define jenkins.username, jenkins.password, and jenkins.ccxmlUrl in your atom config file.", []) return failedBuilds = [] #_get "https://ci.braintreepayments.com/view/Venmo%20Touch/cc.xml", (data) -> _get atom.config.get("jenkins.ccxmlUrl"), (data) -> xml2js.parseString data, (err, result) => if err console.log(err) console.log(data) cb("failed to reach jenkins.ccxmlUrl #{atom.config.get("jenkins.ccxmlUrl")}", []) else _(result.Projects.Project).forEach (project) => if project.$.lastBuildStatus != "Success" failedBuilds.push(project.$) cb(undefined, failedBuilds) }
[ { "context": ".API_URL\n .get '/demo'\n .reply 200, {name: 'Zorium'}\n\n flare\n .get '/'\n .expect 20", "end": 820, "score": 0.6171684265136719, "start": 819, "tag": "NAME", "value": "Z" }, { "context": "API_URL\n .get '/demo'\n .reply 200, {name: 'Zorium'}\...
test/server/index.coffee
rachelmcquirk/hiking
0
flareGun = require 'flare-gun' nock = require 'nock' should = require('chai').should() app = require '../../server' config = require '../../src/config' flare = flareGun.express(app) before -> nock.enableNetConnect('0.0.0.0') after -> flare.close() describe 'server', -> it 'is healthy', -> nock config.API_URL .get '/ping' .reply 200, 'pong' flare .get '/healthcheck' .expect 200, { healthy: true } it 'fails if not healthy', -> nock config.API_URL .get '/ping' .reply 503, 'error' flare .get '/healthcheck' .expect 500, { api: false healthy: false } it 'pongs', -> flare .get '/ping' .expect 200, 'pong' it 'renders /', -> nock config.API_URL .get '/demo' .reply 200, {name: 'Zorium'} flare .get '/' .expect 200 it 'renders /404', -> flare .get '/404' .expect 404
96668
flareGun = require 'flare-gun' nock = require 'nock' should = require('chai').should() app = require '../../server' config = require '../../src/config' flare = flareGun.express(app) before -> nock.enableNetConnect('0.0.0.0') after -> flare.close() describe 'server', -> it 'is healthy', -> nock config.API_URL .get '/ping' .reply 200, 'pong' flare .get '/healthcheck' .expect 200, { healthy: true } it 'fails if not healthy', -> nock config.API_URL .get '/ping' .reply 503, 'error' flare .get '/healthcheck' .expect 500, { api: false healthy: false } it 'pongs', -> flare .get '/ping' .expect 200, 'pong' it 'renders /', -> nock config.API_URL .get '/demo' .reply 200, {name: '<NAME>orium'} flare .get '/' .expect 200 it 'renders /404', -> flare .get '/404' .expect 404
true
flareGun = require 'flare-gun' nock = require 'nock' should = require('chai').should() app = require '../../server' config = require '../../src/config' flare = flareGun.express(app) before -> nock.enableNetConnect('0.0.0.0') after -> flare.close() describe 'server', -> it 'is healthy', -> nock config.API_URL .get '/ping' .reply 200, 'pong' flare .get '/healthcheck' .expect 200, { healthy: true } it 'fails if not healthy', -> nock config.API_URL .get '/ping' .reply 503, 'error' flare .get '/healthcheck' .expect 500, { api: false healthy: false } it 'pongs', -> flare .get '/ping' .expect 200, 'pong' it 'renders /', -> nock config.API_URL .get '/demo' .reply 200, {name: 'PI:NAME:<NAME>END_PIorium'} flare .get '/' .expect 200 it 'renders /404', -> flare .get '/404' .expect 404
[ { "context": "tput'\nmax_concurrent_crawls = 3\nrepos = [\n \"adam-p/markdown-here\",\n \"addyosmani/backbone-fundamenta", "end": 334, "score": 0.6505542397499084, "start": 333, "tag": "USERNAME", "value": "p" }, { "context": "crawls = 3\nrepos = [\n \"adam-p/markdown-here\",\n \...
crawler/src/cli.coffee
scharissis/liberator
0
async = require 'async' co = require 'co' log = require './log' RepoCrawlRequest = require './repo_crawl_request' GithubCrawler = require './github_crawler' LocalFileSystem = require './local_file_system' # Configurable params - will be externalised at some point output_dir = './output' max_concurrent_crawls = 3 repos = [ "adam-p/markdown-here", "addyosmani/backbone-fundamentals", "adobe/brackets", "ajaxorg/ace", "alanshaw/david", "alvarotrigo/fullPage.js", "angular/angular.js", "angular/angular-seed", "angular-ui/bootstrap", "Automattic/socket.io", "balderdashy/sails", "bartaz/impress.js", "black-screen/black-screen", "blueimp/jQuery-File-Upload", "bower/bower", "browserstate/history.js", "caolan/async", "carhartl/jquery-cookie", "ccampbell/mousetrap", "cnpm/cnpmjs.org", "codemirror/CodeMirror", "cytoscape/cytoscape.js", "davidmerfield/Typeset", "defunkt/jquery-pjax", "derbyjs/derby", "desandro/masonry", "designmodo/Flat-UI", "DmitryBaranovskiy/raphael", "driftyco/ionic", "emberjs/ember.js", "facebook/react", "facebook/react-native", "facebook/relay", "enyo/dropzone", "etsy/statsd", "Famous/famous", "fgnass/spin.js", "flightjs/flight", "FredrikNoren/ungit", "ftlabs/fastclick", "getify/You-Dont-Know-JS", "GitbookIO/gitbook", "GoodBoyDigital/pixi.js", "google/lovefield", "gruntjs/grunt", "guillaumepotier/Parsley.js", "gulpjs/gulp", "h2non/toxy", "h5bp/html5-boilerplate", "hakimel/reveal.js", "hammerjs/hammer.js", "jadejs/jade", "janl/mustache.js", "jashkenas/backbone", "jashkenas/underscore", "joyent/node", "jquery/jquery", "jquery/jquery-mobile", "jquery/jquery-ui", "julianshapiro/velocity", "kamens/jQuery-menu-aim", "kenwheeler/slick", "knockout/knockout", "kriskowal/q", "Leaflet/Leaflet", "LearnBoost/mongoose", "less/less.js", "linnovate/mean", "lodash/lodash", "madrobby/zepto", "marionettejs/backbone.marionette", "marmelab/gremlins.js", "mbostock/d3", "meteor/meteor", "mochajs/mocha", "Modernizr/Modernizr", "moment/moment", "mozilla/pdf.js", "mrdoob/three.js", "Netflix/falcor", "NeXTs/Jets.js", "nnnick/Chart.js", "node-inspector/node-inspector", "NUKnightLab/TimelineJS", "peachananr/onepage-scroll", "photonstorm/phaser", "Polymer/polymer", "postcss/postcss", "Prinzhorn/skrollr", "ProseMirror/prosemirror", "rackt/redux", "request/request", "resume/resume.github.com", "rstacruz/jquery.transit", "rstacruz/nprogress", "rwaldron/idiomatic.js", "scottjehl/picturefill", "scottjehl/Respond", "Semantic-Org/Semantic-UI", "shichuan/javascript-patterns", "Shopify/dashing", "sindresorhus/pageres", "strongloop/express", "substack/node-browserify", "tastejs/todomvc", "TryGhost/Ghost", "twitter/typeahead.js", "usablica/intro.js", "videojs/video.js", "wagerfield/parallax", "webpack/webpack", "WickyNilliams/headroom.js", "wycats/handlebars.js", "xing/wysihtml5" ] crawl_repo = (repo_crawl_request, callback) -> co -> yield crawler.crawl repo_crawl_request callback() output_file_system = new LocalFileSystem(output_dir) crawler = new GithubCrawler(output_file_system) crawl_requests = repos.map (repo) -> new RepoCrawlRequest 'github', repo crawl_queue = async.queue(crawl_repo, max_concurrent_crawls) crawl_queue.push(crawl_requests) crawl_queue.drain = -> log.info('Crawl complete')
82426
async = require 'async' co = require 'co' log = require './log' RepoCrawlRequest = require './repo_crawl_request' GithubCrawler = require './github_crawler' LocalFileSystem = require './local_file_system' # Configurable params - will be externalised at some point output_dir = './output' max_concurrent_crawls = 3 repos = [ "adam-p/markdown-here", "addyosmani/backbone-fundamentals", "adobe/brackets", "ajaxorg/ace", "alanshaw/david", "alvarotrigo/fullPage.js", "angular/angular.js", "angular/angular-seed", "angular-ui/bootstrap", "Automattic/socket.io", "balderdashy/sails", "bartaz/impress.js", "black-screen/black-screen", "blueimp/jQuery-File-Upload", "bower/bower", "browserstate/history.js", "caolan/async", "carhartl/jquery-cookie", "ccampbell/mousetrap", "cnpm/cnpmjs.org", "codemirror/CodeMirror", "cytoscape/cytoscape.js", "davidmerfield/Typeset", "defunkt/jquery-pjax", "derbyjs/derby", "desandro/masonry", "designmodo/Flat-UI", "D<NAME>Bar<NAME>iy/raphael", "driftyco/ionic", "emberjs/ember.js", "facebook/react", "facebook/react-native", "facebook/relay", "enyo/dropzone", "etsy/statsd", "Famous/famous", "fgnass/spin.js", "flightjs/flight", "FredrikNoren/ungit", "ftlabs/fastclick", "getify/You-Dont-Know-JS", "GitbookIO/gitbook", "GoodBoyDigital/pixi.js", "google/lovefield", "gruntjs/grunt", "guillaumepotier/Parsley.js", "gulpjs/gulp", "h2non/toxy", "h5bp/html5-boilerplate", "hakimel/reveal.js", "hammerjs/hammer.js", "jadejs/jade", "janl/mustache.js", "jashkenas/backbone", "jashkenas/underscore", "joyent/node", "jquery/jquery", "jquery/jquery-mobile", "jquery/jquery-ui", "julianshapiro/velocity", "kamens/jQuery-menu-aim", "kenwheeler/slick", "knockout/knockout", "kriskowal/q", "Leaflet/Leaflet", "LearnBoost/mongoose", "less/less.js", "linnovate/mean", "lodash/lodash", "madrobby/zepto", "marionettejs/backbone.marionette", "marmelab/gremlins.js", "mbostock/d3", "meteor/meteor", "mochajs/mocha", "Modernizr/Modernizr", "moment/moment", "mozilla/pdf.js", "mrdoob/three.js", "Netflix/falcor", "NeXTs/Jets.js", "nnnick/Chart.js", "node-inspector/node-inspector", "NUKnightLab/TimelineJS", "peachananr/onepage-scroll", "photonstorm/phaser", "Polymer/polymer", "postcss/postcss", "Prinzhorn/skrollr", "ProseMirror/prosemirror", "rackt/redux", "request/request", "resume/resume.github.com", "rstacruz/jquery.transit", "rstacruz/nprogress", "rwaldron/idiomatic.js", "scottjehl/picturefill", "scottjehl/Respond", "Semantic-Org/Semantic-UI", "shichuan/javascript-patterns", "Shopify/dashing", "sindresorhus/pageres", "strongloop/express", "substack/node-browserify", "tastejs/todomvc", "TryGhost/Ghost", "twitter/typeahead.js", "usablica/intro.js", "videojs/video.js", "wagerfield/parallax", "webpack/webpack", "WickyNilliams/headroom.js", "wycats/handlebars.js", "xing/wysihtml5" ] crawl_repo = (repo_crawl_request, callback) -> co -> yield crawler.crawl repo_crawl_request callback() output_file_system = new LocalFileSystem(output_dir) crawler = new GithubCrawler(output_file_system) crawl_requests = repos.map (repo) -> new RepoCrawlRequest 'github', repo crawl_queue = async.queue(crawl_repo, max_concurrent_crawls) crawl_queue.push(crawl_requests) crawl_queue.drain = -> log.info('Crawl complete')
true
async = require 'async' co = require 'co' log = require './log' RepoCrawlRequest = require './repo_crawl_request' GithubCrawler = require './github_crawler' LocalFileSystem = require './local_file_system' # Configurable params - will be externalised at some point output_dir = './output' max_concurrent_crawls = 3 repos = [ "adam-p/markdown-here", "addyosmani/backbone-fundamentals", "adobe/brackets", "ajaxorg/ace", "alanshaw/david", "alvarotrigo/fullPage.js", "angular/angular.js", "angular/angular-seed", "angular-ui/bootstrap", "Automattic/socket.io", "balderdashy/sails", "bartaz/impress.js", "black-screen/black-screen", "blueimp/jQuery-File-Upload", "bower/bower", "browserstate/history.js", "caolan/async", "carhartl/jquery-cookie", "ccampbell/mousetrap", "cnpm/cnpmjs.org", "codemirror/CodeMirror", "cytoscape/cytoscape.js", "davidmerfield/Typeset", "defunkt/jquery-pjax", "derbyjs/derby", "desandro/masonry", "designmodo/Flat-UI", "DPI:NAME:<NAME>END_PIBarPI:NAME:<NAME>END_PIiy/raphael", "driftyco/ionic", "emberjs/ember.js", "facebook/react", "facebook/react-native", "facebook/relay", "enyo/dropzone", "etsy/statsd", "Famous/famous", "fgnass/spin.js", "flightjs/flight", "FredrikNoren/ungit", "ftlabs/fastclick", "getify/You-Dont-Know-JS", "GitbookIO/gitbook", "GoodBoyDigital/pixi.js", "google/lovefield", "gruntjs/grunt", "guillaumepotier/Parsley.js", "gulpjs/gulp", "h2non/toxy", "h5bp/html5-boilerplate", "hakimel/reveal.js", "hammerjs/hammer.js", "jadejs/jade", "janl/mustache.js", "jashkenas/backbone", "jashkenas/underscore", "joyent/node", "jquery/jquery", "jquery/jquery-mobile", "jquery/jquery-ui", "julianshapiro/velocity", "kamens/jQuery-menu-aim", "kenwheeler/slick", "knockout/knockout", "kriskowal/q", "Leaflet/Leaflet", "LearnBoost/mongoose", "less/less.js", "linnovate/mean", "lodash/lodash", "madrobby/zepto", "marionettejs/backbone.marionette", "marmelab/gremlins.js", "mbostock/d3", "meteor/meteor", "mochajs/mocha", "Modernizr/Modernizr", "moment/moment", "mozilla/pdf.js", "mrdoob/three.js", "Netflix/falcor", "NeXTs/Jets.js", "nnnick/Chart.js", "node-inspector/node-inspector", "NUKnightLab/TimelineJS", "peachananr/onepage-scroll", "photonstorm/phaser", "Polymer/polymer", "postcss/postcss", "Prinzhorn/skrollr", "ProseMirror/prosemirror", "rackt/redux", "request/request", "resume/resume.github.com", "rstacruz/jquery.transit", "rstacruz/nprogress", "rwaldron/idiomatic.js", "scottjehl/picturefill", "scottjehl/Respond", "Semantic-Org/Semantic-UI", "shichuan/javascript-patterns", "Shopify/dashing", "sindresorhus/pageres", "strongloop/express", "substack/node-browserify", "tastejs/todomvc", "TryGhost/Ghost", "twitter/typeahead.js", "usablica/intro.js", "videojs/video.js", "wagerfield/parallax", "webpack/webpack", "WickyNilliams/headroom.js", "wycats/handlebars.js", "xing/wysihtml5" ] crawl_repo = (repo_crawl_request, callback) -> co -> yield crawler.crawl repo_crawl_request callback() output_file_system = new LocalFileSystem(output_dir) crawler = new GithubCrawler(output_file_system) crawl_requests = repos.map (repo) -> new RepoCrawlRequest 'github', repo crawl_queue = async.queue(crawl_repo, max_concurrent_crawls) crawl_queue.push(crawl_requests) crawl_queue.drain = -> log.info('Crawl complete')
[ { "context": "######\n# @file: scope-finder.coffee\n# @author: Danny Buonocore\n# @desc: This class parses the text to extract", "end": 139, "score": 0.9892820119857788, "start": 124, "tag": "NAME", "value": "Danny Buonocore" } ]
lib/scope-finder.coffee
dannyBuonocore/atom-hopper
0
############################################################################### # @file: scope-finder.coffee # @author: Danny Buonocore # @desc: This class parses the text to extract the individual scopes. ############################################################################### exports.ScopeFinder = class ScopeFinder constructor: (@name) -> console.log @name ########################################################################### # Returns all the text in the active text editor. ########################################################################### getEditorText: -> atom.workspace.getActiveTextEditor().getText() ########################################################################### # Returns all the text to the left of the cursor. ########################################################################### getLeftText: (buf, pos) -> buf.getTextInRange [[0, 0], [pos.row, @getLineLength(buf, pos)]] ########################################################################### # Returns all the text to the right of the cursor. ########################################################################### getRightText: (buf, pos) -> len = @getLineLength(buf, pos) return buf.getTextInRange [[pos.row, len], buf.getEndPosition()] ########################################################################### # Returns the length of the current line in the given buffer. ########################################################################### getLineLength: (buf, pos) -> buf.lineForRow(pos.row).length ########################################################################### # Extracts and returns all the text included in the scope enclosing the # current buffer position. ########################################################################### getEnclosingScope: -> editor = atom.workspace.getActiveTextEditor() pos = editor.getCursorBufferPosition() text = @getEditorText() leftText = @getLeftText(editor.getBuffer(), pos) rightText = @getRightText(editor.getBuffer(), pos) console.log leftText console.log rightText bracketBlocksLeft = leftText.split /({|})/g bracketBlocksRight = rightText.split /({|})/g openB = 0 closeB = 0 for i in [bracketBlocksLeft.length..0] by -1 if bracketBlocksLeft[i] == '{' openB++ else if bracketBlocksLeft[i] == '}' closeB++ if openB == closeB + 1 break leftScope = leftText.split('{')[openB]
2878
############################################################################### # @file: scope-finder.coffee # @author: <NAME> # @desc: This class parses the text to extract the individual scopes. ############################################################################### exports.ScopeFinder = class ScopeFinder constructor: (@name) -> console.log @name ########################################################################### # Returns all the text in the active text editor. ########################################################################### getEditorText: -> atom.workspace.getActiveTextEditor().getText() ########################################################################### # Returns all the text to the left of the cursor. ########################################################################### getLeftText: (buf, pos) -> buf.getTextInRange [[0, 0], [pos.row, @getLineLength(buf, pos)]] ########################################################################### # Returns all the text to the right of the cursor. ########################################################################### getRightText: (buf, pos) -> len = @getLineLength(buf, pos) return buf.getTextInRange [[pos.row, len], buf.getEndPosition()] ########################################################################### # Returns the length of the current line in the given buffer. ########################################################################### getLineLength: (buf, pos) -> buf.lineForRow(pos.row).length ########################################################################### # Extracts and returns all the text included in the scope enclosing the # current buffer position. ########################################################################### getEnclosingScope: -> editor = atom.workspace.getActiveTextEditor() pos = editor.getCursorBufferPosition() text = @getEditorText() leftText = @getLeftText(editor.getBuffer(), pos) rightText = @getRightText(editor.getBuffer(), pos) console.log leftText console.log rightText bracketBlocksLeft = leftText.split /({|})/g bracketBlocksRight = rightText.split /({|})/g openB = 0 closeB = 0 for i in [bracketBlocksLeft.length..0] by -1 if bracketBlocksLeft[i] == '{' openB++ else if bracketBlocksLeft[i] == '}' closeB++ if openB == closeB + 1 break leftScope = leftText.split('{')[openB]
true
############################################################################### # @file: scope-finder.coffee # @author: PI:NAME:<NAME>END_PI # @desc: This class parses the text to extract the individual scopes. ############################################################################### exports.ScopeFinder = class ScopeFinder constructor: (@name) -> console.log @name ########################################################################### # Returns all the text in the active text editor. ########################################################################### getEditorText: -> atom.workspace.getActiveTextEditor().getText() ########################################################################### # Returns all the text to the left of the cursor. ########################################################################### getLeftText: (buf, pos) -> buf.getTextInRange [[0, 0], [pos.row, @getLineLength(buf, pos)]] ########################################################################### # Returns all the text to the right of the cursor. ########################################################################### getRightText: (buf, pos) -> len = @getLineLength(buf, pos) return buf.getTextInRange [[pos.row, len], buf.getEndPosition()] ########################################################################### # Returns the length of the current line in the given buffer. ########################################################################### getLineLength: (buf, pos) -> buf.lineForRow(pos.row).length ########################################################################### # Extracts and returns all the text included in the scope enclosing the # current buffer position. ########################################################################### getEnclosingScope: -> editor = atom.workspace.getActiveTextEditor() pos = editor.getCursorBufferPosition() text = @getEditorText() leftText = @getLeftText(editor.getBuffer(), pos) rightText = @getRightText(editor.getBuffer(), pos) console.log leftText console.log rightText bracketBlocksLeft = leftText.split /({|})/g bracketBlocksRight = rightText.split /({|})/g openB = 0 closeB = 0 for i in [bracketBlocksLeft.length..0] by -1 if bracketBlocksLeft[i] == '{' openB++ else if bracketBlocksLeft[i] == '}' closeB++ if openB == closeB + 1 break leftScope = leftText.split('{')[openB]
[ { "context": "og \"-- not included:#{sel_id}\"\n dim_key = \"#{sel_key}_#{sel_id}\"\n dim_ids = get_data_array $proc, 'dimmer", "end": 3008, "score": 0.9932376146316528, "start": 2986, "tag": "KEY", "value": "\"#{sel_key}_#{sel_id}\"" }, { "context": ">\n $pr...
app/assets/javascripts/proc_graph.coffee
prototypefund/gremien
0
# Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ ($ document).on 'turbolinks:load', -> console.log '> script @ proc_graph.coffee' # --- Variables ------------------------------ search_input_timer = null $selectors = null $procs = null # --- Methods -------------------------------- search_input = ( in_event ) -> if search_input_timer isnt null window.clearTimeout search_input_timer search_input_timer = window.setTimeout process_search, 500 process_search = -> console.log "> process_search @ proc_graph.coffee" $search_field = ($ '.search_block input[type=search]') search_text = $search_field.val().toLowerCase() $selectors ?= ($ '.selector_list.searchable .selector') $selectors.each (i, e ) -> $sel = ($ e) title = $sel.attr( 'title' ) or '' if search_text.length < 3 or title.toLowerCase().includes search_text $sel.show() if $sel.css( 'display' ) == 'none' else $sel.hide() if $sel.css( 'display' ) == 'block' $procs ?= ($ '.procedure_block') $procs.each (i, e) -> $proc = ($ e) title = $proc.attr( 'title' ) or '' if search_text.length < 3 or title.toLowerCase().includes search_text $proc.show() if $proc.css( 'display' ) == 'none' else $proc.hide() if $proc.css( 'display' ) == 'block' sort_by = ( in_data_attr ) -> console.log "> sort_by @ proc_graph.coffee -- #{in_data_attr}" me = ($ this) grow_procedure = -> console.log "> grow_procedure @ proc_graph.coffee --" $me = ($ this) $proc_detail = $me.find '.procedure_dialog_detail' proc_id = $proc_detail.closest( '.procedure_block' ).attr 'id' $proc_detail.data 'origin-id', proc_id ($ '.dialog').prepend $proc_detail ($ '.dialog_layer').removeClass 'prepared' shrink_procedure = -> console.log "> shrink_procedure @ proc_graph.coffee --" $me = ($ this) $me.addClass 'prepared' $proc_detail = $me.find '.procedure_dialog_detail' proc_id = $proc_detail.data 'origin-id' ($ "##{proc_id}").append $proc_detail click_selector = -> console.log "> click_selector @ proc_graph.coffee --" $me = ($ this) sel_key = $me.data 'sel-key' sel_id = String( $me.data 'sel-id' ) unless $me.hasClass 'selected' $me.addClass 'selected' $procedures = ($ '.procedure_block') $procedures.each ( i, e ) -> $proc = ($ e) the_ids = get_data_array $proc, sel_key #console.log "-- the_ids:#{the_ids}" if the_ids.includes sel_id #console.log "-- proc:#{$proc.attr 'id'}" else #console.log "-- not included:#{sel_id}" dim_key = "#{sel_key}_#{sel_id}" dim_ids = get_data_array $proc, 'dimmer' unless dim_ids.includes dim_key dim_ids.push dim_key $proc.data 'dimmer', dim_ids.join( ' ' ) $proc.addClass 'dimmed' unless $proc.hasClass 'dimmed' else $me.removeClass 'selected' $procedures = ($ ".procedure_block.dimmed") $procedures.each ( i, e ) -> $proc = ($ e) dim_key = "#{sel_key}_#{sel_id}" dim_ids = get_data_array $proc, 'dimmer' #console.log "-- dim_ids:#{dim_ids.join ' '}" if dim_ids.includes dim_key #console.log "-- not included:#{dim_key}" dim_ids.splice dim_ids.indexOf( dim_key ), 1 if dim_ids.length < 1 $proc.data 'dimmer', '' $proc.removeClass 'dimmed' else $proc.data 'dimmer', dim_ids.join( ' ' ) get_data_array = ( $in_ob, in_key ) -> data = $in_ob.data in_key return [] if data is undefined or data.length is 0 return String( data ).split ' ' # --- Initialization ------------------------- $graph = ($ '.procedures_graph') unless $graph.data 'init_procedure_graph' console.log '-- init' $graph.on 'click.procedure_graph', '.procedure_block', grow_procedure $graph.data 'init_procedure_graph', true $dialog_layer = ($ '.dialog_layer.procedure_graph') unless $dialog_layer.data 'init_procedure_graph' console.log '-- init' $dialog_layer.on 'click.procedure_graph', shrink_procedure $dialog_layer.data 'init_procedure_graph', true $selector_lists = ($ '.selector_list') unless $selector_lists.data 'init_procedure_graph' console.log '-- init' $selector_lists.on 'click.procedure_graph', 'li.selector', click_selector $selector_lists.data 'init_procedure_graph', true $search_block =($ '.search_block') unless $search_block.data 'init_procedure_graph' console.log '-- init' $search_block.on 'input.procedure_graph', 'input[type=search]', search_input $search_block.data 'init_procedure_graph', true
18950
# Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ ($ document).on 'turbolinks:load', -> console.log '> script @ proc_graph.coffee' # --- Variables ------------------------------ search_input_timer = null $selectors = null $procs = null # --- Methods -------------------------------- search_input = ( in_event ) -> if search_input_timer isnt null window.clearTimeout search_input_timer search_input_timer = window.setTimeout process_search, 500 process_search = -> console.log "> process_search @ proc_graph.coffee" $search_field = ($ '.search_block input[type=search]') search_text = $search_field.val().toLowerCase() $selectors ?= ($ '.selector_list.searchable .selector') $selectors.each (i, e ) -> $sel = ($ e) title = $sel.attr( 'title' ) or '' if search_text.length < 3 or title.toLowerCase().includes search_text $sel.show() if $sel.css( 'display' ) == 'none' else $sel.hide() if $sel.css( 'display' ) == 'block' $procs ?= ($ '.procedure_block') $procs.each (i, e) -> $proc = ($ e) title = $proc.attr( 'title' ) or '' if search_text.length < 3 or title.toLowerCase().includes search_text $proc.show() if $proc.css( 'display' ) == 'none' else $proc.hide() if $proc.css( 'display' ) == 'block' sort_by = ( in_data_attr ) -> console.log "> sort_by @ proc_graph.coffee -- #{in_data_attr}" me = ($ this) grow_procedure = -> console.log "> grow_procedure @ proc_graph.coffee --" $me = ($ this) $proc_detail = $me.find '.procedure_dialog_detail' proc_id = $proc_detail.closest( '.procedure_block' ).attr 'id' $proc_detail.data 'origin-id', proc_id ($ '.dialog').prepend $proc_detail ($ '.dialog_layer').removeClass 'prepared' shrink_procedure = -> console.log "> shrink_procedure @ proc_graph.coffee --" $me = ($ this) $me.addClass 'prepared' $proc_detail = $me.find '.procedure_dialog_detail' proc_id = $proc_detail.data 'origin-id' ($ "##{proc_id}").append $proc_detail click_selector = -> console.log "> click_selector @ proc_graph.coffee --" $me = ($ this) sel_key = $me.data 'sel-key' sel_id = String( $me.data 'sel-id' ) unless $me.hasClass 'selected' $me.addClass 'selected' $procedures = ($ '.procedure_block') $procedures.each ( i, e ) -> $proc = ($ e) the_ids = get_data_array $proc, sel_key #console.log "-- the_ids:#{the_ids}" if the_ids.includes sel_id #console.log "-- proc:#{$proc.attr 'id'}" else #console.log "-- not included:#{sel_id}" dim_key = <KEY> dim_ids = get_data_array $proc, 'dimmer' unless dim_ids.includes dim_key dim_ids.push dim_key $proc.data 'dimmer', dim_ids.join( ' ' ) $proc.addClass 'dimmed' unless $proc.hasClass 'dimmed' else $me.removeClass 'selected' $procedures = ($ ".procedure_block.dimmed") $procedures.each ( i, e ) -> $proc = ($ e) dim_key = <KEY> dim_ids = get_data_array $proc, 'dimmer' #console.log "-- dim_ids:#{dim_ids.join ' '}" if dim_ids.includes dim_key #console.log "-- not included:#{dim_key}" dim_ids.splice dim_ids.indexOf( dim_key ), 1 if dim_ids.length < 1 $proc.data 'dimmer', '' $proc.removeClass 'dimmed' else $proc.data 'dimmer', dim_ids.join( ' ' ) get_data_array = ( $in_ob, in_key ) -> data = $in_ob.data in_key return [] if data is undefined or data.length is 0 return String( data ).split ' ' # --- Initialization ------------------------- $graph = ($ '.procedures_graph') unless $graph.data 'init_procedure_graph' console.log '-- init' $graph.on 'click.procedure_graph', '.procedure_block', grow_procedure $graph.data 'init_procedure_graph', true $dialog_layer = ($ '.dialog_layer.procedure_graph') unless $dialog_layer.data 'init_procedure_graph' console.log '-- init' $dialog_layer.on 'click.procedure_graph', shrink_procedure $dialog_layer.data 'init_procedure_graph', true $selector_lists = ($ '.selector_list') unless $selector_lists.data 'init_procedure_graph' console.log '-- init' $selector_lists.on 'click.procedure_graph', 'li.selector', click_selector $selector_lists.data 'init_procedure_graph', true $search_block =($ '.search_block') unless $search_block.data 'init_procedure_graph' console.log '-- init' $search_block.on 'input.procedure_graph', 'input[type=search]', search_input $search_block.data 'init_procedure_graph', true
true
# Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://coffeescript.org/ ($ document).on 'turbolinks:load', -> console.log '> script @ proc_graph.coffee' # --- Variables ------------------------------ search_input_timer = null $selectors = null $procs = null # --- Methods -------------------------------- search_input = ( in_event ) -> if search_input_timer isnt null window.clearTimeout search_input_timer search_input_timer = window.setTimeout process_search, 500 process_search = -> console.log "> process_search @ proc_graph.coffee" $search_field = ($ '.search_block input[type=search]') search_text = $search_field.val().toLowerCase() $selectors ?= ($ '.selector_list.searchable .selector') $selectors.each (i, e ) -> $sel = ($ e) title = $sel.attr( 'title' ) or '' if search_text.length < 3 or title.toLowerCase().includes search_text $sel.show() if $sel.css( 'display' ) == 'none' else $sel.hide() if $sel.css( 'display' ) == 'block' $procs ?= ($ '.procedure_block') $procs.each (i, e) -> $proc = ($ e) title = $proc.attr( 'title' ) or '' if search_text.length < 3 or title.toLowerCase().includes search_text $proc.show() if $proc.css( 'display' ) == 'none' else $proc.hide() if $proc.css( 'display' ) == 'block' sort_by = ( in_data_attr ) -> console.log "> sort_by @ proc_graph.coffee -- #{in_data_attr}" me = ($ this) grow_procedure = -> console.log "> grow_procedure @ proc_graph.coffee --" $me = ($ this) $proc_detail = $me.find '.procedure_dialog_detail' proc_id = $proc_detail.closest( '.procedure_block' ).attr 'id' $proc_detail.data 'origin-id', proc_id ($ '.dialog').prepend $proc_detail ($ '.dialog_layer').removeClass 'prepared' shrink_procedure = -> console.log "> shrink_procedure @ proc_graph.coffee --" $me = ($ this) $me.addClass 'prepared' $proc_detail = $me.find '.procedure_dialog_detail' proc_id = $proc_detail.data 'origin-id' ($ "##{proc_id}").append $proc_detail click_selector = -> console.log "> click_selector @ proc_graph.coffee --" $me = ($ this) sel_key = $me.data 'sel-key' sel_id = String( $me.data 'sel-id' ) unless $me.hasClass 'selected' $me.addClass 'selected' $procedures = ($ '.procedure_block') $procedures.each ( i, e ) -> $proc = ($ e) the_ids = get_data_array $proc, sel_key #console.log "-- the_ids:#{the_ids}" if the_ids.includes sel_id #console.log "-- proc:#{$proc.attr 'id'}" else #console.log "-- not included:#{sel_id}" dim_key = PI:KEY:<KEY>END_PI dim_ids = get_data_array $proc, 'dimmer' unless dim_ids.includes dim_key dim_ids.push dim_key $proc.data 'dimmer', dim_ids.join( ' ' ) $proc.addClass 'dimmed' unless $proc.hasClass 'dimmed' else $me.removeClass 'selected' $procedures = ($ ".procedure_block.dimmed") $procedures.each ( i, e ) -> $proc = ($ e) dim_key = PI:KEY:<KEY>END_PI dim_ids = get_data_array $proc, 'dimmer' #console.log "-- dim_ids:#{dim_ids.join ' '}" if dim_ids.includes dim_key #console.log "-- not included:#{dim_key}" dim_ids.splice dim_ids.indexOf( dim_key ), 1 if dim_ids.length < 1 $proc.data 'dimmer', '' $proc.removeClass 'dimmed' else $proc.data 'dimmer', dim_ids.join( ' ' ) get_data_array = ( $in_ob, in_key ) -> data = $in_ob.data in_key return [] if data is undefined or data.length is 0 return String( data ).split ' ' # --- Initialization ------------------------- $graph = ($ '.procedures_graph') unless $graph.data 'init_procedure_graph' console.log '-- init' $graph.on 'click.procedure_graph', '.procedure_block', grow_procedure $graph.data 'init_procedure_graph', true $dialog_layer = ($ '.dialog_layer.procedure_graph') unless $dialog_layer.data 'init_procedure_graph' console.log '-- init' $dialog_layer.on 'click.procedure_graph', shrink_procedure $dialog_layer.data 'init_procedure_graph', true $selector_lists = ($ '.selector_list') unless $selector_lists.data 'init_procedure_graph' console.log '-- init' $selector_lists.on 'click.procedure_graph', 'li.selector', click_selector $selector_lists.data 'init_procedure_graph', true $search_block =($ '.search_block') unless $search_block.data 'init_procedure_graph' console.log '-- init' $search_block.on 'input.procedure_graph', 'input[type=search]', search_input $search_block.data 'init_procedure_graph', true
[ { "context": "end the current battle\n#\n# Author:\n# github.com/mattantonelli\n\nenv = process.env\n\n# Types (vs grass, fire, wate", "end": 523, "score": 0.9996426701545715, "start": 510, "tag": "USERNAME", "value": "mattantonelli" }, { "context": "fect: 'attack', power: 40 }\n\n...
src/pokemon-battle.coffee
mattantonelli/hubot-pokemon-battle
0
# Description # A simple Pokémon battler. # # Configuration: # BULBASAUR_EMOJI - Emoji keyword for Bulbasaur (default: :bulbasaur:) # CHARMANDER_EMOJI - Emoji keyword for Charmander (default: :charmander:) # SQUIRTLE_EMOJI - Emoji keyword for Squirtle (default: :squirtle:) # # Commands: # hubot poke battle start - start a new battle # hubot poke battle restart - end the current battle and start a new one # hubot poke battle end - end the current battle # # Author: # github.com/mattantonelli env = process.env # Types (vs grass, fire, water, normal) TYPE_MODIFIERS = { grass: { grass: 0.5, fire: 0.5, water: 2.0, normal: 1.0 } fire: { grass: 2.0, fire: 0.5, water: 0.5, normal: 1.0 } water: { grass: 0.5, fire: 2.0, water: 0.5, normal: 1.0 } normal: { grass: 1.0, fire: 1.0, water: 1.0, normal: 1.0 } } # Multipliers for stages of atk/def up/down STAGE_MULTIPLIERS = [0.25, 0.29, 0.33, 0.40, 0.50, 0.67, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00] # Moves TACKLE = { name: 'TACKLE', type: 'normal', effect: 'attack', power: 50 } SCRATCH = { name: 'SCRATCH', type: 'normal', effect: 'attack', power: 40 } GROWL = { name: 'GROWL', type: 'normal', effect: 'attack down', power: null } TAIL_WHIP = { name: 'TAIL WHIP', type: 'normal', effect: 'defense down', power: null } VINE_WHIP = { name: 'VINE WHIP', type: 'grass', effect: 'special attack', power: 45 } EMBER = { name: 'EMBER', type: 'fire', effect: 'special attack', power: 40 } WATER_GUN = { name: 'WATER GUN', type: 'water', effect: 'special attack', power: 40 } # Pokémon BULBASAUR = { name: "#{env.BULBASAUR_EMOJI || ':bulbasaur:'} Bulbasaur" type: 'grass' level: 1 moves: [TACKLE, GROWL, VINE_WHIP] hp: 45 attack: 49 defense: 49 sp_attack: 65 sp_defense: 65 speed: 45 attack_stage: 0 defense_stage: 0 } CHARMANDER = { name: "#{env.CHARMANDER_EMOJI || ':charmander:'} Charmander" type: 'fire' level: 1 moves: [SCRATCH, GROWL, EMBER] hp: 39 attack: 52 defense: 43 sp_attack: 60 sp_defense: 50 speed: 65 attack_stage: 0 defense_stage: 0 } SQUIRTLE = { name: "#{env.SQUIRTLE_EMOJI || ':squirtle:'} Squirtle" type: 'water' level: 1 moves: [TACKLE, TAIL_WHIP, WATER_GUN] hp: 44 attack: 48 defense: 65 sp_attack: 50 sp_defense: 64 speed: 43 attack_stage: 0 defense_stage: 0 } module.exports = (robot) -> robot.respond /poke battle start/i, (res) -> startGame(res) robot.respond /poke battle restart/i, (res) -> restartGame(res) robot.respond /poke battle end/i, (res) -> endGame(res) startGame = (res) -> res.send """ Welcome to the Hubot Pokémon Stadium! Please choose your Pokémon: #{SQUIRTLE.name} #{BULBASAUR.name} #{CHARMANDER.name} """ robot.hear /(squirtle|bulbasaur|charmander)/i, (res) -> choosePokemon(res, res.match[1]) choosePokemon = (res, pokemon) -> key = brainKey(res, 'attacker') if pokemon == 'squirtle' robot.brain.set(key, SQUIRTLE) else if pokemon == 'bulbasaur' robot.brain.set(key, BULBASAUR) else if pokemon == 'charmander' robot.brain.set(key, CHARMANDER) pokemon = robot.brain.get(key) res.send "You chose #{pokemon.name}!" restartGame = (res) -> # Restart endGame = (res) -> # End useMove = (res, attacker, defender, move) -> if move.effect == 'attack' || move.effect == 'special attack' attack = if move.effect == 'attack' then attacker.attack else attacker.sp_attack defense = if move.effect == 'attack' then defender.defense else defender.sp_defense attack *= STAGE_MULTIPLIERS[attacker.attack_stage + 6] defense *= STAGE_MULTIPLIERS[defender.defense_stage + 6] damage = ( ((2 * attacker.level + 10) / 250) * (attack / defense) * move.power ) * modifier(attacker, defender, move) defender.hp = Math.max(defender.hp - damage, 0) else if move.effect == 'attack down' defender.attack_stage = Math.max(defender.attack_stage - 1, -6) else if move.effect == 'defense down' defender.defense_stage = Math.max(defender.defense_stage - 1, -6) modifier = (attacker, defender, move) -> stab = if attacker.type == move.type then 1.5 else 1.0 type = TYPE_MODIFIERS[move.type][defender.type] critical = Math.random() * 100 < 6.25 random = (Math.floor(Math.random() * 16) + 85) / 100 stab * type * critical * random brainKey = (res, key) -> "#{res}-#{key}"
40396
# Description # A simple Pokémon battler. # # Configuration: # BULBASAUR_EMOJI - Emoji keyword for Bulbasaur (default: :bulbasaur:) # CHARMANDER_EMOJI - Emoji keyword for Charmander (default: :charmander:) # SQUIRTLE_EMOJI - Emoji keyword for Squirtle (default: :squirtle:) # # Commands: # hubot poke battle start - start a new battle # hubot poke battle restart - end the current battle and start a new one # hubot poke battle end - end the current battle # # Author: # github.com/mattantonelli env = process.env # Types (vs grass, fire, water, normal) TYPE_MODIFIERS = { grass: { grass: 0.5, fire: 0.5, water: 2.0, normal: 1.0 } fire: { grass: 2.0, fire: 0.5, water: 0.5, normal: 1.0 } water: { grass: 0.5, fire: 2.0, water: 0.5, normal: 1.0 } normal: { grass: 1.0, fire: 1.0, water: 1.0, normal: 1.0 } } # Multipliers for stages of atk/def up/down STAGE_MULTIPLIERS = [0.25, 0.29, 0.33, 0.40, 0.50, 0.67, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00] # Moves TACKLE = { name: 'TACKLE', type: 'normal', effect: 'attack', power: 50 } SCRATCH = { name: 'SCRATCH', type: 'normal', effect: 'attack', power: 40 } GROWL = { name: '<NAME>', type: 'normal', effect: 'attack down', power: null } TAIL_WHIP = { name: 'TAIL <NAME>IP', type: 'normal', effect: 'defense down', power: null } VINE_WHIP = { name: '<NAME>', type: 'grass', effect: 'special attack', power: 45 } EMBER = { name: '<NAME>', type: 'fire', effect: 'special attack', power: 40 } WATER_GUN = { name: '<NAME>', type: 'water', effect: 'special attack', power: 40 } # Pokémon BULBASAUR = { name: "#{env.BULBASAUR_EMOJI || ':bulbasaur:'} <NAME>ulbasaur" type: 'grass' level: 1 moves: [TACKLE, GROWL, VINE_WHIP] hp: 45 attack: 49 defense: 49 sp_attack: 65 sp_defense: 65 speed: 45 attack_stage: 0 defense_stage: 0 } CHARMANDER = { name: "#{env.CHARMANDER_EMOJI || ':charmander:'} <NAME>" type: 'fire' level: 1 moves: [SCRATCH, GROWL, EMBER] hp: 39 attack: 52 defense: 43 sp_attack: 60 sp_defense: 50 speed: 65 attack_stage: 0 defense_stage: 0 } SQUIRTLE = { name: "#{env.SQUIRTLE_EMOJI || ':squirtle:'} <NAME>" type: 'water' level: 1 moves: [TACKLE, TAIL_WHIP, WATER_GUN] hp: 44 attack: 48 defense: 65 sp_attack: 50 sp_defense: 64 speed: 43 attack_stage: 0 defense_stage: 0 } module.exports = (robot) -> robot.respond /poke battle start/i, (res) -> startGame(res) robot.respond /poke battle restart/i, (res) -> restartGame(res) robot.respond /poke battle end/i, (res) -> endGame(res) startGame = (res) -> res.send """ Welcome to the Hubot Pokémon Stadium! Please choose your Pokémon: #{SQUIRTLE.name} #{BULBASAUR.name} #{CHARMANDER.name} """ robot.hear /(squirtle|bulbasaur|charmander)/i, (res) -> choosePokemon(res, res.match[1]) choosePokemon = (res, pokemon) -> key = brainKey(res, 'attacker') if pokemon == 'squirtle' robot.brain.set(key, SQUIRTLE) else if pokemon == 'bulbasaur' robot.brain.set(key, BULBASAUR) else if pokemon == 'charmander' robot.brain.set(key, CHARMANDER) pokemon = robot.brain.get(key) res.send "You chose #{pokemon.name}!" restartGame = (res) -> # Restart endGame = (res) -> # End useMove = (res, attacker, defender, move) -> if move.effect == 'attack' || move.effect == 'special attack' attack = if move.effect == 'attack' then attacker.attack else attacker.sp_attack defense = if move.effect == 'attack' then defender.defense else defender.sp_defense attack *= STAGE_MULTIPLIERS[attacker.attack_stage + 6] defense *= STAGE_MULTIPLIERS[defender.defense_stage + 6] damage = ( ((2 * attacker.level + 10) / 250) * (attack / defense) * move.power ) * modifier(attacker, defender, move) defender.hp = Math.max(defender.hp - damage, 0) else if move.effect == 'attack down' defender.attack_stage = Math.max(defender.attack_stage - 1, -6) else if move.effect == 'defense down' defender.defense_stage = Math.max(defender.defense_stage - 1, -6) modifier = (attacker, defender, move) -> stab = if attacker.type == move.type then 1.5 else 1.0 type = TYPE_MODIFIERS[move.type][defender.type] critical = Math.random() * 100 < 6.25 random = (Math.floor(Math.random() * 16) + 85) / 100 stab * type * critical * random brainKey = (res, key) -> "#{res<KEY>}-#{key}"
true
# Description # A simple Pokémon battler. # # Configuration: # BULBASAUR_EMOJI - Emoji keyword for Bulbasaur (default: :bulbasaur:) # CHARMANDER_EMOJI - Emoji keyword for Charmander (default: :charmander:) # SQUIRTLE_EMOJI - Emoji keyword for Squirtle (default: :squirtle:) # # Commands: # hubot poke battle start - start a new battle # hubot poke battle restart - end the current battle and start a new one # hubot poke battle end - end the current battle # # Author: # github.com/mattantonelli env = process.env # Types (vs grass, fire, water, normal) TYPE_MODIFIERS = { grass: { grass: 0.5, fire: 0.5, water: 2.0, normal: 1.0 } fire: { grass: 2.0, fire: 0.5, water: 0.5, normal: 1.0 } water: { grass: 0.5, fire: 2.0, water: 0.5, normal: 1.0 } normal: { grass: 1.0, fire: 1.0, water: 1.0, normal: 1.0 } } # Multipliers for stages of atk/def up/down STAGE_MULTIPLIERS = [0.25, 0.29, 0.33, 0.40, 0.50, 0.67, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00] # Moves TACKLE = { name: 'TACKLE', type: 'normal', effect: 'attack', power: 50 } SCRATCH = { name: 'SCRATCH', type: 'normal', effect: 'attack', power: 40 } GROWL = { name: 'PI:NAME:<NAME>END_PI', type: 'normal', effect: 'attack down', power: null } TAIL_WHIP = { name: 'TAIL PI:NAME:<NAME>END_PIIP', type: 'normal', effect: 'defense down', power: null } VINE_WHIP = { name: 'PI:NAME:<NAME>END_PI', type: 'grass', effect: 'special attack', power: 45 } EMBER = { name: 'PI:NAME:<NAME>END_PI', type: 'fire', effect: 'special attack', power: 40 } WATER_GUN = { name: 'PI:NAME:<NAME>END_PI', type: 'water', effect: 'special attack', power: 40 } # Pokémon BULBASAUR = { name: "#{env.BULBASAUR_EMOJI || ':bulbasaur:'} PI:NAME:<NAME>END_PIulbasaur" type: 'grass' level: 1 moves: [TACKLE, GROWL, VINE_WHIP] hp: 45 attack: 49 defense: 49 sp_attack: 65 sp_defense: 65 speed: 45 attack_stage: 0 defense_stage: 0 } CHARMANDER = { name: "#{env.CHARMANDER_EMOJI || ':charmander:'} PI:NAME:<NAME>END_PI" type: 'fire' level: 1 moves: [SCRATCH, GROWL, EMBER] hp: 39 attack: 52 defense: 43 sp_attack: 60 sp_defense: 50 speed: 65 attack_stage: 0 defense_stage: 0 } SQUIRTLE = { name: "#{env.SQUIRTLE_EMOJI || ':squirtle:'} PI:NAME:<NAME>END_PI" type: 'water' level: 1 moves: [TACKLE, TAIL_WHIP, WATER_GUN] hp: 44 attack: 48 defense: 65 sp_attack: 50 sp_defense: 64 speed: 43 attack_stage: 0 defense_stage: 0 } module.exports = (robot) -> robot.respond /poke battle start/i, (res) -> startGame(res) robot.respond /poke battle restart/i, (res) -> restartGame(res) robot.respond /poke battle end/i, (res) -> endGame(res) startGame = (res) -> res.send """ Welcome to the Hubot Pokémon Stadium! Please choose your Pokémon: #{SQUIRTLE.name} #{BULBASAUR.name} #{CHARMANDER.name} """ robot.hear /(squirtle|bulbasaur|charmander)/i, (res) -> choosePokemon(res, res.match[1]) choosePokemon = (res, pokemon) -> key = brainKey(res, 'attacker') if pokemon == 'squirtle' robot.brain.set(key, SQUIRTLE) else if pokemon == 'bulbasaur' robot.brain.set(key, BULBASAUR) else if pokemon == 'charmander' robot.brain.set(key, CHARMANDER) pokemon = robot.brain.get(key) res.send "You chose #{pokemon.name}!" restartGame = (res) -> # Restart endGame = (res) -> # End useMove = (res, attacker, defender, move) -> if move.effect == 'attack' || move.effect == 'special attack' attack = if move.effect == 'attack' then attacker.attack else attacker.sp_attack defense = if move.effect == 'attack' then defender.defense else defender.sp_defense attack *= STAGE_MULTIPLIERS[attacker.attack_stage + 6] defense *= STAGE_MULTIPLIERS[defender.defense_stage + 6] damage = ( ((2 * attacker.level + 10) / 250) * (attack / defense) * move.power ) * modifier(attacker, defender, move) defender.hp = Math.max(defender.hp - damage, 0) else if move.effect == 'attack down' defender.attack_stage = Math.max(defender.attack_stage - 1, -6) else if move.effect == 'defense down' defender.defense_stage = Math.max(defender.defense_stage - 1, -6) modifier = (attacker, defender, move) -> stab = if attacker.type == move.type then 1.5 else 1.0 type = TYPE_MODIFIERS[move.type][defender.type] critical = Math.random() * 100 < 6.25 random = (Math.floor(Math.random() * 16) + 85) / 100 stab * type * critical * random brainKey = (res, key) -> "#{resPI:KEY:<KEY>END_PI}-#{key}"
[ { "context": "+ 4}\n ]\n\n string = \"you say you're 'certain', but are you really?\"\n expect(@fixture.chec", "end": 3764, "score": 0.6190311908721924, "start": 3761, "tag": "NAME", "value": "ain" }, { "context": ").toEqual []\n\n string = \"you say you're 'serta...
spec/spellchecker-spec.coffee
fvulich/node-spellchecker
4
{Spellchecker} = require '../lib/spellchecker' fs = require 'fs' path = require 'path' enUS = "A robot is a mechanical or virtual artificial agent, usually an electronic machine" deDE = "ein Roboter ist eine technische Apparatur, die üblicherweise dazu dient, dem Menschen mechanische Arbeit abzunehmen." frFR = "les robots les plus évolués sont capables de se déplacer et de se recharger par eux-mêmes" defaultLanguage = if process.platform is 'darwin' then '' else 'en_US' dictionaryDirectory = path.join(__dirname, 'dictionaries') readDictionaryForLang = (lang) -> return new Buffer([]) unless lang fs.readFileSync(path.join(dictionaryDirectory, "#{lang.replace(/_/g, '-')}.bdic")) describe "SpellChecker", -> describe ".isMisspelled(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns true if the word is mispelled", -> @fixture.setDictionary('en_US', readDictionaryForLang('en_US')) expect(@fixture.isMisspelled('wwoorrddd')).toBe true it "returns false if the word isn't mispelled", -> @fixture.setDictionary('en_US', readDictionaryForLang('en_US')) expect(@fixture.isMisspelled('word')).toBe false it "throws an exception when no word specified", -> expect(-> @fixture.isMisspelled()).toThrow() it "automatically detects languages on OS X", -> return unless process.platform is 'darwin' expect(@fixture.checkSpelling(enUS)).toEqual [] expect(@fixture.checkSpelling(deDE)).toEqual [] expect(@fixture.checkSpelling(frFR)).toEqual [] it "correctly switches languages", -> expect(@fixture.setDictionary('en_US', readDictionaryForLang('en_US'))).toBe true expect(@fixture.checkSpelling(enUS)).toEqual [] expect(@fixture.checkSpelling(deDE)).not.toEqual [] expect(@fixture.checkSpelling(frFR)).not.toEqual [] if @fixture.setDictionary('de_DE', readDictionaryForLang('de_DE')) expect(@fixture.checkSpelling(enUS)).not.toEqual [] expect(@fixture.checkSpelling(deDE)).toEqual [] expect(@fixture.checkSpelling(frFR)).not.toEqual [] @fixture = new Spellchecker() if @fixture.setDictionary('fr_FR', readDictionaryForLang('fr_FR')) expect(@fixture.checkSpelling(enUS)).not.toEqual [] expect(@fixture.checkSpelling(deDE)).not.toEqual [] expect(@fixture.checkSpelling(frFR)).toEqual [] describe ".checkSpelling(string)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of character ranges of misspelled words", -> string = "cat caat dog dooog" expect(@fixture.checkSpelling(string)).toEqual [ {start: 4, end: 8}, {start: 13, end: 18}, ] it "accounts for UTF16 pairs", -> string = "😎 cat caat dog dooog" expect(@fixture.checkSpelling(string)).toEqual [ {start: 7, end: 11}, {start: 16, end: 21}, ] it "accounts for other non-word characters", -> string = "'cat' (caat. <dog> :dooog)" expect(@fixture.checkSpelling(string)).toEqual [ {start: 7, end: 11}, {start: 20, end: 25}, ] it "does not treat non-english letters as word boundaries", -> @fixture.add("cliché") expect(@fixture.checkSpelling("what cliché nonsense")).toEqual [] @fixture.remove("cliché") it "handles words with apostrophes", -> string = "doesn't isn't aint hasn't" expect(@fixture.checkSpelling(string)).toEqual [ {start: string.indexOf("aint"), end: string.indexOf("aint") + 4} ] string = "you say you're 'certain', but are you really?" expect(@fixture.checkSpelling(string)).toEqual [] string = "you say you're 'sertan', but are you really?" expect(@fixture.checkSpelling(string)).toEqual [ {start: string.indexOf("sertan"), end: string.indexOf("',")} ] it "handles invalid inputs", -> fixture = @fixture expect(fixture.checkSpelling("")).toEqual [] expect(-> fixture.checkSpelling()).toThrow("Bad argument") expect(-> fixture.checkSpelling(null)).toThrow("Bad argument") expect(-> fixture.checkSpelling({})).toThrow("Bad argument") describe ".getCorrectionsForMisspelling(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of possible corrections", -> corrections = @fixture.getCorrectionsForMisspelling('worrd') expect(corrections.length).toBeGreaterThan 0 expect(corrections.indexOf('word')).toBeGreaterThan -1 it "throws an exception when no word specified", -> expect(-> @fixture.getCorrectionsForMisspelling()).toThrow() describe ".add(word) and .remove(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "allows words to be added and removed to the dictionary", -> # NB: Windows spellchecker cannot remove words, and since it holds onto # words, rerunning this test >1 time causes it to incorrectly fail return if process.platform is 'win32' expect(@fixture.isMisspelled('wwoorrdd')).toBe true @fixture.add('wwoorrdd') expect(@fixture.isMisspelled('wwoorrdd')).toBe false @fixture.remove('wwoorrdd') expect(@fixture.isMisspelled('wwoorrdd')).toBe true it "add throws an error if no word is specified", -> errorOccurred = false try @fixture.add() catch errorOccurred = true expect(errorOccurred).toBe true it "remove throws an error if no word is specified", -> errorOccurred = false try @fixture.remove() catch errorOccurred = true expect(errorOccurred).toBe true describe ".getAvailableDictionaries()", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of string dictionary names", -> # NB: getAvailableDictionaries is nop'ped in hunspell and it also doesn't # work inside Appveyor's CI environment return if process.platform is 'linux' or process.env.CI or process.env.SPELLCHECKER_PREFER_HUNSPELL dictionaries = @fixture.getAvailableDictionaries() expect(Array.isArray(dictionaries)).toBe true expect(dictionaries.length).toBeGreaterThan 0 for dictionary in dictionaries.length expect(typeof dictionary).toBe 'string' expect(diction.length).toBeGreaterThan 0 describe ".setDictionary(lang, dictDirectory)", -> it "sets the spell checker's language, and dictionary directory", -> awesome = true expect(awesome).toBe true
193632
{Spellchecker} = require '../lib/spellchecker' fs = require 'fs' path = require 'path' enUS = "A robot is a mechanical or virtual artificial agent, usually an electronic machine" deDE = "ein Roboter ist eine technische Apparatur, die üblicherweise dazu dient, dem Menschen mechanische Arbeit abzunehmen." frFR = "les robots les plus évolués sont capables de se déplacer et de se recharger par eux-mêmes" defaultLanguage = if process.platform is 'darwin' then '' else 'en_US' dictionaryDirectory = path.join(__dirname, 'dictionaries') readDictionaryForLang = (lang) -> return new Buffer([]) unless lang fs.readFileSync(path.join(dictionaryDirectory, "#{lang.replace(/_/g, '-')}.bdic")) describe "SpellChecker", -> describe ".isMisspelled(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns true if the word is mispelled", -> @fixture.setDictionary('en_US', readDictionaryForLang('en_US')) expect(@fixture.isMisspelled('wwoorrddd')).toBe true it "returns false if the word isn't mispelled", -> @fixture.setDictionary('en_US', readDictionaryForLang('en_US')) expect(@fixture.isMisspelled('word')).toBe false it "throws an exception when no word specified", -> expect(-> @fixture.isMisspelled()).toThrow() it "automatically detects languages on OS X", -> return unless process.platform is 'darwin' expect(@fixture.checkSpelling(enUS)).toEqual [] expect(@fixture.checkSpelling(deDE)).toEqual [] expect(@fixture.checkSpelling(frFR)).toEqual [] it "correctly switches languages", -> expect(@fixture.setDictionary('en_US', readDictionaryForLang('en_US'))).toBe true expect(@fixture.checkSpelling(enUS)).toEqual [] expect(@fixture.checkSpelling(deDE)).not.toEqual [] expect(@fixture.checkSpelling(frFR)).not.toEqual [] if @fixture.setDictionary('de_DE', readDictionaryForLang('de_DE')) expect(@fixture.checkSpelling(enUS)).not.toEqual [] expect(@fixture.checkSpelling(deDE)).toEqual [] expect(@fixture.checkSpelling(frFR)).not.toEqual [] @fixture = new Spellchecker() if @fixture.setDictionary('fr_FR', readDictionaryForLang('fr_FR')) expect(@fixture.checkSpelling(enUS)).not.toEqual [] expect(@fixture.checkSpelling(deDE)).not.toEqual [] expect(@fixture.checkSpelling(frFR)).toEqual [] describe ".checkSpelling(string)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of character ranges of misspelled words", -> string = "cat caat dog dooog" expect(@fixture.checkSpelling(string)).toEqual [ {start: 4, end: 8}, {start: 13, end: 18}, ] it "accounts for UTF16 pairs", -> string = "😎 cat caat dog dooog" expect(@fixture.checkSpelling(string)).toEqual [ {start: 7, end: 11}, {start: 16, end: 21}, ] it "accounts for other non-word characters", -> string = "'cat' (caat. <dog> :dooog)" expect(@fixture.checkSpelling(string)).toEqual [ {start: 7, end: 11}, {start: 20, end: 25}, ] it "does not treat non-english letters as word boundaries", -> @fixture.add("cliché") expect(@fixture.checkSpelling("what cliché nonsense")).toEqual [] @fixture.remove("cliché") it "handles words with apostrophes", -> string = "doesn't isn't aint hasn't" expect(@fixture.checkSpelling(string)).toEqual [ {start: string.indexOf("aint"), end: string.indexOf("aint") + 4} ] string = "you say you're 'cert<NAME>', but are you really?" expect(@fixture.checkSpelling(string)).toEqual [] string = "you say you're 'sert<NAME>', but are you really?" expect(@fixture.checkSpelling(string)).toEqual [ {start: string.indexOf("sertan"), end: string.indexOf("',")} ] it "handles invalid inputs", -> fixture = @fixture expect(fixture.checkSpelling("")).toEqual [] expect(-> fixture.checkSpelling()).toThrow("Bad argument") expect(-> fixture.checkSpelling(null)).toThrow("Bad argument") expect(-> fixture.checkSpelling({})).toThrow("Bad argument") describe ".getCorrectionsForMisspelling(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of possible corrections", -> corrections = @fixture.getCorrectionsForMisspelling('worrd') expect(corrections.length).toBeGreaterThan 0 expect(corrections.indexOf('word')).toBeGreaterThan -1 it "throws an exception when no word specified", -> expect(-> @fixture.getCorrectionsForMisspelling()).toThrow() describe ".add(word) and .remove(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "allows words to be added and removed to the dictionary", -> # NB: Windows spellchecker cannot remove words, and since it holds onto # words, rerunning this test >1 time causes it to incorrectly fail return if process.platform is 'win32' expect(@fixture.isMisspelled('wwoorrdd')).toBe true @fixture.add('wwoorrdd') expect(@fixture.isMisspelled('wwoorrdd')).toBe false @fixture.remove('wwoorrdd') expect(@fixture.isMisspelled('wwoorrdd')).toBe true it "add throws an error if no word is specified", -> errorOccurred = false try @fixture.add() catch errorOccurred = true expect(errorOccurred).toBe true it "remove throws an error if no word is specified", -> errorOccurred = false try @fixture.remove() catch errorOccurred = true expect(errorOccurred).toBe true describe ".getAvailableDictionaries()", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of string dictionary names", -> # NB: getAvailableDictionaries is nop'ped in hunspell and it also doesn't # work inside Appveyor's CI environment return if process.platform is 'linux' or process.env.CI or process.env.SPELLCHECKER_PREFER_HUNSPELL dictionaries = @fixture.getAvailableDictionaries() expect(Array.isArray(dictionaries)).toBe true expect(dictionaries.length).toBeGreaterThan 0 for dictionary in dictionaries.length expect(typeof dictionary).toBe 'string' expect(diction.length).toBeGreaterThan 0 describe ".setDictionary(lang, dictDirectory)", -> it "sets the spell checker's language, and dictionary directory", -> awesome = true expect(awesome).toBe true
true
{Spellchecker} = require '../lib/spellchecker' fs = require 'fs' path = require 'path' enUS = "A robot is a mechanical or virtual artificial agent, usually an electronic machine" deDE = "ein Roboter ist eine technische Apparatur, die üblicherweise dazu dient, dem Menschen mechanische Arbeit abzunehmen." frFR = "les robots les plus évolués sont capables de se déplacer et de se recharger par eux-mêmes" defaultLanguage = if process.platform is 'darwin' then '' else 'en_US' dictionaryDirectory = path.join(__dirname, 'dictionaries') readDictionaryForLang = (lang) -> return new Buffer([]) unless lang fs.readFileSync(path.join(dictionaryDirectory, "#{lang.replace(/_/g, '-')}.bdic")) describe "SpellChecker", -> describe ".isMisspelled(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns true if the word is mispelled", -> @fixture.setDictionary('en_US', readDictionaryForLang('en_US')) expect(@fixture.isMisspelled('wwoorrddd')).toBe true it "returns false if the word isn't mispelled", -> @fixture.setDictionary('en_US', readDictionaryForLang('en_US')) expect(@fixture.isMisspelled('word')).toBe false it "throws an exception when no word specified", -> expect(-> @fixture.isMisspelled()).toThrow() it "automatically detects languages on OS X", -> return unless process.platform is 'darwin' expect(@fixture.checkSpelling(enUS)).toEqual [] expect(@fixture.checkSpelling(deDE)).toEqual [] expect(@fixture.checkSpelling(frFR)).toEqual [] it "correctly switches languages", -> expect(@fixture.setDictionary('en_US', readDictionaryForLang('en_US'))).toBe true expect(@fixture.checkSpelling(enUS)).toEqual [] expect(@fixture.checkSpelling(deDE)).not.toEqual [] expect(@fixture.checkSpelling(frFR)).not.toEqual [] if @fixture.setDictionary('de_DE', readDictionaryForLang('de_DE')) expect(@fixture.checkSpelling(enUS)).not.toEqual [] expect(@fixture.checkSpelling(deDE)).toEqual [] expect(@fixture.checkSpelling(frFR)).not.toEqual [] @fixture = new Spellchecker() if @fixture.setDictionary('fr_FR', readDictionaryForLang('fr_FR')) expect(@fixture.checkSpelling(enUS)).not.toEqual [] expect(@fixture.checkSpelling(deDE)).not.toEqual [] expect(@fixture.checkSpelling(frFR)).toEqual [] describe ".checkSpelling(string)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of character ranges of misspelled words", -> string = "cat caat dog dooog" expect(@fixture.checkSpelling(string)).toEqual [ {start: 4, end: 8}, {start: 13, end: 18}, ] it "accounts for UTF16 pairs", -> string = "😎 cat caat dog dooog" expect(@fixture.checkSpelling(string)).toEqual [ {start: 7, end: 11}, {start: 16, end: 21}, ] it "accounts for other non-word characters", -> string = "'cat' (caat. <dog> :dooog)" expect(@fixture.checkSpelling(string)).toEqual [ {start: 7, end: 11}, {start: 20, end: 25}, ] it "does not treat non-english letters as word boundaries", -> @fixture.add("cliché") expect(@fixture.checkSpelling("what cliché nonsense")).toEqual [] @fixture.remove("cliché") it "handles words with apostrophes", -> string = "doesn't isn't aint hasn't" expect(@fixture.checkSpelling(string)).toEqual [ {start: string.indexOf("aint"), end: string.indexOf("aint") + 4} ] string = "you say you're 'certPI:NAME:<NAME>END_PI', but are you really?" expect(@fixture.checkSpelling(string)).toEqual [] string = "you say you're 'sertPI:NAME:<NAME>END_PI', but are you really?" expect(@fixture.checkSpelling(string)).toEqual [ {start: string.indexOf("sertan"), end: string.indexOf("',")} ] it "handles invalid inputs", -> fixture = @fixture expect(fixture.checkSpelling("")).toEqual [] expect(-> fixture.checkSpelling()).toThrow("Bad argument") expect(-> fixture.checkSpelling(null)).toThrow("Bad argument") expect(-> fixture.checkSpelling({})).toThrow("Bad argument") describe ".getCorrectionsForMisspelling(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of possible corrections", -> corrections = @fixture.getCorrectionsForMisspelling('worrd') expect(corrections.length).toBeGreaterThan 0 expect(corrections.indexOf('word')).toBeGreaterThan -1 it "throws an exception when no word specified", -> expect(-> @fixture.getCorrectionsForMisspelling()).toThrow() describe ".add(word) and .remove(word)", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "allows words to be added and removed to the dictionary", -> # NB: Windows spellchecker cannot remove words, and since it holds onto # words, rerunning this test >1 time causes it to incorrectly fail return if process.platform is 'win32' expect(@fixture.isMisspelled('wwoorrdd')).toBe true @fixture.add('wwoorrdd') expect(@fixture.isMisspelled('wwoorrdd')).toBe false @fixture.remove('wwoorrdd') expect(@fixture.isMisspelled('wwoorrdd')).toBe true it "add throws an error if no word is specified", -> errorOccurred = false try @fixture.add() catch errorOccurred = true expect(errorOccurred).toBe true it "remove throws an error if no word is specified", -> errorOccurred = false try @fixture.remove() catch errorOccurred = true expect(errorOccurred).toBe true describe ".getAvailableDictionaries()", -> beforeEach -> @fixture = new Spellchecker() @fixture.setDictionary defaultLanguage, readDictionaryForLang(defaultLanguage) it "returns an array of string dictionary names", -> # NB: getAvailableDictionaries is nop'ped in hunspell and it also doesn't # work inside Appveyor's CI environment return if process.platform is 'linux' or process.env.CI or process.env.SPELLCHECKER_PREFER_HUNSPELL dictionaries = @fixture.getAvailableDictionaries() expect(Array.isArray(dictionaries)).toBe true expect(dictionaries.length).toBeGreaterThan 0 for dictionary in dictionaries.length expect(typeof dictionary).toBe 'string' expect(diction.length).toBeGreaterThan 0 describe ".setDictionary(lang, dictDirectory)", -> it "sets the spell checker's language, and dictionary directory", -> awesome = true expect(awesome).toBe true
[ { "context": "otocol is documented here:\n#\n# https://github.com/josephg/ShareJS/wiki/Wire-Protocol\n\ntestCase = require('n", "end": 113, "score": 0.9997211694717407, "start": 106, "tag": "USERNAME", "value": "josephg" }, { "context": " @model\n\n @server.listen =>\n @n...
node_modules/share/test/browserchannel.coffee
abraarsyed/workshare
2
# Tests for the server's browserchannel frontend. The protocol is documented here: # # https://github.com/josephg/ShareJS/wiki/Wire-Protocol testCase = require('nodeunit').testCase assert = require 'assert' {BCSocket} = require 'browserchannel' server = require '../src/server' types = require '../src/types' helpers = require './helpers' newDocName = helpers.newDocName applyOps = helpers.applyOps makePassPart = helpers.makePassPart ANYOBJECT = new Object # Helper method to check that subsequent data received by the callback is a particular # set of values. expectData = (socket, expectedData, callback) -> expectedData = [expectedData] unless Array.isArray expectedData socket.onmessage = (data) -> expected = expectedData.shift() if expected.meta == ANYOBJECT assert.strictEqual typeof data.meta, 'object' delete data.meta delete expected.meta assert.deepEqual expected, data if expectedData.length == 0 socket.onmessage = (data) -> console.warn 'xxxx', data callback() module.exports = testCase setUp: (callback) -> @auth = (client, action) -> action.accept() options = browserchannel: {} rest: null socketio: null db: {type: 'none'} auth: (client, action) => @auth client, action try @model = server.createModel options @server = server options, @model @server.listen => @name = 'testingdoc' # Open a new browserchannel session to the server @socket = new BCSocket "http://localhost:#{@server.address().port}/channel" @socket.onmessage = (data) => @id = data.auth assert.ok @id callback() @socket.onerror = (e) -> console.warn 'eeee', e @socket.send auth:null @expect = (data, callback) => expectData @socket, data, callback catch e console.log e.stack throw e tearDown: (callback) -> @socket.close() # Its important the port has closed before the next test is run. @server.on 'close', callback @server.close() 'open an existing document with no version specified opens the document': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true} @expect {doc:@name, v:0, open:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'open an existing document with version specified opens the document': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true, v:0} @expect {doc:@name, v:0, open:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'open a nonexistant document with create:true creates the document': (test) -> @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @model.getSnapshot @name, (error, docData) -> test.ok docData.meta test.strictEqual typeof(docData.meta.ctime), 'number' test.strictEqual typeof(docData.meta.mtime), 'number' delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() 'open a nonexistant document without create fails': (test) -> @socket.send {doc:@name, open:true} @expect {doc:@name, open:false, error:'Document does not exist'}, => test.done() 'open a nonexistant document at a particular version without create fails': (test) -> @socket.send {doc:@name, open:true, v:0} @expect {doc:@name, open:false, error:'Document does not exist'}, => test.done() 'open a nonexistant document with snapshot:null fails normally': (test) -> @socket.send {doc:@name, open:true, snapshot:null} @expect {doc:@name, open:false, snapshot:null, error:'Document does not exist'}, => test.done() 'get a snapshot of a nonexistant document fails normally': (test) -> @socket.send {doc:@name, snapshot:null} @expect {doc:@name, snapshot:null, error:'Document does not exist'}, => test.done() 'open a nonexistant document with create:true and snapshot:null does not return the snapshot': (test) -> # The snapshot can be inferred. @socket.send {doc:@name, open:true, create:true, type:'text', snapshot:null} @expect {doc:@name, open:true, create:true, v:0}, => test.done() 'open a document with a different type fails': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true, type:'text'} @expect {doc:@name, open:false, error:'Type mismatch'}, => test.done() 'open an existing document with create:true opens the current document': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @socket.send {doc:@name, open:true, create:true, type:'simple', snapshot:null} # The type isn't sent if it can be inferred. @expect {doc:@name, create:false, open:true, v:1, snapshot:{str:'hi'}}, -> test.done() 'open a document at a previous version and get ops since': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @socket.send {doc:@name, v:0, open:true, type:'simple'} @expect [{doc:@name, v:0, open:true}, {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}], -> test.done() 'create a document without opening it': (test) -> @socket.send {doc:@name, create:true, type:'simple'} @expect {doc:@name, create:true}, => @model.getSnapshot @name, (error, docData) -> test.ok docData.meta delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() 'create a document that already exists returns create:false': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, create:true, type:'simple'} @expect {doc:@name, create:false}, => test.done() 'create a document with snapshot:null returns create:true and no snapshot': (test) -> @socket.send {doc:@name, create:true, type:'simple', snapshot:null} @expect {doc:@name, create:true}, => test.done() 'receive ops through an open document': (test) -> @socket.send {doc:@name, v:0, open:true, create:true, type:'simple'} @expect {doc:@name, v:0, open:true, create:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0} @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'send an op': (test) -> @model.create @name, 'simple', => listener = (opData) -> test.strictEqual opData.v, 0 test.deepEqual opData.op, {position:0, text:'hi'} test.done() @model.listen @name, listener, (error, v) -> test.strictEqual v, 0 @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} 'send an op with metadata': (test) -> @model.create @name, 'simple', => listener = (opData) -> test.strictEqual opData.v, 0 test.strictEqual opData.meta.x, 5 test.deepEqual opData.op, {position:0, text:'hi'} test.done() @model.listen @name, listener, (error, v) -> test.strictEqual v, 0 @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} 'receive confirmation when an op is sent': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} @expect {doc:@name, v:0}, -> test.done() 'not be sent your own ops back': (test) -> # @socket.onmessage = (data) -> # test.notDeepEqual data.op, {position:0, text:'hi'} if data.op? # @socket.send {doc:@name, open:true, create:true, type:'simple'} @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} @expect [{doc:@name, v:0, open:true, create:true}, {v:0}], => # Gonna do this a dodgy way. Because I don't want to wait an undefined amount of time # to make sure the op doesn't come, I'll trigger another op and make sure it recieves that. # The second op should come after the first. @expect {v:1, op:{position:0, text:'yo '}, meta:ANYOBJECT}, -> test.done() @model.applyOp @name, {v:1, op:{position:0, text:'yo '}} 'detect duplicate ops using dupIfSource': (test) -> @socket.send {doc:@name, open:true, create:true, type:'simple'} @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} # Resending the op... In reality, this would be sent in a new session. @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, dupIfSource:[@id]} @expect [{doc:@name, v:0, open:true, create:true}, {v:0}, {v:null, error:'Op already submitted'}], -> test.done() 'get a document snapshot': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {v:0, op:{position:0, text:'internet'}}, (error, _) => test.ifError(error) @socket.send {doc:@name, snapshot:null} @expect {doc:@name, snapshot:{str:'internet'}, v:1, type:'simple'}, -> test.done() 'be able to close a document': (test) -> name1 = newDocName() name2 = newDocName() @socket.send {doc:name1, open:true, create:true, type:'simple'} @socket.send {open:false} @socket.send {doc:name2, open:true, create:true, type:'text'} @expect [{doc:name1, open:true, create:true, v:0}, {open:false}, {doc:name2, open:true, create:true, v:0}], => # name1 should be closed, and name2 should be open. # We should only get the op for name2. @model.applyOp name1, {v:0, op:{position:0, text:'Blargh!'}}, (error, appliedVersion) -> test.fail error if error @model.applyOp name2, {v:0, op:[{i:'hi', p:0}]}, (error, appliedVersion) -> test.fail error if error @expect {v:0, op:[{i:'hi', p:0}], meta:ANYOBJECT}, -> test.done() 'doc names are sent in ops when necessary': (test) -> name1 = newDocName() name2 = newDocName() @socket.send {doc:name1, open:true, create:true, type:'simple'} @socket.send {doc:name2, open:true, create:true, type:'simple'} passPart = makePassPart test, 3 @expect [{doc:name1, open:true, create:true, v:0}, {doc:name2, open:true, create:true, v:0}], => @model.applyOp name1, {v:0, op:{position:0, text:'a'}}, (error) => test.fail error if error @model.applyOp name2, {v:0, op:{position:0, text:'b'}}, (error) => test.fail error if error @model.applyOp name1, {v:1, op:{position:0, text:'c'}}, (error) => test.fail error if error # All the ops that come through the socket should have the doc name set. @socket.onmessage = (data) => test.strictEqual data.doc?, true passPart() "don't repeat document names": (test) -> passPart = makePassPart test, 3 @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @socket.onmessage = (data) => # This time, none of the ops should have the document name set. test.strictEqual data.doc?, false passPart() @socket.send {doc:@name, op:{position: 0, text:'a'}, v:0} @socket.send {doc:@name, op:{position: 0, text:'b'}, v:1} @socket.send {doc:@name, op:{position: 0, text:'c'}, v:2} 'an error message is sent through the socket if the operation is invalid': (test) -> @model.create @name, 'simple', => # This might cause the model code to print out an error stack trace @socket.send {doc:@name, v:0, op:{position:-100, text:'asdf'}} @expect {doc:@name, v:null, error:'Invalid position'}, -> test.done() 'creating a document with a null doc name creates a new doc': (test) -> @socket.send {doc:null, create:true, type:'simple'} @socket.onmessage = (data) => test.strictEqual data.create, true test.equal typeof data.doc, 'string' test.ok data.doc.length > 8 @model.getSnapshot data.doc, (error, docData) -> test.ok docData.meta test.strictEqual typeof(docData.meta.ctime), 'number' test.strictEqual typeof(docData.meta.mtime), 'number' delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() # ---- User agent tests 'The user agent is persisted across requests': (test) -> a = null @auth = (agent, action) => if a test.strictEqual a, agent else a = agent action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} @expect {v:0}, -> test.expect 3 test.done() 'Cannot connect if auth rejects you': (test) -> @auth = (agent, action) -> test.strictEqual action.type, 'connect' test.ok agent.remoteAddress in ['localhost', '127.0.0.1'] # Is there a nicer way to do this? test.strictEqual typeof agent.sessionId, 'string' test.ok agent.sessionId.length > 5 test.ok agent.connectTime test.strictEqual typeof agent.headers, 'object' # I can't edit the headers using socket.io-agent's API. I'd test the default headers in this # object, but the default XHR headers aren't part of socket.io's API, so they could change between # versions and break the test. test.strictEqual agent.headers['user-agent'], 'node.js' action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.send({auth:null}) expectData socket, {auth:null, error:'forbidden'}, -> socket.onclose = -> test.expect 7 test.done() 'Cannot open a document if auth rejects you': (test) -> @auth = (agent, action) => if action.name == 'open' action.reject() else action.accept() @model.create @name, 'simple', => @socket.send {doc:@name, open:true} @expect {doc:@name, open:false, error:'forbidden'}, -> test.done() 'Cannot open a document if you cannot get a snapshot': (test) -> @auth = (agent, action) => if action.name == 'get snapshot' action.reject() else action.accept() @model.create @name, 'simple', => @socket.send {doc:@name, open:true, snapshot:null} @expect {doc:@name, open:false, snapshot:null, error:'forbidden'}, -> test.done() 'Cannot create a document if youre not allowed to create': (test) -> @auth = (agent, action) => if action.name == 'create' action.reject() else action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:false, error:'forbidden'}, -> test.done() 'Cannot submit an op if auth rejects you': (test) -> @auth = (agent, action) -> if action.type == 'update' action.reject() else action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple', snapshot:null} @expect {doc:@name, open:true, create:true, v:0}, => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{}} @expect {v:null, error:'forbidden'}, -> test.done() 'Authentication string available in auth function': (test) -> @auth = (agent, action) -> test.strictEqual agent.authentication, '1234' action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onclose = () -> test.done() socket.send {auth:'1234'} 'Authentication object available in auth function': (test) -> @auth = (agent, action) -> test.strictEqual agent.authentication.a, 1234 action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onclose = () -> test.done() socket.send {auth:{a:1234}} 'Socket timeout if no auth message is sent': (test) -> console.log 'Waiting for a timeout... this usually takes about 10 seconds' # This test should be rewritten to use timerstub. socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onmessage = (data) -> test.strictEqual data.auth, null test.strictEqual data.error, 'Timeout waiting for client auth message' socket.onclose = () -> test.done()
63222
# Tests for the server's browserchannel frontend. The protocol is documented here: # # https://github.com/josephg/ShareJS/wiki/Wire-Protocol testCase = require('nodeunit').testCase assert = require 'assert' {BCSocket} = require 'browserchannel' server = require '../src/server' types = require '../src/types' helpers = require './helpers' newDocName = helpers.newDocName applyOps = helpers.applyOps makePassPart = helpers.makePassPart ANYOBJECT = new Object # Helper method to check that subsequent data received by the callback is a particular # set of values. expectData = (socket, expectedData, callback) -> expectedData = [expectedData] unless Array.isArray expectedData socket.onmessage = (data) -> expected = expectedData.shift() if expected.meta == ANYOBJECT assert.strictEqual typeof data.meta, 'object' delete data.meta delete expected.meta assert.deepEqual expected, data if expectedData.length == 0 socket.onmessage = (data) -> console.warn 'xxxx', data callback() module.exports = testCase setUp: (callback) -> @auth = (client, action) -> action.accept() options = browserchannel: {} rest: null socketio: null db: {type: 'none'} auth: (client, action) => @auth client, action try @model = server.createModel options @server = server options, @model @server.listen => @name = 'testingdoc' # Open a new browserchannel session to the server @socket = new BCSocket "http://localhost:#{@server.address().port}/channel" @socket.onmessage = (data) => @id = data.auth assert.ok @id callback() @socket.onerror = (e) -> console.warn 'eeee', e @socket.send auth:null @expect = (data, callback) => expectData @socket, data, callback catch e console.log e.stack throw e tearDown: (callback) -> @socket.close() # Its important the port has closed before the next test is run. @server.on 'close', callback @server.close() 'open an existing document with no version specified opens the document': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true} @expect {doc:@name, v:0, open:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'open an existing document with version specified opens the document': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true, v:0} @expect {doc:@name, v:0, open:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'open a nonexistant document with create:true creates the document': (test) -> @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @model.getSnapshot @name, (error, docData) -> test.ok docData.meta test.strictEqual typeof(docData.meta.ctime), 'number' test.strictEqual typeof(docData.meta.mtime), 'number' delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() 'open a nonexistant document without create fails': (test) -> @socket.send {doc:@name, open:true} @expect {doc:@name, open:false, error:'Document does not exist'}, => test.done() 'open a nonexistant document at a particular version without create fails': (test) -> @socket.send {doc:@name, open:true, v:0} @expect {doc:@name, open:false, error:'Document does not exist'}, => test.done() 'open a nonexistant document with snapshot:null fails normally': (test) -> @socket.send {doc:@name, open:true, snapshot:null} @expect {doc:@name, open:false, snapshot:null, error:'Document does not exist'}, => test.done() 'get a snapshot of a nonexistant document fails normally': (test) -> @socket.send {doc:@name, snapshot:null} @expect {doc:@name, snapshot:null, error:'Document does not exist'}, => test.done() 'open a nonexistant document with create:true and snapshot:null does not return the snapshot': (test) -> # The snapshot can be inferred. @socket.send {doc:@name, open:true, create:true, type:'text', snapshot:null} @expect {doc:@name, open:true, create:true, v:0}, => test.done() 'open a document with a different type fails': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true, type:'text'} @expect {doc:@name, open:false, error:'Type mismatch'}, => test.done() 'open an existing document with create:true opens the current document': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @socket.send {doc:@name, open:true, create:true, type:'simple', snapshot:null} # The type isn't sent if it can be inferred. @expect {doc:@name, create:false, open:true, v:1, snapshot:{str:'hi'}}, -> test.done() 'open a document at a previous version and get ops since': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @socket.send {doc:@name, v:0, open:true, type:'simple'} @expect [{doc:@name, v:0, open:true}, {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}], -> test.done() 'create a document without opening it': (test) -> @socket.send {doc:@name, create:true, type:'simple'} @expect {doc:@name, create:true}, => @model.getSnapshot @name, (error, docData) -> test.ok docData.meta delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() 'create a document that already exists returns create:false': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, create:true, type:'simple'} @expect {doc:@name, create:false}, => test.done() 'create a document with snapshot:null returns create:true and no snapshot': (test) -> @socket.send {doc:@name, create:true, type:'simple', snapshot:null} @expect {doc:@name, create:true}, => test.done() 'receive ops through an open document': (test) -> @socket.send {doc:@name, v:0, open:true, create:true, type:'simple'} @expect {doc:@name, v:0, open:true, create:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0} @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'send an op': (test) -> @model.create @name, 'simple', => listener = (opData) -> test.strictEqual opData.v, 0 test.deepEqual opData.op, {position:0, text:'hi'} test.done() @model.listen @name, listener, (error, v) -> test.strictEqual v, 0 @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} 'send an op with metadata': (test) -> @model.create @name, 'simple', => listener = (opData) -> test.strictEqual opData.v, 0 test.strictEqual opData.meta.x, 5 test.deepEqual opData.op, {position:0, text:'hi'} test.done() @model.listen @name, listener, (error, v) -> test.strictEqual v, 0 @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} 'receive confirmation when an op is sent': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} @expect {doc:@name, v:0}, -> test.done() 'not be sent your own ops back': (test) -> # @socket.onmessage = (data) -> # test.notDeepEqual data.op, {position:0, text:'hi'} if data.op? # @socket.send {doc:@name, open:true, create:true, type:'simple'} @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} @expect [{doc:@name, v:0, open:true, create:true}, {v:0}], => # Gonna do this a dodgy way. Because I don't want to wait an undefined amount of time # to make sure the op doesn't come, I'll trigger another op and make sure it recieves that. # The second op should come after the first. @expect {v:1, op:{position:0, text:'yo '}, meta:ANYOBJECT}, -> test.done() @model.applyOp @name, {v:1, op:{position:0, text:'yo '}} 'detect duplicate ops using dupIfSource': (test) -> @socket.send {doc:@name, open:true, create:true, type:'simple'} @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} # Resending the op... In reality, this would be sent in a new session. @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, dupIfSource:[@id]} @expect [{doc:@name, v:0, open:true, create:true}, {v:0}, {v:null, error:'Op already submitted'}], -> test.done() 'get a document snapshot': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {v:0, op:{position:0, text:'internet'}}, (error, _) => test.ifError(error) @socket.send {doc:@name, snapshot:null} @expect {doc:@name, snapshot:{str:'internet'}, v:1, type:'simple'}, -> test.done() 'be able to close a document': (test) -> name1 = newDocName() name2 = newDocName() @socket.send {doc:name1, open:true, create:true, type:'simple'} @socket.send {open:false} @socket.send {doc:name2, open:true, create:true, type:'text'} @expect [{doc:name1, open:true, create:true, v:0}, {open:false}, {doc:name2, open:true, create:true, v:0}], => # name1 should be closed, and name2 should be open. # We should only get the op for name2. @model.applyOp name1, {v:0, op:{position:0, text:'Blargh!'}}, (error, appliedVersion) -> test.fail error if error @model.applyOp name2, {v:0, op:[{i:'hi', p:0}]}, (error, appliedVersion) -> test.fail error if error @expect {v:0, op:[{i:'hi', p:0}], meta:ANYOBJECT}, -> test.done() 'doc names are sent in ops when necessary': (test) -> name1 = newDocName() name2 = newDocName() @socket.send {doc:name1, open:true, create:true, type:'simple'} @socket.send {doc:name2, open:true, create:true, type:'simple'} passPart = makePassPart test, 3 @expect [{doc:name1, open:true, create:true, v:0}, {doc:name2, open:true, create:true, v:0}], => @model.applyOp name1, {v:0, op:{position:0, text:'a'}}, (error) => test.fail error if error @model.applyOp name2, {v:0, op:{position:0, text:'b'}}, (error) => test.fail error if error @model.applyOp name1, {v:1, op:{position:0, text:'c'}}, (error) => test.fail error if error # All the ops that come through the socket should have the doc name set. @socket.onmessage = (data) => test.strictEqual data.doc?, true passPart() "don't repeat document names": (test) -> passPart = makePassPart test, 3 @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @socket.onmessage = (data) => # This time, none of the ops should have the document name set. test.strictEqual data.doc?, false passPart() @socket.send {doc:@name, op:{position: 0, text:'a'}, v:0} @socket.send {doc:@name, op:{position: 0, text:'b'}, v:1} @socket.send {doc:@name, op:{position: 0, text:'c'}, v:2} 'an error message is sent through the socket if the operation is invalid': (test) -> @model.create @name, 'simple', => # This might cause the model code to print out an error stack trace @socket.send {doc:@name, v:0, op:{position:-100, text:'asdf'}} @expect {doc:@name, v:null, error:'Invalid position'}, -> test.done() 'creating a document with a null doc name creates a new doc': (test) -> @socket.send {doc:null, create:true, type:'simple'} @socket.onmessage = (data) => test.strictEqual data.create, true test.equal typeof data.doc, 'string' test.ok data.doc.length > 8 @model.getSnapshot data.doc, (error, docData) -> test.ok docData.meta test.strictEqual typeof(docData.meta.ctime), 'number' test.strictEqual typeof(docData.meta.mtime), 'number' delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() # ---- User agent tests 'The user agent is persisted across requests': (test) -> a = null @auth = (agent, action) => if a test.strictEqual a, agent else a = agent action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} @expect {v:0}, -> test.expect 3 test.done() 'Cannot connect if auth rejects you': (test) -> @auth = (agent, action) -> test.strictEqual action.type, 'connect' test.ok agent.remoteAddress in ['localhost', '127.0.0.1'] # Is there a nicer way to do this? test.strictEqual typeof agent.sessionId, 'string' test.ok agent.sessionId.length > 5 test.ok agent.connectTime test.strictEqual typeof agent.headers, 'object' # I can't edit the headers using socket.io-agent's API. I'd test the default headers in this # object, but the default XHR headers aren't part of socket.io's API, so they could change between # versions and break the test. test.strictEqual agent.headers['user-agent'], 'node.js' action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.send({auth:null}) expectData socket, {auth:null, error:'forbidden'}, -> socket.onclose = -> test.expect 7 test.done() 'Cannot open a document if auth rejects you': (test) -> @auth = (agent, action) => if action.name == 'open' action.reject() else action.accept() @model.create @name, 'simple', => @socket.send {doc:@name, open:true} @expect {doc:@name, open:false, error:'forbidden'}, -> test.done() 'Cannot open a document if you cannot get a snapshot': (test) -> @auth = (agent, action) => if action.name == 'get snapshot' action.reject() else action.accept() @model.create @name, 'simple', => @socket.send {doc:@name, open:true, snapshot:null} @expect {doc:@name, open:false, snapshot:null, error:'forbidden'}, -> test.done() 'Cannot create a document if youre not allowed to create': (test) -> @auth = (agent, action) => if action.name == 'create' action.reject() else action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:false, error:'forbidden'}, -> test.done() 'Cannot submit an op if auth rejects you': (test) -> @auth = (agent, action) -> if action.type == 'update' action.reject() else action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple', snapshot:null} @expect {doc:@name, open:true, create:true, v:0}, => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{}} @expect {v:null, error:'forbidden'}, -> test.done() 'Authentication string available in auth function': (test) -> @auth = (agent, action) -> test.strictEqual agent.authentication, '1234' action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onclose = () -> test.done() socket.send {auth:'<PASSWORD>'} 'Authentication object available in auth function': (test) -> @auth = (agent, action) -> test.strictEqual agent.authentication.a, 1234 action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onclose = () -> test.done() socket.send {auth:{a:1234}} 'Socket timeout if no auth message is sent': (test) -> console.log 'Waiting for a timeout... this usually takes about 10 seconds' # This test should be rewritten to use timerstub. socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onmessage = (data) -> test.strictEqual data.auth, null test.strictEqual data.error, 'Timeout waiting for client auth message' socket.onclose = () -> test.done()
true
# Tests for the server's browserchannel frontend. The protocol is documented here: # # https://github.com/josephg/ShareJS/wiki/Wire-Protocol testCase = require('nodeunit').testCase assert = require 'assert' {BCSocket} = require 'browserchannel' server = require '../src/server' types = require '../src/types' helpers = require './helpers' newDocName = helpers.newDocName applyOps = helpers.applyOps makePassPart = helpers.makePassPart ANYOBJECT = new Object # Helper method to check that subsequent data received by the callback is a particular # set of values. expectData = (socket, expectedData, callback) -> expectedData = [expectedData] unless Array.isArray expectedData socket.onmessage = (data) -> expected = expectedData.shift() if expected.meta == ANYOBJECT assert.strictEqual typeof data.meta, 'object' delete data.meta delete expected.meta assert.deepEqual expected, data if expectedData.length == 0 socket.onmessage = (data) -> console.warn 'xxxx', data callback() module.exports = testCase setUp: (callback) -> @auth = (client, action) -> action.accept() options = browserchannel: {} rest: null socketio: null db: {type: 'none'} auth: (client, action) => @auth client, action try @model = server.createModel options @server = server options, @model @server.listen => @name = 'testingdoc' # Open a new browserchannel session to the server @socket = new BCSocket "http://localhost:#{@server.address().port}/channel" @socket.onmessage = (data) => @id = data.auth assert.ok @id callback() @socket.onerror = (e) -> console.warn 'eeee', e @socket.send auth:null @expect = (data, callback) => expectData @socket, data, callback catch e console.log e.stack throw e tearDown: (callback) -> @socket.close() # Its important the port has closed before the next test is run. @server.on 'close', callback @server.close() 'open an existing document with no version specified opens the document': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true} @expect {doc:@name, v:0, open:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'open an existing document with version specified opens the document': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true, v:0} @expect {doc:@name, v:0, open:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'open a nonexistant document with create:true creates the document': (test) -> @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @model.getSnapshot @name, (error, docData) -> test.ok docData.meta test.strictEqual typeof(docData.meta.ctime), 'number' test.strictEqual typeof(docData.meta.mtime), 'number' delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() 'open a nonexistant document without create fails': (test) -> @socket.send {doc:@name, open:true} @expect {doc:@name, open:false, error:'Document does not exist'}, => test.done() 'open a nonexistant document at a particular version without create fails': (test) -> @socket.send {doc:@name, open:true, v:0} @expect {doc:@name, open:false, error:'Document does not exist'}, => test.done() 'open a nonexistant document with snapshot:null fails normally': (test) -> @socket.send {doc:@name, open:true, snapshot:null} @expect {doc:@name, open:false, snapshot:null, error:'Document does not exist'}, => test.done() 'get a snapshot of a nonexistant document fails normally': (test) -> @socket.send {doc:@name, snapshot:null} @expect {doc:@name, snapshot:null, error:'Document does not exist'}, => test.done() 'open a nonexistant document with create:true and snapshot:null does not return the snapshot': (test) -> # The snapshot can be inferred. @socket.send {doc:@name, open:true, create:true, type:'text', snapshot:null} @expect {doc:@name, open:true, create:true, v:0}, => test.done() 'open a document with a different type fails': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, open:true, type:'text'} @expect {doc:@name, open:false, error:'Type mismatch'}, => test.done() 'open an existing document with create:true opens the current document': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @socket.send {doc:@name, open:true, create:true, type:'simple', snapshot:null} # The type isn't sent if it can be inferred. @expect {doc:@name, create:false, open:true, v:1, snapshot:{str:'hi'}}, -> test.done() 'open a document at a previous version and get ops since': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0}, => @socket.send {doc:@name, v:0, open:true, type:'simple'} @expect [{doc:@name, v:0, open:true}, {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}], -> test.done() 'create a document without opening it': (test) -> @socket.send {doc:@name, create:true, type:'simple'} @expect {doc:@name, create:true}, => @model.getSnapshot @name, (error, docData) -> test.ok docData.meta delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() 'create a document that already exists returns create:false': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, create:true, type:'simple'} @expect {doc:@name, create:false}, => test.done() 'create a document with snapshot:null returns create:true and no snapshot': (test) -> @socket.send {doc:@name, create:true, type:'simple', snapshot:null} @expect {doc:@name, create:true}, => test.done() 'receive ops through an open document': (test) -> @socket.send {doc:@name, v:0, open:true, create:true, type:'simple'} @expect {doc:@name, v:0, open:true, create:true}, => @model.applyOp @name, {op:{position:0, text:'hi'}, v:0} @expect {v:0, op:{position:0, text:'hi'}, meta:ANYOBJECT}, -> test.done() 'send an op': (test) -> @model.create @name, 'simple', => listener = (opData) -> test.strictEqual opData.v, 0 test.deepEqual opData.op, {position:0, text:'hi'} test.done() @model.listen @name, listener, (error, v) -> test.strictEqual v, 0 @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} 'send an op with metadata': (test) -> @model.create @name, 'simple', => listener = (opData) -> test.strictEqual opData.v, 0 test.strictEqual opData.meta.x, 5 test.deepEqual opData.op, {position:0, text:'hi'} test.done() @model.listen @name, listener, (error, v) -> test.strictEqual v, 0 @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} 'receive confirmation when an op is sent': (test) -> @model.create @name, 'simple', => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} @expect {doc:@name, v:0}, -> test.done() 'not be sent your own ops back': (test) -> # @socket.onmessage = (data) -> # test.notDeepEqual data.op, {position:0, text:'hi'} if data.op? # @socket.send {doc:@name, open:true, create:true, type:'simple'} @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} @expect [{doc:@name, v:0, open:true, create:true}, {v:0}], => # Gonna do this a dodgy way. Because I don't want to wait an undefined amount of time # to make sure the op doesn't come, I'll trigger another op and make sure it recieves that. # The second op should come after the first. @expect {v:1, op:{position:0, text:'yo '}, meta:ANYOBJECT}, -> test.done() @model.applyOp @name, {v:1, op:{position:0, text:'yo '}} 'detect duplicate ops using dupIfSource': (test) -> @socket.send {doc:@name, open:true, create:true, type:'simple'} @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}} # Resending the op... In reality, this would be sent in a new session. @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, dupIfSource:[@id]} @expect [{doc:@name, v:0, open:true, create:true}, {v:0}, {v:null, error:'Op already submitted'}], -> test.done() 'get a document snapshot': (test) -> @model.create @name, 'simple', => @model.applyOp @name, {v:0, op:{position:0, text:'internet'}}, (error, _) => test.ifError(error) @socket.send {doc:@name, snapshot:null} @expect {doc:@name, snapshot:{str:'internet'}, v:1, type:'simple'}, -> test.done() 'be able to close a document': (test) -> name1 = newDocName() name2 = newDocName() @socket.send {doc:name1, open:true, create:true, type:'simple'} @socket.send {open:false} @socket.send {doc:name2, open:true, create:true, type:'text'} @expect [{doc:name1, open:true, create:true, v:0}, {open:false}, {doc:name2, open:true, create:true, v:0}], => # name1 should be closed, and name2 should be open. # We should only get the op for name2. @model.applyOp name1, {v:0, op:{position:0, text:'Blargh!'}}, (error, appliedVersion) -> test.fail error if error @model.applyOp name2, {v:0, op:[{i:'hi', p:0}]}, (error, appliedVersion) -> test.fail error if error @expect {v:0, op:[{i:'hi', p:0}], meta:ANYOBJECT}, -> test.done() 'doc names are sent in ops when necessary': (test) -> name1 = newDocName() name2 = newDocName() @socket.send {doc:name1, open:true, create:true, type:'simple'} @socket.send {doc:name2, open:true, create:true, type:'simple'} passPart = makePassPart test, 3 @expect [{doc:name1, open:true, create:true, v:0}, {doc:name2, open:true, create:true, v:0}], => @model.applyOp name1, {v:0, op:{position:0, text:'a'}}, (error) => test.fail error if error @model.applyOp name2, {v:0, op:{position:0, text:'b'}}, (error) => test.fail error if error @model.applyOp name1, {v:1, op:{position:0, text:'c'}}, (error) => test.fail error if error # All the ops that come through the socket should have the doc name set. @socket.onmessage = (data) => test.strictEqual data.doc?, true passPart() "don't repeat document names": (test) -> passPart = makePassPart test, 3 @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @socket.onmessage = (data) => # This time, none of the ops should have the document name set. test.strictEqual data.doc?, false passPart() @socket.send {doc:@name, op:{position: 0, text:'a'}, v:0} @socket.send {doc:@name, op:{position: 0, text:'b'}, v:1} @socket.send {doc:@name, op:{position: 0, text:'c'}, v:2} 'an error message is sent through the socket if the operation is invalid': (test) -> @model.create @name, 'simple', => # This might cause the model code to print out an error stack trace @socket.send {doc:@name, v:0, op:{position:-100, text:'asdf'}} @expect {doc:@name, v:null, error:'Invalid position'}, -> test.done() 'creating a document with a null doc name creates a new doc': (test) -> @socket.send {doc:null, create:true, type:'simple'} @socket.onmessage = (data) => test.strictEqual data.create, true test.equal typeof data.doc, 'string' test.ok data.doc.length > 8 @model.getSnapshot data.doc, (error, docData) -> test.ok docData.meta test.strictEqual typeof(docData.meta.ctime), 'number' test.strictEqual typeof(docData.meta.mtime), 'number' delete docData.meta test.deepEqual docData, {snapshot:{str:''}, v:0, type:types.simple} test.done() # ---- User agent tests 'The user agent is persisted across requests': (test) -> a = null @auth = (agent, action) => if a test.strictEqual a, agent else a = agent action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:true, create:true, v:0}, => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{x:5}} @expect {v:0}, -> test.expect 3 test.done() 'Cannot connect if auth rejects you': (test) -> @auth = (agent, action) -> test.strictEqual action.type, 'connect' test.ok agent.remoteAddress in ['localhost', '127.0.0.1'] # Is there a nicer way to do this? test.strictEqual typeof agent.sessionId, 'string' test.ok agent.sessionId.length > 5 test.ok agent.connectTime test.strictEqual typeof agent.headers, 'object' # I can't edit the headers using socket.io-agent's API. I'd test the default headers in this # object, but the default XHR headers aren't part of socket.io's API, so they could change between # versions and break the test. test.strictEqual agent.headers['user-agent'], 'node.js' action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.send({auth:null}) expectData socket, {auth:null, error:'forbidden'}, -> socket.onclose = -> test.expect 7 test.done() 'Cannot open a document if auth rejects you': (test) -> @auth = (agent, action) => if action.name == 'open' action.reject() else action.accept() @model.create @name, 'simple', => @socket.send {doc:@name, open:true} @expect {doc:@name, open:false, error:'forbidden'}, -> test.done() 'Cannot open a document if you cannot get a snapshot': (test) -> @auth = (agent, action) => if action.name == 'get snapshot' action.reject() else action.accept() @model.create @name, 'simple', => @socket.send {doc:@name, open:true, snapshot:null} @expect {doc:@name, open:false, snapshot:null, error:'forbidden'}, -> test.done() 'Cannot create a document if youre not allowed to create': (test) -> @auth = (agent, action) => if action.name == 'create' action.reject() else action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple'} @expect {doc:@name, open:false, error:'forbidden'}, -> test.done() 'Cannot submit an op if auth rejects you': (test) -> @auth = (agent, action) -> if action.type == 'update' action.reject() else action.accept() @socket.send {doc:@name, open:true, create:true, type:'simple', snapshot:null} @expect {doc:@name, open:true, create:true, v:0}, => @socket.send {doc:@name, v:0, op:{position:0, text:'hi'}, meta:{}} @expect {v:null, error:'forbidden'}, -> test.done() 'Authentication string available in auth function': (test) -> @auth = (agent, action) -> test.strictEqual agent.authentication, '1234' action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onclose = () -> test.done() socket.send {auth:'PI:PASSWORD:<PASSWORD>END_PI'} 'Authentication object available in auth function': (test) -> @auth = (agent, action) -> test.strictEqual agent.authentication.a, 1234 action.reject() socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onclose = () -> test.done() socket.send {auth:{a:1234}} 'Socket timeout if no auth message is sent': (test) -> console.log 'Waiting for a timeout... this usually takes about 10 seconds' # This test should be rewritten to use timerstub. socket = new BCSocket "http://localhost:#{@server.address().port}/channel" socket.onmessage = (data) -> test.strictEqual data.auth, null test.strictEqual data.error, 'Timeout waiting for client auth message' socket.onclose = () -> test.done()
[ { "context": "kes you never want to leave parties.\n *\n * @name Clingy\n * @prerequisite Join 250 parties\n * @effect -1", "end": 131, "score": 0.988340437412262, "start": 125, "tag": "NAME", "value": "Clingy" } ]
src/character/personalities/Clingy.coffee
sadbear-/IdleLands
3
Personality = require "../base/Personality" `/** * This personality makes you never want to leave parties. * * @name Clingy * @prerequisite Join 250 parties * @effect -100 partyLeavePercent * @effect More likely to join parties * @category Personalities * @package Player */` class Clingy extends Personality constructor: -> partyLeavePercent: -> -100 eventModifier: (player, event) -> if event.type is "party" then 100 @canUse = (player) -> player.statistics["player party join"] >= 250 @desc = "Join 250 parties" module.exports = exports = Clingy
195997
Personality = require "../base/Personality" `/** * This personality makes you never want to leave parties. * * @name <NAME> * @prerequisite Join 250 parties * @effect -100 partyLeavePercent * @effect More likely to join parties * @category Personalities * @package Player */` class Clingy extends Personality constructor: -> partyLeavePercent: -> -100 eventModifier: (player, event) -> if event.type is "party" then 100 @canUse = (player) -> player.statistics["player party join"] >= 250 @desc = "Join 250 parties" module.exports = exports = Clingy
true
Personality = require "../base/Personality" `/** * This personality makes you never want to leave parties. * * @name PI:NAME:<NAME>END_PI * @prerequisite Join 250 parties * @effect -100 partyLeavePercent * @effect More likely to join parties * @category Personalities * @package Player */` class Clingy extends Personality constructor: -> partyLeavePercent: -> -100 eventModifier: (player, event) -> if event.type is "party" then 100 @canUse = (player) -> player.statistics["player party join"] >= 250 @desc = "Join 250 parties" module.exports = exports = Clingy
[ { "context": "(require('prerender-node').set('prerenderToken', 'tVzH3bYtDlOZkQuLaEHI').blacklisted('^/api/v1').set('protocol', 'https'", "end": 786, "score": 0.9708030223846436, "start": 766, "tag": "PASSWORD", "value": "tVzH3bYtDlOZkQuLaEHI" } ]
chutter.coffee
chutterbox/chutter
14
# TODO: move to ENV variables #if process.env.NODE_ENV is "production" # require "newrelic" # gaID = process.env.GOOGLE_ANALYTICS_PRODUCTION #else # gaID = process.env.GOOGLE_ANALYTICS_STAGING express = require("express") cluster = require("cluster") compress = require('compression') favicon = require("serve-favicon") chutter = express() chutter.use(compress()) chutter.engine "html", require("ejs").renderFile chutter.set "views", __dirname + "/app" oneYear = 31557600000 chutter.use "/", express.static(__dirname + "/app", {maxAge: oneYear}) chutter.use "/vendor", express.static(__dirname + "/vendor", {maxAge: oneYear}) # angular is bad for SEO, we have it prerendered in another heroku repo chutter.use(require('prerender-node').set('prerenderToken', 'tVzH3bYtDlOZkQuLaEHI').blacklisted('^/api/v1').set('protocol', 'https').set('afterRender', (req, pres) -> console.log "crawled" )) request = require('request') chutter.use '/api/v1', (req, res) -> url = (process.env.API_HOST || 'http://10.0.1.3:3000') + "/api/v1#{req.url}" req.pipe(request(url)).pipe(res) chutter.use(favicon(__dirname + '/favicon.ico')); chutter.get "/moderation", (req, res) -> res.render "partials/moderation/index.html" chutter.get "/moderation/*", (req, res) -> res.render "partials/moderation/index.html" chutter.get "/management", (req, res) -> res.render "partials/management/index.html" chutter.get "/management/*", (req, res) -> res.render "partials/management/index.html" chutter.get "/me", (req, res) -> res.render "partials/me/index.html" chutter.get "/me/*", (req, res) -> res.render "partials/me/index.html" chutter.get "/*", (req, res) -> res.render "partials/main/index.html" port = process.env.PORT or 5000 if cluster.isMaster # Fork workers. i = 0 while i < 4 cluster.fork() i++ else chutter.listen port, -> console.log "Listening on port" + port
114490
# TODO: move to ENV variables #if process.env.NODE_ENV is "production" # require "newrelic" # gaID = process.env.GOOGLE_ANALYTICS_PRODUCTION #else # gaID = process.env.GOOGLE_ANALYTICS_STAGING express = require("express") cluster = require("cluster") compress = require('compression') favicon = require("serve-favicon") chutter = express() chutter.use(compress()) chutter.engine "html", require("ejs").renderFile chutter.set "views", __dirname + "/app" oneYear = 31557600000 chutter.use "/", express.static(__dirname + "/app", {maxAge: oneYear}) chutter.use "/vendor", express.static(__dirname + "/vendor", {maxAge: oneYear}) # angular is bad for SEO, we have it prerendered in another heroku repo chutter.use(require('prerender-node').set('prerenderToken', '<PASSWORD>').blacklisted('^/api/v1').set('protocol', 'https').set('afterRender', (req, pres) -> console.log "crawled" )) request = require('request') chutter.use '/api/v1', (req, res) -> url = (process.env.API_HOST || 'http://10.0.1.3:3000') + "/api/v1#{req.url}" req.pipe(request(url)).pipe(res) chutter.use(favicon(__dirname + '/favicon.ico')); chutter.get "/moderation", (req, res) -> res.render "partials/moderation/index.html" chutter.get "/moderation/*", (req, res) -> res.render "partials/moderation/index.html" chutter.get "/management", (req, res) -> res.render "partials/management/index.html" chutter.get "/management/*", (req, res) -> res.render "partials/management/index.html" chutter.get "/me", (req, res) -> res.render "partials/me/index.html" chutter.get "/me/*", (req, res) -> res.render "partials/me/index.html" chutter.get "/*", (req, res) -> res.render "partials/main/index.html" port = process.env.PORT or 5000 if cluster.isMaster # Fork workers. i = 0 while i < 4 cluster.fork() i++ else chutter.listen port, -> console.log "Listening on port" + port
true
# TODO: move to ENV variables #if process.env.NODE_ENV is "production" # require "newrelic" # gaID = process.env.GOOGLE_ANALYTICS_PRODUCTION #else # gaID = process.env.GOOGLE_ANALYTICS_STAGING express = require("express") cluster = require("cluster") compress = require('compression') favicon = require("serve-favicon") chutter = express() chutter.use(compress()) chutter.engine "html", require("ejs").renderFile chutter.set "views", __dirname + "/app" oneYear = 31557600000 chutter.use "/", express.static(__dirname + "/app", {maxAge: oneYear}) chutter.use "/vendor", express.static(__dirname + "/vendor", {maxAge: oneYear}) # angular is bad for SEO, we have it prerendered in another heroku repo chutter.use(require('prerender-node').set('prerenderToken', 'PI:PASSWORD:<PASSWORD>END_PI').blacklisted('^/api/v1').set('protocol', 'https').set('afterRender', (req, pres) -> console.log "crawled" )) request = require('request') chutter.use '/api/v1', (req, res) -> url = (process.env.API_HOST || 'http://10.0.1.3:3000') + "/api/v1#{req.url}" req.pipe(request(url)).pipe(res) chutter.use(favicon(__dirname + '/favicon.ico')); chutter.get "/moderation", (req, res) -> res.render "partials/moderation/index.html" chutter.get "/moderation/*", (req, res) -> res.render "partials/moderation/index.html" chutter.get "/management", (req, res) -> res.render "partials/management/index.html" chutter.get "/management/*", (req, res) -> res.render "partials/management/index.html" chutter.get "/me", (req, res) -> res.render "partials/me/index.html" chutter.get "/me/*", (req, res) -> res.render "partials/me/index.html" chutter.get "/*", (req, res) -> res.render "partials/main/index.html" port = process.env.PORT or 5000 if cluster.isMaster # Fork workers. i = 0 while i < 4 cluster.fork() i++ else chutter.listen port, -> console.log "Listening on port" + port
[ { "context": "###\n# Copyright jtlebi.fr <admin@jtlebi.fr> and other contributors.", "end": 17, "score": 0.9671869874000549, "start": 16, "tag": "EMAIL", "value": "j" }, { "context": "###\n# Copyright jtlebi.fr <admin@jtlebi.fr> and other contributors.\n#\n# Per", "end": 25, ...
src/lib/staticServer.coffee
yadutaf/Weathermap-archive
1
### # Copyright jtlebi.fr <admin@jtlebi.fr> and other contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. ### #static file server Restify = require 'restify' Connect = require 'connect' module.exports = (Server) -> return (objectName, dir, urlbase, urlsuffix='', version=false) -> urlbase = '/'+urlbase urlsuffix = '\.'+urlsuffix+'/' if urlsuffix.length staticServer = Connect.static dir route = {path: urlbase+'/.*'+urlsuffix} if version route.version = version Server.get route, (req, res, next) -> req.url = req.url.substr urlbase.length # take off leading /base so that connect locates it correctly staticServer req, res, (status) -> if status if status.errno == 9 #EBADF => weird error to ignore return console.error status.toString() + " for path "+req.url return res.send new Restify.ResourceNotFoundError("Requested "+objectName+" could not be found") return
142795
### # Copyright <EMAIL>tlebi.fr <<EMAIL>> and other contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. ### #static file server Restify = require 'restify' Connect = require 'connect' module.exports = (Server) -> return (objectName, dir, urlbase, urlsuffix='', version=false) -> urlbase = '/'+urlbase urlsuffix = '\.'+urlsuffix+'/' if urlsuffix.length staticServer = Connect.static dir route = {path: urlbase+'/.*'+urlsuffix} if version route.version = version Server.get route, (req, res, next) -> req.url = req.url.substr urlbase.length # take off leading /base so that connect locates it correctly staticServer req, res, (status) -> if status if status.errno == 9 #EBADF => weird error to ignore return console.error status.toString() + " for path "+req.url return res.send new Restify.ResourceNotFoundError("Requested "+objectName+" could not be found") return
true
### # Copyright PI:EMAIL:<EMAIL>END_PItlebi.fr <PI:EMAIL:<EMAIL>END_PI> and other contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. ### #static file server Restify = require 'restify' Connect = require 'connect' module.exports = (Server) -> return (objectName, dir, urlbase, urlsuffix='', version=false) -> urlbase = '/'+urlbase urlsuffix = '\.'+urlsuffix+'/' if urlsuffix.length staticServer = Connect.static dir route = {path: urlbase+'/.*'+urlsuffix} if version route.version = version Server.get route, (req, res, next) -> req.url = req.url.substr urlbase.length # take off leading /base so that connect locates it correctly staticServer req, res, (status) -> if status if status.errno == 9 #EBADF => weird error to ignore return console.error status.toString() + " for path "+req.url return res.send new Restify.ResourceNotFoundError("Requested "+objectName+" could not be found") return
[ { "context": "->\n @_super arguments...\n\n @foreignKey = \"#{name}Id\"\n\n owner.field(@foreignKey, type: \"Id\")\n\n ", "end": 212, "score": 0.9986451864242554, "start": 202, "tag": "KEY", "value": "\"#{name}Id" } ]
node_modules/tower/packages/tower-model/shared/relation/belongsTo.coffee
MagicPower2/Power
1
_ = Tower._ class Tower.ModelRelationBelongsTo extends Tower.ModelRelation @reopen isBelongsTo: true init: (owner, name, options = {}) -> @_super arguments... @foreignKey = "#{name}Id" owner.field(@foreignKey, type: "Id") # this is kind of a hack until it becomes clear how to accomplish in the ember api mixins = owner.PrototypeMixin.mixins computed = mixins[mixins.length - 1].properties[@foreignKey] computed._dependentKeys.push(@name) if @polymorphic @foreignType = "#{name}Type" owner.field(@foreignType, type: 'String') #owner.prototype[name] = -> # @relation(name) Tower.ModelRelationBelongsToCursorMixin = Ember.Mixin.create isBelongsTo: true # need to do something here about Reflection clonePrototype: -> clone = @concat() clone.isCursor = true Tower.ModelRelationCursorMixin.apply(clone) Tower.ModelRelationBelongsToCursorMixin.apply(clone) find: -> @compile() @_super(arguments...) compile: -> relation = @relation # @todo shouldn't have to do $in here... @where(id: $in: [@owner.get(relation.foreignKey)]) class Tower.ModelRelationBelongsToCursor extends Tower.ModelRelationCursor @reopenClass makeOld: -> array = [] array.isCursor = true Tower.ModelRelationCursorMixin.apply(array) Tower.ModelRelationBelongsToCursorMixin.apply(array) @include Tower.ModelRelationBelongsToCursorMixin module.exports = Tower.ModelRelationBelongsTo
223501
_ = Tower._ class Tower.ModelRelationBelongsTo extends Tower.ModelRelation @reopen isBelongsTo: true init: (owner, name, options = {}) -> @_super arguments... @foreignKey = <KEY>" owner.field(@foreignKey, type: "Id") # this is kind of a hack until it becomes clear how to accomplish in the ember api mixins = owner.PrototypeMixin.mixins computed = mixins[mixins.length - 1].properties[@foreignKey] computed._dependentKeys.push(@name) if @polymorphic @foreignType = "#{name}Type" owner.field(@foreignType, type: 'String') #owner.prototype[name] = -> # @relation(name) Tower.ModelRelationBelongsToCursorMixin = Ember.Mixin.create isBelongsTo: true # need to do something here about Reflection clonePrototype: -> clone = @concat() clone.isCursor = true Tower.ModelRelationCursorMixin.apply(clone) Tower.ModelRelationBelongsToCursorMixin.apply(clone) find: -> @compile() @_super(arguments...) compile: -> relation = @relation # @todo shouldn't have to do $in here... @where(id: $in: [@owner.get(relation.foreignKey)]) class Tower.ModelRelationBelongsToCursor extends Tower.ModelRelationCursor @reopenClass makeOld: -> array = [] array.isCursor = true Tower.ModelRelationCursorMixin.apply(array) Tower.ModelRelationBelongsToCursorMixin.apply(array) @include Tower.ModelRelationBelongsToCursorMixin module.exports = Tower.ModelRelationBelongsTo
true
_ = Tower._ class Tower.ModelRelationBelongsTo extends Tower.ModelRelation @reopen isBelongsTo: true init: (owner, name, options = {}) -> @_super arguments... @foreignKey = PI:KEY:<KEY>END_PI" owner.field(@foreignKey, type: "Id") # this is kind of a hack until it becomes clear how to accomplish in the ember api mixins = owner.PrototypeMixin.mixins computed = mixins[mixins.length - 1].properties[@foreignKey] computed._dependentKeys.push(@name) if @polymorphic @foreignType = "#{name}Type" owner.field(@foreignType, type: 'String') #owner.prototype[name] = -> # @relation(name) Tower.ModelRelationBelongsToCursorMixin = Ember.Mixin.create isBelongsTo: true # need to do something here about Reflection clonePrototype: -> clone = @concat() clone.isCursor = true Tower.ModelRelationCursorMixin.apply(clone) Tower.ModelRelationBelongsToCursorMixin.apply(clone) find: -> @compile() @_super(arguments...) compile: -> relation = @relation # @todo shouldn't have to do $in here... @where(id: $in: [@owner.get(relation.foreignKey)]) class Tower.ModelRelationBelongsToCursor extends Tower.ModelRelationCursor @reopenClass makeOld: -> array = [] array.isCursor = true Tower.ModelRelationCursorMixin.apply(array) Tower.ModelRelationBelongsToCursorMixin.apply(array) @include Tower.ModelRelationBelongsToCursorMixin module.exports = Tower.ModelRelationBelongsTo
[ { "context": " 'From', field: 'from'}\n ] }\n\n { name: \"Shakespeare\", url: '/shakespeare/:name/:from', fields: [\n ", "end": 856, "score": 0.9992568492889404, "start": 845, "tag": "NAME", "value": "Shakespeare" }, { "context": " 'From', field: 'from'}\n ] }\n\n ...
lib/operations.coffee
philipmuir/foaas
1
module.exports = (app) -> app.get '/operations', (req, res) -> res.send [ { name: "Fuck Off", url: '/off/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck You", url: '/you/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck This", url: '/this/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck That", url: '/that/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck Everything", url: '/everything/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck Everyone", url: '/everyone/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Shakespeare", url: '/shakespeare/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Linus", url: '/linus/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "King", url: '/king/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck me Pink", url: '/pink/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck my Life", url: '/life/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck me with a chainsaw", url: '/chainsaw/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Hide-and-go-fuck-yourself", url: '/outside/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck you very much", url: '/outside/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck [x]", url: '/:thing/:from', fields: [ { name: 'Thing', field: 'thing'} { name: 'From', field: 'from'} ] } { name: "Flying Fuck", url: '/flying/:from', fields: [ { name: 'From', field: 'from'} ] } ]
137680
module.exports = (app) -> app.get '/operations', (req, res) -> res.send [ { name: "Fuck Off", url: '/off/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck You", url: '/you/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck This", url: '/this/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck That", url: '/that/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck Everything", url: '/everything/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck Everyone", url: '/everyone/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "<NAME>", url: '/shakespeare/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "<NAME>", url: '/linus/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "King", url: '/king/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck me Pink", url: '/pink/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck my Life", url: '/life/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck me with a chainsaw", url: '/chainsaw/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Hide-and-go-fuck-yourself", url: '/outside/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck you very much", url: '/outside/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck [x]", url: '/:thing/:from', fields: [ { name: 'Thing', field: 'thing'} { name: 'From', field: 'from'} ] } { name: "Flying Fuck", url: '/flying/:from', fields: [ { name: 'From', field: 'from'} ] } ]
true
module.exports = (app) -> app.get '/operations', (req, res) -> res.send [ { name: "Fuck Off", url: '/off/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck You", url: '/you/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck This", url: '/this/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck That", url: '/that/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck Everything", url: '/everything/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck Everyone", url: '/everyone/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "PI:NAME:<NAME>END_PI", url: '/shakespeare/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "PI:NAME:<NAME>END_PI", url: '/linus/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "King", url: '/king/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck me Pink", url: '/pink/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck my Life", url: '/life/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck me with a chainsaw", url: '/chainsaw/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Hide-and-go-fuck-yourself", url: '/outside/:name/:from', fields: [ { name: 'Name', field: 'name'} { name: 'From', field: 'from'} ] } { name: "Fuck you very much", url: '/outside/:from', fields: [ { name: 'From', field: 'from'} ] } { name: "Fuck [x]", url: '/:thing/:from', fields: [ { name: 'Thing', field: 'thing'} { name: 'From', field: 'from'} ] } { name: "Flying Fuck", url: '/flying/:from', fields: [ { name: 'From', field: 'from'} ] } ]
[ { "context": "cle',\n display: 'The Friendship and Flight of Andy Warhol, Philip Pearlstein, and ...',\n image_url: 'h", "end": 339, "score": 0.9997984170913696, "start": 328, "tag": "NAME", "value": "Andy Warhol" }, { "context": "isplay: 'The Friendship and Flight of Andy ...
src/mobile/components/search_results/test/template.coffee
kanaabe/force
1
fs = require 'fs' jade = require 'jade' path = require 'path' fixtures = require '../../../test/helpers/fixtures' SearchResult = require '../../../models/search_result' describe 'result.jade', -> before -> @fixture = { model: 'article', display_model: 'Article', display: 'The Friendship and Flight of Andy Warhol, Philip Pearlstein, and ...', image_url: 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSlZL9Q-fcFKGOvBsHCfxI6JpcJr5-hUMACOlhD-1j2l-rOahjx-ZUKmAg', display_model: 'article', location: '/article/artsy-editorial-from-pittsburgh-to-promise-the-friendship-and-flight', about: 'Jun 17, 2015 ... In 1949, two young, aspiring artists, Philip Pearlstein and Andy Warhol, bought \nbus tickets out of Pittsburgh. They arrived in New York with a few ...' } filename = path.resolve __dirname, "../result.jade" @render = jade.compile(fs.readFileSync(filename), { filename: filename }) it 'doesnt allow unsafe xss-ey html', -> @fixture.about = '<script>alert(1)</script>' html = @render(result: new SearchResult @fixture) html.should.not.containEql '<script>'
14255
fs = require 'fs' jade = require 'jade' path = require 'path' fixtures = require '../../../test/helpers/fixtures' SearchResult = require '../../../models/search_result' describe 'result.jade', -> before -> @fixture = { model: 'article', display_model: 'Article', display: 'The Friendship and Flight of <NAME>, <NAME>, and ...', image_url: 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSlZL9Q-fcFKGOvBsHCfxI6JpcJr5-hUMACOlhD-1j2l-rOahjx-ZUKmAg', display_model: 'article', location: '/article/artsy-editorial-from-pittsburgh-to-promise-the-friendship-and-flight', about: 'Jun 17, 2015 ... In 1949, two young, aspiring artists, <NAME> and <NAME>, bought \nbus tickets out of Pittsburgh. They arrived in New York with a few ...' } filename = path.resolve __dirname, "../result.jade" @render = jade.compile(fs.readFileSync(filename), { filename: filename }) it 'doesnt allow unsafe xss-ey html', -> @fixture.about = '<script>alert(1)</script>' html = @render(result: new SearchResult @fixture) html.should.not.containEql '<script>'
true
fs = require 'fs' jade = require 'jade' path = require 'path' fixtures = require '../../../test/helpers/fixtures' SearchResult = require '../../../models/search_result' describe 'result.jade', -> before -> @fixture = { model: 'article', display_model: 'Article', display: 'The Friendship and Flight of PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI, and ...', image_url: 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSlZL9Q-fcFKGOvBsHCfxI6JpcJr5-hUMACOlhD-1j2l-rOahjx-ZUKmAg', display_model: 'article', location: '/article/artsy-editorial-from-pittsburgh-to-promise-the-friendship-and-flight', about: 'Jun 17, 2015 ... In 1949, two young, aspiring artists, PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI, bought \nbus tickets out of Pittsburgh. They arrived in New York with a few ...' } filename = path.resolve __dirname, "../result.jade" @render = jade.compile(fs.readFileSync(filename), { filename: filename }) it 'doesnt allow unsafe xss-ey html', -> @fixture.about = '<script>alert(1)</script>' html = @render(result: new SearchResult @fixture) html.should.not.containEql '<script>'
[ { "context": " 15\n $or:\n content:\n $like: \"Dummy\"\n featured:\n $exists:true\n $", "end": 6500, "score": 0.9738500714302063, "start": 6495, "tag": "NAME", "value": "Dummy" }, { "context": "me'}\"\n \n a = new testModel\n first_n...
test/bq-test.coffee
apiaryio/backbone_query
40
# Requires assert = require('assert') {QueryCollection} = require "../src/backbone-query" Backbone = require('backbone') create = -> new QueryCollection [ {title:"Home", colors:["red","yellow","blue"], likes:12, featured:true, content: "Dummy content about coffeescript"} {title:"About", colors:["red"], likes:2, featured:true, content: "dummy content about javascript"} {title:"Contact", colors:["red","blue"], likes:20, content: "Dummy content about PHP"} ] describe "Backbone Query Tests", -> it "Equals query", -> a = create() result = a.query title:"Home" assert.equal result.length, 1 assert.equal result[0].get("title"), "Home" result = a.whereBy colors: "blue" assert.equal result.length, 2 result = a.whereBy colors: ["red", "blue"] assert.equal result.length, 1 it "Simple equals query (no results)", -> a = create() result = a.whereBy title:"Homes" assert.equal result.length, 0 it "Simple equals query with explicit $equal", -> a = create() result = a.whereBy title: {$equal: "About"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$contains operator", -> a = create() result = a.whereBy colors: {$contains: "blue"} assert.equal result.length, 2 it "$ne operator", -> a = create() result = a.whereBy title: {$ne: "Home"} assert.equal result.length, 2 it "$lt operator", -> a = create() result = a.whereBy likes: {$lt: 12} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$lte operator", -> a = create() result = a.whereBy likes: {$lte: 12} assert.equal result.length, 2 it "$gt operator", -> a = create() result = a.whereBy likes: {$gt: 12} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$gte operator", -> a = create() result = a.whereBy likes: {$gte: 12} assert.equal result.length, 2 it "$between operator", -> a = create() result = a.whereBy likes: {$between: [1,5]} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$in operator", -> a = create() result = a.whereBy title: {$in: ["Home","About"]} assert.equal result.length, 2 it "$in operator with wrong query value", -> a = create() result = a.whereBy title: {$in: "Home"} assert.equal result.length, 0 it "$nin operator", -> a = create() result = a.whereBy title: {$nin: ["Home","About"]} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$all operator", -> a = create() result = a.whereBy colors: {$all: ["red","blue"]} assert.equal result.length, 2 it "$all operator (wrong values)", -> a = create() result = a.whereBy title: {$all: ["red","blue"]} assert.equal result.length, 0 result = a.whereBy colors: {$all: "red"} assert.equal result.length, 0 it "$any operator", -> a = create() result = a.whereBy colors: {$any: ["red","blue"]} assert.equal result.length, 3 result = a.whereBy colors: {$any: ["yellow","blue"]} assert.equal result.length, 2 it "$size operator", -> a = create() result = a.whereBy colors: {$size: 3} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$exists operator", -> a = create() result = a.whereBy featured: {$exists: true} assert.equal result.length, 2 it "$has operator", -> a = create() result = a.whereBy featured: {$exists: false} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$like operator", -> a = create() result = a.whereBy content: {$like: "javascript"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$like operator 2", -> a = create() result = a.whereBy content: {$like: "content"} assert.equal result.length, 3 it "$likeI operator", -> a = create() result = a.whereBy content: {$likeI: "dummy"} assert.equal result.length, 3 result = a.whereBy content: {$like: "dummy"} assert.equal result.length, 1 it "$regex", -> a = create() result = a.whereBy content: {$regex: /javascript/gi} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$regex2", -> a = create() result = a.whereBy content: {$regex: /dummy/} assert.equal result.length, 1 it "$regex3", -> a = create() result = a.whereBy content: {$regex: /dummy/i} assert.equal result.length, 3 it "$regex4", -> a = create() result = a.whereBy content: /javascript/i assert.equal result.length, 1 it "$cb - callback", -> a = create() result = a.whereBy title: {$cb: (attr) -> attr.charAt(0).toLowerCase() is "c"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$cb - callback - checking 'this' is the model", -> a = create() result = a.whereBy title: $cb: (attr) -> @get("title") is "Home" assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$and operator", -> a = create() result = a.whereBy likes: {$gt: 5}, colors: {$contains: "yellow"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$and operator (explicit)", -> a = create() result = a.whereBy $and: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$or operator", -> a = create() result = a.whereBy $or: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 2 it "$or2 operator", -> a = create() result = a.whereBy $or: {likes: {$gt: 5}, featured: true} assert.equal result.length, 3 it "$nor operator", -> a = create() result = a.whereBy $nor: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "Compound Queries", -> a = create() result = a.whereBy $and: {likes: {$gt: 5}}, $or: {content: {$like: "PHP"}, colors: {$contains: "yellow"}} assert.equal result.length, 2 result = a.whereBy $and: likes: $lt: 15 $or: content: $like: "Dummy" featured: $exists:true $not: colors: $contains: "yellow" assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "Limit", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:2} assert.equal result.length, 2 it "Offset", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:2, offset:2} assert.equal result.length, 1 it "Page", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:3, page:2} assert.equal result.length, 0 it "Sorder by model key", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy:"likes"} assert.equal result.length, 3 assert.equal result[0].get("title"), "About" assert.equal result[1].get("title"), "Home" assert.equal result[2].get("title"), "Contact" it "Sorder by model key with descending order", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy:"likes", order:"desc"} assert.equal result.length, 3 assert.equal result[2].get("title"), "About" assert.equal result[1].get("title"), "Home" assert.equal result[0].get("title"), "Contact" it "Sorder by function", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 assert.equal result[2].get("title"), "About" assert.equal result[0].get("title"), "Home" assert.equal result[1].get("title"), "Contact" it "cache", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 a.remove result.at(0) result = a.whereBy {likes: {$gt: 1}}, {sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 2 result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 it "cache with multiple collections", -> a = create() b = create() b.remove b.at(0) assert.equal b.length, 2 assert.equal a.length, 3 a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 3 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 a.remove a_result[0] b.remove b_result[0] a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 3 assert.equal a.length, 2 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 assert.equal b.length, 1 a.resetQueryCache() a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 2 assert.equal a.length, 2 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 assert.equal b.length, 1 it "null attribute with various operators", -> a = create() result = a.whereBy wrong_key: {$like: "test"} assert.equal result.length, 0 result = a.whereBy wrong_key: {$regex: /test/} assert.equal result.length, 0 result = a.whereBy wrong_key: {$contains: "test"} assert.equal result.length, 0 result = a.whereBy wrong_key: {$all: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$any: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$size: 10} assert.equal result.length, 0 result = a.whereBy wrong_key: {$in: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$nin: [12,23]} assert.equal result.length, 0 it "Where method", -> a = create() result = a.whereBy likes: $gt: 5 assert.equal result.length, 2 assert.equal result.models.length, result.length it "$computed", -> class testModel extends Backbone.Model full_name: -> "#{@get 'first_name'} #{@get 'last_name'}" a = new testModel first_name: "Dave" last_name: "Tonge" b = new testModel first_name: "John" last_name: "Smith" c = new QueryCollection [a,b] result = c.query full_name: $computed: "Dave Tonge" assert.equal result.length, 1 assert.equal result[0].get("first_name"), "Dave" result = c.query full_name: $computed: $likeI: "n sm" assert.equal result.length, 1 assert.equal result[0].get("first_name"), "John" it "$elemMatch", -> a = new QueryCollection [ {title: "Home", comments:[ {text:"I like this post"} {text:"I love this post"} {text:"I hate this post"} ]} {title: "About", comments:[ {text:"I like this page"} {text:"I love this page"} {text:"I really like this page"} ]} ] b = new QueryCollection [ {foo: [ {shape: "square", color: "purple", thick: false} {shape: "circle", color: "red", thick: true} ]} {foo: [ {shape: "square", color: "red", thick: true} {shape: "circle", color: "purple", thick: false} ]} ] text_search = {$likeI: "love"} result = a.query $or: comments: $elemMatch: text: text_search title: text_search assert.equal result.length, 2 result = a.query $or: comments: $elemMatch: text: /post/ assert.equal result.length, 1 result = a.query $or: comments: $elemMatch: text: /post/ title: /about/i assert.equal result.length, 2 result = a.query $or: comments: $elemMatch: text: /really/ assert.equal result.length, 1 result = b.query foo: $elemMatch: shape:"square" color:"purple" assert.equal result.length, 1 assert.equal result[0].get("foo")[0].shape, "square" assert.equal result[0].get("foo")[0].color, "purple" assert.equal result[0].get("foo")[0].thick, false it "$any and $all", -> a = name: "test", tags1: ["red","yellow"], tags2: ["orange", "green", "red", "blue"] b = name: "test1", tags1: ["purple","blue"], tags2: ["orange", "red", "blue"] c = name: "test2", tags1: ["black","yellow"], tags2: ["green", "orange", "blue"] d = name: "test3", tags1: ["red","yellow","blue"], tags2: ["green"] e = new QueryCollection [a,b,c,d] result = e.query tags1: $any: ["red","purple"] # should match a, b, d tags2: $all: ["orange","green"] # should match a, c assert.equal result.length, 1 assert.equal result[0].get("name"), "test" it "$elemMatch - compound queries", -> a = new QueryCollection [ {title: "Home", comments:[ {text:"I like this post"} {text:"I love this post"} {text:"I hate this post"} ]} {title: "About", comments:[ {text:"I like this page"} {text:"I love this page"} {text:"I really like this page"} ]} ] result = a.query comments: $elemMatch: $not: text:/page/ assert.equal result.length, 1 # Test from RobW - https://github.com/Rob--W it "Explicit $and combined with matching $or must return the correct number of items", -> Col = new QueryCollection [ {equ:'ok', same: 'ok'}, {equ:'ok', same: 'ok'} ] result = Col.query $and: equ: 'ok' # Matches both items $or: same: 'ok' # Matches both items assert.equal result.length, 2 # Test from RobW - https://github.com/Rob--W it "Implicit $and consisting of non-matching subquery and $or must return empty list", -> Col = new QueryCollection [ {equ:'ok', same: 'ok'}, {equ:'ok', same: 'ok'} ] result = Col.query equ: 'bogus' # Matches nothing $or: same: 'ok' # Matches all items, but due to implicit $and, this subquery should not affect the result assert.equal result.length, 0 it "Testing nested compound operators", -> a = create() result = a.whereBy $and: colors: $contains: "blue" # Matches 1,3 $or: featured:true # Matches 1,2 likes:12 # Matches 1 # And only matches 1 $or:[ {content:$like:"dummy"} # Matches 2 {content:$like:"Dummy"} # Matches 1,3 ] # Or matches 3 assert.equal result.length, 1 result = a.whereBy $and: colors: $contains: "blue" # Matches 1,3 $or: featured:true # Matches 1,2 likes:20 # Matches 3 # And only matches 2 $or:[ {content:$like:"dummy"} # Matches 2 {content:$like:"Dummy"} # Matches 1,3 ] # Or matches 3 assert.equal result.length, 2 it "works with queries supplied as arrays", -> a = create() result = a.query $or: [ {title:"Home"} {title:"About"} ] assert.equal result.length, 2 assert.equal result[0].get("title"), "Home" assert.equal result[1].get("title"), "About"
62987
# Requires assert = require('assert') {QueryCollection} = require "../src/backbone-query" Backbone = require('backbone') create = -> new QueryCollection [ {title:"Home", colors:["red","yellow","blue"], likes:12, featured:true, content: "Dummy content about coffeescript"} {title:"About", colors:["red"], likes:2, featured:true, content: "dummy content about javascript"} {title:"Contact", colors:["red","blue"], likes:20, content: "Dummy content about PHP"} ] describe "Backbone Query Tests", -> it "Equals query", -> a = create() result = a.query title:"Home" assert.equal result.length, 1 assert.equal result[0].get("title"), "Home" result = a.whereBy colors: "blue" assert.equal result.length, 2 result = a.whereBy colors: ["red", "blue"] assert.equal result.length, 1 it "Simple equals query (no results)", -> a = create() result = a.whereBy title:"Homes" assert.equal result.length, 0 it "Simple equals query with explicit $equal", -> a = create() result = a.whereBy title: {$equal: "About"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$contains operator", -> a = create() result = a.whereBy colors: {$contains: "blue"} assert.equal result.length, 2 it "$ne operator", -> a = create() result = a.whereBy title: {$ne: "Home"} assert.equal result.length, 2 it "$lt operator", -> a = create() result = a.whereBy likes: {$lt: 12} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$lte operator", -> a = create() result = a.whereBy likes: {$lte: 12} assert.equal result.length, 2 it "$gt operator", -> a = create() result = a.whereBy likes: {$gt: 12} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$gte operator", -> a = create() result = a.whereBy likes: {$gte: 12} assert.equal result.length, 2 it "$between operator", -> a = create() result = a.whereBy likes: {$between: [1,5]} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$in operator", -> a = create() result = a.whereBy title: {$in: ["Home","About"]} assert.equal result.length, 2 it "$in operator with wrong query value", -> a = create() result = a.whereBy title: {$in: "Home"} assert.equal result.length, 0 it "$nin operator", -> a = create() result = a.whereBy title: {$nin: ["Home","About"]} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$all operator", -> a = create() result = a.whereBy colors: {$all: ["red","blue"]} assert.equal result.length, 2 it "$all operator (wrong values)", -> a = create() result = a.whereBy title: {$all: ["red","blue"]} assert.equal result.length, 0 result = a.whereBy colors: {$all: "red"} assert.equal result.length, 0 it "$any operator", -> a = create() result = a.whereBy colors: {$any: ["red","blue"]} assert.equal result.length, 3 result = a.whereBy colors: {$any: ["yellow","blue"]} assert.equal result.length, 2 it "$size operator", -> a = create() result = a.whereBy colors: {$size: 3} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$exists operator", -> a = create() result = a.whereBy featured: {$exists: true} assert.equal result.length, 2 it "$has operator", -> a = create() result = a.whereBy featured: {$exists: false} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$like operator", -> a = create() result = a.whereBy content: {$like: "javascript"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$like operator 2", -> a = create() result = a.whereBy content: {$like: "content"} assert.equal result.length, 3 it "$likeI operator", -> a = create() result = a.whereBy content: {$likeI: "dummy"} assert.equal result.length, 3 result = a.whereBy content: {$like: "dummy"} assert.equal result.length, 1 it "$regex", -> a = create() result = a.whereBy content: {$regex: /javascript/gi} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$regex2", -> a = create() result = a.whereBy content: {$regex: /dummy/} assert.equal result.length, 1 it "$regex3", -> a = create() result = a.whereBy content: {$regex: /dummy/i} assert.equal result.length, 3 it "$regex4", -> a = create() result = a.whereBy content: /javascript/i assert.equal result.length, 1 it "$cb - callback", -> a = create() result = a.whereBy title: {$cb: (attr) -> attr.charAt(0).toLowerCase() is "c"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$cb - callback - checking 'this' is the model", -> a = create() result = a.whereBy title: $cb: (attr) -> @get("title") is "Home" assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$and operator", -> a = create() result = a.whereBy likes: {$gt: 5}, colors: {$contains: "yellow"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$and operator (explicit)", -> a = create() result = a.whereBy $and: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$or operator", -> a = create() result = a.whereBy $or: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 2 it "$or2 operator", -> a = create() result = a.whereBy $or: {likes: {$gt: 5}, featured: true} assert.equal result.length, 3 it "$nor operator", -> a = create() result = a.whereBy $nor: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "Compound Queries", -> a = create() result = a.whereBy $and: {likes: {$gt: 5}}, $or: {content: {$like: "PHP"}, colors: {$contains: "yellow"}} assert.equal result.length, 2 result = a.whereBy $and: likes: $lt: 15 $or: content: $like: "<NAME>" featured: $exists:true $not: colors: $contains: "yellow" assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "Limit", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:2} assert.equal result.length, 2 it "Offset", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:2, offset:2} assert.equal result.length, 1 it "Page", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:3, page:2} assert.equal result.length, 0 it "Sorder by model key", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy:"likes"} assert.equal result.length, 3 assert.equal result[0].get("title"), "About" assert.equal result[1].get("title"), "Home" assert.equal result[2].get("title"), "Contact" it "Sorder by model key with descending order", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy:"likes", order:"desc"} assert.equal result.length, 3 assert.equal result[2].get("title"), "About" assert.equal result[1].get("title"), "Home" assert.equal result[0].get("title"), "Contact" it "Sorder by function", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 assert.equal result[2].get("title"), "About" assert.equal result[0].get("title"), "Home" assert.equal result[1].get("title"), "Contact" it "cache", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 a.remove result.at(0) result = a.whereBy {likes: {$gt: 1}}, {sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 2 result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 it "cache with multiple collections", -> a = create() b = create() b.remove b.at(0) assert.equal b.length, 2 assert.equal a.length, 3 a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 3 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 a.remove a_result[0] b.remove b_result[0] a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 3 assert.equal a.length, 2 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 assert.equal b.length, 1 a.resetQueryCache() a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 2 assert.equal a.length, 2 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 assert.equal b.length, 1 it "null attribute with various operators", -> a = create() result = a.whereBy wrong_key: {$like: "test"} assert.equal result.length, 0 result = a.whereBy wrong_key: {$regex: /test/} assert.equal result.length, 0 result = a.whereBy wrong_key: {$contains: "test"} assert.equal result.length, 0 result = a.whereBy wrong_key: {$all: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$any: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$size: 10} assert.equal result.length, 0 result = a.whereBy wrong_key: {$in: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$nin: [12,23]} assert.equal result.length, 0 it "Where method", -> a = create() result = a.whereBy likes: $gt: 5 assert.equal result.length, 2 assert.equal result.models.length, result.length it "$computed", -> class testModel extends Backbone.Model full_name: -> "#{@get 'first_name'} #{@get 'last_name'}" a = new testModel first_name: "<NAME>" last_name: "<NAME>" b = new testModel first_name: "<NAME>" last_name: "<NAME>" c = new QueryCollection [a,b] result = c.query full_name: $computed: "<NAME>" assert.equal result.length, 1 assert.equal result[0].get("first_name"), "<NAME>" result = c.query full_name: $computed: $likeI: "n sm" assert.equal result.length, 1 assert.equal result[0].get("first_name"), "<NAME>" it "$elemMatch", -> a = new QueryCollection [ {title: "Home", comments:[ {text:"I like this post"} {text:"I love this post"} {text:"I hate this post"} ]} {title: "About", comments:[ {text:"I like this page"} {text:"I love this page"} {text:"I really like this page"} ]} ] b = new QueryCollection [ {foo: [ {shape: "square", color: "purple", thick: false} {shape: "circle", color: "red", thick: true} ]} {foo: [ {shape: "square", color: "red", thick: true} {shape: "circle", color: "purple", thick: false} ]} ] text_search = {$likeI: "love"} result = a.query $or: comments: $elemMatch: text: text_search title: text_search assert.equal result.length, 2 result = a.query $or: comments: $elemMatch: text: /post/ assert.equal result.length, 1 result = a.query $or: comments: $elemMatch: text: /post/ title: /about/i assert.equal result.length, 2 result = a.query $or: comments: $elemMatch: text: /really/ assert.equal result.length, 1 result = b.query foo: $elemMatch: shape:"square" color:"purple" assert.equal result.length, 1 assert.equal result[0].get("foo")[0].shape, "square" assert.equal result[0].get("foo")[0].color, "purple" assert.equal result[0].get("foo")[0].thick, false it "$any and $all", -> a = name: "test", tags1: ["red","yellow"], tags2: ["orange", "green", "red", "blue"] b = name: "test1", tags1: ["purple","blue"], tags2: ["orange", "red", "blue"] c = name: "test2", tags1: ["black","yellow"], tags2: ["green", "orange", "blue"] d = name: "test<NAME>", tags1: ["red","yellow","blue"], tags2: ["green"] e = new QueryCollection [a,b,c,d] result = e.query tags1: $any: ["red","purple"] # should match a, b, d tags2: $all: ["orange","green"] # should match a, c assert.equal result.length, 1 assert.equal result[0].get("name"), "test" it "$elemMatch - compound queries", -> a = new QueryCollection [ {title: "Home", comments:[ {text:"I like this post"} {text:"I love this post"} {text:"I hate this post"} ]} {title: "About", comments:[ {text:"I like this page"} {text:"I love this page"} {text:"I really like this page"} ]} ] result = a.query comments: $elemMatch: $not: text:/page/ assert.equal result.length, 1 # Test from RobW - https://github.com/Rob--W it "Explicit $and combined with matching $or must return the correct number of items", -> Col = new QueryCollection [ {equ:'ok', same: 'ok'}, {equ:'ok', same: 'ok'} ] result = Col.query $and: equ: 'ok' # Matches both items $or: same: 'ok' # Matches both items assert.equal result.length, 2 # Test from RobW - https://github.com/Rob--W it "Implicit $and consisting of non-matching subquery and $or must return empty list", -> Col = new QueryCollection [ {equ:'ok', same: 'ok'}, {equ:'ok', same: 'ok'} ] result = Col.query equ: 'bogus' # Matches nothing $or: same: 'ok' # Matches all items, but due to implicit $and, this subquery should not affect the result assert.equal result.length, 0 it "Testing nested compound operators", -> a = create() result = a.whereBy $and: colors: $contains: "blue" # Matches 1,3 $or: featured:true # Matches 1,2 likes:12 # Matches 1 # And only matches 1 $or:[ {content:$like:"dummy"} # Matches 2 {content:$like:"Dummy"} # Matches 1,3 ] # Or matches 3 assert.equal result.length, 1 result = a.whereBy $and: colors: $contains: "blue" # Matches 1,3 $or: featured:true # Matches 1,2 likes:20 # Matches 3 # And only matches 2 $or:[ {content:$like:"dummy"} # Matches 2 {content:$like:"Dummy"} # Matches 1,3 ] # Or matches 3 assert.equal result.length, 2 it "works with queries supplied as arrays", -> a = create() result = a.query $or: [ {title:"Home"} {title:"About"} ] assert.equal result.length, 2 assert.equal result[0].get("title"), "Home" assert.equal result[1].get("title"), "About"
true
# Requires assert = require('assert') {QueryCollection} = require "../src/backbone-query" Backbone = require('backbone') create = -> new QueryCollection [ {title:"Home", colors:["red","yellow","blue"], likes:12, featured:true, content: "Dummy content about coffeescript"} {title:"About", colors:["red"], likes:2, featured:true, content: "dummy content about javascript"} {title:"Contact", colors:["red","blue"], likes:20, content: "Dummy content about PHP"} ] describe "Backbone Query Tests", -> it "Equals query", -> a = create() result = a.query title:"Home" assert.equal result.length, 1 assert.equal result[0].get("title"), "Home" result = a.whereBy colors: "blue" assert.equal result.length, 2 result = a.whereBy colors: ["red", "blue"] assert.equal result.length, 1 it "Simple equals query (no results)", -> a = create() result = a.whereBy title:"Homes" assert.equal result.length, 0 it "Simple equals query with explicit $equal", -> a = create() result = a.whereBy title: {$equal: "About"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$contains operator", -> a = create() result = a.whereBy colors: {$contains: "blue"} assert.equal result.length, 2 it "$ne operator", -> a = create() result = a.whereBy title: {$ne: "Home"} assert.equal result.length, 2 it "$lt operator", -> a = create() result = a.whereBy likes: {$lt: 12} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$lte operator", -> a = create() result = a.whereBy likes: {$lte: 12} assert.equal result.length, 2 it "$gt operator", -> a = create() result = a.whereBy likes: {$gt: 12} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$gte operator", -> a = create() result = a.whereBy likes: {$gte: 12} assert.equal result.length, 2 it "$between operator", -> a = create() result = a.whereBy likes: {$between: [1,5]} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$in operator", -> a = create() result = a.whereBy title: {$in: ["Home","About"]} assert.equal result.length, 2 it "$in operator with wrong query value", -> a = create() result = a.whereBy title: {$in: "Home"} assert.equal result.length, 0 it "$nin operator", -> a = create() result = a.whereBy title: {$nin: ["Home","About"]} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$all operator", -> a = create() result = a.whereBy colors: {$all: ["red","blue"]} assert.equal result.length, 2 it "$all operator (wrong values)", -> a = create() result = a.whereBy title: {$all: ["red","blue"]} assert.equal result.length, 0 result = a.whereBy colors: {$all: "red"} assert.equal result.length, 0 it "$any operator", -> a = create() result = a.whereBy colors: {$any: ["red","blue"]} assert.equal result.length, 3 result = a.whereBy colors: {$any: ["yellow","blue"]} assert.equal result.length, 2 it "$size operator", -> a = create() result = a.whereBy colors: {$size: 3} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$exists operator", -> a = create() result = a.whereBy featured: {$exists: true} assert.equal result.length, 2 it "$has operator", -> a = create() result = a.whereBy featured: {$exists: false} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$like operator", -> a = create() result = a.whereBy content: {$like: "javascript"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$like operator 2", -> a = create() result = a.whereBy content: {$like: "content"} assert.equal result.length, 3 it "$likeI operator", -> a = create() result = a.whereBy content: {$likeI: "dummy"} assert.equal result.length, 3 result = a.whereBy content: {$like: "dummy"} assert.equal result.length, 1 it "$regex", -> a = create() result = a.whereBy content: {$regex: /javascript/gi} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "$regex2", -> a = create() result = a.whereBy content: {$regex: /dummy/} assert.equal result.length, 1 it "$regex3", -> a = create() result = a.whereBy content: {$regex: /dummy/i} assert.equal result.length, 3 it "$regex4", -> a = create() result = a.whereBy content: /javascript/i assert.equal result.length, 1 it "$cb - callback", -> a = create() result = a.whereBy title: {$cb: (attr) -> attr.charAt(0).toLowerCase() is "c"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Contact" it "$cb - callback - checking 'this' is the model", -> a = create() result = a.whereBy title: $cb: (attr) -> @get("title") is "Home" assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$and operator", -> a = create() result = a.whereBy likes: {$gt: 5}, colors: {$contains: "yellow"} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$and operator (explicit)", -> a = create() result = a.whereBy $and: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "Home" it "$or operator", -> a = create() result = a.whereBy $or: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 2 it "$or2 operator", -> a = create() result = a.whereBy $or: {likes: {$gt: 5}, featured: true} assert.equal result.length, 3 it "$nor operator", -> a = create() result = a.whereBy $nor: {likes: {$gt: 5}, colors: {$contains: "yellow"}} assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "Compound Queries", -> a = create() result = a.whereBy $and: {likes: {$gt: 5}}, $or: {content: {$like: "PHP"}, colors: {$contains: "yellow"}} assert.equal result.length, 2 result = a.whereBy $and: likes: $lt: 15 $or: content: $like: "PI:NAME:<NAME>END_PI" featured: $exists:true $not: colors: $contains: "yellow" assert.equal result.length, 1 assert.equal result.at(0).get("title"), "About" it "Limit", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:2} assert.equal result.length, 2 it "Offset", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:2, offset:2} assert.equal result.length, 1 it "Page", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {limit:3, page:2} assert.equal result.length, 0 it "Sorder by model key", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy:"likes"} assert.equal result.length, 3 assert.equal result[0].get("title"), "About" assert.equal result[1].get("title"), "Home" assert.equal result[2].get("title"), "Contact" it "Sorder by model key with descending order", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy:"likes", order:"desc"} assert.equal result.length, 3 assert.equal result[2].get("title"), "About" assert.equal result[1].get("title"), "Home" assert.equal result[0].get("title"), "Contact" it "Sorder by function", -> a = create() result = a.query {likes: {$gt: 1}}, {sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 assert.equal result[2].get("title"), "About" assert.equal result[0].get("title"), "Home" assert.equal result[1].get("title"), "Contact" it "cache", -> a = create() result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 a.remove result.at(0) result = a.whereBy {likes: {$gt: 1}}, {sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 2 result = a.whereBy {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal result.length, 3 it "cache with multiple collections", -> a = create() b = create() b.remove b.at(0) assert.equal b.length, 2 assert.equal a.length, 3 a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 3 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 a.remove a_result[0] b.remove b_result[0] a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 3 assert.equal a.length, 2 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 assert.equal b.length, 1 a.resetQueryCache() a_result = a.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal a_result.length, 2 assert.equal a.length, 2 b_result = b.query {likes: {$gt: 1}}, {cache:true, sortBy: (model) -> model.get("title").charAt(2) } assert.equal b_result.length, 2 assert.equal b.length, 1 it "null attribute with various operators", -> a = create() result = a.whereBy wrong_key: {$like: "test"} assert.equal result.length, 0 result = a.whereBy wrong_key: {$regex: /test/} assert.equal result.length, 0 result = a.whereBy wrong_key: {$contains: "test"} assert.equal result.length, 0 result = a.whereBy wrong_key: {$all: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$any: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$size: 10} assert.equal result.length, 0 result = a.whereBy wrong_key: {$in: [12,23]} assert.equal result.length, 0 result = a.whereBy wrong_key: {$nin: [12,23]} assert.equal result.length, 0 it "Where method", -> a = create() result = a.whereBy likes: $gt: 5 assert.equal result.length, 2 assert.equal result.models.length, result.length it "$computed", -> class testModel extends Backbone.Model full_name: -> "#{@get 'first_name'} #{@get 'last_name'}" a = new testModel first_name: "PI:NAME:<NAME>END_PI" last_name: "PI:NAME:<NAME>END_PI" b = new testModel first_name: "PI:NAME:<NAME>END_PI" last_name: "PI:NAME:<NAME>END_PI" c = new QueryCollection [a,b] result = c.query full_name: $computed: "PI:NAME:<NAME>END_PI" assert.equal result.length, 1 assert.equal result[0].get("first_name"), "PI:NAME:<NAME>END_PI" result = c.query full_name: $computed: $likeI: "n sm" assert.equal result.length, 1 assert.equal result[0].get("first_name"), "PI:NAME:<NAME>END_PI" it "$elemMatch", -> a = new QueryCollection [ {title: "Home", comments:[ {text:"I like this post"} {text:"I love this post"} {text:"I hate this post"} ]} {title: "About", comments:[ {text:"I like this page"} {text:"I love this page"} {text:"I really like this page"} ]} ] b = new QueryCollection [ {foo: [ {shape: "square", color: "purple", thick: false} {shape: "circle", color: "red", thick: true} ]} {foo: [ {shape: "square", color: "red", thick: true} {shape: "circle", color: "purple", thick: false} ]} ] text_search = {$likeI: "love"} result = a.query $or: comments: $elemMatch: text: text_search title: text_search assert.equal result.length, 2 result = a.query $or: comments: $elemMatch: text: /post/ assert.equal result.length, 1 result = a.query $or: comments: $elemMatch: text: /post/ title: /about/i assert.equal result.length, 2 result = a.query $or: comments: $elemMatch: text: /really/ assert.equal result.length, 1 result = b.query foo: $elemMatch: shape:"square" color:"purple" assert.equal result.length, 1 assert.equal result[0].get("foo")[0].shape, "square" assert.equal result[0].get("foo")[0].color, "purple" assert.equal result[0].get("foo")[0].thick, false it "$any and $all", -> a = name: "test", tags1: ["red","yellow"], tags2: ["orange", "green", "red", "blue"] b = name: "test1", tags1: ["purple","blue"], tags2: ["orange", "red", "blue"] c = name: "test2", tags1: ["black","yellow"], tags2: ["green", "orange", "blue"] d = name: "testPI:NAME:<NAME>END_PI", tags1: ["red","yellow","blue"], tags2: ["green"] e = new QueryCollection [a,b,c,d] result = e.query tags1: $any: ["red","purple"] # should match a, b, d tags2: $all: ["orange","green"] # should match a, c assert.equal result.length, 1 assert.equal result[0].get("name"), "test" it "$elemMatch - compound queries", -> a = new QueryCollection [ {title: "Home", comments:[ {text:"I like this post"} {text:"I love this post"} {text:"I hate this post"} ]} {title: "About", comments:[ {text:"I like this page"} {text:"I love this page"} {text:"I really like this page"} ]} ] result = a.query comments: $elemMatch: $not: text:/page/ assert.equal result.length, 1 # Test from RobW - https://github.com/Rob--W it "Explicit $and combined with matching $or must return the correct number of items", -> Col = new QueryCollection [ {equ:'ok', same: 'ok'}, {equ:'ok', same: 'ok'} ] result = Col.query $and: equ: 'ok' # Matches both items $or: same: 'ok' # Matches both items assert.equal result.length, 2 # Test from RobW - https://github.com/Rob--W it "Implicit $and consisting of non-matching subquery and $or must return empty list", -> Col = new QueryCollection [ {equ:'ok', same: 'ok'}, {equ:'ok', same: 'ok'} ] result = Col.query equ: 'bogus' # Matches nothing $or: same: 'ok' # Matches all items, but due to implicit $and, this subquery should not affect the result assert.equal result.length, 0 it "Testing nested compound operators", -> a = create() result = a.whereBy $and: colors: $contains: "blue" # Matches 1,3 $or: featured:true # Matches 1,2 likes:12 # Matches 1 # And only matches 1 $or:[ {content:$like:"dummy"} # Matches 2 {content:$like:"Dummy"} # Matches 1,3 ] # Or matches 3 assert.equal result.length, 1 result = a.whereBy $and: colors: $contains: "blue" # Matches 1,3 $or: featured:true # Matches 1,2 likes:20 # Matches 3 # And only matches 2 $or:[ {content:$like:"dummy"} # Matches 2 {content:$like:"Dummy"} # Matches 1,3 ] # Or matches 3 assert.equal result.length, 2 it "works with queries supplied as arrays", -> a = create() result = a.query $or: [ {title:"Home"} {title:"About"} ] assert.equal result.length, 2 assert.equal result[0].get("title"), "Home" assert.equal result[1].get("title"), "About"
[ { "context": "# Copyright Joyent, Inc. and other Node contributors.\n#\n# Permission", "end": 18, "score": 0.997692346572876, "start": 12, "tag": "NAME", "value": "Joyent" } ]
test/simple/test-tls-set-encoding.coffee
lxe/io.coffee
0
# Copyright Joyent, Inc. and other Node contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. common = require("../common") assert = require("assert") tls = require("tls") fs = require("fs") options = key: fs.readFileSync(common.fixturesDir + "/keys/agent2-key.pem") cert: fs.readFileSync(common.fixturesDir + "/keys/agent2-cert.pem") connections = 0 message = "hello world\n" server = tls.Server(options, (socket) -> socket.end message connections++ return ) server.listen common.PORT, -> client = tls.connect( port: common.PORT rejectUnauthorized: false ) buffer = "" client.setEncoding "utf8" client.on "data", (d) -> assert.ok typeof d is "string" buffer += d return client.on "close", -> # readyState is deprecated but we want to make # sure this isn't triggering an assert in lib/net.js # See issue #1069. assert.equal "closed", client.readyState assert.equal buffer, message console.log message server.close() return return process.on "exit", -> assert.equal 1, connections return
212332
# Copyright <NAME>, Inc. and other Node contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. common = require("../common") assert = require("assert") tls = require("tls") fs = require("fs") options = key: fs.readFileSync(common.fixturesDir + "/keys/agent2-key.pem") cert: fs.readFileSync(common.fixturesDir + "/keys/agent2-cert.pem") connections = 0 message = "hello world\n" server = tls.Server(options, (socket) -> socket.end message connections++ return ) server.listen common.PORT, -> client = tls.connect( port: common.PORT rejectUnauthorized: false ) buffer = "" client.setEncoding "utf8" client.on "data", (d) -> assert.ok typeof d is "string" buffer += d return client.on "close", -> # readyState is deprecated but we want to make # sure this isn't triggering an assert in lib/net.js # See issue #1069. assert.equal "closed", client.readyState assert.equal buffer, message console.log message server.close() return return process.on "exit", -> assert.equal 1, connections return
true
# Copyright PI:NAME:<NAME>END_PI, Inc. and other Node contributors. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to permit # persons to whom the Software is furnished to do so, subject to the # following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE # USE OR OTHER DEALINGS IN THE SOFTWARE. common = require("../common") assert = require("assert") tls = require("tls") fs = require("fs") options = key: fs.readFileSync(common.fixturesDir + "/keys/agent2-key.pem") cert: fs.readFileSync(common.fixturesDir + "/keys/agent2-cert.pem") connections = 0 message = "hello world\n" server = tls.Server(options, (socket) -> socket.end message connections++ return ) server.listen common.PORT, -> client = tls.connect( port: common.PORT rejectUnauthorized: false ) buffer = "" client.setEncoding "utf8" client.on "data", (d) -> assert.ok typeof d is "string" buffer += d return client.on "close", -> # readyState is deprecated but we want to make # sure this isn't triggering an assert in lib/net.js # See issue #1069. assert.equal "closed", client.readyState assert.equal buffer, message console.log message server.close() return return process.on "exit", -> assert.equal 1, connections return
[ { "context": "js\n\n PXL.js\n Benjamin Blundell - ben@pxljs.com\n http://pxljs.", "end": 197, "score": 0.9998800158500671, "start": 180, "tag": "NAME", "value": "Benjamin Blundell" }, { "context": " PXL.js\n ...
test/MD5Test.coffee
OniDaito/pxljs
1
### ABOUT .__ _________ __| | \____ \ \/ / | | |_> > <| |__ | __/__/\_ \____/ |__| \/ js PXL.js Benjamin Blundell - ben@pxljs.com http://pxljs.com This software is released under the MIT Licence. See LICENCE.txt for details Testing the MD5 Model loading class ### chai = require 'chai' chai.should() PXLMath = require '../src/math/math' PXLMD5 = require '../src/import/md5' fs = require 'fs' describe 'MD5 tests: ', -> # Not sure I'm happy with the dirname relative stuff but it seems to work :) md5 = new PXLMD5.MD5Model( __dirname + "/../html/models/hellknight/hellknight.md5mesh") md5.skeleton.update() it 'md5 hellknight has 110 joints', -> md5.num_joints.should.equal 110 it 'md5 hellknight should have four child nodes', -> md5.children.length.should.equal 4 it 'md5 bone 10 should be "lhand"', -> md5.skeleton.bones[10].name.should.equal "lhand" it 'md5 vertex 2 on mesh 0 should be 3.36169,-20.2517,100.319', -> Math.round(md5.children[0].geometry.vertices[2].p.x).should.equal 3 #Math.round(md5.children[0].geometry.vertices[2].p.y).should.equal -20 Math.round(md5.children[0].geometry.vertices[2].p.z).should.equal 100 Math.round(md5.children[0].geometry.vertices[2].p.y).should.equal -20 it 'md5 vertex 100 on mesh 0 should be 20.4423, -9.70051, 49.5357', -> Math.round(md5.children[0].geometry.vertices[100].p.x).should.equal 20 Math.round(md5.children[0].geometry.vertices[100].p.y).should.equal -10 Math.round(md5.children[0].geometry.vertices[100].p.z).should.equal 50 it 'md5 luparm pose rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("luparm").rotation_pose m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [0.86, 0.24, -0.44, 0, -0.15, 0.96, 0.22, 0, 0.48, -0.12, 0.87, 0, 0, 0, 0, 1] chai.assert.deepEqual(b,rot_real) it 'md5 waist pose rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("waist").rotation_pose m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist global rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("rwrist").rotation_global m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [0.71,0.44,0.55,0,-0.38,0.9,-0.22,0,-0.59,-0.05,0.81,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist skinned rotation matrix should match C++ Version', -> m = md5.skeleton.getBoneByName("rwrist").skinned_matrix b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist position vector should match C++ Version', -> #md5.skeleton.update() v = md5.skeleton.getBoneByName("rwrist").position_relative round = (n) -> Math.round(n * 100) / 100 b = [round(v.x), round(v.y), round(v.z)] rot_real = [-6.86, 0.23, -1.31] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist Quaternion should match C++ Version', -> v = md5.skeleton.getBoneByName("rwrist").rotation_relative round = (x) -> Math.round(x * 100) / 100 b = [round(v.x),round(v.y),round(v.z),round(v.w)] rot_real = [0.59, -0.22, 0.16,0.76] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist position vector pose should match C++ Version', -> v = md5.skeleton.getBoneByName("rwrist").position_pose round = (x) -> Math.round(x * 100) / 100 b = [round(v.x), round(v.y), round(v.z)] rot_real = [-41.19, 5.21, 96.32] chai.assert.deepEqual(b,rot_real)
179883
### ABOUT .__ _________ __| | \____ \ \/ / | | |_> > <| |__ | __/__/\_ \____/ |__| \/ js PXL.js <NAME> - <EMAIL> http://pxljs.com This software is released under the MIT Licence. See LICENCE.txt for details Testing the MD5 Model loading class ### chai = require 'chai' chai.should() PXLMath = require '../src/math/math' PXLMD5 = require '../src/import/md5' fs = require 'fs' describe 'MD5 tests: ', -> # Not sure I'm happy with the dirname relative stuff but it seems to work :) md5 = new PXLMD5.MD5Model( __dirname + "/../html/models/hellknight/hellknight.md5mesh") md5.skeleton.update() it 'md5 hellknight has 110 joints', -> md5.num_joints.should.equal 110 it 'md5 hellknight should have four child nodes', -> md5.children.length.should.equal 4 it 'md5 bone 10 should be "lhand"', -> md5.skeleton.bones[10].name.should.equal "lhand" it 'md5 vertex 2 on mesh 0 should be 3.36169,-20.2517,100.319', -> Math.round(md5.children[0].geometry.vertices[2].p.x).should.equal 3 #Math.round(md5.children[0].geometry.vertices[2].p.y).should.equal -20 Math.round(md5.children[0].geometry.vertices[2].p.z).should.equal 100 Math.round(md5.children[0].geometry.vertices[2].p.y).should.equal -20 it 'md5 vertex 100 on mesh 0 should be 20.4423, -9.70051, 49.5357', -> Math.round(md5.children[0].geometry.vertices[100].p.x).should.equal 20 Math.round(md5.children[0].geometry.vertices[100].p.y).should.equal -10 Math.round(md5.children[0].geometry.vertices[100].p.z).should.equal 50 it 'md5 luparm pose rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("luparm").rotation_pose m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [0.86, 0.24, -0.44, 0, -0.15, 0.96, 0.22, 0, 0.48, -0.12, 0.87, 0, 0, 0, 0, 1] chai.assert.deepEqual(b,rot_real) it 'md5 waist pose rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("waist").rotation_pose m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist global rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("rwrist").rotation_global m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [0.71,0.44,0.55,0,-0.38,0.9,-0.22,0,-0.59,-0.05,0.81,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist skinned rotation matrix should match C++ Version', -> m = md5.skeleton.getBoneByName("rwrist").skinned_matrix b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist position vector should match C++ Version', -> #md5.skeleton.update() v = md5.skeleton.getBoneByName("rwrist").position_relative round = (n) -> Math.round(n * 100) / 100 b = [round(v.x), round(v.y), round(v.z)] rot_real = [-6.86, 0.23, -1.31] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist Quaternion should match C++ Version', -> v = md5.skeleton.getBoneByName("rwrist").rotation_relative round = (x) -> Math.round(x * 100) / 100 b = [round(v.x),round(v.y),round(v.z),round(v.w)] rot_real = [0.59, -0.22, 0.16,0.76] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist position vector pose should match C++ Version', -> v = md5.skeleton.getBoneByName("rwrist").position_pose round = (x) -> Math.round(x * 100) / 100 b = [round(v.x), round(v.y), round(v.z)] rot_real = [-41.19, 5.21, 96.32] chai.assert.deepEqual(b,rot_real)
true
### ABOUT .__ _________ __| | \____ \ \/ / | | |_> > <| |__ | __/__/\_ \____/ |__| \/ js PXL.js PI:NAME:<NAME>END_PI - PI:EMAIL:<EMAIL>END_PI http://pxljs.com This software is released under the MIT Licence. See LICENCE.txt for details Testing the MD5 Model loading class ### chai = require 'chai' chai.should() PXLMath = require '../src/math/math' PXLMD5 = require '../src/import/md5' fs = require 'fs' describe 'MD5 tests: ', -> # Not sure I'm happy with the dirname relative stuff but it seems to work :) md5 = new PXLMD5.MD5Model( __dirname + "/../html/models/hellknight/hellknight.md5mesh") md5.skeleton.update() it 'md5 hellknight has 110 joints', -> md5.num_joints.should.equal 110 it 'md5 hellknight should have four child nodes', -> md5.children.length.should.equal 4 it 'md5 bone 10 should be "lhand"', -> md5.skeleton.bones[10].name.should.equal "lhand" it 'md5 vertex 2 on mesh 0 should be 3.36169,-20.2517,100.319', -> Math.round(md5.children[0].geometry.vertices[2].p.x).should.equal 3 #Math.round(md5.children[0].geometry.vertices[2].p.y).should.equal -20 Math.round(md5.children[0].geometry.vertices[2].p.z).should.equal 100 Math.round(md5.children[0].geometry.vertices[2].p.y).should.equal -20 it 'md5 vertex 100 on mesh 0 should be 20.4423, -9.70051, 49.5357', -> Math.round(md5.children[0].geometry.vertices[100].p.x).should.equal 20 Math.round(md5.children[0].geometry.vertices[100].p.y).should.equal -10 Math.round(md5.children[0].geometry.vertices[100].p.z).should.equal 50 it 'md5 luparm pose rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("luparm").rotation_pose m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [0.86, 0.24, -0.44, 0, -0.15, 0.96, 0.22, 0, 0.48, -0.12, 0.87, 0, 0, 0, 0, 1] chai.assert.deepEqual(b,rot_real) it 'md5 waist pose rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("waist").rotation_pose m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist global rotation matrix should match C++ Version', -> m = new PXLMath.Matrix4() q = md5.skeleton.getBoneByName("rwrist").rotation_global m.mult(q.getMatrix4()) b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [0.71,0.44,0.55,0,-0.38,0.9,-0.22,0,-0.59,-0.05,0.81,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist skinned rotation matrix should match C++ Version', -> m = md5.skeleton.getBoneByName("rwrist").skinned_matrix b = [] for n in m.a # Round to two decimal places b.push Math.round(n * 100) / 100 rot_real = [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist position vector should match C++ Version', -> #md5.skeleton.update() v = md5.skeleton.getBoneByName("rwrist").position_relative round = (n) -> Math.round(n * 100) / 100 b = [round(v.x), round(v.y), round(v.z)] rot_real = [-6.86, 0.23, -1.31] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist Quaternion should match C++ Version', -> v = md5.skeleton.getBoneByName("rwrist").rotation_relative round = (x) -> Math.round(x * 100) / 100 b = [round(v.x),round(v.y),round(v.z),round(v.w)] rot_real = [0.59, -0.22, 0.16,0.76] chai.assert.deepEqual(b,rot_real) it 'md5 rwrist position vector pose should match C++ Version', -> v = md5.skeleton.getBoneByName("rwrist").position_pose round = (x) -> Math.round(x * 100) / 100 b = [round(v.x), round(v.y), round(v.z)] rot_real = [-41.19, 5.21, 96.32] chai.assert.deepEqual(b,rot_real)
[ { "context": "ss.env[\"#{appPrefix}_DATABASE_NAME\"]\n password: process.env[\"#{appPrefix}_DATABASE_PASSWORD\"]\n port: process", "end": 640, "score": 0.9375680685043335, "start": 629, "tag": "PASSWORD", "value": "process.env" }, { "context": "refix}_DATABASE_NAME\"]\n pass...
src/Utility/Server.coffee
braintapper/braintapper-sveltekit-server-tools
0
import { browser, dev, mode } from "$app/env" import debug from "./Console.coffee" import Sugar from "sugar-and-spice" Sugar.extend() `const appPrefix = import.meta.env.VITE_ENV_PREFIX` # import PgForwardMigration from "../Database/PostgresqlMigration.coffee" import Database from "../Database/Postgresql.coffee" Server = initialized: false environment: process.env["#{appPrefix}_ENVIRONMENT"] database: undefined database_configuration: user: process.env["#{appPrefix}_DATABASE_USER"] host: process.env["#{appPrefix}_DATABASE_HOST"] database: process.env["#{appPrefix}_DATABASE_NAME"] password: process.env["#{appPrefix}_DATABASE_PASSWORD"] port: process.env["#{appPrefix}_DATABASE_PORT"] max: 20 idleTimeoutMillis: 30000 connectionTimeoutMillis: 2000 migration_configuration: migrationPath: "./db/migrations" database: @database initialize: ()-> debug.error "Server Initialization" @database = new Database(Server.database_configuration) debug.error "Initialized database" unless @environment == "development" || @environment.length == 0 # prod only try debug.announce "Run Outstanding Migrations" #outstandingMigrations = new PgForwardMigration(@migration_configuration) #outstandingMigrations.migrate() catch e debug.announce "Migration Error" debug.log e debug.footer() @initialized = true get_database: ()-> unless @database? debug.error "Reinitialized database" @database = new Database(@database_configuration) return @database locals: ()-> return env: @environment db: @get_database() prepare: (request)-> if request.path.startsWith "/app/api" #console.log database.pool request.locals = Server.locals() return request seed: ()-> migrate: ()-> export default Server
25972
import { browser, dev, mode } from "$app/env" import debug from "./Console.coffee" import Sugar from "sugar-and-spice" Sugar.extend() `const appPrefix = import.meta.env.VITE_ENV_PREFIX` # import PgForwardMigration from "../Database/PostgresqlMigration.coffee" import Database from "../Database/Postgresql.coffee" Server = initialized: false environment: process.env["#{appPrefix}_ENVIRONMENT"] database: undefined database_configuration: user: process.env["#{appPrefix}_DATABASE_USER"] host: process.env["#{appPrefix}_DATABASE_HOST"] database: process.env["#{appPrefix}_DATABASE_NAME"] password: <PASSWORD>["<PASSWORD>"] port: process.env["#{appPrefix}_DATABASE_PORT"] max: 20 idleTimeoutMillis: 30000 connectionTimeoutMillis: 2000 migration_configuration: migrationPath: "./db/migrations" database: @database initialize: ()-> debug.error "Server Initialization" @database = new Database(Server.database_configuration) debug.error "Initialized database" unless @environment == "development" || @environment.length == 0 # prod only try debug.announce "Run Outstanding Migrations" #outstandingMigrations = new PgForwardMigration(@migration_configuration) #outstandingMigrations.migrate() catch e debug.announce "Migration Error" debug.log e debug.footer() @initialized = true get_database: ()-> unless @database? debug.error "Reinitialized database" @database = new Database(@database_configuration) return @database locals: ()-> return env: @environment db: @get_database() prepare: (request)-> if request.path.startsWith "/app/api" #console.log database.pool request.locals = Server.locals() return request seed: ()-> migrate: ()-> export default Server
true
import { browser, dev, mode } from "$app/env" import debug from "./Console.coffee" import Sugar from "sugar-and-spice" Sugar.extend() `const appPrefix = import.meta.env.VITE_ENV_PREFIX` # import PgForwardMigration from "../Database/PostgresqlMigration.coffee" import Database from "../Database/Postgresql.coffee" Server = initialized: false environment: process.env["#{appPrefix}_ENVIRONMENT"] database: undefined database_configuration: user: process.env["#{appPrefix}_DATABASE_USER"] host: process.env["#{appPrefix}_DATABASE_HOST"] database: process.env["#{appPrefix}_DATABASE_NAME"] password: PI:PASSWORD:<PASSWORD>END_PI["PI:PASSWORD:<PASSWORD>END_PI"] port: process.env["#{appPrefix}_DATABASE_PORT"] max: 20 idleTimeoutMillis: 30000 connectionTimeoutMillis: 2000 migration_configuration: migrationPath: "./db/migrations" database: @database initialize: ()-> debug.error "Server Initialization" @database = new Database(Server.database_configuration) debug.error "Initialized database" unless @environment == "development" || @environment.length == 0 # prod only try debug.announce "Run Outstanding Migrations" #outstandingMigrations = new PgForwardMigration(@migration_configuration) #outstandingMigrations.migrate() catch e debug.announce "Migration Error" debug.log e debug.footer() @initialized = true get_database: ()-> unless @database? debug.error "Reinitialized database" @database = new Database(@database_configuration) return @database locals: ()-> return env: @environment db: @get_database() prepare: (request)-> if request.path.startsWith "/app/api" #console.log database.pool request.locals = Server.locals() return request seed: ()-> migrate: ()-> export default Server
[ { "context": "henticate in their profile\n application_secret: \"5d6578d2d8e38a251550cdf9d31dc2e349e328bf\"\n\n # once a given user authenticates the registe", "end": 477, "score": 0.9997605085372925, "start": 437, "tag": "KEY", "value": "5d6578d2d8e38a251550cdf9d31dc2e349e328bf" } ]
lib/assets/javascripts/code_sync/backends/gist.coffee
datapimp/code_sync
3
window.backend ||= {} backend.authentication ||= # there must be an application registered with github # whose domain matches the domain making the request to # the gist api on behalf of the user # this is set in the application registration application_client_id: "1d70d6fe89bb1e381b5c" # this is generated in the application settings and # will require the user to authenticate in their profile application_secret: "5d6578d2d8e38a251550cdf9d31dc2e349e328bf" # once a given user authenticates the registered application # there will be an authorization token stored against their account authorization_token: "" # base64 encoded username:password # used for http basic authentication to github api user_digest: "" backend.authenticate = (username, password, callback)-> unless backend.authentication.authorization_token backend.createAuthorization username, password, ()-> backend.authenticate(username, password) backend.authentication backend.createAuthorization = (username,password, callback)-> $.ajax type: "GET" url: "https://api.github.com/authorizations" success: (response)-> authorization = response[0] backend.authentication.authorization_token = authorization.token callback() beforeSend:(xhr)-> xhr.setRequestHeader("Authorization", "BASIC #{ backend.getDigest(username,password) }" ) backend.getDigest = (username,password)-> if value = backend.authentication.user_digest return value if btoa? backend.authentication.user_digest = btoa("#{username}:#{password}") backend.createGist = (content)-> data = description: "test gist" public: false content: content files: "data.js" : content options = type: "POST" url: "https://api.github.com/gists" data: JSON.stringify(data) contentType: "application/json" beforeRequest: (xhr)-> #xhr.setRequestHeader("Authorization", "BASIC #{ backend.getDigest(username,password) }" ) xhr.setRequestHeader("Authorization", "token #{ backend.authentication.authorization_token }") success: (response)-> console.log "Response", response failure: ()-> console.log "failure!", arguments console.log "options", options, data $.ajax(options) backend.createGist("sup baby")
110581
window.backend ||= {} backend.authentication ||= # there must be an application registered with github # whose domain matches the domain making the request to # the gist api on behalf of the user # this is set in the application registration application_client_id: "1d70d6fe89bb1e381b5c" # this is generated in the application settings and # will require the user to authenticate in their profile application_secret: "<KEY>" # once a given user authenticates the registered application # there will be an authorization token stored against their account authorization_token: "" # base64 encoded username:password # used for http basic authentication to github api user_digest: "" backend.authenticate = (username, password, callback)-> unless backend.authentication.authorization_token backend.createAuthorization username, password, ()-> backend.authenticate(username, password) backend.authentication backend.createAuthorization = (username,password, callback)-> $.ajax type: "GET" url: "https://api.github.com/authorizations" success: (response)-> authorization = response[0] backend.authentication.authorization_token = authorization.token callback() beforeSend:(xhr)-> xhr.setRequestHeader("Authorization", "BASIC #{ backend.getDigest(username,password) }" ) backend.getDigest = (username,password)-> if value = backend.authentication.user_digest return value if btoa? backend.authentication.user_digest = btoa("#{username}:#{password}") backend.createGist = (content)-> data = description: "test gist" public: false content: content files: "data.js" : content options = type: "POST" url: "https://api.github.com/gists" data: JSON.stringify(data) contentType: "application/json" beforeRequest: (xhr)-> #xhr.setRequestHeader("Authorization", "BASIC #{ backend.getDigest(username,password) }" ) xhr.setRequestHeader("Authorization", "token #{ backend.authentication.authorization_token }") success: (response)-> console.log "Response", response failure: ()-> console.log "failure!", arguments console.log "options", options, data $.ajax(options) backend.createGist("sup baby")
true
window.backend ||= {} backend.authentication ||= # there must be an application registered with github # whose domain matches the domain making the request to # the gist api on behalf of the user # this is set in the application registration application_client_id: "1d70d6fe89bb1e381b5c" # this is generated in the application settings and # will require the user to authenticate in their profile application_secret: "PI:KEY:<KEY>END_PI" # once a given user authenticates the registered application # there will be an authorization token stored against their account authorization_token: "" # base64 encoded username:password # used for http basic authentication to github api user_digest: "" backend.authenticate = (username, password, callback)-> unless backend.authentication.authorization_token backend.createAuthorization username, password, ()-> backend.authenticate(username, password) backend.authentication backend.createAuthorization = (username,password, callback)-> $.ajax type: "GET" url: "https://api.github.com/authorizations" success: (response)-> authorization = response[0] backend.authentication.authorization_token = authorization.token callback() beforeSend:(xhr)-> xhr.setRequestHeader("Authorization", "BASIC #{ backend.getDigest(username,password) }" ) backend.getDigest = (username,password)-> if value = backend.authentication.user_digest return value if btoa? backend.authentication.user_digest = btoa("#{username}:#{password}") backend.createGist = (content)-> data = description: "test gist" public: false content: content files: "data.js" : content options = type: "POST" url: "https://api.github.com/gists" data: JSON.stringify(data) contentType: "application/json" beforeRequest: (xhr)-> #xhr.setRequestHeader("Authorization", "BASIC #{ backend.getDigest(username,password) }" ) xhr.setRequestHeader("Authorization", "token #{ backend.authentication.authorization_token }") success: (response)-> console.log "Response", response failure: ()-> console.log "failure!", arguments console.log "options", options, data $.ajax(options) backend.createGist("sup baby")
[ { "context": "orm = new FormData\n form.append('password', @password)\n fetch(\"/api/recipes/#{@ver}\", {method: '", "end": 360, "score": 0.990267276763916, "start": 351, "tag": "PASSWORD", "value": "@password" } ]
view/src/coffee/uploader.coffee
ponkotuy/FactorioRecipe
0
$(document).ready -> fetch('/api/recipes/versions').then (res) -> res.json().then (json) -> render(json) render = (json) -> new Vue el: '#versions' data: versions: json ver: json[0] password: '' alert: null methods: deleteRecipe: -> form = new FormData form.append('password', @password) fetch("/api/recipes/#{@ver}", {method: 'delete', body: form}).then (res) => if res.status == 200 location.reload(false) else res.text().then (text) => @alert = text
75248
$(document).ready -> fetch('/api/recipes/versions').then (res) -> res.json().then (json) -> render(json) render = (json) -> new Vue el: '#versions' data: versions: json ver: json[0] password: '' alert: null methods: deleteRecipe: -> form = new FormData form.append('password', <PASSWORD>) fetch("/api/recipes/#{@ver}", {method: 'delete', body: form}).then (res) => if res.status == 200 location.reload(false) else res.text().then (text) => @alert = text
true
$(document).ready -> fetch('/api/recipes/versions').then (res) -> res.json().then (json) -> render(json) render = (json) -> new Vue el: '#versions' data: versions: json ver: json[0] password: '' alert: null methods: deleteRecipe: -> form = new FormData form.append('password', PI:PASSWORD:<PASSWORD>END_PI) fetch("/api/recipes/#{@ver}", {method: 'delete', body: form}).then (res) => if res.status == 200 location.reload(false) else res.text().then (text) => @alert = text
[ { "context": "\n\n\n# 'colorThief' module v1.0\n# by Marc Krenn, July 1st, 2016 | marc.krenn@gmail.com | @marc_kr", "end": 45, "score": 0.9999078512191772, "start": 35, "tag": "NAME", "value": "Marc Krenn" }, { "context": "ief' module v1.0\n# by Marc Krenn, July 1st, 2016 | marc.kren...
29colorThief.framer/modules/colorThief.coffee
gremjua-forks/100daysofframer
26
# 'colorThief' module v1.0 # by Marc Krenn, July 1st, 2016 | marc.krenn@gmail.com | @marc_krenn # ... based on colorThief.js by by Lokesh Dhakar http://www.lokeshdhakar.com # and kulturaveshchi # The 'colorThief' module allows you to extract the dominant color(s) of images. # -------------------------------------------------------------------- # The following is a slightly modified, auto-converted coffeescript version # of Color Thief, based on a PR by kulturaveshchi (https://github.com/lokesh/color-thief/pull/84) # Usage: # -------------------------------------------------------------------- ### # Include Module by adding the following line on top of your project {ColorThief} = require "colorThief" # Get dominant color colorThief.getColor imgSrc, (color) -> print color # Optional: Set custom sample quality colorThief.getColor {url:imgSrc, quality:10}, (color) -> print color # Get color palette # By default, this will return 5 colors at default quality 10 colorThief.getPalette imgSrc, (colors) -> print colors # Optional: Set custom colorCount and sample quality colorThief.getPalette {url:imgSrc, colorCount: 5, quality:10}, (colors) -> print colors ### # -------------------------------------------------------------------- ###! # Color Thief v2.0 # by Lokesh Dhakar - http://www.lokeshdhakar.com # # License # ------- # Creative Commons Attribution 2.5 License: # http://creativecommons.org/licenses/by/2.5/ # # Thanks # ------ # Nick Rabinowitz - For creating quantize.js. # John Schulz - For clean up and optimization. @JFSIII # Nathan Spady - For adding drag and drop support to the demo page. # ### ### CanvasImage Class Class that wraps the html image element and canvas. It also simplifies some of the canvas context manipulation with a set of helper functions. ### CanvasImage = (image) -> @canvas = document.createElement('canvas') @context = @canvas.getContext('2d') document.body.appendChild @canvas @width = @canvas.width = image.width @height = @canvas.height = image.height @context.drawImage image, 0, 0, @width, @height return CanvasImage::clear = -> @context.clearRect 0, 0, @width, @height return CanvasImage::update = (imageData) -> @context.putImageData imageData, 0, 0 return CanvasImage::getPixelCount = -> @width * @height CanvasImage::getImageData = -> @context.getImageData 0, 0, @width, @height CanvasImage::removeCanvas = -> @canvas.parentNode.removeChild @canvas return exports.ColorThief = -> ### # getColor(sourceImage[, quality]) # returns {r: num, g: num, b: num} # # Use the median cut algorithm provided by quantize.js to cluster similar # colors and return the base color from the largest cluster. # # Quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. # 10 is the default. There is a trade-off between quality and speed. The bigger the number, the # faster a color will be returned but the greater the likelihood that it will not be the visually # most dominant color. # # ### exports.ColorThief::getColor = (imgOptions, response) -> switch typeof imgOptions when "string" url = imgOptions quality = 10 when "object" url = imgOptions.url quality = imgOptions.quality img = new Image img.onload = => palette = @getColors(img, 5, quality) dominantColor = palette[0] response(colRgb = new Color("rgb(#{dominantColor[0]},#{dominantColor[1]},#{dominantColor[2]})")) img.crossOrigin = "anonymous" if url.startsWith("http") then img.src = "https://crossorigin.me/#{url}" else img.src = url exports.ColorThief::getPalette = (imgOptions, response) -> switch typeof imgOptions when "string" then url = imgOptions when "object" then url = imgOptions.url quality = imgOptions.quality ?= 10 colorCount = imgOptions.colorCount ?= 5 img = new Image img.onload = => palette = @getColors(img, colorCount, quality) colArray = [] for col in palette colArray.push(new Color("rgb(#{col[0]},#{col[1]},#{col[2]})")) response(colArray) img.crossOrigin = "anonymous" if url.startsWith("http") then img.src = "https://crossorigin.me/#{url}" else img.src = url ### # getColors(sourceImage[, colorCount, quality]) # returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...] # # Use the median cut algorithm provided by quantize.js to cluster similar colors. # # colorCount determines the size of the palette; the number of colors returned. If not set, it # defaults to 10. # # BUGGY: Function does not always return the requested amount of colors. It can be +/- 2. # # quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. # 10 is the default. There is a trade-off between quality and speed. The bigger the number, the # faster the palette generation but the greater the likelihood that colors will be missed. # # ### exports.ColorThief::getColors = (sourceImage, colorCount, quality) -> if `typeof colorCount == 'undefined'` colorCount = 10 if `typeof quality == 'undefined'` or quality < 1 quality = 10 # Create custom CanvasImage object image = new CanvasImage(sourceImage) imageData = image.getImageData() pixels = imageData.data pixelCount = image.getPixelCount() # Store the RGB values in an array format suitable for quantize function pixelArray = [] i = 0 offset = undefined r = undefined g = undefined b = undefined a = undefined while i < pixelCount offset = i * 4 r = pixels[offset + 0] g = pixels[offset + 1] b = pixels[offset + 2] a = pixels[offset + 3] # If pixel is mostly opaque and not white if a >= 125 if !(r > 250 and g > 250 and b > 250) pixelArray.push [ r g b ] i = i + quality # Send array to quantize function which clusters values # using median cut algorithm cmap = MMCQ.quantize(pixelArray, colorCount) palette = if cmap then cmap.palette() else null # Clean up image.removeCanvas() palette ###! # quantize.js Copyright 2008 Nick Rabinowitz. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ### # fill out a couple protovis dependencies ###! # Block below copied from Protovis: http://mbostock.github.com/protovis/ # Copyright 2010 Stanford Visualization Group # Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php ### if !pv pv = map: (array, f) -> o = {} if f then array.map(((d, i) -> o.index = i f.call o, d )) else array.slice() naturalOrder: (a, b) -> if a < b then -1 else if a > b then 1 else 0 sum: (array, f) -> o = {} array.reduce if f then ((p, d, i) -> o.index = i p + f.call(o, d) ) else ((p, d) -> p + d ) max: (array, f) -> Math.max.apply null, if f then pv.map(array, f) else array ###* # Basic Javascript port of the MMCQ (modified median cut quantization) # algorithm from the Leptonica library (http://www.leptonica.com/). # Returns a color map you can use to map original pixels to the reduced # palette. Still a work in progress. # # @author Nick Rabinowitz # @example // array of pixels as [R,G,B] arrays var myPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207] // etc ]; var maxColors = 4; var cmap = MMCQ.quantize(myPixels, maxColors); var newPalette = cmap.palette(); var newPixels = myPixels.map(function(p) { return cmap.map(p); }); ### MMCQ = do -> # private constants sigbits = 5 rshift = 8 - sigbits maxIterations = 1000 fractByPopulations = 0.75 # get reduced-space color index for a pixel getColorIndex = (r, g, b) -> (r << 2 * sigbits) + (g << sigbits) + b # Simple priority queue PQueue = (comparator) -> contents = [] sorted = false sort = -> contents.sort comparator sorted = true return { push: (o) -> contents.push o sorted = false return peek: (index) -> if !sorted sort() if `index == undefined` index = contents.length - 1 contents[index] pop: -> if !sorted sort() contents.pop() size: -> contents.length map: (f) -> contents.map f debug: -> if !sorted sort() contents } # 3d color space box VBox = (r1, r2, g1, g2, b1, b2, histo) -> vbox = this vbox.r1 = r1 vbox.r2 = r2 vbox.g1 = g1 vbox.g2 = g2 vbox.b1 = b1 vbox.b2 = b2 vbox.histo = histo return # Color map CMap = -> @vboxes = new PQueue((a, b) -> pv.naturalOrder a.vbox.count() * a.vbox.volume(), b.vbox.count() * b.vbox.volume() ) return # histo (1-d array, giving the number of pixels in # each quantized region of color space), or null on error getHisto = (pixels) -> histosize = 1 << 3 * sigbits histo = new Array(histosize) index = undefined rval = undefined gval = undefined bval = undefined pixels.forEach (pixel) -> rval = pixel[0] >> rshift gval = pixel[1] >> rshift bval = pixel[2] >> rshift index = getColorIndex(rval, gval, bval) histo[index] = (histo[index] or 0) + 1 return histo vboxFromPixels = (pixels, histo) -> rmin = 1000000 rmax = 0 gmin = 1000000 gmax = 0 bmin = 1000000 bmax = 0 rval = undefined gval = undefined bval = undefined # find min/max pixels.forEach (pixel) -> rval = pixel[0] >> rshift gval = pixel[1] >> rshift bval = pixel[2] >> rshift if rval < rmin rmin = rval else if rval > rmax rmax = rval if gval < gmin gmin = gval else if gval > gmax gmax = gval if bval < bmin bmin = bval else if bval > bmax bmax = bval return new VBox(rmin, rmax, gmin, gmax, bmin, bmax, histo) medianCutApply = (histo, vbox) -> doCut = (color) -> dim1 = color + '1' dim2 = color + '2' left = undefined right = undefined vbox1 = undefined vbox2 = undefined d2 = undefined count2 = 0 `i = vbox[dim1]` while i <= vbox[dim2] if partialsum[i] > total / 2 vbox1 = vbox.copy() vbox2 = vbox.copy() left = i - (vbox[dim1]) right = vbox[dim2] - i if left <= right d2 = Math.min(vbox[dim2] - 1, ~ ~(i + right / 2)) else d2 = Math.max(vbox[dim1], ~ ~(i - 1 - (left / 2))) # avoid 0-count boxes while !partialsum[d2] d2++ count2 = lookaheadsum[d2] while !count2 and partialsum[d2 - 1] count2 = lookaheadsum[--d2] # set dimensions vbox1[dim2] = d2 vbox2[dim1] = vbox1[dim2] + 1 # console.log('vbox counts:', vbox.count(), vbox1.count(), vbox2.count()); return [ vbox1 vbox2 ] i++ return if !vbox.count() return rw = vbox.r2 - (vbox.r1) + 1 gw = vbox.g2 - (vbox.g1) + 1 bw = vbox.b2 - (vbox.b1) + 1 maxw = pv.max([ rw gw bw ]) # only one pixel, no split if `vbox.count() == 1` return [ vbox.copy() ] ### Find the partial sum arrays along the selected axis. ### total = 0 partialsum = [] lookaheadsum = [] i = undefined j = undefined k = undefined sum = undefined index = undefined if `maxw == rw` i = vbox.r1 while i <= vbox.r2 sum = 0 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 index = getColorIndex(i, j, k) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ else if `maxw == gw` i = vbox.g1 while i <= vbox.g2 sum = 0 j = vbox.r1 while j <= vbox.r2 k = vbox.b1 while k <= vbox.b2 index = getColorIndex(j, i, k) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ else ### maxw == bw ### i = vbox.b1 while i <= vbox.b2 sum = 0 j = vbox.r1 while j <= vbox.r2 k = vbox.g1 while k <= vbox.g2 index = getColorIndex(j, k, i) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ partialsum.forEach (d, i) -> lookaheadsum[i] = total - d return # determine the cut planes if `maxw == rw` then doCut('r') else if `maxw == gw` then doCut('g') else doCut('b') quantize = (pixels, maxcolors) -> k = 0 # short-circuit # inner function to do the iteration iter = (lh, target) -> ncolors = lh.size() niters = 0 vbox = undefined while niters < maxIterations if ncolors >= target return if niters++ > maxIterations # console.log("infinite loop; perhaps too few pixels!"); return vbox = lh.pop() if !vbox.count() ### just put it back ### lh.push vbox niters++ k++ continue # do the cut vboxes = medianCutApply(histo, vbox) vbox1 = vboxes[0] vbox2 = vboxes[1] if !vbox1 # console.log("vbox1 not defined; shouldn't happen!"); return lh.push vbox1 if vbox2 ### vbox2 can be null ### lh.push vbox2 ncolors++ return if !pixels.length or maxcolors < 2 or maxcolors > 256 # console.log('wrong number of maxcolors'); return false # XXX: check color content and convert to grayscale if insufficient histo = getHisto(pixels) histosize = 1 << 3 * sigbits # check that we aren't below maxcolors already nColors = 0 histo.forEach -> nColors++ return if nColors <= maxcolors # XXX: generate the new colors from the histo and return else # get the beginning vbox from the colors vbox = vboxFromPixels(pixels, histo) pq = new PQueue((a, b) -> pv.naturalOrder a.count(), b.count() ) pq.push vbox # first set of colors, sorted by population iter pq, fractByPopulations * maxcolors # Re-sort by the product of pixel occupancy times the size in color space. pq2 = new PQueue((a, b) -> pv.naturalOrder a.count() * a.volume(), b.count() * b.volume() ) while pq.size() pq2.push pq.pop() # next set - generate the median cuts using the (npix * vol) sorting. iter pq2, maxcolors # calculate the actual colors cmap = new CMap while pq2.size() cmap.push pq2.pop() cmap VBox.prototype = volume: (force) -> vbox = this if !vbox._volume or force vbox._volume = (vbox.r2 - (vbox.r1) + 1) * (vbox.g2 - (vbox.g1) + 1) * (vbox.b2 - (vbox.b1) + 1) vbox._volume count: (force) -> vbox = this histo = vbox.histo if !vbox._count_set or force npix = 0 i = undefined j = undefined k = undefined i = vbox.r1 while i <= vbox.r2 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 `index = getColorIndex(i, j, k)` npix += histo[index] or 0 k++ j++ i++ vbox._count = npix vbox._count_set = true vbox._count copy: -> vbox = this new VBox(vbox.r1, vbox.r2, vbox.g1, vbox.g2, vbox.b1, vbox.b2, vbox.histo) avg: (force) -> vbox = this histo = vbox.histo if !vbox._avg or force ntot = 0 mult = 1 << 8 - sigbits rsum = 0 gsum = 0 bsum = 0 hval = undefined i = undefined j = undefined k = undefined histoindex = undefined i = vbox.r1 while i <= vbox.r2 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 histoindex = getColorIndex(i, j, k) hval = histo[histoindex] or 0 ntot += hval rsum += hval * (i + 0.5) * mult gsum += hval * (j + 0.5) * mult bsum += hval * (k + 0.5) * mult k++ j++ i++ if ntot vbox._avg = [ ~ ~(rsum / ntot) ~ ~(gsum / ntot) ~ ~(bsum / ntot) ] else # console.log('empty box'); vbox._avg = [ ~ ~(mult * (vbox.r1 + vbox.r2 + 1) / 2) ~ ~(mult * (vbox.g1 + vbox.g2 + 1) / 2) ~ ~(mult * (vbox.b1 + vbox.b2 + 1) / 2) ] vbox._avg contains: (pixel) -> vbox = this rval = pixel[0] >> rshift `gval = pixel[1] >> rshift` `bval = pixel[2] >> rshift` rval >= vbox.r1 and rval <= vbox.r2 and gval >= vbox.g1 and gval <= vbox.g2 and bval >= vbox.b1 and bval <= vbox.b2 CMap.prototype = push: (vbox) -> @vboxes.push vbox: vbox color: vbox.avg() return palette: -> @vboxes.map (vb) -> vb.color size: -> @vboxes.size() map: (color) -> vboxes = @vboxes i = 0 while i < vboxes.size() if vboxes.peek(i).vbox.contains(color) return vboxes.peek(i).color i++ @nearest color nearest: (color) -> vboxes = @vboxes d1 = undefined d2 = undefined pColor = undefined i = 0 while i < vboxes.size() d2 = Math.sqrt((color[0] - (vboxes.peek(i).color[0])) ** 2 + (color[1] - (vboxes.peek(i).color[1])) ** 2 + (color[2] - (vboxes.peek(i).color[2])) ** 2) if d2 < d1 or `d1 == undefined` d1 = d2 pColor = vboxes.peek(i).color i++ pColor forcebw: -> # XXX: won't work yet vboxes = @vboxes vboxes.sort (a, b) -> pv.naturalOrder pv.sum(a.color), pv.sum(b.color) # force darkest color to black if everything < 5 lowest = vboxes[0].color if lowest[0] < 5 and lowest[1] < 5 and lowest[2] < 5 vboxes[0].color = [ 0 0 0 ] # force lightest color to white if everything > 251 idx = vboxes.length - 1 highest = vboxes[idx].color if highest[0] > 251 and highest[1] > 251 and highest[2] > 251 vboxes[idx].color = [ 255 255 255 ] return { quantize: quantize } # --- # generated by js2coffee 2.2.0
45472
# 'colorThief' module v1.0 # by <NAME>, July 1st, 2016 | <EMAIL> | @marc_krenn # ... based on colorThief.js by by <NAME> http://www.lokeshdhakar.com # and kulturaveshchi # The 'colorThief' module allows you to extract the dominant color(s) of images. # -------------------------------------------------------------------- # The following is a slightly modified, auto-converted coffeescript version # of Color Thief, based on a PR by kulturaveshchi (https://github.com/lokesh/color-thief/pull/84) # Usage: # -------------------------------------------------------------------- ### # Include Module by adding the following line on top of your project {ColorThief} = require "colorThief" # Get dominant color colorThief.getColor imgSrc, (color) -> print color # Optional: Set custom sample quality colorThief.getColor {url:imgSrc, quality:10}, (color) -> print color # Get color palette # By default, this will return 5 colors at default quality 10 colorThief.getPalette imgSrc, (colors) -> print colors # Optional: Set custom colorCount and sample quality colorThief.getPalette {url:imgSrc, colorCount: 5, quality:10}, (colors) -> print colors ### # -------------------------------------------------------------------- ###! # Color Thief v2.0 # by <NAME> - http://www.lokeshdhakar.com # # License # ------- # Creative Commons Attribution 2.5 License: # http://creativecommons.org/licenses/by/2.5/ # # Thanks # ------ # <NAME> - For creating quantize.js. # <NAME> - For clean up and optimization. @JFSIII # <NAME> - For adding drag and drop support to the demo page. # ### ### CanvasImage Class Class that wraps the html image element and canvas. It also simplifies some of the canvas context manipulation with a set of helper functions. ### CanvasImage = (image) -> @canvas = document.createElement('canvas') @context = @canvas.getContext('2d') document.body.appendChild @canvas @width = @canvas.width = image.width @height = @canvas.height = image.height @context.drawImage image, 0, 0, @width, @height return CanvasImage::clear = -> @context.clearRect 0, 0, @width, @height return CanvasImage::update = (imageData) -> @context.putImageData imageData, 0, 0 return CanvasImage::getPixelCount = -> @width * @height CanvasImage::getImageData = -> @context.getImageData 0, 0, @width, @height CanvasImage::removeCanvas = -> @canvas.parentNode.removeChild @canvas return exports.ColorThief = -> ### # getColor(sourceImage[, quality]) # returns {r: num, g: num, b: num} # # Use the median cut algorithm provided by quantize.js to cluster similar # colors and return the base color from the largest cluster. # # Quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. # 10 is the default. There is a trade-off between quality and speed. The bigger the number, the # faster a color will be returned but the greater the likelihood that it will not be the visually # most dominant color. # # ### exports.ColorThief::getColor = (imgOptions, response) -> switch typeof imgOptions when "string" url = imgOptions quality = 10 when "object" url = imgOptions.url quality = imgOptions.quality img = new Image img.onload = => palette = @getColors(img, 5, quality) dominantColor = palette[0] response(colRgb = new Color("rgb(#{dominantColor[0]},#{dominantColor[1]},#{dominantColor[2]})")) img.crossOrigin = "anonymous" if url.startsWith("http") then img.src = "https://crossorigin.me/#{url}" else img.src = url exports.ColorThief::getPalette = (imgOptions, response) -> switch typeof imgOptions when "string" then url = imgOptions when "object" then url = imgOptions.url quality = imgOptions.quality ?= 10 colorCount = imgOptions.colorCount ?= 5 img = new Image img.onload = => palette = @getColors(img, colorCount, quality) colArray = [] for col in palette colArray.push(new Color("rgb(#{col[0]},#{col[1]},#{col[2]})")) response(colArray) img.crossOrigin = "anonymous" if url.startsWith("http") then img.src = "https://crossorigin.me/#{url}" else img.src = url ### # getColors(sourceImage[, colorCount, quality]) # returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...] # # Use the median cut algorithm provided by quantize.js to cluster similar colors. # # colorCount determines the size of the palette; the number of colors returned. If not set, it # defaults to 10. # # BUGGY: Function does not always return the requested amount of colors. It can be +/- 2. # # quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. # 10 is the default. There is a trade-off between quality and speed. The bigger the number, the # faster the palette generation but the greater the likelihood that colors will be missed. # # ### exports.ColorThief::getColors = (sourceImage, colorCount, quality) -> if `typeof colorCount == 'undefined'` colorCount = 10 if `typeof quality == 'undefined'` or quality < 1 quality = 10 # Create custom CanvasImage object image = new CanvasImage(sourceImage) imageData = image.getImageData() pixels = imageData.data pixelCount = image.getPixelCount() # Store the RGB values in an array format suitable for quantize function pixelArray = [] i = 0 offset = undefined r = undefined g = undefined b = undefined a = undefined while i < pixelCount offset = i * 4 r = pixels[offset + 0] g = pixels[offset + 1] b = pixels[offset + 2] a = pixels[offset + 3] # If pixel is mostly opaque and not white if a >= 125 if !(r > 250 and g > 250 and b > 250) pixelArray.push [ r g b ] i = i + quality # Send array to quantize function which clusters values # using median cut algorithm cmap = MMCQ.quantize(pixelArray, colorCount) palette = if cmap then cmap.palette() else null # Clean up image.removeCanvas() palette ###! # quantize.js Copyright 2008 <NAME>. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ### # fill out a couple protovis dependencies ###! # Block below copied from Protovis: http://mbostock.github.com/protovis/ # Copyright 2010 Stanford Visualization Group # Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php ### if !pv pv = map: (array, f) -> o = {} if f then array.map(((d, i) -> o.index = i f.call o, d )) else array.slice() naturalOrder: (a, b) -> if a < b then -1 else if a > b then 1 else 0 sum: (array, f) -> o = {} array.reduce if f then ((p, d, i) -> o.index = i p + f.call(o, d) ) else ((p, d) -> p + d ) max: (array, f) -> Math.max.apply null, if f then pv.map(array, f) else array ###* # Basic Javascript port of the MMCQ (modified median cut quantization) # algorithm from the Leptonica library (http://www.leptonica.com/). # Returns a color map you can use to map original pixels to the reduced # palette. Still a work in progress. # # @author <NAME> # @example // array of pixels as [R,G,B] arrays var myPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207] // etc ]; var maxColors = 4; var cmap = MMCQ.quantize(myPixels, maxColors); var newPalette = cmap.palette(); var newPixels = myPixels.map(function(p) { return cmap.map(p); }); ### MMCQ = do -> # private constants sigbits = 5 rshift = 8 - sigbits maxIterations = 1000 fractByPopulations = 0.75 # get reduced-space color index for a pixel getColorIndex = (r, g, b) -> (r << 2 * sigbits) + (g << sigbits) + b # Simple priority queue PQueue = (comparator) -> contents = [] sorted = false sort = -> contents.sort comparator sorted = true return { push: (o) -> contents.push o sorted = false return peek: (index) -> if !sorted sort() if `index == undefined` index = contents.length - 1 contents[index] pop: -> if !sorted sort() contents.pop() size: -> contents.length map: (f) -> contents.map f debug: -> if !sorted sort() contents } # 3d color space box VBox = (r1, r2, g1, g2, b1, b2, histo) -> vbox = this vbox.r1 = r1 vbox.r2 = r2 vbox.g1 = g1 vbox.g2 = g2 vbox.b1 = b1 vbox.b2 = b2 vbox.histo = histo return # Color map CMap = -> @vboxes = new PQueue((a, b) -> pv.naturalOrder a.vbox.count() * a.vbox.volume(), b.vbox.count() * b.vbox.volume() ) return # histo (1-d array, giving the number of pixels in # each quantized region of color space), or null on error getHisto = (pixels) -> histosize = 1 << 3 * sigbits histo = new Array(histosize) index = undefined rval = undefined gval = undefined bval = undefined pixels.forEach (pixel) -> rval = pixel[0] >> rshift gval = pixel[1] >> rshift bval = pixel[2] >> rshift index = getColorIndex(rval, gval, bval) histo[index] = (histo[index] or 0) + 1 return histo vboxFromPixels = (pixels, histo) -> rmin = 1000000 rmax = 0 gmin = 1000000 gmax = 0 bmin = 1000000 bmax = 0 rval = undefined gval = undefined bval = undefined # find min/max pixels.forEach (pixel) -> rval = pixel[0] >> rshift gval = pixel[1] >> rshift bval = pixel[2] >> rshift if rval < rmin rmin = rval else if rval > rmax rmax = rval if gval < gmin gmin = gval else if gval > gmax gmax = gval if bval < bmin bmin = bval else if bval > bmax bmax = bval return new VBox(rmin, rmax, gmin, gmax, bmin, bmax, histo) medianCutApply = (histo, vbox) -> doCut = (color) -> dim1 = color + '1' dim2 = color + '2' left = undefined right = undefined vbox1 = undefined vbox2 = undefined d2 = undefined count2 = 0 `i = vbox[dim1]` while i <= vbox[dim2] if partialsum[i] > total / 2 vbox1 = vbox.copy() vbox2 = vbox.copy() left = i - (vbox[dim1]) right = vbox[dim2] - i if left <= right d2 = Math.min(vbox[dim2] - 1, ~ ~(i + right / 2)) else d2 = Math.max(vbox[dim1], ~ ~(i - 1 - (left / 2))) # avoid 0-count boxes while !partialsum[d2] d2++ count2 = lookaheadsum[d2] while !count2 and partialsum[d2 - 1] count2 = lookaheadsum[--d2] # set dimensions vbox1[dim2] = d2 vbox2[dim1] = vbox1[dim2] + 1 # console.log('vbox counts:', vbox.count(), vbox1.count(), vbox2.count()); return [ vbox1 vbox2 ] i++ return if !vbox.count() return rw = vbox.r2 - (vbox.r1) + 1 gw = vbox.g2 - (vbox.g1) + 1 bw = vbox.b2 - (vbox.b1) + 1 maxw = pv.max([ rw gw bw ]) # only one pixel, no split if `vbox.count() == 1` return [ vbox.copy() ] ### Find the partial sum arrays along the selected axis. ### total = 0 partialsum = [] lookaheadsum = [] i = undefined j = undefined k = undefined sum = undefined index = undefined if `maxw == rw` i = vbox.r1 while i <= vbox.r2 sum = 0 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 index = getColorIndex(i, j, k) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ else if `maxw == gw` i = vbox.g1 while i <= vbox.g2 sum = 0 j = vbox.r1 while j <= vbox.r2 k = vbox.b1 while k <= vbox.b2 index = getColorIndex(j, i, k) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ else ### maxw == bw ### i = vbox.b1 while i <= vbox.b2 sum = 0 j = vbox.r1 while j <= vbox.r2 k = vbox.g1 while k <= vbox.g2 index = getColorIndex(j, k, i) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ partialsum.forEach (d, i) -> lookaheadsum[i] = total - d return # determine the cut planes if `maxw == rw` then doCut('r') else if `maxw == gw` then doCut('g') else doCut('b') quantize = (pixels, maxcolors) -> k = 0 # short-circuit # inner function to do the iteration iter = (lh, target) -> ncolors = lh.size() niters = 0 vbox = undefined while niters < maxIterations if ncolors >= target return if niters++ > maxIterations # console.log("infinite loop; perhaps too few pixels!"); return vbox = lh.pop() if !vbox.count() ### just put it back ### lh.push vbox niters++ k++ continue # do the cut vboxes = medianCutApply(histo, vbox) vbox1 = vboxes[0] vbox2 = vboxes[1] if !vbox1 # console.log("vbox1 not defined; shouldn't happen!"); return lh.push vbox1 if vbox2 ### vbox2 can be null ### lh.push vbox2 ncolors++ return if !pixels.length or maxcolors < 2 or maxcolors > 256 # console.log('wrong number of maxcolors'); return false # XXX: check color content and convert to grayscale if insufficient histo = getHisto(pixels) histosize = 1 << 3 * sigbits # check that we aren't below maxcolors already nColors = 0 histo.forEach -> nColors++ return if nColors <= maxcolors # XXX: generate the new colors from the histo and return else # get the beginning vbox from the colors vbox = vboxFromPixels(pixels, histo) pq = new PQueue((a, b) -> pv.naturalOrder a.count(), b.count() ) pq.push vbox # first set of colors, sorted by population iter pq, fractByPopulations * maxcolors # Re-sort by the product of pixel occupancy times the size in color space. pq2 = new PQueue((a, b) -> pv.naturalOrder a.count() * a.volume(), b.count() * b.volume() ) while pq.size() pq2.push pq.pop() # next set - generate the median cuts using the (npix * vol) sorting. iter pq2, maxcolors # calculate the actual colors cmap = new CMap while pq2.size() cmap.push pq2.pop() cmap VBox.prototype = volume: (force) -> vbox = this if !vbox._volume or force vbox._volume = (vbox.r2 - (vbox.r1) + 1) * (vbox.g2 - (vbox.g1) + 1) * (vbox.b2 - (vbox.b1) + 1) vbox._volume count: (force) -> vbox = this histo = vbox.histo if !vbox._count_set or force npix = 0 i = undefined j = undefined k = undefined i = vbox.r1 while i <= vbox.r2 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 `index = getColorIndex(i, j, k)` npix += histo[index] or 0 k++ j++ i++ vbox._count = npix vbox._count_set = true vbox._count copy: -> vbox = this new VBox(vbox.r1, vbox.r2, vbox.g1, vbox.g2, vbox.b1, vbox.b2, vbox.histo) avg: (force) -> vbox = this histo = vbox.histo if !vbox._avg or force ntot = 0 mult = 1 << 8 - sigbits rsum = 0 gsum = 0 bsum = 0 hval = undefined i = undefined j = undefined k = undefined histoindex = undefined i = vbox.r1 while i <= vbox.r2 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 histoindex = getColorIndex(i, j, k) hval = histo[histoindex] or 0 ntot += hval rsum += hval * (i + 0.5) * mult gsum += hval * (j + 0.5) * mult bsum += hval * (k + 0.5) * mult k++ j++ i++ if ntot vbox._avg = [ ~ ~(rsum / ntot) ~ ~(gsum / ntot) ~ ~(bsum / ntot) ] else # console.log('empty box'); vbox._avg = [ ~ ~(mult * (vbox.r1 + vbox.r2 + 1) / 2) ~ ~(mult * (vbox.g1 + vbox.g2 + 1) / 2) ~ ~(mult * (vbox.b1 + vbox.b2 + 1) / 2) ] vbox._avg contains: (pixel) -> vbox = this rval = pixel[0] >> rshift `gval = pixel[1] >> rshift` `bval = pixel[2] >> rshift` rval >= vbox.r1 and rval <= vbox.r2 and gval >= vbox.g1 and gval <= vbox.g2 and bval >= vbox.b1 and bval <= vbox.b2 CMap.prototype = push: (vbox) -> @vboxes.push vbox: vbox color: vbox.avg() return palette: -> @vboxes.map (vb) -> vb.color size: -> @vboxes.size() map: (color) -> vboxes = @vboxes i = 0 while i < vboxes.size() if vboxes.peek(i).vbox.contains(color) return vboxes.peek(i).color i++ @nearest color nearest: (color) -> vboxes = @vboxes d1 = undefined d2 = undefined pColor = undefined i = 0 while i < vboxes.size() d2 = Math.sqrt((color[0] - (vboxes.peek(i).color[0])) ** 2 + (color[1] - (vboxes.peek(i).color[1])) ** 2 + (color[2] - (vboxes.peek(i).color[2])) ** 2) if d2 < d1 or `d1 == undefined` d1 = d2 pColor = vboxes.peek(i).color i++ pColor forcebw: -> # XXX: won't work yet vboxes = @vboxes vboxes.sort (a, b) -> pv.naturalOrder pv.sum(a.color), pv.sum(b.color) # force darkest color to black if everything < 5 lowest = vboxes[0].color if lowest[0] < 5 and lowest[1] < 5 and lowest[2] < 5 vboxes[0].color = [ 0 0 0 ] # force lightest color to white if everything > 251 idx = vboxes.length - 1 highest = vboxes[idx].color if highest[0] > 251 and highest[1] > 251 and highest[2] > 251 vboxes[idx].color = [ 255 255 255 ] return { quantize: quantize } # --- # generated by js2coffee 2.2.0
true
# 'colorThief' module v1.0 # by PI:NAME:<NAME>END_PI, July 1st, 2016 | PI:EMAIL:<EMAIL>END_PI | @marc_krenn # ... based on colorThief.js by by PI:NAME:<NAME>END_PI http://www.lokeshdhakar.com # and kulturaveshchi # The 'colorThief' module allows you to extract the dominant color(s) of images. # -------------------------------------------------------------------- # The following is a slightly modified, auto-converted coffeescript version # of Color Thief, based on a PR by kulturaveshchi (https://github.com/lokesh/color-thief/pull/84) # Usage: # -------------------------------------------------------------------- ### # Include Module by adding the following line on top of your project {ColorThief} = require "colorThief" # Get dominant color colorThief.getColor imgSrc, (color) -> print color # Optional: Set custom sample quality colorThief.getColor {url:imgSrc, quality:10}, (color) -> print color # Get color palette # By default, this will return 5 colors at default quality 10 colorThief.getPalette imgSrc, (colors) -> print colors # Optional: Set custom colorCount and sample quality colorThief.getPalette {url:imgSrc, colorCount: 5, quality:10}, (colors) -> print colors ### # -------------------------------------------------------------------- ###! # Color Thief v2.0 # by PI:NAME:<NAME>END_PI - http://www.lokeshdhakar.com # # License # ------- # Creative Commons Attribution 2.5 License: # http://creativecommons.org/licenses/by/2.5/ # # Thanks # ------ # PI:NAME:<NAME>END_PI - For creating quantize.js. # PI:NAME:<NAME>END_PI - For clean up and optimization. @JFSIII # PI:NAME:<NAME>END_PI - For adding drag and drop support to the demo page. # ### ### CanvasImage Class Class that wraps the html image element and canvas. It also simplifies some of the canvas context manipulation with a set of helper functions. ### CanvasImage = (image) -> @canvas = document.createElement('canvas') @context = @canvas.getContext('2d') document.body.appendChild @canvas @width = @canvas.width = image.width @height = @canvas.height = image.height @context.drawImage image, 0, 0, @width, @height return CanvasImage::clear = -> @context.clearRect 0, 0, @width, @height return CanvasImage::update = (imageData) -> @context.putImageData imageData, 0, 0 return CanvasImage::getPixelCount = -> @width * @height CanvasImage::getImageData = -> @context.getImageData 0, 0, @width, @height CanvasImage::removeCanvas = -> @canvas.parentNode.removeChild @canvas return exports.ColorThief = -> ### # getColor(sourceImage[, quality]) # returns {r: num, g: num, b: num} # # Use the median cut algorithm provided by quantize.js to cluster similar # colors and return the base color from the largest cluster. # # Quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. # 10 is the default. There is a trade-off between quality and speed. The bigger the number, the # faster a color will be returned but the greater the likelihood that it will not be the visually # most dominant color. # # ### exports.ColorThief::getColor = (imgOptions, response) -> switch typeof imgOptions when "string" url = imgOptions quality = 10 when "object" url = imgOptions.url quality = imgOptions.quality img = new Image img.onload = => palette = @getColors(img, 5, quality) dominantColor = palette[0] response(colRgb = new Color("rgb(#{dominantColor[0]},#{dominantColor[1]},#{dominantColor[2]})")) img.crossOrigin = "anonymous" if url.startsWith("http") then img.src = "https://crossorigin.me/#{url}" else img.src = url exports.ColorThief::getPalette = (imgOptions, response) -> switch typeof imgOptions when "string" then url = imgOptions when "object" then url = imgOptions.url quality = imgOptions.quality ?= 10 colorCount = imgOptions.colorCount ?= 5 img = new Image img.onload = => palette = @getColors(img, colorCount, quality) colArray = [] for col in palette colArray.push(new Color("rgb(#{col[0]},#{col[1]},#{col[2]})")) response(colArray) img.crossOrigin = "anonymous" if url.startsWith("http") then img.src = "https://crossorigin.me/#{url}" else img.src = url ### # getColors(sourceImage[, colorCount, quality]) # returns array[ {r: num, g: num, b: num}, {r: num, g: num, b: num}, ...] # # Use the median cut algorithm provided by quantize.js to cluster similar colors. # # colorCount determines the size of the palette; the number of colors returned. If not set, it # defaults to 10. # # BUGGY: Function does not always return the requested amount of colors. It can be +/- 2. # # quality is an optional argument. It needs to be an integer. 1 is the highest quality settings. # 10 is the default. There is a trade-off between quality and speed. The bigger the number, the # faster the palette generation but the greater the likelihood that colors will be missed. # # ### exports.ColorThief::getColors = (sourceImage, colorCount, quality) -> if `typeof colorCount == 'undefined'` colorCount = 10 if `typeof quality == 'undefined'` or quality < 1 quality = 10 # Create custom CanvasImage object image = new CanvasImage(sourceImage) imageData = image.getImageData() pixels = imageData.data pixelCount = image.getPixelCount() # Store the RGB values in an array format suitable for quantize function pixelArray = [] i = 0 offset = undefined r = undefined g = undefined b = undefined a = undefined while i < pixelCount offset = i * 4 r = pixels[offset + 0] g = pixels[offset + 1] b = pixels[offset + 2] a = pixels[offset + 3] # If pixel is mostly opaque and not white if a >= 125 if !(r > 250 and g > 250 and b > 250) pixelArray.push [ r g b ] i = i + quality # Send array to quantize function which clusters values # using median cut algorithm cmap = MMCQ.quantize(pixelArray, colorCount) palette = if cmap then cmap.palette() else null # Clean up image.removeCanvas() palette ###! # quantize.js Copyright 2008 PI:NAME:<NAME>END_PI. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php ### # fill out a couple protovis dependencies ###! # Block below copied from Protovis: http://mbostock.github.com/protovis/ # Copyright 2010 Stanford Visualization Group # Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php ### if !pv pv = map: (array, f) -> o = {} if f then array.map(((d, i) -> o.index = i f.call o, d )) else array.slice() naturalOrder: (a, b) -> if a < b then -1 else if a > b then 1 else 0 sum: (array, f) -> o = {} array.reduce if f then ((p, d, i) -> o.index = i p + f.call(o, d) ) else ((p, d) -> p + d ) max: (array, f) -> Math.max.apply null, if f then pv.map(array, f) else array ###* # Basic Javascript port of the MMCQ (modified median cut quantization) # algorithm from the Leptonica library (http://www.leptonica.com/). # Returns a color map you can use to map original pixels to the reduced # palette. Still a work in progress. # # @author PI:NAME:<NAME>END_PI # @example // array of pixels as [R,G,B] arrays var myPixels = [[190,197,190], [202,204,200], [207,214,210], [211,214,211], [205,207,207] // etc ]; var maxColors = 4; var cmap = MMCQ.quantize(myPixels, maxColors); var newPalette = cmap.palette(); var newPixels = myPixels.map(function(p) { return cmap.map(p); }); ### MMCQ = do -> # private constants sigbits = 5 rshift = 8 - sigbits maxIterations = 1000 fractByPopulations = 0.75 # get reduced-space color index for a pixel getColorIndex = (r, g, b) -> (r << 2 * sigbits) + (g << sigbits) + b # Simple priority queue PQueue = (comparator) -> contents = [] sorted = false sort = -> contents.sort comparator sorted = true return { push: (o) -> contents.push o sorted = false return peek: (index) -> if !sorted sort() if `index == undefined` index = contents.length - 1 contents[index] pop: -> if !sorted sort() contents.pop() size: -> contents.length map: (f) -> contents.map f debug: -> if !sorted sort() contents } # 3d color space box VBox = (r1, r2, g1, g2, b1, b2, histo) -> vbox = this vbox.r1 = r1 vbox.r2 = r2 vbox.g1 = g1 vbox.g2 = g2 vbox.b1 = b1 vbox.b2 = b2 vbox.histo = histo return # Color map CMap = -> @vboxes = new PQueue((a, b) -> pv.naturalOrder a.vbox.count() * a.vbox.volume(), b.vbox.count() * b.vbox.volume() ) return # histo (1-d array, giving the number of pixels in # each quantized region of color space), or null on error getHisto = (pixels) -> histosize = 1 << 3 * sigbits histo = new Array(histosize) index = undefined rval = undefined gval = undefined bval = undefined pixels.forEach (pixel) -> rval = pixel[0] >> rshift gval = pixel[1] >> rshift bval = pixel[2] >> rshift index = getColorIndex(rval, gval, bval) histo[index] = (histo[index] or 0) + 1 return histo vboxFromPixels = (pixels, histo) -> rmin = 1000000 rmax = 0 gmin = 1000000 gmax = 0 bmin = 1000000 bmax = 0 rval = undefined gval = undefined bval = undefined # find min/max pixels.forEach (pixel) -> rval = pixel[0] >> rshift gval = pixel[1] >> rshift bval = pixel[2] >> rshift if rval < rmin rmin = rval else if rval > rmax rmax = rval if gval < gmin gmin = gval else if gval > gmax gmax = gval if bval < bmin bmin = bval else if bval > bmax bmax = bval return new VBox(rmin, rmax, gmin, gmax, bmin, bmax, histo) medianCutApply = (histo, vbox) -> doCut = (color) -> dim1 = color + '1' dim2 = color + '2' left = undefined right = undefined vbox1 = undefined vbox2 = undefined d2 = undefined count2 = 0 `i = vbox[dim1]` while i <= vbox[dim2] if partialsum[i] > total / 2 vbox1 = vbox.copy() vbox2 = vbox.copy() left = i - (vbox[dim1]) right = vbox[dim2] - i if left <= right d2 = Math.min(vbox[dim2] - 1, ~ ~(i + right / 2)) else d2 = Math.max(vbox[dim1], ~ ~(i - 1 - (left / 2))) # avoid 0-count boxes while !partialsum[d2] d2++ count2 = lookaheadsum[d2] while !count2 and partialsum[d2 - 1] count2 = lookaheadsum[--d2] # set dimensions vbox1[dim2] = d2 vbox2[dim1] = vbox1[dim2] + 1 # console.log('vbox counts:', vbox.count(), vbox1.count(), vbox2.count()); return [ vbox1 vbox2 ] i++ return if !vbox.count() return rw = vbox.r2 - (vbox.r1) + 1 gw = vbox.g2 - (vbox.g1) + 1 bw = vbox.b2 - (vbox.b1) + 1 maxw = pv.max([ rw gw bw ]) # only one pixel, no split if `vbox.count() == 1` return [ vbox.copy() ] ### Find the partial sum arrays along the selected axis. ### total = 0 partialsum = [] lookaheadsum = [] i = undefined j = undefined k = undefined sum = undefined index = undefined if `maxw == rw` i = vbox.r1 while i <= vbox.r2 sum = 0 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 index = getColorIndex(i, j, k) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ else if `maxw == gw` i = vbox.g1 while i <= vbox.g2 sum = 0 j = vbox.r1 while j <= vbox.r2 k = vbox.b1 while k <= vbox.b2 index = getColorIndex(j, i, k) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ else ### maxw == bw ### i = vbox.b1 while i <= vbox.b2 sum = 0 j = vbox.r1 while j <= vbox.r2 k = vbox.g1 while k <= vbox.g2 index = getColorIndex(j, k, i) sum += histo[index] or 0 k++ j++ total += sum partialsum[i] = total i++ partialsum.forEach (d, i) -> lookaheadsum[i] = total - d return # determine the cut planes if `maxw == rw` then doCut('r') else if `maxw == gw` then doCut('g') else doCut('b') quantize = (pixels, maxcolors) -> k = 0 # short-circuit # inner function to do the iteration iter = (lh, target) -> ncolors = lh.size() niters = 0 vbox = undefined while niters < maxIterations if ncolors >= target return if niters++ > maxIterations # console.log("infinite loop; perhaps too few pixels!"); return vbox = lh.pop() if !vbox.count() ### just put it back ### lh.push vbox niters++ k++ continue # do the cut vboxes = medianCutApply(histo, vbox) vbox1 = vboxes[0] vbox2 = vboxes[1] if !vbox1 # console.log("vbox1 not defined; shouldn't happen!"); return lh.push vbox1 if vbox2 ### vbox2 can be null ### lh.push vbox2 ncolors++ return if !pixels.length or maxcolors < 2 or maxcolors > 256 # console.log('wrong number of maxcolors'); return false # XXX: check color content and convert to grayscale if insufficient histo = getHisto(pixels) histosize = 1 << 3 * sigbits # check that we aren't below maxcolors already nColors = 0 histo.forEach -> nColors++ return if nColors <= maxcolors # XXX: generate the new colors from the histo and return else # get the beginning vbox from the colors vbox = vboxFromPixels(pixels, histo) pq = new PQueue((a, b) -> pv.naturalOrder a.count(), b.count() ) pq.push vbox # first set of colors, sorted by population iter pq, fractByPopulations * maxcolors # Re-sort by the product of pixel occupancy times the size in color space. pq2 = new PQueue((a, b) -> pv.naturalOrder a.count() * a.volume(), b.count() * b.volume() ) while pq.size() pq2.push pq.pop() # next set - generate the median cuts using the (npix * vol) sorting. iter pq2, maxcolors # calculate the actual colors cmap = new CMap while pq2.size() cmap.push pq2.pop() cmap VBox.prototype = volume: (force) -> vbox = this if !vbox._volume or force vbox._volume = (vbox.r2 - (vbox.r1) + 1) * (vbox.g2 - (vbox.g1) + 1) * (vbox.b2 - (vbox.b1) + 1) vbox._volume count: (force) -> vbox = this histo = vbox.histo if !vbox._count_set or force npix = 0 i = undefined j = undefined k = undefined i = vbox.r1 while i <= vbox.r2 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 `index = getColorIndex(i, j, k)` npix += histo[index] or 0 k++ j++ i++ vbox._count = npix vbox._count_set = true vbox._count copy: -> vbox = this new VBox(vbox.r1, vbox.r2, vbox.g1, vbox.g2, vbox.b1, vbox.b2, vbox.histo) avg: (force) -> vbox = this histo = vbox.histo if !vbox._avg or force ntot = 0 mult = 1 << 8 - sigbits rsum = 0 gsum = 0 bsum = 0 hval = undefined i = undefined j = undefined k = undefined histoindex = undefined i = vbox.r1 while i <= vbox.r2 j = vbox.g1 while j <= vbox.g2 k = vbox.b1 while k <= vbox.b2 histoindex = getColorIndex(i, j, k) hval = histo[histoindex] or 0 ntot += hval rsum += hval * (i + 0.5) * mult gsum += hval * (j + 0.5) * mult bsum += hval * (k + 0.5) * mult k++ j++ i++ if ntot vbox._avg = [ ~ ~(rsum / ntot) ~ ~(gsum / ntot) ~ ~(bsum / ntot) ] else # console.log('empty box'); vbox._avg = [ ~ ~(mult * (vbox.r1 + vbox.r2 + 1) / 2) ~ ~(mult * (vbox.g1 + vbox.g2 + 1) / 2) ~ ~(mult * (vbox.b1 + vbox.b2 + 1) / 2) ] vbox._avg contains: (pixel) -> vbox = this rval = pixel[0] >> rshift `gval = pixel[1] >> rshift` `bval = pixel[2] >> rshift` rval >= vbox.r1 and rval <= vbox.r2 and gval >= vbox.g1 and gval <= vbox.g2 and bval >= vbox.b1 and bval <= vbox.b2 CMap.prototype = push: (vbox) -> @vboxes.push vbox: vbox color: vbox.avg() return palette: -> @vboxes.map (vb) -> vb.color size: -> @vboxes.size() map: (color) -> vboxes = @vboxes i = 0 while i < vboxes.size() if vboxes.peek(i).vbox.contains(color) return vboxes.peek(i).color i++ @nearest color nearest: (color) -> vboxes = @vboxes d1 = undefined d2 = undefined pColor = undefined i = 0 while i < vboxes.size() d2 = Math.sqrt((color[0] - (vboxes.peek(i).color[0])) ** 2 + (color[1] - (vboxes.peek(i).color[1])) ** 2 + (color[2] - (vboxes.peek(i).color[2])) ** 2) if d2 < d1 or `d1 == undefined` d1 = d2 pColor = vboxes.peek(i).color i++ pColor forcebw: -> # XXX: won't work yet vboxes = @vboxes vboxes.sort (a, b) -> pv.naturalOrder pv.sum(a.color), pv.sum(b.color) # force darkest color to black if everything < 5 lowest = vboxes[0].color if lowest[0] < 5 and lowest[1] < 5 and lowest[2] < 5 vboxes[0].color = [ 0 0 0 ] # force lightest color to white if everything > 251 idx = vboxes.length - 1 highest = vboxes[idx].color if highest[0] > 251 and highest[1] > 251 and highest[2] > 251 vboxes[idx].color = [ 255 255 255 ] return { quantize: quantize } # --- # generated by js2coffee 2.2.0
[ { "context": " cb\n\nCreate.account = (index, cb) ->\n\tuserName = 'user' + Faker.random.number()\n\tdisplayName = 'userDisp", "end": 7586, "score": 0.9974149465560913, "start": 7582, "tag": "USERNAME", "value": "user" }, { "context": " = 'user' + Faker.random.number()\n\tdisplayName...
seeds/create.coffee
LogicalOutcomes/KoNote
1
Imm = require 'immutable' Faker = require 'faker' Async = require 'async' Moment = require 'moment' Config = require '../src/config' {Users, TimestampFormat, generateId} = require '../src/persist' {ProgramColors, EventTypeColors} = require '../src/colors' {stripMetadata} = require '../src/persist/utils' Create = {} # Utilities createData = (dataCollection, obj, cb) -> global.ActiveSession.persist[dataCollection].create obj, cb # Singular create functions Create.clientFile = (cb) -> first = Faker.name.firstName() middle = Faker.name.firstName() last = Faker.name.lastName() recordId = Faker.random.number().toString() earliestDate = Moment().subtract(29000, 'days') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 birthDate = Moment().subtract(randomDay, 'days').format('YYYYMMMDD') clientFile = Imm.fromJS { clientName: {first, middle, last} recordId: recordId birthDate status: 'active' plan: { sections: [] } detailUnits: [] } createData 'clientFiles', clientFile, cb Create.globalEvent = ({progEvent}, cb) -> globalEvent = Imm.fromJS { title: progEvent.get('title') description: progEvent.get('description') startTimestamp: progEvent.get('startTimestamp') endTimestamp: progEvent.get('endTimestamp') typeId: progEvent.get('typeId') clientFileId: progEvent.get('clientFileId') relatedProgNoteId: progEvent.get('relatedProgNoteId') relatedProgEventId: progEvent.get('id') programId: progEvent.get('authorProgramId') backdate: progEvent.get('backdate') status: progEvent.get('status') statusReason: progEvent.get('statusReason') } createData 'globalEvents', globalEvent, cb Create.progEvent = ({clientFile, progNote, eventTypes}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') randomDaySpan = Math.floor(Math.random() * 10) + 1 randomEnddate = Moment().subtract(randomDay, 'days').add(randomDaySpan, 'days') eventTypeIds = eventTypes .map (eventType) -> eventType.get('id') .toJS() randomIndex = Math.floor(Math.random() * eventTypeIds.length) randomTypeId = eventTypeIds[randomIndex] relatedProgNoteId = progNote.get('id') clientFileId = clientFile.get('id') progEvent = Imm.fromJS { title: Faker.company.bsBuzz() description: Faker.lorem.paragraph() startTimestamp: randomBackdate.format(TimestampFormat) endTimestamp: randomEnddate.format(TimestampFormat) status: 'default' # statusReason: optional backdate: progNote.get('backdate') typeId: randomTypeId relatedProgNoteId authorProgramId: '' clientFileId } createData 'progEvents', progEvent, cb Create.quickNote = ({clientFile}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') quickNote = Imm.fromJS { type: 'basic' status: 'default' clientFileId: clientFile.get('id') notes: Faker.lorem.paragraph() timestamp: randomBackdate.format(TimestampFormat) backdate: '' authorProgramId: '' beginTimestamp: '' } createData 'progNotes', quickNote, cb Create.progNote = ({clientFile, sections, planTargets, metrics}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') progNoteTemplate = Imm.fromJS Config.templates[Config.useTemplate] progNoteUnit = progNoteTemplate.getIn(['units', 0]) # Loop over progNote sections progNoteSections = sections.map (section) -> # Loop over targetIds, and get the matching planTarget definition targets = section.get('targetIds').map (targetId) -> planTarget = planTargets.find (target) -> target.get('id') is targetId # Loop over metricIds, get the matching metric metricNotes = planTarget.get('metricIds').map (metricId) -> metric = metrics.find (metric) -> metric.get('id') is metricId # Generate fake metric value randomNumber = Math.floor(Math.random() * 10) + 1 # Construct the metric note return { id: metric.get('id') name: metric.get('name') definition: metric.get('definition') value: randomNumber.toString() } # Construct the target note return { id: planTarget.get('id') name: planTarget.get('name') description: planTarget.get('description') notes: Faker.lorem.paragraph() metrics: metricNotes.toJS() } # Construct the section as a whole return { id: section.get('id') name: section.get('name') targets: targets } # 1/3 chance of having a summary hasSummary = (Math.floor(Math.random() * 3) + 1) is 3 progNote = Imm.fromJS { clientFileId: clientFile.get('id') type: 'full' status: 'default' templateId: progNoteTemplate.get('id') backdate: '' timestamp: randomBackdate.format(TimestampFormat) authorProgramId: '' beginTimestamp: '' summary: if hasSummary then Faker.lorem.paragraph() else '' units: [ { id: progNoteUnit.get('id') type: progNoteUnit.get('type') name: progNoteUnit.get('name') sections: progNoteSections } ] } createData 'progNotes', progNote, cb Create.alert = (clientFile, cb) -> clientFileId = clientFile.get('id') alert = Imm.fromJS { content: Faker.lorem.paragraph() clientFileId status: 'default' statusReason: 'Seeded' updateReason: 'Seeded' authorProgramId: '' } createData 'alerts', alert, cb Create.planTarget = (clientFile, metrics, cb) -> metricIds = metrics .map (metric) -> metric.get('id') .toJS() # randomly chooses a status, with a higher probability of 'default' randomNumber = Math.floor(Math.random() * 10) + 1 if randomNumber > 8 status = 'deactivated' else if randomNumber < 2 status = 'completed' else status = 'default' target = Imm.fromJS { clientFileId: clientFile.get('id') name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() status metricIds } createData 'planTargets', target, cb Create.planTargetRevision = (target, cb) -> newDescription = Faker.lorem.paragraph() updatedPlanTarget = target.set 'description', newDescription global.ActiveSession.persist.planTargets.createRevision updatedPlanTarget, cb Create.program = (index, cb) -> program = Imm.fromJS({ name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() status: 'default' # chooses a hexColor randomly from an imported list of hexcolors colorKeyHex: ProgramColors.get(Math.floor(Math.random() * ProgramColors.size)) }) createData 'programs', program, cb Create.clientFileProgramLink = (clientFile, program, cb) -> link = Imm.fromJS({ clientFileId: clientFile.get('id') programId: program.get('id') status: 'enrolled' }) createData 'clientFileProgramLinks', link, cb Create.metric = (index, cb) -> metric = Imm.fromJS ({ name: Faker.company.bsBuzz() definition: Faker.lorem.paragraph() status: 'default' }) createData 'metrics', metric, cb Create.eventType = (index, cb) -> eventType = Imm.fromJS ({ name: Faker.company.bsBuzz() # chooses a hexColor randomly from an imported list of hexcolors colorKeyHex: EventTypeColors.get(Math.floor(Math.random() * EventTypeColors.size)) description: Faker.lorem.paragraph() status: 'default' }) createData 'eventTypes', eventType, cb Create.account = (index, cb) -> userName = 'user' + Faker.random.number() displayName = 'userDisplay' + Faker.random.number() password = 'password' accountType = 'normal' Users.Account.create global.ActiveSession.account, userName, displayName, password, accountType, cb Create.planTemplate = (index, cb) -> planTemplate = Imm.fromJS { name: Faker.company.bsBuzz() sections: [ { name: Faker.company.bsBuzz() targets: [ { name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() metricIds: [] } ] }, { name: Faker.company.bsBuzz() targets: [ { name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() metricIds: [] } ] } ] } # Multi create functions Create.clientFiles = (quantity, cb=(->)) -> Async.times quantity, Create.clientFile, (err, clientFiles) -> if err cb err return console.log "Created #{quantity} clientFiles" cb null, Imm.List(clientFiles) Create.progEvents = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.progEvent(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.quickNotes = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.quickNote(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.progNotes = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.progNote(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.planTargets = (quantity, clientFile, metrics, cb) -> sliceSize = Math.floor(metrics.size / quantity) x = 0 Async.times quantity, (index, cb) => targetMetrics = metrics.slice(x, x + sliceSize) Create.planTarget(clientFile, targetMetrics, cb) x += sliceSize , (err, results) -> if err cb err return console.log "Created #{quantity} planTargets" cb null, Imm.List(results) Create.planTargetRevisions = (quantity, planTarget, cb) -> Async.times quantity, (index, cb) => Create.planTargetRevision(planTarget, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.programs = (quantity, cb) -> Async.times quantity, Create.program, (err, programs) -> if err cb err return console.log "Created #{quantity} programs" cb null, Imm.List(programs) Create.clientFileProgramLinks = (clientFiles, program, cb) -> Async.map clientFiles.toArray(), (clientFile, cb) -> Create.clientFileProgramLink clientFile, program, (err, result) -> if err cb err return cb null, Imm.List(result) , cb Create.metrics = (quantity, cb) -> Async.times quantity, Create.metric, (err, metrics) -> if err cb err return console.log "Created #{quantity} metrics" cb null, Imm.List(metrics) Create.eventTypes = (quantity, cb) -> Async.times quantity, Create.eventType, (err, eventTypes) -> if err cb err return console.log "Created #{quantity} eventTypes" cb null, Imm.List(eventTypes) Create.accounts = (quantity, cb) -> Async.times quantity, Create.account, (err, accounts) -> if err cb err return console.log "Created #{quantity} accounts" cb null, Imm.List(accounts) Create.planTemplates = (quantity, cb) -> Async.times quantity, Create.planTemplate, (err, planTemplates) -> if err cb err return console.log "Created #{quantity} planTemplates" cb null, Imm.List(planTemplates) module.exports = Create
94414
Imm = require 'immutable' Faker = require 'faker' Async = require 'async' Moment = require 'moment' Config = require '../src/config' {Users, TimestampFormat, generateId} = require '../src/persist' {ProgramColors, EventTypeColors} = require '../src/colors' {stripMetadata} = require '../src/persist/utils' Create = {} # Utilities createData = (dataCollection, obj, cb) -> global.ActiveSession.persist[dataCollection].create obj, cb # Singular create functions Create.clientFile = (cb) -> first = Faker.name.firstName() middle = Faker.name.firstName() last = Faker.name.lastName() recordId = Faker.random.number().toString() earliestDate = Moment().subtract(29000, 'days') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 birthDate = Moment().subtract(randomDay, 'days').format('YYYYMMMDD') clientFile = Imm.fromJS { clientName: {first, middle, last} recordId: recordId birthDate status: 'active' plan: { sections: [] } detailUnits: [] } createData 'clientFiles', clientFile, cb Create.globalEvent = ({progEvent}, cb) -> globalEvent = Imm.fromJS { title: progEvent.get('title') description: progEvent.get('description') startTimestamp: progEvent.get('startTimestamp') endTimestamp: progEvent.get('endTimestamp') typeId: progEvent.get('typeId') clientFileId: progEvent.get('clientFileId') relatedProgNoteId: progEvent.get('relatedProgNoteId') relatedProgEventId: progEvent.get('id') programId: progEvent.get('authorProgramId') backdate: progEvent.get('backdate') status: progEvent.get('status') statusReason: progEvent.get('statusReason') } createData 'globalEvents', globalEvent, cb Create.progEvent = ({clientFile, progNote, eventTypes}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') randomDaySpan = Math.floor(Math.random() * 10) + 1 randomEnddate = Moment().subtract(randomDay, 'days').add(randomDaySpan, 'days') eventTypeIds = eventTypes .map (eventType) -> eventType.get('id') .toJS() randomIndex = Math.floor(Math.random() * eventTypeIds.length) randomTypeId = eventTypeIds[randomIndex] relatedProgNoteId = progNote.get('id') clientFileId = clientFile.get('id') progEvent = Imm.fromJS { title: Faker.company.bsBuzz() description: Faker.lorem.paragraph() startTimestamp: randomBackdate.format(TimestampFormat) endTimestamp: randomEnddate.format(TimestampFormat) status: 'default' # statusReason: optional backdate: progNote.get('backdate') typeId: randomTypeId relatedProgNoteId authorProgramId: '' clientFileId } createData 'progEvents', progEvent, cb Create.quickNote = ({clientFile}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') quickNote = Imm.fromJS { type: 'basic' status: 'default' clientFileId: clientFile.get('id') notes: Faker.lorem.paragraph() timestamp: randomBackdate.format(TimestampFormat) backdate: '' authorProgramId: '' beginTimestamp: '' } createData 'progNotes', quickNote, cb Create.progNote = ({clientFile, sections, planTargets, metrics}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') progNoteTemplate = Imm.fromJS Config.templates[Config.useTemplate] progNoteUnit = progNoteTemplate.getIn(['units', 0]) # Loop over progNote sections progNoteSections = sections.map (section) -> # Loop over targetIds, and get the matching planTarget definition targets = section.get('targetIds').map (targetId) -> planTarget = planTargets.find (target) -> target.get('id') is targetId # Loop over metricIds, get the matching metric metricNotes = planTarget.get('metricIds').map (metricId) -> metric = metrics.find (metric) -> metric.get('id') is metricId # Generate fake metric value randomNumber = Math.floor(Math.random() * 10) + 1 # Construct the metric note return { id: metric.get('id') name: metric.get('name') definition: metric.get('definition') value: randomNumber.toString() } # Construct the target note return { id: planTarget.get('id') name: planTarget.get('name') description: planTarget.get('description') notes: Faker.lorem.paragraph() metrics: metricNotes.toJS() } # Construct the section as a whole return { id: section.get('id') name: section.get('name') targets: targets } # 1/3 chance of having a summary hasSummary = (Math.floor(Math.random() * 3) + 1) is 3 progNote = Imm.fromJS { clientFileId: clientFile.get('id') type: 'full' status: 'default' templateId: progNoteTemplate.get('id') backdate: '' timestamp: randomBackdate.format(TimestampFormat) authorProgramId: '' beginTimestamp: '' summary: if hasSummary then Faker.lorem.paragraph() else '' units: [ { id: progNoteUnit.get('id') type: progNoteUnit.get('type') name: progNoteUnit.get('name') sections: progNoteSections } ] } createData 'progNotes', progNote, cb Create.alert = (clientFile, cb) -> clientFileId = clientFile.get('id') alert = Imm.fromJS { content: Faker.lorem.paragraph() clientFileId status: 'default' statusReason: 'Seeded' updateReason: 'Seeded' authorProgramId: '' } createData 'alerts', alert, cb Create.planTarget = (clientFile, metrics, cb) -> metricIds = metrics .map (metric) -> metric.get('id') .toJS() # randomly chooses a status, with a higher probability of 'default' randomNumber = Math.floor(Math.random() * 10) + 1 if randomNumber > 8 status = 'deactivated' else if randomNumber < 2 status = 'completed' else status = 'default' target = Imm.fromJS { clientFileId: clientFile.get('id') name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() status metricIds } createData 'planTargets', target, cb Create.planTargetRevision = (target, cb) -> newDescription = Faker.lorem.paragraph() updatedPlanTarget = target.set 'description', newDescription global.ActiveSession.persist.planTargets.createRevision updatedPlanTarget, cb Create.program = (index, cb) -> program = Imm.fromJS({ name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() status: 'default' # chooses a hexColor randomly from an imported list of hexcolors colorKeyHex: ProgramColors.get(Math.floor(Math.random() * ProgramColors.size)) }) createData 'programs', program, cb Create.clientFileProgramLink = (clientFile, program, cb) -> link = Imm.fromJS({ clientFileId: clientFile.get('id') programId: program.get('id') status: 'enrolled' }) createData 'clientFileProgramLinks', link, cb Create.metric = (index, cb) -> metric = Imm.fromJS ({ name: Faker.company.bsBuzz() definition: Faker.lorem.paragraph() status: 'default' }) createData 'metrics', metric, cb Create.eventType = (index, cb) -> eventType = Imm.fromJS ({ name: Faker.company.bsBuzz() # chooses a hexColor randomly from an imported list of hexcolors colorKeyHex: EventTypeColors.get(Math.floor(Math.random() * EventTypeColors.size)) description: Faker.lorem.paragraph() status: 'default' }) createData 'eventTypes', eventType, cb Create.account = (index, cb) -> userName = 'user' + Faker.random.number() displayName = 'userDisplay' + Faker.random.number() password = '<PASSWORD>' accountType = 'normal' Users.Account.create global.ActiveSession.account, userName, displayName, password, accountType, cb Create.planTemplate = (index, cb) -> planTemplate = Imm.fromJS { name: Faker.company.bsBuzz() sections: [ { name: Faker.company.bsBuzz() targets: [ { name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() metricIds: [] } ] }, { name: Faker.company.bsBuzz() targets: [ { name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() metricIds: [] } ] } ] } # Multi create functions Create.clientFiles = (quantity, cb=(->)) -> Async.times quantity, Create.clientFile, (err, clientFiles) -> if err cb err return console.log "Created #{quantity} clientFiles" cb null, Imm.List(clientFiles) Create.progEvents = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.progEvent(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.quickNotes = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.quickNote(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.progNotes = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.progNote(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.planTargets = (quantity, clientFile, metrics, cb) -> sliceSize = Math.floor(metrics.size / quantity) x = 0 Async.times quantity, (index, cb) => targetMetrics = metrics.slice(x, x + sliceSize) Create.planTarget(clientFile, targetMetrics, cb) x += sliceSize , (err, results) -> if err cb err return console.log "Created #{quantity} planTargets" cb null, Imm.List(results) Create.planTargetRevisions = (quantity, planTarget, cb) -> Async.times quantity, (index, cb) => Create.planTargetRevision(planTarget, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.programs = (quantity, cb) -> Async.times quantity, Create.program, (err, programs) -> if err cb err return console.log "Created #{quantity} programs" cb null, Imm.List(programs) Create.clientFileProgramLinks = (clientFiles, program, cb) -> Async.map clientFiles.toArray(), (clientFile, cb) -> Create.clientFileProgramLink clientFile, program, (err, result) -> if err cb err return cb null, Imm.List(result) , cb Create.metrics = (quantity, cb) -> Async.times quantity, Create.metric, (err, metrics) -> if err cb err return console.log "Created #{quantity} metrics" cb null, Imm.List(metrics) Create.eventTypes = (quantity, cb) -> Async.times quantity, Create.eventType, (err, eventTypes) -> if err cb err return console.log "Created #{quantity} eventTypes" cb null, Imm.List(eventTypes) Create.accounts = (quantity, cb) -> Async.times quantity, Create.account, (err, accounts) -> if err cb err return console.log "Created #{quantity} accounts" cb null, Imm.List(accounts) Create.planTemplates = (quantity, cb) -> Async.times quantity, Create.planTemplate, (err, planTemplates) -> if err cb err return console.log "Created #{quantity} planTemplates" cb null, Imm.List(planTemplates) module.exports = Create
true
Imm = require 'immutable' Faker = require 'faker' Async = require 'async' Moment = require 'moment' Config = require '../src/config' {Users, TimestampFormat, generateId} = require '../src/persist' {ProgramColors, EventTypeColors} = require '../src/colors' {stripMetadata} = require '../src/persist/utils' Create = {} # Utilities createData = (dataCollection, obj, cb) -> global.ActiveSession.persist[dataCollection].create obj, cb # Singular create functions Create.clientFile = (cb) -> first = Faker.name.firstName() middle = Faker.name.firstName() last = Faker.name.lastName() recordId = Faker.random.number().toString() earliestDate = Moment().subtract(29000, 'days') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 birthDate = Moment().subtract(randomDay, 'days').format('YYYYMMMDD') clientFile = Imm.fromJS { clientName: {first, middle, last} recordId: recordId birthDate status: 'active' plan: { sections: [] } detailUnits: [] } createData 'clientFiles', clientFile, cb Create.globalEvent = ({progEvent}, cb) -> globalEvent = Imm.fromJS { title: progEvent.get('title') description: progEvent.get('description') startTimestamp: progEvent.get('startTimestamp') endTimestamp: progEvent.get('endTimestamp') typeId: progEvent.get('typeId') clientFileId: progEvent.get('clientFileId') relatedProgNoteId: progEvent.get('relatedProgNoteId') relatedProgEventId: progEvent.get('id') programId: progEvent.get('authorProgramId') backdate: progEvent.get('backdate') status: progEvent.get('status') statusReason: progEvent.get('statusReason') } createData 'globalEvents', globalEvent, cb Create.progEvent = ({clientFile, progNote, eventTypes}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') randomDaySpan = Math.floor(Math.random() * 10) + 1 randomEnddate = Moment().subtract(randomDay, 'days').add(randomDaySpan, 'days') eventTypeIds = eventTypes .map (eventType) -> eventType.get('id') .toJS() randomIndex = Math.floor(Math.random() * eventTypeIds.length) randomTypeId = eventTypeIds[randomIndex] relatedProgNoteId = progNote.get('id') clientFileId = clientFile.get('id') progEvent = Imm.fromJS { title: Faker.company.bsBuzz() description: Faker.lorem.paragraph() startTimestamp: randomBackdate.format(TimestampFormat) endTimestamp: randomEnddate.format(TimestampFormat) status: 'default' # statusReason: optional backdate: progNote.get('backdate') typeId: randomTypeId relatedProgNoteId authorProgramId: '' clientFileId } createData 'progEvents', progEvent, cb Create.quickNote = ({clientFile}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') quickNote = Imm.fromJS { type: 'basic' status: 'default' clientFileId: clientFile.get('id') notes: Faker.lorem.paragraph() timestamp: randomBackdate.format(TimestampFormat) backdate: '' authorProgramId: '' beginTimestamp: '' } createData 'progNotes', quickNote, cb Create.progNote = ({clientFile, sections, planTargets, metrics}, cb) -> earliestDate = Moment().subtract(2, 'months') daySpan = Moment().diff(earliestDate, 'days') randomDay = Math.floor(Math.random() * daySpan) + 1 randomBackdate = Moment().subtract(randomDay, 'days') progNoteTemplate = Imm.fromJS Config.templates[Config.useTemplate] progNoteUnit = progNoteTemplate.getIn(['units', 0]) # Loop over progNote sections progNoteSections = sections.map (section) -> # Loop over targetIds, and get the matching planTarget definition targets = section.get('targetIds').map (targetId) -> planTarget = planTargets.find (target) -> target.get('id') is targetId # Loop over metricIds, get the matching metric metricNotes = planTarget.get('metricIds').map (metricId) -> metric = metrics.find (metric) -> metric.get('id') is metricId # Generate fake metric value randomNumber = Math.floor(Math.random() * 10) + 1 # Construct the metric note return { id: metric.get('id') name: metric.get('name') definition: metric.get('definition') value: randomNumber.toString() } # Construct the target note return { id: planTarget.get('id') name: planTarget.get('name') description: planTarget.get('description') notes: Faker.lorem.paragraph() metrics: metricNotes.toJS() } # Construct the section as a whole return { id: section.get('id') name: section.get('name') targets: targets } # 1/3 chance of having a summary hasSummary = (Math.floor(Math.random() * 3) + 1) is 3 progNote = Imm.fromJS { clientFileId: clientFile.get('id') type: 'full' status: 'default' templateId: progNoteTemplate.get('id') backdate: '' timestamp: randomBackdate.format(TimestampFormat) authorProgramId: '' beginTimestamp: '' summary: if hasSummary then Faker.lorem.paragraph() else '' units: [ { id: progNoteUnit.get('id') type: progNoteUnit.get('type') name: progNoteUnit.get('name') sections: progNoteSections } ] } createData 'progNotes', progNote, cb Create.alert = (clientFile, cb) -> clientFileId = clientFile.get('id') alert = Imm.fromJS { content: Faker.lorem.paragraph() clientFileId status: 'default' statusReason: 'Seeded' updateReason: 'Seeded' authorProgramId: '' } createData 'alerts', alert, cb Create.planTarget = (clientFile, metrics, cb) -> metricIds = metrics .map (metric) -> metric.get('id') .toJS() # randomly chooses a status, with a higher probability of 'default' randomNumber = Math.floor(Math.random() * 10) + 1 if randomNumber > 8 status = 'deactivated' else if randomNumber < 2 status = 'completed' else status = 'default' target = Imm.fromJS { clientFileId: clientFile.get('id') name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() status metricIds } createData 'planTargets', target, cb Create.planTargetRevision = (target, cb) -> newDescription = Faker.lorem.paragraph() updatedPlanTarget = target.set 'description', newDescription global.ActiveSession.persist.planTargets.createRevision updatedPlanTarget, cb Create.program = (index, cb) -> program = Imm.fromJS({ name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() status: 'default' # chooses a hexColor randomly from an imported list of hexcolors colorKeyHex: ProgramColors.get(Math.floor(Math.random() * ProgramColors.size)) }) createData 'programs', program, cb Create.clientFileProgramLink = (clientFile, program, cb) -> link = Imm.fromJS({ clientFileId: clientFile.get('id') programId: program.get('id') status: 'enrolled' }) createData 'clientFileProgramLinks', link, cb Create.metric = (index, cb) -> metric = Imm.fromJS ({ name: Faker.company.bsBuzz() definition: Faker.lorem.paragraph() status: 'default' }) createData 'metrics', metric, cb Create.eventType = (index, cb) -> eventType = Imm.fromJS ({ name: Faker.company.bsBuzz() # chooses a hexColor randomly from an imported list of hexcolors colorKeyHex: EventTypeColors.get(Math.floor(Math.random() * EventTypeColors.size)) description: Faker.lorem.paragraph() status: 'default' }) createData 'eventTypes', eventType, cb Create.account = (index, cb) -> userName = 'user' + Faker.random.number() displayName = 'userDisplay' + Faker.random.number() password = 'PI:PASSWORD:<PASSWORD>END_PI' accountType = 'normal' Users.Account.create global.ActiveSession.account, userName, displayName, password, accountType, cb Create.planTemplate = (index, cb) -> planTemplate = Imm.fromJS { name: Faker.company.bsBuzz() sections: [ { name: Faker.company.bsBuzz() targets: [ { name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() metricIds: [] } ] }, { name: Faker.company.bsBuzz() targets: [ { name: Faker.company.bsBuzz() description: Faker.lorem.paragraph() metricIds: [] } ] } ] } # Multi create functions Create.clientFiles = (quantity, cb=(->)) -> Async.times quantity, Create.clientFile, (err, clientFiles) -> if err cb err return console.log "Created #{quantity} clientFiles" cb null, Imm.List(clientFiles) Create.progEvents = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.progEvent(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.quickNotes = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.quickNote(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.progNotes = (quantity, props, cb) -> Async.times quantity, (index, cb) -> Create.progNote(props, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.planTargets = (quantity, clientFile, metrics, cb) -> sliceSize = Math.floor(metrics.size / quantity) x = 0 Async.times quantity, (index, cb) => targetMetrics = metrics.slice(x, x + sliceSize) Create.planTarget(clientFile, targetMetrics, cb) x += sliceSize , (err, results) -> if err cb err return console.log "Created #{quantity} planTargets" cb null, Imm.List(results) Create.planTargetRevisions = (quantity, planTarget, cb) -> Async.times quantity, (index, cb) => Create.planTargetRevision(planTarget, cb) , (err, results) -> if err cb err return cb null, Imm.List(results) Create.programs = (quantity, cb) -> Async.times quantity, Create.program, (err, programs) -> if err cb err return console.log "Created #{quantity} programs" cb null, Imm.List(programs) Create.clientFileProgramLinks = (clientFiles, program, cb) -> Async.map clientFiles.toArray(), (clientFile, cb) -> Create.clientFileProgramLink clientFile, program, (err, result) -> if err cb err return cb null, Imm.List(result) , cb Create.metrics = (quantity, cb) -> Async.times quantity, Create.metric, (err, metrics) -> if err cb err return console.log "Created #{quantity} metrics" cb null, Imm.List(metrics) Create.eventTypes = (quantity, cb) -> Async.times quantity, Create.eventType, (err, eventTypes) -> if err cb err return console.log "Created #{quantity} eventTypes" cb null, Imm.List(eventTypes) Create.accounts = (quantity, cb) -> Async.times quantity, Create.account, (err, accounts) -> if err cb err return console.log "Created #{quantity} accounts" cb null, Imm.List(accounts) Create.planTemplates = (quantity, cb) -> Async.times quantity, Create.planTemplate, (err, planTemplates) -> if err cb err return console.log "Created #{quantity} planTemplates" cb null, Imm.List(planTemplates) module.exports = Create
[ { "context": "s an id', (done) ->\n# bob = new Flat({name: 'Bob'})\n# assert.equal(bob.get('name'), 'Bob', 'n", "end": 1635, "score": 0.9912055730819702, "start": 1632, "tag": "NAME", "value": "Bob" }, { "context": "me: 'Bob'})\n# assert.equal(bob.get('name'), 'Bob', '...
test/generators/flat/sync.coffee
michaelBenin/backbone-orm
1
util = require 'util' assert = require 'assert' _ = require 'underscore' Backbone = require 'backbone' Queue = require '../../../lib/queue' ModelCache = require('../../../lib/cache/singletons').ModelCache QueryCache = require('../../../lib/cache/singletons').QueryCache Fabricator = require '../../fabricator' module.exports = (options, callback) -> DATABASE_URL = options.database_url or '' BASE_SCHEMA = options.schema or {} SYNC = options.sync BASE_COUNT = 5 ModelCache.configure({enabled: !!options.cache, max: 100}).hardReset() # configure model cache class Flat extends Backbone.Model urlRoot: "#{DATABASE_URL}/flats" schema: BASE_SCHEMA sync: SYNC(Flat) describe "Backbone Sync (cache: #{options.cache}, query_cache: #{options.query_cache})", -> before (done) -> return done() unless options.before; options.before([Flat], done) after (done) -> callback(); done() beforeEach (done) -> queue = new Queue(1) # reset caches queue.defer (callback) -> ModelCache.configure({enabled: !!options.cache, max: 100}).reset(callback) # configure model cache queue.defer (callback) -> QueryCache.configure({enabled: !!options.query_cache, verbose: false}).reset(callback) # configure query cache queue.defer (callback) -> Flat.resetSchema(callback) queue.defer (callback) -> Fabricator.create(Flat, BASE_COUNT, { name: Fabricator.uniqueId('flat_') created_at: Fabricator.date updated_at: Fabricator.date }, callback) queue.await done # it 'saves a model and assigns an id', (done) -> # bob = new Flat({name: 'Bob'}) # assert.equal(bob.get('name'), 'Bob', 'name before save is Bob') # assert.ok(!bob.id, 'id before save doesn\'t exist') # # queue = new Queue(1) # queue.defer (callback) -> bob.save callback # # queue.defer (callback) -> # assert.equal(bob.get('name'), 'Bob', 'name after save is Bob') # assert.ok(!!bob.id, 'id after save is assigned') # callback() # # queue.await done it 'fetches model data', (done) -> Flat.findOne (err, model) -> assert.ok(!err, "No errors: #{err}") assert.ok(!!model, 'got model') new_model = new Flat({id: model.id}) new_model.fetch (err) -> assert.ok(!err, "No errors: #{err}") assert.deepEqual(model.toJSON(), new_model.toJSON(), "\nExpected: #{util.inspect(model.toJSON())}\nActual: #{util.inspect(new_model.toJSON())}") done() # it 'destroys a model', (done) -> # Flat.findOne (err, model) -> # assert.ok(!err, "No errors: #{err}") # assert.ok(!!model, 'got model') # model_id = model.id # # model.destroy (err) -> # assert.ok(!err, "No errors: #{err}") # # Flat.find model_id, (err, model) -> # assert.ok(!err, "No errors: #{err}") # assert.ok(!model, "Model not found after destroy") # done()
82708
util = require 'util' assert = require 'assert' _ = require 'underscore' Backbone = require 'backbone' Queue = require '../../../lib/queue' ModelCache = require('../../../lib/cache/singletons').ModelCache QueryCache = require('../../../lib/cache/singletons').QueryCache Fabricator = require '../../fabricator' module.exports = (options, callback) -> DATABASE_URL = options.database_url or '' BASE_SCHEMA = options.schema or {} SYNC = options.sync BASE_COUNT = 5 ModelCache.configure({enabled: !!options.cache, max: 100}).hardReset() # configure model cache class Flat extends Backbone.Model urlRoot: "#{DATABASE_URL}/flats" schema: BASE_SCHEMA sync: SYNC(Flat) describe "Backbone Sync (cache: #{options.cache}, query_cache: #{options.query_cache})", -> before (done) -> return done() unless options.before; options.before([Flat], done) after (done) -> callback(); done() beforeEach (done) -> queue = new Queue(1) # reset caches queue.defer (callback) -> ModelCache.configure({enabled: !!options.cache, max: 100}).reset(callback) # configure model cache queue.defer (callback) -> QueryCache.configure({enabled: !!options.query_cache, verbose: false}).reset(callback) # configure query cache queue.defer (callback) -> Flat.resetSchema(callback) queue.defer (callback) -> Fabricator.create(Flat, BASE_COUNT, { name: Fabricator.uniqueId('flat_') created_at: Fabricator.date updated_at: Fabricator.date }, callback) queue.await done # it 'saves a model and assigns an id', (done) -> # bob = new Flat({name: '<NAME>'}) # assert.equal(bob.get('name'), '<NAME>', 'name before save is <NAME>') # assert.ok(!bob.id, 'id before save doesn\'t exist') # # queue = new Queue(1) # queue.defer (callback) -> bob.save callback # # queue.defer (callback) -> # assert.equal(bob.get('name'), '<NAME>', 'name after save is <NAME>') # assert.ok(!!bob.id, 'id after save is assigned') # callback() # # queue.await done it 'fetches model data', (done) -> Flat.findOne (err, model) -> assert.ok(!err, "No errors: #{err}") assert.ok(!!model, 'got model') new_model = new Flat({id: model.id}) new_model.fetch (err) -> assert.ok(!err, "No errors: #{err}") assert.deepEqual(model.toJSON(), new_model.toJSON(), "\nExpected: #{util.inspect(model.toJSON())}\nActual: #{util.inspect(new_model.toJSON())}") done() # it 'destroys a model', (done) -> # Flat.findOne (err, model) -> # assert.ok(!err, "No errors: #{err}") # assert.ok(!!model, 'got model') # model_id = model.id # # model.destroy (err) -> # assert.ok(!err, "No errors: #{err}") # # Flat.find model_id, (err, model) -> # assert.ok(!err, "No errors: #{err}") # assert.ok(!model, "Model not found after destroy") # done()
true
util = require 'util' assert = require 'assert' _ = require 'underscore' Backbone = require 'backbone' Queue = require '../../../lib/queue' ModelCache = require('../../../lib/cache/singletons').ModelCache QueryCache = require('../../../lib/cache/singletons').QueryCache Fabricator = require '../../fabricator' module.exports = (options, callback) -> DATABASE_URL = options.database_url or '' BASE_SCHEMA = options.schema or {} SYNC = options.sync BASE_COUNT = 5 ModelCache.configure({enabled: !!options.cache, max: 100}).hardReset() # configure model cache class Flat extends Backbone.Model urlRoot: "#{DATABASE_URL}/flats" schema: BASE_SCHEMA sync: SYNC(Flat) describe "Backbone Sync (cache: #{options.cache}, query_cache: #{options.query_cache})", -> before (done) -> return done() unless options.before; options.before([Flat], done) after (done) -> callback(); done() beforeEach (done) -> queue = new Queue(1) # reset caches queue.defer (callback) -> ModelCache.configure({enabled: !!options.cache, max: 100}).reset(callback) # configure model cache queue.defer (callback) -> QueryCache.configure({enabled: !!options.query_cache, verbose: false}).reset(callback) # configure query cache queue.defer (callback) -> Flat.resetSchema(callback) queue.defer (callback) -> Fabricator.create(Flat, BASE_COUNT, { name: Fabricator.uniqueId('flat_') created_at: Fabricator.date updated_at: Fabricator.date }, callback) queue.await done # it 'saves a model and assigns an id', (done) -> # bob = new Flat({name: 'PI:NAME:<NAME>END_PI'}) # assert.equal(bob.get('name'), 'PI:NAME:<NAME>END_PI', 'name before save is PI:NAME:<NAME>END_PI') # assert.ok(!bob.id, 'id before save doesn\'t exist') # # queue = new Queue(1) # queue.defer (callback) -> bob.save callback # # queue.defer (callback) -> # assert.equal(bob.get('name'), 'PI:NAME:<NAME>END_PI', 'name after save is PI:NAME:<NAME>END_PI') # assert.ok(!!bob.id, 'id after save is assigned') # callback() # # queue.await done it 'fetches model data', (done) -> Flat.findOne (err, model) -> assert.ok(!err, "No errors: #{err}") assert.ok(!!model, 'got model') new_model = new Flat({id: model.id}) new_model.fetch (err) -> assert.ok(!err, "No errors: #{err}") assert.deepEqual(model.toJSON(), new_model.toJSON(), "\nExpected: #{util.inspect(model.toJSON())}\nActual: #{util.inspect(new_model.toJSON())}") done() # it 'destroys a model', (done) -> # Flat.findOne (err, model) -> # assert.ok(!err, "No errors: #{err}") # assert.ok(!!model, 'got model') # model_id = model.id # # model.destroy (err) -> # assert.ok(!err, "No errors: #{err}") # # Flat.find model_id, (err, model) -> # assert.ok(!err, "No errors: #{err}") # assert.ok(!model, "Model not found after destroy") # done()
[ { "context": " emailAddress: @getAccount()\n password: @getPassword()\n success: (resp) =>\n controll", "end": 2878, "score": 0.9078353047370911, "start": 2866, "tag": "PASSWORD", "value": "@getPassword" }, { "context": "phoneNumber: @getAccount()\n ...
talk-account/client/app/signin.coffee
ikingye/talk-os
3,084
React = require 'react' Immutable = require 'immutable' ajax = require '../ajax' detect = require '../util/detect' locales = require '../locales' analytics = require '../util/analytics' controllers = require '../controllers' Space = React.createFactory require 'react-lite-space' MobileInput = React.createFactory require './mobile-input' AccountSwitcher = React.createFactory require './account-switcher' ThirdpartyEntries = React.createFactory require './thirdparty-entries' {a, i, h3, div, form, span, input, button, strong, fieldset} = React.DOM module.exports = React.createClass displayName: 'app-signin' propTypes: store: React.PropTypes.instanceOf(Immutable.Map).isRequired getInitialState: -> account = @getAccount() tab: if (account[0] is '+') then 'mobile' else 'email' error: null quickLogin: @validUser() componentWillUnmount: -> @resetPassword() getUser: -> @props.store.get 'user' validUser: -> user = @getUser() return false if not user? return false if not Immutable.Map.isMap user hasLogin = user.has 'login' hasEmail = user.has 'emailAddress' hasPhone = user.has 'phoneNumber' hasUnions = user.has('unions') and user.get('unions').size > 0 hasLogin or hasEmail or hasPhone or hasUnions detectUser: -> user = @getUser() account = => switch user.get 'login' when 'email' then user.get 'emailAddress' when 'mobile' then user.get 'phoneNumber' else union = user.get 'unions' .find (union) => union.get('refer') is user.get('login') if not union? return locales.get('undefinedAccount', @getLanguage()) union.get 'showname' account() getAccount: -> @props.store.getIn(['client', 'account']) getPassword: -> @props.store.getIn(['client', 'password']) getLanguage: -> @props.store.getIn(['client', 'language']) isLoading: -> @props.store.getIn(['client', 'isLoading']) onAccountChange: (event) -> @setState error: null controllers.updateAccount event.target.value onMobileAccountChange: (account) -> @setState error: null controllers.updateAccount account onPasswordChange: (event) -> @setState error: null controllers.updatePassword event.target.value onRouteSignUp: (event) -> event.preventDefault() controllers.routeSignUp() requestReset: (event) -> event.preventDefault() controllers.routeForgotPassword() onSignIn: -> if not detect.isValidPassword(@getPassword()) @setState error: locales.get('passwordNoShortThan6', @getLanguage()) return if @state.tab is 'email' if detect.isEmail @getAccount() @setState error: null ajax.emailSignIn data: emailAddress: @getAccount() password: @getPassword() success: (resp) => controllers.logInRedirectWithData('email') @setState error: null error: (err) => error = JSON.parse err.response @setState error: error.message analytics.loginError() else @setState error: locales.get('notEmail', @getLanguage()) else if @state.tab is 'mobile' if detect.isMobile @getAccount() @setState error: null ajax.mobileSignIn data: phoneNumber: @getAccount() password: @getPassword() success: (resp) => controllers.logInRedirectWithData('phone') @setState error: null error: (err) => error = JSON.parse err.response @setState error: error.message analytics.loginError() else @setState error: locales.get('notPhoneNumber', @getLanguage()) else @setState error: locales.get('unknownAccountType', @getLanguage()) resetPassword: -> controllers.resetPassword() onTabSwitch: (tab) -> @setState tab: tab error: null captchaUid: null @resetPassword() if tab is 'email' controllers.updateAccount '' else controllers.updateAccount '+86' onSubmit: (event) -> event.preventDefault() @onSignIn() onGotoTalk: -> controllers.loginDirectWithData() onSwitchToOtherAccount: -> @setState quickLogin: false renderQuickLoginComponents: -> loginedUser = @detectUser() fieldset className: 'control-panel', div className: 'as-line-centered', "#{locales.get 'haveLoginedAccount', @getLanguage()}:" div className: 'as-line-centered', h3 {}, "#{loginedUser}" Space height: 35 div className: 'as-line-filled', button className: 'button is-primary', onClick: @onGotoTalk, locales.get 'quickSignInJianliao', @getLanguage() Space height: 20 div className: 'as-line-centered', a tabIndex: 0, className: 'link-guide', onClick: @onSwitchToOtherAccount, locales.get('switchToOtherAccount', @getLanguage()) renderLoginComponents: -> fieldset className: 'control-panel', AccountSwitcher tab: @state.tab, onSwitch: @onTabSwitch mobileGuide: locales.get('signInWithMobile', @getLanguage()) emailGuide: locales.get('signInWithEmail', @getLanguage()) Space height: 35 switch @state.tab when 'email' div className: 'as-line', input type: 'email', value: @getAccount(), onChange: @onAccountChange placeholder: locales.get('email', @getLanguage()) autoFocus: true, name: 'email' if detect.isEmail(@getAccount()) span className: 'ok-icon icon icon-tick' when 'mobile' MobileInput language: @getLanguage() account: @getAccount(), onChange: @onMobileAccountChange autoFocus: true Space height: 15, width: null div className: 'as-line', input type: 'password', value: @getPassword(), onChange: @onPasswordChange placeholder: locales.get('passwordNoShortThan6', @getLanguage()) name: 'password' a tabIndex: 0, className: 'link-inside', onClick: @requestReset, locales.get('forgotPassword', @getLanguage()) Space height: 35 if @state.error div className: 'as-line', span className: 'hint-error', @state.error Space height: 15 div className: 'as-line-filled', if @isLoading() button className: 'button is-primary is-disabled', locales.get('signInJianliao', @getLanguage()) else button className: 'button is-primary', locales.get('signInJianliao', @getLanguage()) Space height: 20, width: null div className: 'as-line-centered', span className: 'text-guide', locales.get('dontHaveAnAccount', @getLanguage()) Space width: 5 a tabIndex: 0, className: 'link-guide', onClick: @onRouteSignUp, locales.get('registerAccount', @getLanguage()) Space height: 120 a tabIndex: 0, className: 'old-user-guide', onClick: @requestReset, locales.get('oldUserPasswordGuide', @getLanguage()) Space height: 15 ThirdpartyEntries language: @getLanguage() render: -> form className: 'app-signin', onSubmit: @onSubmit, if @state.quickLogin @renderQuickLoginComponents() else @renderLoginComponents()
60144
React = require 'react' Immutable = require 'immutable' ajax = require '../ajax' detect = require '../util/detect' locales = require '../locales' analytics = require '../util/analytics' controllers = require '../controllers' Space = React.createFactory require 'react-lite-space' MobileInput = React.createFactory require './mobile-input' AccountSwitcher = React.createFactory require './account-switcher' ThirdpartyEntries = React.createFactory require './thirdparty-entries' {a, i, h3, div, form, span, input, button, strong, fieldset} = React.DOM module.exports = React.createClass displayName: 'app-signin' propTypes: store: React.PropTypes.instanceOf(Immutable.Map).isRequired getInitialState: -> account = @getAccount() tab: if (account[0] is '+') then 'mobile' else 'email' error: null quickLogin: @validUser() componentWillUnmount: -> @resetPassword() getUser: -> @props.store.get 'user' validUser: -> user = @getUser() return false if not user? return false if not Immutable.Map.isMap user hasLogin = user.has 'login' hasEmail = user.has 'emailAddress' hasPhone = user.has 'phoneNumber' hasUnions = user.has('unions') and user.get('unions').size > 0 hasLogin or hasEmail or hasPhone or hasUnions detectUser: -> user = @getUser() account = => switch user.get 'login' when 'email' then user.get 'emailAddress' when 'mobile' then user.get 'phoneNumber' else union = user.get 'unions' .find (union) => union.get('refer') is user.get('login') if not union? return locales.get('undefinedAccount', @getLanguage()) union.get 'showname' account() getAccount: -> @props.store.getIn(['client', 'account']) getPassword: -> @props.store.getIn(['client', 'password']) getLanguage: -> @props.store.getIn(['client', 'language']) isLoading: -> @props.store.getIn(['client', 'isLoading']) onAccountChange: (event) -> @setState error: null controllers.updateAccount event.target.value onMobileAccountChange: (account) -> @setState error: null controllers.updateAccount account onPasswordChange: (event) -> @setState error: null controllers.updatePassword event.target.value onRouteSignUp: (event) -> event.preventDefault() controllers.routeSignUp() requestReset: (event) -> event.preventDefault() controllers.routeForgotPassword() onSignIn: -> if not detect.isValidPassword(@getPassword()) @setState error: locales.get('passwordNoShortThan6', @getLanguage()) return if @state.tab is 'email' if detect.isEmail @getAccount() @setState error: null ajax.emailSignIn data: emailAddress: @getAccount() password: <PASSWORD>() success: (resp) => controllers.logInRedirectWithData('email') @setState error: null error: (err) => error = JSON.parse err.response @setState error: error.message analytics.loginError() else @setState error: locales.get('notEmail', @getLanguage()) else if @state.tab is 'mobile' if detect.isMobile @getAccount() @setState error: null ajax.mobileSignIn data: phoneNumber: @getAccount() password: @<PASSWORD>() success: (resp) => controllers.logInRedirectWithData('phone') @setState error: null error: (err) => error = JSON.parse err.response @setState error: error.message analytics.loginError() else @setState error: locales.get('notPhoneNumber', @getLanguage()) else @setState error: locales.get('unknownAccountType', @getLanguage()) resetPassword: -> controllers.resetPassword() onTabSwitch: (tab) -> @setState tab: tab error: null captchaUid: null @resetPassword() if tab is 'email' controllers.updateAccount '' else controllers.updateAccount '+86' onSubmit: (event) -> event.preventDefault() @onSignIn() onGotoTalk: -> controllers.loginDirectWithData() onSwitchToOtherAccount: -> @setState quickLogin: false renderQuickLoginComponents: -> loginedUser = @detectUser() fieldset className: 'control-panel', div className: 'as-line-centered', "#{locales.get 'haveLoginedAccount', @getLanguage()}:" div className: 'as-line-centered', h3 {}, "#{loginedUser}" Space height: 35 div className: 'as-line-filled', button className: 'button is-primary', onClick: @onGotoTalk, locales.get 'quickSignInJianliao', @getLanguage() Space height: 20 div className: 'as-line-centered', a tabIndex: 0, className: 'link-guide', onClick: @onSwitchToOtherAccount, locales.get('switchToOtherAccount', @getLanguage()) renderLoginComponents: -> fieldset className: 'control-panel', AccountSwitcher tab: @state.tab, onSwitch: @onTabSwitch mobileGuide: locales.get('signInWithMobile', @getLanguage()) emailGuide: locales.get('signInWithEmail', @getLanguage()) Space height: 35 switch @state.tab when 'email' div className: 'as-line', input type: 'email', value: @getAccount(), onChange: @onAccountChange placeholder: locales.get('email', @getLanguage()) autoFocus: true, name: 'email' if detect.isEmail(@getAccount()) span className: 'ok-icon icon icon-tick' when 'mobile' MobileInput language: @getLanguage() account: @getAccount(), onChange: @onMobileAccountChange autoFocus: true Space height: 15, width: null div className: 'as-line', input type: 'password', value: @getPassword(), onChange: @onPasswordChange placeholder: locales.get('passwordNoShortThan6', @getLanguage()) name: 'password' a tabIndex: 0, className: 'link-inside', onClick: @requestReset, locales.get('forgotPassword', @getLanguage()) Space height: 35 if @state.error div className: 'as-line', span className: 'hint-error', @state.error Space height: 15 div className: 'as-line-filled', if @isLoading() button className: 'button is-primary is-disabled', locales.get('signInJianliao', @getLanguage()) else button className: 'button is-primary', locales.get('signInJianliao', @getLanguage()) Space height: 20, width: null div className: 'as-line-centered', span className: 'text-guide', locales.get('dontHaveAnAccount', @getLanguage()) Space width: 5 a tabIndex: 0, className: 'link-guide', onClick: @onRouteSignUp, locales.get('registerAccount', @getLanguage()) Space height: 120 a tabIndex: 0, className: 'old-user-guide', onClick: @requestReset, locales.get('oldUserPasswordGuide', @getLanguage()) Space height: 15 ThirdpartyEntries language: @getLanguage() render: -> form className: 'app-signin', onSubmit: @onSubmit, if @state.quickLogin @renderQuickLoginComponents() else @renderLoginComponents()
true
React = require 'react' Immutable = require 'immutable' ajax = require '../ajax' detect = require '../util/detect' locales = require '../locales' analytics = require '../util/analytics' controllers = require '../controllers' Space = React.createFactory require 'react-lite-space' MobileInput = React.createFactory require './mobile-input' AccountSwitcher = React.createFactory require './account-switcher' ThirdpartyEntries = React.createFactory require './thirdparty-entries' {a, i, h3, div, form, span, input, button, strong, fieldset} = React.DOM module.exports = React.createClass displayName: 'app-signin' propTypes: store: React.PropTypes.instanceOf(Immutable.Map).isRequired getInitialState: -> account = @getAccount() tab: if (account[0] is '+') then 'mobile' else 'email' error: null quickLogin: @validUser() componentWillUnmount: -> @resetPassword() getUser: -> @props.store.get 'user' validUser: -> user = @getUser() return false if not user? return false if not Immutable.Map.isMap user hasLogin = user.has 'login' hasEmail = user.has 'emailAddress' hasPhone = user.has 'phoneNumber' hasUnions = user.has('unions') and user.get('unions').size > 0 hasLogin or hasEmail or hasPhone or hasUnions detectUser: -> user = @getUser() account = => switch user.get 'login' when 'email' then user.get 'emailAddress' when 'mobile' then user.get 'phoneNumber' else union = user.get 'unions' .find (union) => union.get('refer') is user.get('login') if not union? return locales.get('undefinedAccount', @getLanguage()) union.get 'showname' account() getAccount: -> @props.store.getIn(['client', 'account']) getPassword: -> @props.store.getIn(['client', 'password']) getLanguage: -> @props.store.getIn(['client', 'language']) isLoading: -> @props.store.getIn(['client', 'isLoading']) onAccountChange: (event) -> @setState error: null controllers.updateAccount event.target.value onMobileAccountChange: (account) -> @setState error: null controllers.updateAccount account onPasswordChange: (event) -> @setState error: null controllers.updatePassword event.target.value onRouteSignUp: (event) -> event.preventDefault() controllers.routeSignUp() requestReset: (event) -> event.preventDefault() controllers.routeForgotPassword() onSignIn: -> if not detect.isValidPassword(@getPassword()) @setState error: locales.get('passwordNoShortThan6', @getLanguage()) return if @state.tab is 'email' if detect.isEmail @getAccount() @setState error: null ajax.emailSignIn data: emailAddress: @getAccount() password: PI:PASSWORD:<PASSWORD>END_PI() success: (resp) => controllers.logInRedirectWithData('email') @setState error: null error: (err) => error = JSON.parse err.response @setState error: error.message analytics.loginError() else @setState error: locales.get('notEmail', @getLanguage()) else if @state.tab is 'mobile' if detect.isMobile @getAccount() @setState error: null ajax.mobileSignIn data: phoneNumber: @getAccount() password: @PI:PASSWORD:<PASSWORD>END_PI() success: (resp) => controllers.logInRedirectWithData('phone') @setState error: null error: (err) => error = JSON.parse err.response @setState error: error.message analytics.loginError() else @setState error: locales.get('notPhoneNumber', @getLanguage()) else @setState error: locales.get('unknownAccountType', @getLanguage()) resetPassword: -> controllers.resetPassword() onTabSwitch: (tab) -> @setState tab: tab error: null captchaUid: null @resetPassword() if tab is 'email' controllers.updateAccount '' else controllers.updateAccount '+86' onSubmit: (event) -> event.preventDefault() @onSignIn() onGotoTalk: -> controllers.loginDirectWithData() onSwitchToOtherAccount: -> @setState quickLogin: false renderQuickLoginComponents: -> loginedUser = @detectUser() fieldset className: 'control-panel', div className: 'as-line-centered', "#{locales.get 'haveLoginedAccount', @getLanguage()}:" div className: 'as-line-centered', h3 {}, "#{loginedUser}" Space height: 35 div className: 'as-line-filled', button className: 'button is-primary', onClick: @onGotoTalk, locales.get 'quickSignInJianliao', @getLanguage() Space height: 20 div className: 'as-line-centered', a tabIndex: 0, className: 'link-guide', onClick: @onSwitchToOtherAccount, locales.get('switchToOtherAccount', @getLanguage()) renderLoginComponents: -> fieldset className: 'control-panel', AccountSwitcher tab: @state.tab, onSwitch: @onTabSwitch mobileGuide: locales.get('signInWithMobile', @getLanguage()) emailGuide: locales.get('signInWithEmail', @getLanguage()) Space height: 35 switch @state.tab when 'email' div className: 'as-line', input type: 'email', value: @getAccount(), onChange: @onAccountChange placeholder: locales.get('email', @getLanguage()) autoFocus: true, name: 'email' if detect.isEmail(@getAccount()) span className: 'ok-icon icon icon-tick' when 'mobile' MobileInput language: @getLanguage() account: @getAccount(), onChange: @onMobileAccountChange autoFocus: true Space height: 15, width: null div className: 'as-line', input type: 'password', value: @getPassword(), onChange: @onPasswordChange placeholder: locales.get('passwordNoShortThan6', @getLanguage()) name: 'password' a tabIndex: 0, className: 'link-inside', onClick: @requestReset, locales.get('forgotPassword', @getLanguage()) Space height: 35 if @state.error div className: 'as-line', span className: 'hint-error', @state.error Space height: 15 div className: 'as-line-filled', if @isLoading() button className: 'button is-primary is-disabled', locales.get('signInJianliao', @getLanguage()) else button className: 'button is-primary', locales.get('signInJianliao', @getLanguage()) Space height: 20, width: null div className: 'as-line-centered', span className: 'text-guide', locales.get('dontHaveAnAccount', @getLanguage()) Space width: 5 a tabIndex: 0, className: 'link-guide', onClick: @onRouteSignUp, locales.get('registerAccount', @getLanguage()) Space height: 120 a tabIndex: 0, className: 'old-user-guide', onClick: @requestReset, locales.get('oldUserPasswordGuide', @getLanguage()) Space height: 15 ThirdpartyEntries language: @getLanguage() render: -> form className: 'app-signin', onSubmit: @onSubmit, if @state.quickLogin @renderQuickLoginComponents() else @renderLoginComponents()
[ { "context": "\"Rechtliches\"\n about: \"Über\"\n contact: \"Kontakt\"\n twitter_follow: \"Twitter\"\n employers: \"Mi", "end": 1238, "score": 0.5291073322296143, "start": 1235, "tag": "NAME", "value": "akt" }, { "context": "Über\"\n contact: \"Kontakt\"\n twitter_f...
app/locale/de-DE.coffee
Melondonut/codecombat
0
module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: "German (Germany)", translation: common: loading: "Lade..." saving: "Speichere..." sending: "Übertrage..." send: "Senden" cancel: "Abbrechen" save: "Speichern" publish: "Publiziere" create: "Erstelle" delay_1_sec: "1 Sekunde" delay_3_sec: "3 Sekunden" delay_5_sec: "5 Sekunden" manual: "Manuell" fork: "Fork" play: "Abspielen" retry: "Erneut versuchen" # watch: "Watch" # unwatch: "Unwatch" # submit_patch: "Submit Patch" units: second: "Sekunde" seconds: "Sekunden" minute: "Minute" minutes: "Minuten" hour: "Stunde" hours: "Stunden" day: "Tag" days: "Tage" week: "Woche" weeks: "Wochen" month: "Monat" months: "Monate" year: "Jahr" years: "Jahre" modal: close: "Schließen" okay: "Okay" not_found: page_not_found: "Seite nicht gefunden" nav: play: "Spielen" # community: "Community" editor: "Editor" blog: "Blog" forum: "Forum" # account: "Account" admin: "Administration" home: "Home" contribute: "Helfen" legal: "Rechtliches" about: "Über" contact: "Kontakt" twitter_follow: "Twitter" employers: "Mitarbeiter" versions: save_version_title: "Neue Version speichern" new_major_version: "Neue Hauptversion" cla_prefix: "Damit Änderungen gespeichert werden können, musst du unsere Lizenzbedingungen (" cla_url: "CLA" cla_suffix: ") akzeptieren." cla_agree: "Ich stimme zu" login: sign_up: "Registrieren" log_in: "Einloggen" logging_in: "Logge ein" log_out: "Ausloggen" recover: "Account wiederherstellen" recover: recover_account_title: "Account Wiederherstellung" send_password: "Wiederherstellungskennwort senden" signup: create_account_title: "Account anlegen, um Fortschritt zu speichern" description: "Es ist kostenlos. Nur noch ein paar Dinge, dann kannst Du loslegen." email_announcements: "Erhalte Benachrichtigungen per Email" coppa: "Älter als 13 oder nicht aus den USA" coppa_why: "(Warum?)" creating: "Erzeuge Account..." sign_up: "Neuen Account anlegen" log_in: "mit Passwort einloggen" social_signup: "oder, du registriest dich über Facebook oder G+:" # required: "You need to log in before you can go that way." home: slogan: "Lerne spielend Programmieren" no_ie: "CodeCombat läuft nicht im IE8 oder älteren Browsern. Tut uns Leid!" no_mobile: "CodeCombat ist nicht für Mobilgeräte optimiert und funktioniert möglicherweise nicht." play: "Spielen" old_browser: "Oh! Dein Browser ist zu alt für CodeCombat. Sorry!" old_browser_suffix: "Du kannst es trotzdem versuchen, aber es wird wahrscheinlich nicht funktionieren." campaign: "Kampagne" for_beginners: "Für Anfänger" multiplayer: "Mehrspieler" for_developers: "Für Entwickler" # javascript_blurb: "The language of the web. Great for writing websites, web apps, HTML5 games, and servers." # python_blurb: "Simple yet powerful, Python is a great general purpose programming language." # coffeescript_blurb: "Nicer JavaScript syntax." # clojure_blurb: "A modern Lisp." # lua_blurb: "Game scripting language." # io_blurb: "Simple but obscure." play: choose_your_level: "Wähle dein Level" adventurer_prefix: "Du kannst zu jedem Level springen oder diskutiere die Level " adventurer_forum: "im Abenteurerforum" adventurer_suffix: "." campaign_beginner: "Anfängerkampagne" campaign_beginner_description: "... in der Du die Zauberei der Programmierung lernst." campaign_dev: "Beliebiges schwierigeres Level" campaign_dev_description: "... in welchem Du die Bedienung erlernst, indem Du etwas schwierigeres machst." campaign_multiplayer: "Multiplayerarena" campaign_multiplayer_description: "... in der Du Kopf-an-Kopf gegen andere Spieler programmierst." campaign_player_created: "Von Spielern erstellt" campaign_player_created_description: "... in welchem Du gegen die Kreativität eines <a href=\"/contribute#artisan\">Artisan Zauberers</a> kämpfst." level_difficulty: "Schwierigkeit: " play_as: "Spiele als " spectate: "Zuschauen" contact: contact_us: "Kontaktiere CodeCombat" welcome: "Schön von Dir zu hören! Benutze dieses Formular um uns eine Email zu schicken." contribute_prefix: "Wenn Du Interesse hast, uns zu unterstützen dann sieh dir die " contribute_page: "Unterstützer Seite" contribute_suffix: " an!" forum_prefix: "Für alle öffentlichen Themen, benutze stattdessen " forum_page: "unser Forum" forum_suffix: "." send: "Sende Feedback" contact_candidate: "Kontaktiere Kandidaten" recruitment_reminder: "Benutzen Sie dieses Formular um Kontakt zu Kandidaten aufzunehmen, an denen Sie interessiert sind. Bedenken Sie das CodeCombat 15% des ersten Jahresgehaltes berechnet. Diese Gebühr wird fällig wenn Sie den Kandidaten einstellen und ist für 90 Tage rückerstattungsfähig, sollte der Mitarbeiter nicht eingestellt bleiben. Mitarbeiter die für Teilzeit, Remote oder eine Auftragsarbeit eingestellt werden sind kostenlos, das gilt auch für Praktikanten." diplomat_suggestion: title: "Hilf CodeCombat zu übersetzen!" sub_heading: "Wir brauchen Deine Sprachfähigkeiten." pitch_body: "Wir entwickeln CodeCombat in Englisch, aber wir haben Spieler in der ganzen Welt. Viele von ihnen wollen in Deutsch spielen, sprechen aber kein Englisch. Wenn Du also beide Sprachen beherrscht, melde Dich an um ein Diplomat zu werden und hilf die Website und die Levels zu Deutsch zu übersetzen." missing_translations: "Solange wir nicht alles ins Deutsche übesetzt haben, siehst Du die englische Übersetzung, wo Deutsch leider noch nicht zur Verfügung steht." learn_more: "Finde heraus, wie Du ein Diplomat werden kannst" subscribe_as_diplomat: "Schreibe dich als Diplomat ein" wizard_settings: title: "Zauberer Einstellungen" customize_avatar: "Individualisiere deinen Avatar" active: "Aktiv" color: "Farbe" group: "Gruppe" clothes: "Kleidung" trim: "Applikationen" cloud: "Wolke" team: "Team" spell: "Zauber" boots: "Stiefel" hue: "Farbton" saturation: "Sättigung" lightness: "Helligkeit" account_settings: title: "Accounteinstellungen" not_logged_in: "Logge Dich ein oder lege einen Account an, um deine Einstellungen ändern zu können." autosave: "Sichere Änderungen automatisch" me_tab: "Ich" picture_tab: "Bild" upload_picture: "Ein Bild hochladen" wizard_tab: "Zauberer" password_tab: "Passwort" emails_tab: "Emails" admin: "Admin" wizard_color: "Die Farbe der Kleidung des Zauberers" new_password: "Neues Passwort" new_password_verify: "Passwort verifizieren" email_subscriptions: "Email Abonnements" email_announcements: "Ankündigungen" email_announcements_description: "Erhalte regelmäßig Ankündigungen zu deinem Account." email_notifications: "Benachrichtigungen" # email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity." # email_any_notes: "Any Notifications" # email_any_notes_description: "Disable to stop all activity notification emails." email_recruit_notes: "Job-Angebote" # email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job." contributor_emails: "Unterstützer Email" contribute_prefix: "Wir suchen nach Leuten, die mitmachen! Schau dir die" contribute_page: "Unterstützer Seite" contribute_suffix: " an um mehr zu erfahren." email_toggle: "Alles wählen" error_saving: "Fehler beim Speichern" saved: "Änderungen gespeichert" password_mismatch: "Passwörter stimmen nicht überein." # password_repeat: "Please repeat your password." job_profile: "Jobprofil" job_profile_approved: "Dein Jobprofil wurde von CodeCombat freigegeben. Arbeitgeber können dieses solange einsehen, bis du es als inaktiv markiert oder wenn innerhalb von vier Wochen keine Änderung daran vorgenommen wurde." job_profile_explanation: "Hi! Fülle dies aus und wir melden uns bei dir bezüglich des Auffindens eines Jobs als Programmierer" sample_profile: "Ein Beispielprofil ansehen" view_profile: "Dein Profil ansehen" account_profile: settings: "Einstellungen" edit_profile: "Profil editieren" # done_editing: "Done Editing" profile_for_prefix: "Profil von " profile_for_suffix: "" # featured: "Featured" # not_featured: "Not Featured" # looking_for: "Looking for:" last_updated: "zuletzt geändert:" contact: "Kontakt" # active: "Looking for interview offers now" # inactive: "Not looking for offers right now" # complete: "complete" # next: "Next" next_city: "Stadt?" next_country: "Wähle dein Land." next_name: "Name?" next_short_description: "Schreibe eine kurze Beschreibung." next_long_description: "Beschreibe deine gewünschte Position" next_skills: "Liste mindestens fünf Fähigkeiten." # next_work: "chronicle your work history." # next_education: "recount your educational ordeals." next_projects: "Zeige bis zu 3 Projekte an denen du gearbeitet hast." # next_links: "add any personal or social links." next_photo: "Füge ein optionales professionelles Foto hinzu." # next_active: "mark yourself open to offers to show up in searches." example_blog: "Blog" example_personal_site: "Persönliche Seite" links_header: "Persönliche Links" links_blurb: "Verlinke zu anderen Seiten oder Profilen die du hervorheben möchtest, wie z.B. dein GitHub, dein LinkedIn oder deinen Blog." links_name: "Link-Name" # links_name_help: "What are you linking to?" links_link_blurb: "Link URL" # basics_header: "Update basic info" # basics_active: "Open to Offers" # basics_active_help: "Want interview offers right now?" # basics_job_title: "Desired Job Title" # basics_job_title_help: "What role are you looking for?" basics_city: "Stadt" basics_city_help: "Stadt in der du arbeiten möchtest (oder jetzt lebst)." basics_country: "Land" basics_country_help: "Land in dem du arbeiten möchtest (oder jetzt lebst)." # basics_visa: "US Work Status" # basics_visa_help: "Are you authorized to work in the US, or do you need visa sponsorship? (If you live in Canada or Australia, mark authorized.)" # basics_looking_for: "Looking For" basics_looking_for_full_time: "Vollzeit" basics_looking_for_part_time: "Teilzeit" basics_looking_for_remote: "Remote" # basics_looking_for_contracting: "Contracting" basics_looking_for_internship: "Praktikum" # basics_looking_for_help: "What kind of developer position do you want?" name_header: "Trage deinen Namen ein" name_anonymous: "Anonymer Entwickler" # name_help: "Name you want employers to see, like 'Nick Winter'." # short_description_header: "Write a short description of yourself" # short_description_blurb: "Add a tagline to help an employer quickly learn more about you." # short_description: "Tagline" # short_description_help: "Who are you, and what are you looking for? 140 characters max." skills_header: "Fähigkeiten" # skills_help: "Tag relevant developer skills in order of proficiency." long_description_header: "Beschreibe deine gewünschte Position" # long_description_blurb: "Tell employers how awesome you are and what role you want." # long_description: "Self Description" # long_description_help: "Describe yourself to potential employers. Keep it short and to the point. We recommend outlining the position that would most interest you. Tasteful markdown okay; 600 characters max." work_experience: "Berufserfahrung" # work_header: "Chronicle your work history" # work_years: "Years of Experience" # work_years_help: "How many years of professional experience (getting paid) developing software do you have?" # work_blurb: "List your relevant work experience, most recent first." work_employer: "Arbeitgeber" work_employer_help: "Name deines Arbeitgebers." # work_role: "Job Title" # work_role_help: "What was your job title or role?" # work_duration: "Duration" # work_duration_help: "When did you hold this gig?" work_description: "Beschreibung" work_description_help: "Was hast du dort gemacht (140 Zeichen; optional)" # education: "Education" # education_header: "Recount your academic ordeals" # education_blurb: "List your academic ordeals." education_school: "Schule" education_school_help: "Name deiner Schule." education_degree: "Abschluss" # education_degree_help: "What was your degree and field of study?" # education_duration: "Dates" education_duration_help: "Wann?" education_description: "Beschreibung" # education_description_help: "Highlight anything about this educational experience. (140 chars; optional)" # our_notes: "CodeCombat's Notes" # remarks: "Remarks" projects: "Projekte" projects_header: "Füge 3 Projekte hinzu" projects_header_2: "Projekte (Top 3)" # projects_blurb: "Highlight your projects to amaze employers." project_name: "Projekt Name" project_name_help: "Wie wurde das Projekt genannt?" project_description: "Beschreibung" project_description_help: "Beschreibe kurz das Projekt." project_picture: "Bild" project_picture_help: "Lade ein 230x115px oder größeres Bild hoch, welches das Projekt darstellt." project_link: "Link" project_link_help: "Verlinke zu dem Projekt." player_code: "Spieler Code" employers: # hire_developers_not_credentials: "Hire developers, not credentials." # get_started: "Get Started" # already_screened: "We've already technically screened all our candidates" # filter_further: ", but you can also filter further:" # filter_visa: "Visa" # filter_visa_yes: "US Authorized" # filter_visa_no: "Not Authorized" # filter_education_top: "Top School" # filter_education_other: "Other" # filter_role_web_developer: "Web Developer" # filter_role_software_developer: "Software Developer" # filter_role_mobile_developer: "Mobile Developer" # filter_experience: "Experience" # filter_experience_senior: "Senior" # filter_experience_junior: "Junior" # filter_experience_recent_grad: "Recent Grad" # filter_experience_student: "College Student" # filter_results: "results" # start_hiring: "Start hiring." # reasons: "Three reasons you should hire through us:" # everyone_looking: "Everyone here is looking for their next opportunity." # everyone_looking_blurb: "Forget about 20% LinkedIn InMail response rates. Everyone that we list on this site wants to find their next position and will respond to your request for an introduction." # weeding: "Sit back; we've done the weeding for you." # weeding_blurb: "Every player that we list has been screened for technical ability. We also perform phone screens for select candidates and make notes on their profiles to save you time." # pass_screen: "They will pass your technical screen." # pass_screen_blurb: "Review each candidate's code before reaching out. One employer found that 5x as many of our devs passed their technical screen than hiring from Hacker News." # make_hiring_easier: "Make my hiring easier, please." what: "Was ist CodeCombat?" # what_blurb: "CodeCombat is a multiplayer browser programming game. Players write code to control their forces in battle against other developers. Our players have experience with all major tech stacks." # cost: "How much do we charge?" # cost_blurb: "We charge 15% of first year's salary and offer a 100% money back guarantee for 90 days. We don't charge for candidates who are already actively being interviewed at your company." candidate_name: "Name" # candidate_location: "Location" # candidate_looking_for: "Looking For" candidate_role: "Rolle" # candidate_top_skills: "Top Skills" # candidate_years_experience: "Yrs Exp" # candidate_last_updated: "Last Updated" # candidate_who: "Who" # featured_developers: "Featured Developers" # other_developers: "Other Developers" # inactive_developers: "Inactive Developers" play_level: done: "Fertig" grid: "Raster" customize_wizard: "Bearbeite den Zauberer" home: "Startseite" guide: "Hilfe" multiplayer: "Multiplayer" restart: "Neustart" goals: "Ziele" # success: "Success!" # incomplete: "Incomplete" # timed_out: "Ran out of time" # failing: "Failing" action_timeline: "Aktionszeitstrahl" click_to_select: "Klicke auf eine Einheit, um sie auszuwählen." reload_title: "Gesamten Code neu laden?" reload_really: "Bist Du sicher, dass Du das Level neu beginnen willst?" reload_confirm: "Alles neu laden" victory_title_prefix: "" victory_title_suffix: " Abgeschlossen" victory_sign_up: "Melde Dich an, um Fortschritte zu speichern" victory_sign_up_poke: "Möchtest Du Neuigkeiten per Mail erhalten? Erstelle einen kostenlosen Account und wir halten Dich auf dem Laufenden." victory_rate_the_level: "Bewerte das Level: " victory_return_to_ladder: "Zurück zur Rangliste" victory_play_next_level: "Spiel das nächste Level" victory_go_home: "Geh auf die Startseite" victory_review: "Erzähl uns davon!" victory_hour_of_code_done: "Bist Du fertig?" victory_hour_of_code_done_yes: "Ja, ich bin mit meiner Code-Stunde fertig!" multiplayer_title: "Multiplayer Einstellungen" multiplayer_link_description: "Gib diesen Link jedem, der mitmachen will." multiplayer_hint_label: "Hinweis:" multiplayer_hint: " Klick den Link, um alles auszuwählen, dann drück ⌘-C oder Strg-C um den Link zu kopieren." multiplayer_coming_soon: "Mehr Multiplayerfeatures werden kommen!" # multiplayer_sign_in_leaderboard: "Sign in or create an account and get your solution on the leaderboard." guide_title: "Anleitung" tome_minion_spells: "Die Zaubersprüche Deiner Knechte" tome_read_only_spells: "Nur-lesen Zauberspüche" tome_other_units: "Andere Einheiten" tome_cast_button_castable: "Führe aus" tome_cast_button_casting: "Ausführen" tome_cast_button_cast: "Zauberspuch ausführen" tome_autocast_delay: "Verzögerung der automatischen Ausführung" tome_select_spell: "Wähle einen Zauber" tome_select_a_thang: "Wähle jemanden aus, um " tome_available_spells: "Verfügbare Zauber" hud_continue: "Weiter (drücke Shift + Leertaste)" spell_saved: "Zauber gespeichert" skip_tutorial: "Überspringen (Esc)" editor_config: "Editor Einstellungen" editor_config_title: "Editor Einstellungen" editor_config_level_language_label: "Sprache für dieses Level" editor_config_level_language_description: "Lege die Programmiersprache für dieses bestimmte Level fest." editor_config_default_language_label: "Voreinstellung Programmiersprache" editor_config_default_language_description: "Definiere die Programmiersprache in der du programmieren möchtest wenn du ein neues Level beginnst." editor_config_keybindings_label: "Tastenbelegung" editor_config_keybindings_default: "Standard (Ace)" editor_config_keybindings_description: "Fügt zusätzliche Tastenkombinationen, bekannt aus anderen Editoren, hinzu" # editor_config_livecompletion_label: "Live Autocompletion" # editor_config_livecompletion_description: "Displays autocomplete suggestions while typing." editor_config_invisibles_label: "Zeige unsichtbare Zeichen" editor_config_invisibles_description: "Zeigt unsichtbare Zeichen wie Leertasten an." editor_config_indentguides_label: "Zeige Einrückungshilfe" editor_config_indentguides_description: "Zeigt vertikale Linien an um Einrückungen besser zu sehen." editor_config_behaviors_label: "Intelligentes Verhalten" editor_config_behaviors_description: "Vervollständigt automatisch Klammern und Anführungszeichen." keyboard_shortcuts: "Tastenkürzel" loading_ready: "Bereit!" tip_insert_positions: "Halte 'Umschalt' gedrückt und klicke auf die Karte um die Koordinaten einzufügen." tip_toggle_play: "Wechsel zwischen Play und Pause mit Strg+P." tip_scrub_shortcut: "Spule vor und zurück mit Strg+[ und Strg+]" tip_guide_exists: "Klicke auf die Anleitung am oberen Ende der Seite für nützliche Informationen" tip_open_source: "CodeCombat ist 100% quelloffen!" tip_beta_launch: "CodeCombat startete seine Beta im Oktober 2013." tip_js_beginning: "JavaScript ist nur der Anfang." tip_autocast_setting: "Ändere die Einstellungen für das automatische Ausführen über das Zahnrad neben dem Ausführen Knopf" think_solution: "Denke über die Lösung nach, nicht über das Problem." tip_theory_practice: "In der Theorie gibt es keinen Unterschied zwischen Theorie und Praxis. In der Praxis schon. - Yogi Berra" tip_error_free: "Es gibt zwei Wege fehlerfreie Programme zu schreiben; nur der Dritte funktioniert. - Alan Perlis" tip_debugging_program: "Wenn Debugging der Prozess zum Fehler entfernen ist, dann muss Programmieren der Prozess sein Fehler zu machen. - Edsger W. Dijkstra" tip_forums: "Gehe zum Forum und sage uns was du denkst!" tip_baby_coders: "In der Zukunft werden sogar Babies Erzmagier sein." tip_morale_improves: "Das Laden wird weiter gehen bis die Stimmung sich verbessert." tip_all_species: "Wir glauben an gleiche Chancen für alle Arten Programmieren zu lernen." # tip_reticulating: "Reticulating spines." tip_harry: "Du bist ein Zauberer, " tip_great_responsibility: "Mit großen Programmierfähigkeiten kommt große Verantwortung." tip_munchkin: "Wenn du dein Gemüse nicht isst, besucht dich ein Zwerg während du schläfst." tip_binary: "Es gibt auf der Welt nur 10 Arten von Menschen: die, welche Binär verstehen und die, welche nicht." tip_commitment_yoda: "Ein Programmier muss die größte Hingabe haben, den ernstesten Verstand. ~ Yoda" tip_no_try: "Tu. Oder tu nicht. Es gibt kein Versuchen. - Yoda" tip_patience: "Geduld du musst haben, junger Padawan. - Yoda" tip_documented_bug: "Ein dokumentierter Fehler ist kein Fehler; er ist ein Merkmal." tip_impossible: "Es wirkt immer unmöglich bis es vollbracht ist. - Nelson Mandela" tip_talk_is_cheap: "Reden ist billig. Zeig mir den Code. - Linus Torvalds" tip_first_language: "Das schwierigste, das du jemals lernen wirst, ist die erste Programmiersprache. - Alan Kay" # tip_hardware_problem: "Q: How many programmers does it take to change a light bulb? A: None, it's a hardware problem." time_current: "Aktuell" time_total: "Total" time_goto: "Gehe zu" infinite_loop_try_again: "Erneut versuchen" # infinite_loop_reset_level: "Reset Level" infinite_loop_comment_out: "Meinen Code auskommentieren" keyboard_shortcuts: keyboard_shortcuts: "Tastaturkürzel" space: "Leertaste" enter: "Eingabetaste" # escape: "Escape" # cast_spell: "Cast current spell." # continue_script: "Continue past current script." # skip_scripts: "Skip past all skippable scripts." # toggle_playback: "Toggle play/pause." # scrub_playback: "Scrub back and forward through time." # single_scrub_playback: "Scrub back and forward through time by a single frame." # scrub_execution: "Scrub through current spell execution." # toggle_debug: "Toggle debug display." # toggle_grid: "Toggle grid overlay." # toggle_pathfinding: "Toggle pathfinding overlay." # beautify: "Beautify your code by standardizing its formatting." # move_wizard: "Move your Wizard around the level." admin: av_title: "Administrator Übersicht" av_entities_sub_title: "Entitäten" av_entities_users_url: "Benutzer" av_entities_active_instances_url: "Aktive Instanzen" av_entities_employer_list_url: "Arbeitgeberliste" av_other_sub_title: "Sonstige" # av_other_debug_base_url: "Base (for debugging base.jade)" u_title: "Benutzerliste" lg_title: "Letzte Spiele" # clas: "CLAs" community: level_editor: "Level Editor" main_title: "CodeCombat Community" facebook: "Facebook" twitter: "Twitter" gplus: "Google+" editor: main_title: "CodeCombat Editoren" main_description: "Entwerfe deine eigenen Level, Kampagnen, Einheiten und Lernmaterial. Wir stellen alle Werkzeuge zur Verfügung, die Du dafür benötigst!" article_title: "Artikel Editor" article_description: "Schreiben Sie Artikel, die anderen Spieler einen Überblick über Programmierkonzepte geben und in einer Vielzahl von Ebenen und Kampagnen genutzt werden können." thang_title: "Thang Editor" thang_description: "Entwerfe Einheiten, definiere ihre Standardlogik, Grafiken und Töne. Zurzeit werden nur Flash Vektorgrafiken unterstützt." level_title: "Level Editor" level_description: "Beinhaltet die Werkzeuge zum Scripten, Hochladen von Tönen und zur Konstruktion eigener Logik, damit jedes erdenkliches Level erstellt werden kann. Genau die Sachen, die wir selber benutzen!" # achievement_title: "Achievement Editor" got_questions: "Fragen zur Benutzung des CodeCombat Editors?" contact_us: "setze dich mit uns in Verbindung!" hipchat_prefix: "Besuche uns auch in unserem" hipchat_url: "HipChat room." back: "Zurück" revert: "Zurücksetzen" revert_models: "Models zurücksetzen." # pick_a_terrain: "Pick A Terrain" # small: "Small" # grassy: "Grassy" fork_title: "Forke neue Version" fork_creating: "Erzeuge Fork..." # randomize: "Randomize" more: "Mehr" wiki: "Wiki" live_chat: "Live Chat" level_some_options: "Einige Einstellungsmöglichkeiten?" level_tab_thangs: "Thangs" level_tab_scripts: "Skripte" level_tab_settings: "Einstellungen" level_tab_components: "Komponenten" level_tab_systems: "Systeme" level_tab_thangs_title: "Aktuelle Thangs" level_tab_thangs_all: "Alle" level_tab_thangs_conditions: "Startbedingungen" level_tab_thangs_add: "Thangs hinzufügen" delete: "Löschen" duplicate: "Duplizieren" level_settings_title: "Einstellungen" level_component_tab_title: "Aktuelle Komponenten" level_component_btn_new: "neue Komponente erstellen" level_systems_tab_title: "Aktuelle Systeme" level_systems_btn_new: "neues System erstellen" level_systems_btn_add: "System hinzufügen" level_components_title: "Zurück zu allen Thangs" level_components_type: "Typ" level_component_edit_title: "Komponente bearbeiten" level_component_config_schema: "Konfigurationsschema" level_component_settings: "Einstellungen" level_system_edit_title: "System bearbeiten" create_system_title: "neues System erstellen" new_component_title: "Neue Komponente erstellen" new_component_field_system: "System" new_article_title: "Erstelle einen neuen Artikel" new_thang_title: "Erstelle einen neuen Thang-Typen" new_level_title: "Erstelle ein neues Level" new_article_title_login: "Melde dich an um einen neuen Artikel zu erstellen" new_thang_title_login: "Melde dich an um einen neuen Thang-Typen zu erstellen" new_level_title_login: "Melde dich an um ein neues Level zu erstellen" # new_achievement_title: "Create a New Achievement" # new_achievement_title_login: "Log In to Create a New Achievement" article_search_title: "Durchsuche Artikel hier" thang_search_title: "Durchsuche Thang-Typen hier" level_search_title: "Durchsuche Levels hier" # achievement_search_title: "Search Achievements" # read_only_warning2: "Note: you can't save any edits here, because you're not logged in." article: edit_btn_preview: "Vorschau" edit_article_title: "Artikel bearbeiten" general: and: "und" name: "Name" body: "Inhalt" version: "Version" commit_msg: "Commit Nachricht" version_history: "Versionshistorie" version_history_for: "Versionsgeschichte für: " result: "Ergebnis" results: "Ergebnisse" description: "Beschreibung" or: "oder" subject: "Betreff" email: "Email" password: "Passwort" message: "Nachricht" code: "Code" ladder: "Rangliste" when: "Wann" opponent: "Gegner" rank: "Rang" score: "Punktzahl" win: "Sieg" loss: "Niederlage" tie: "Unentschieden" easy: "Einfach" medium: "Mittel" hard: "Schwer" player: "Spieler" about: who_is_codecombat: "Wer ist CodeCombat?" why_codecombat: "Warum CodeCombat?" who_description_prefix: "gründeten CodeCombat im Jahre 2013 zusammen. Wir entwickelten außerdem " who_description_suffix: ", die meist benutzte (#1) Web and iOS Applikation 2008 zum Lernen des Schreibens von chinesischen und japanischen Schriftzeichen." who_description_ending: "Nun ist es an der Zeit, den Leuten das Programmieren beizubringen." why_paragraph_1: "Als er Skritter machte, wusste George nicht wie man programmiert und war permanent darüber frustriert, dass er seine Ideen nicht umsetzen konnte. Danach versuchte er es zu lernen, aber das ging ihm zu langsam. Sein Mitbewohner versuchte Codecademy, als er sich umorientierte und aufhörte zu lehren, aber \"langweilte sich\". Jede Woche begann ein neuer Freund mit Codecademy und ließ es dann wieder bleiben. Wir erkannten, dass es das gleiche Problem war, welches wir mit Skritter gelöst hatten: Leute lernen eine Fähigkeit mittels langsamer, intersiver Lerneinheiten, wobei sie schnelle, umfassende Übung bräuchten. Wir kennen Abhilfe." why_paragraph_2: "Programmieren lernen? Du brauchst keine Stunden. Du musst einen Haufen Code schreiben und dabei Spaß haben." why_paragraph_3_prefix: "Darum geht's beim Programmieren. Es soll Spaß machen. Nicht so einen Spaß wie" why_paragraph_3_italic: "jau, 'ne Plakette" why_paragraph_3_center: "sondern Spaß wie" why_paragraph_3_italic_caps: "NEIN MUTTI ICH MUSS NOCH DEN LEVEL BEENDEN !" why_paragraph_3_suffix: "Deshalb ist CodeCombat ein Multiplayerspiel und kein spielähnlicher Kurs. Wir werden nicht aufhören bis du nicht mehr aufhören kannst -- nur diesmal ist das eine gute Sache." why_paragraph_4: "Wenn dich Spiele süchtig machen, dass lass dich von diesem süchtig machen und werde ein Zauberer des Technologiezeitalters." why_ending: "Und hey, es kostet nichts. " why_ending_url: "Beginne jetzt zu zaubern!" george_description: "CEO, Businesstyp, Web Designer, Game Designer und Champion der Programmieranfänger überall." scott_description: "Außergewöhnlicher Programmierer, Softwarearchitekt, Küchenzauberer und Finanzmeister. Scott ist der Vernünftige." nick_description: "Programmierzauberer, exzentrischer Motivationskünstler und Auf-den-Kopf-stell-Experimentierer. Nick könnte alles mögliche tun und entschied CodeCombat zu bauen." jeremy_description: "Kundendienstmagier, Usability Tester und Community-Organisator. Wahrscheinlich hast du schon mit Jeremy gesprochen." michael_description: "Programmierer, Systemadministrator und studentisch technisches Wunderkind, Michael hält unsere Server am Laufen." glen_description: "Programmier und leidenschaftlicher Spieleentwickler mit der Motivation die Welt, durch das Entwickeln von Sachen die zählen, zu einem besseren Platz zu machen. Das Wort 'unmöglich' kann nicht in seinem Wortschatz gefunden werden. Neue Fähigkeiten zu lernen ist seine Leidenschaft!" legal: page_title: "Rechtliches" opensource_intro: "CodeCombat ist Free-to-Play und vollständig Open Source." opensource_description_prefix: "Schau dir " github_url: "unsere GitHub-Seite" opensource_description_center: " an und mach mit wenn Du möchtest! CodeCombat baut auf duzenden Open Source Projekten auf, und wir lieben sie. Schau dir die Liste in " archmage_wiki_url: "unserem Erzmagier-Wiki" opensource_description_suffix: " an, welche Software dieses Spiel möglich macht." practices_title: "Best Practices" practices_description: "Dies sind unsere Versprechen an dich, den Spieler, in weniger Fachchinesisch." privacy_title: "Datenschutz" privacy_description: "Wir werden deine persönlichen Daten nicht verkaufen. Letztenendes beabsichtigen wir, durch Vermittlung von Jobs zu verdienen, aber sei versichert, dass wir nicht deine persönlichen Daten ohne deine ausdrückliche Einwilligung interessierten Firmen zur Verfügung stellen werden." security_title: "Datensicherheit" security_description: "Wir streben an, deine persönlichen Daten sicher zu verwahren. Als Open Source Projekt ist unsere Site frei zugänglich für jedermann, auch um unsere Sicherheitsmaßnahmen in Augenschein zu nehmen und zu verbessern." email_title: "Email" email_description_prefix: "Wir werden dich nicht mit Spam überschwemmen. Mittels" email_settings_url: "deiner Emaileinstellungen" email_description_suffix: "oder durch von uns gesendete Links kannst du jederzeit deine Einstellungen ändern und Abonnements kündigen." cost_title: "Kosten" cost_description: "CodeCombat ist zur Zeit 100% kostenlos! Eines unserer Hauptziele ist, es dabei zu belassen, so dass es so viele Leute wie möglich spielen können, unabhängig davon in welcher Lebenssituation sie sich befinden. Falls dunkle Wolken aufziehen, könnten wir manche Inhalte im Rahmen eines Abonnements anbieten, aber lieber nicht. Mit etwas Glück können wir die Firma erhalten durch:" recruitment_title: "Recruiting" recruitment_description_prefix: "Hier bei CodeCombat kannst du ein mächtiger Zauberer werden, nicht nur im Spiel, sondern auch in der Realität." url_hire_programmers: "Niemand kann schnell genug Programmierer einstellen." recruitment_description_suffix: "So wenn du deine Fähigkeiten entwickelt hast und zustimmst, werden wir deine besten Leistungen den tausenden Arbeitgebern demonstrieren, welche nur auf die Gelegentheit warten, dich einzustellen. Sie bezahlen uns ein bisschen, und sie bezahlen dir " recruitment_description_italic: "jede Menge" recruitment_description_ending: ", die Seite bleibt kostenlos und jeder ist glücklich. So der Plan." # copyrights_title: "Copyrights and Licenses" # contributor_title: "Contributor License Agreement" # contributor_description_prefix: "All contributions, both on the site and on our GitHub repository, are subject to our" # cla_url: "CLA" # contributor_description_suffix: "to which you should agree before contributing." # code_title: "Code - MIT" # code_description_prefix: "All code owned by CodeCombat or hosted on codecombat.com, both in the GitHub repository or in the codecombat.com database, is licensed under the" # mit_license_url: "MIT license" # code_description_suffix: "This includes all code in Systems and Components that are made available by CodeCombat for the purpose of creating levels." # art_title: "Art/Music - Creative Commons " # art_description_prefix: "All common content is available under the" # cc_license_url: "Creative Commons Attribution 4.0 International License" # art_description_suffix: "Common content is anything made generally available by CodeCombat for the purpose of creating Levels. This includes:" # art_music: "Music" # art_sound: "Sound" # art_artwork: "Artwork" # art_sprites: "Sprites" # art_other: "Any and all other non-code creative works that are made available when creating Levels." # art_access: "Currently there is no universal, easy system for fetching these assets. In general, fetch them from the URLs as used by the site, contact us for assistance, or help us in extending the site to make these assets more easily accessible." # art_paragraph_1: "For attribution, please name and link to codecombat.com near where the source is used or where appropriate for the medium. For example:" # use_list_1: "If used in a movie or another game, include codecombat.com in the credits." # use_list_2: "If used on a website, include a link near the usage, for example underneath an image, or in a general attributions page where you might also mention other Creative Commons works and open source software being used on the site. Something that's already clearly referencing CodeCombat, such as a blog post mentioning CodeCombat, does not need some separate attribution." # art_paragraph_2: "If the content being used is created not by CodeCombat but instead by a user of codecombat.com, attribute them instead, and follow attribution directions provided in that resource's description if there are any." # rights_title: "Rights Reserved" # rights_desc: "All rights are reserved for Levels themselves. This includes" # rights_scripts: "Scripts" # rights_unit: "Unit configuration" # rights_description: "Description" # rights_writings: "Writings" # rights_media: "Media (sounds, music) and any other creative content made specifically for that Level and not made generally available when creating Levels." # rights_clarification: "To clarify, anything that is made available in the Level Editor for the purpose of making levels is under CC, whereas the content created with the Level Editor or uploaded in the course of creation of Levels is not." nutshell_title: "Zusammenfassung" # nutshell_description: "Any resources we provide in the Level Editor are free to use as you like for creating Levels. But we reserve the right to restrict distribution of the Levels themselves (that are created on codecombat.com) so that they may be charged for in the future, if that's what ends up happening." canonical: "Die englische Version dieses Dokuments ist die definitive, kanonische Version. Sollte es Unterschiede zwischen den Übersetzungen geben, dann hat das englische Dokument Vorrang." contribute: # page_title: "Contributing" character_classes_title: "Charakter Klassen" # introduction_desc_intro: "We have high hopes for CodeCombat." # introduction_desc_pref: "We want to be where programmers of all stripes come to learn and play together, introduce others to the wonderful world of coding, and reflect the best parts of the community. We can't and don't want to do that alone; what makes projects like GitHub, Stack Overflow and Linux great are the people who use them and build on them. To that end, " # introduction_desc_github_url: "CodeCombat is totally open source" # introduction_desc_suf: ", and we aim to provide as many ways as possible for you to take part and make this project as much yours as ours." # introduction_desc_ending: "We hope you'll join our party!" # introduction_desc_signature: "- Nick, George, Scott, Michael, Jeremy and Glen" # alert_account_message_intro: "Hey there!" # alert_account_message: "To subscribe for class emails, you'll need to be logged in first." # archmage_summary: "Interested in working on game graphics, user interface design, database and server organization, multiplayer networking, physics, sound, or game engine performance? Want to help build a game to help other people learn what you are good at? We have a lot to do and if you are an experienced programmer and want to develop for CodeCombat, this class is for you. We would love your help building the best programming game ever." # archmage_introduction: "One of the best parts about building games is they synthesize so many different things. Graphics, sound, real-time networking, social networking, and of course many of the more common aspects of programming, from low-level database management, and server administration to user facing design and interface building. There's a lot to do, and if you're an experienced programmer with a hankering to really dive into the nitty-gritty of CodeCombat, this class might be for you. We would love to have your help building the best programming game ever." # class_attributes: "Class Attributes" # archmage_attribute_1_pref: "Knowledge in " # archmage_attribute_1_suf: ", or a desire to learn. Most of our code is in this language. If you're a fan of Ruby or Python, you'll feel right at home. It's JavaScript, but with a nicer syntax." # archmage_attribute_2: "Some experience in programming and personal initiative. We'll help you get oriented, but we can't spend much time training you." # how_to_join: "How To Join" # join_desc_1: "Anyone can help out! Just check out our " # join_desc_2: "to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email. Want to chat about what to do or how to get more deeply involved? " # join_desc_3: ", or find us in our " # join_desc_4: "and we'll go from there!" join_url_email: "Emaile uns" # join_url_hipchat: "public HipChat room" # more_about_archmage: "Learn More About Becoming an Archmage" # archmage_subscribe_desc: "Get emails on new coding opportunities and announcements." # artisan_summary_pref: "Want to design levels and expand CodeCombat's arsenal? People are playing through our content at a pace faster than we can build! Right now, our level editor is barebone, so be wary. Making levels will be a little challenging and buggy. If you have visions of campaigns spanning for-loops to" # artisan_summary_suf: ", then this class is for you." # artisan_introduction_pref: "We must construct additional levels! People be clamoring for more content, and we can only build so many ourselves. Right now your workstation is level one; our level editor is barely usable even by its creators, so be wary. If you have visions of campaigns spanning for-loops to" # artisan_introduction_suf: ", then this class might be for you." # artisan_attribute_1: "Any experience in building content like this would be nice, such as using Blizzard's level editors. But not required!" # artisan_attribute_2: "A hankering to do a whole lot of testing and iteration. To make good levels, you need to take it to others and watch them play it, and be prepared to find a lot of things to fix." # artisan_attribute_3: "For the time being, endurance en par with an Adventurer. Our Level Editor is super preliminary and frustrating to use. You have been warned!" # artisan_join_desc: "Use the Level Editor in these steps, give or take:" # artisan_join_step1: "Read the documentation." # artisan_join_step2: "Create a new level and explore existing levels." # artisan_join_step3: "Find us in our public HipChat room for help." # artisan_join_step4: "Post your levels on the forum for feedback." # more_about_artisan: "Learn More About Becoming an Artisan" # artisan_subscribe_desc: "Get emails on level editor updates and announcements." # adventurer_summary: "Let us be clear about your role: you are the tank. You are going to take heavy damage. We need people to try out brand-new levels and help identify how to make things better. The pain will be enormous; making good games is a long process and no one gets it right the first time. If you can endure and have a high constitution score, then this class is for you." # adventurer_introduction: "Let's be clear about your role: you are the tank. You're going to take heavy damage. We need people to try out brand-new levels and help identify how to make things better. The pain will be enormous; making good games is a long process and no one gets it right the first time. If you can endure and have a high constitution score, then this class might be for you." # adventurer_attribute_1: "A thirst for learning. You want to learn how to code and we want to teach you how to code. You'll probably be doing most of the teaching in this case, though." # adventurer_attribute_2: "Charismatic. Be gentle but articulate about what needs improving, and offer suggestions on how to improve." # adventurer_join_pref: "Either get together with (or recruit!) an Artisan and work with them, or check the box below to receive emails when there are new levels to test. We'll also be posting about levels to review on our networks like" # adventurer_forum_url: "our forum" # adventurer_join_suf: "so if you prefer to be notified those ways, sign up there!" # more_about_adventurer: "Learn More About Becoming an Adventurer" # adventurer_subscribe_desc: "Get emails when there are new levels to test." # scribe_summary_pref: "CodeCombat is not just going to be a bunch of levels. It will also be a resource of programming knowledge that players can hook into. That way, each Artisan can link to a detailed article that for the player's edification: documentation akin to what the " # scribe_summary_suf: " has built. If you enjoy explaining programming concepts, then this class is for you." # scribe_introduction_pref: "CodeCombat isn't just going to be a bunch of levels. It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into. That way rather than each Artisan having to describe in detail what a comparison operator is, they can simply link their level to the Article describing them that is already written for the player's edification. Something along the lines of what the " # scribe_introduction_url_mozilla: "Mozilla Developer Network" # scribe_introduction_suf: " has built. If your idea of fun is articulating the concepts of programming in Markdown form, then this class might be for you." # scribe_attribute_1: "Skill in words is pretty much all you need. Not only grammar and spelling, but able to convey complicated ideas to others." contact_us_url: "Kontaktiere uns" # scribe_join_description: "tell us a little about yourself, your experience with programming and what sort of things you'd like to write about. We'll go from there!" # more_about_scribe: "Learn More About Becoming a Scribe" # scribe_subscribe_desc: "Get emails about article writing announcements." # diplomat_summary: "There is a large interest in CodeCombat in other countries that do not speak English! We are looking for translators who are willing to spend their time translating the site's corpus of words so that CodeCombat is accessible across the world as soon as possible. If you'd like to help getting CodeCombat international, then this class is for you." # diplomat_introduction_pref: "So, if there's one thing we learned from the " # diplomat_launch_url: "launch in October" # diplomat_introduction_suf: "it's that there is sizeable interest in CodeCombat in other countries! We're building a corps of translators eager to turn one set of words into another set of words to get CodeCombat as accessible across the world as possible. If you like getting sneak peeks at upcoming content and getting these levels to your fellow nationals ASAP, then this class might be for you." # diplomat_attribute_1: "Fluency in English and the language you would like to translate to. When conveying complicated ideas, it's important to have a strong grasp in both!" # diplomat_join_pref_github: "Find your language locale file " # diplomat_github_url: "on GitHub" # diplomat_join_suf_github: ", edit it online, and submit a pull request. Also, check this box below to keep up-to-date on new internationalization developments!" # more_about_diplomat: "Learn More About Becoming a Diplomat" # diplomat_subscribe_desc: "Get emails about i18n developments and levels to translate." # ambassador_summary: "We are trying to build a community, and every community needs a support team when there are troubles. We have got chats, emails, and social networks so that our users can get acquainted with the game. If you want to help people get involved, have fun, and learn some programming, then this class is for you." # ambassador_introduction: "This is a community we're building, and you are the connections. We've got Olark chats, emails, and social networks with lots of people to talk with and help get acquainted with the game and learn from. If you want to help people get involved and have fun, and get a good feel of the pulse of CodeCombat and where we're going, then this class might be for you." # ambassador_attribute_1: "Communication skills. Be able to identify the problems players are having and help them solve them. Also, keep the rest of us informed about what players are saying, what they like and don't like and want more of!" # ambassador_join_desc: "tell us a little about yourself, what you've done and what you'd be interested in doing. We'll go from there!" # ambassador_join_note_strong: "Note" # ambassador_join_note_desc: "One of our top priorities is to build multiplayer where players having difficulty solving levels can summon higher level wizards to help them. This will be a great way for ambassadors to do their thing. We'll keep you posted!" # more_about_ambassador: "Learn More About Becoming an Ambassador" # ambassador_subscribe_desc: "Get emails on support updates and multiplayer developments." # changes_auto_save: "Changes are saved automatically when you toggle checkboxes." diligent_scribes: "Unsere fleißgen Schreiber:" powerful_archmages: "Unsere mächtigen Erzmagier:" creative_artisans: "Unsere kreativen Handwerker:" brave_adventurers: "Unsere mutigen Abenteurer:" translating_diplomats: "Unsere übersetzenden Diplomaten:" helpful_ambassadors: "Unsere hilfreichen Botschafter:" classes: archmage_title: "Erzmagier" archmage_title_description: "(Programmierer)" artisan_title: "Handwerker" artisan_title_description: "(Level Entwickler)" adventurer_title: "Abenteurer" adventurer_title_description: "(Level Spieltester)" scribe_title: "Schreiber" scribe_title_description: "(Artikel Editor)" diplomat_title: "Diplomat" diplomat_title_description: "(Übersetzer)" ambassador_title: "Botschafter" ambassador_title_description: "(Support)" ladder: please_login: "Bitte logge dich zunächst ein, bevor du ein Ladder-Game spielst." my_matches: "Meine Matches" simulate: "Simuliere" # simulation_explanation: "By simulating games you can get your game ranked faster!" simulate_games: "Simuliere Spiele!" # simulate_all: "RESET AND SIMULATE GAMES" games_simulated_by: "Spiele die durch dich simuliert worden:" games_simulated_for: "Spiele die für dich simuliert worden:" games_simulated: "simulierte Spiele" games_played: "gespielte Spiele" ratio: "Ratio" # leaderboard: "Leaderboard" # battle_as: "Battle as " summary_your: "Deine " summary_matches: "Matches - " summary_wins: " Siege, " # summary_losses: " Losses" # rank_no_code: "No New Code to Rank" # rank_my_game: "Rank My Game!" # rank_submitting: "Submitting..." # rank_submitted: "Submitted for Ranking" # rank_failed: "Failed to Rank" # rank_being_ranked: "Game Being Ranked" # rank_last_submitted: "submitted " # help_simulate: "Help simulate games?" # code_being_simulated: "Your new code is being simulated by other players for ranking. This will refresh as new matches come in." # no_ranked_matches_pre: "No ranked matches for the " # no_ranked_matches_post: " team! Play against some competitors and then come back here to get your game ranked." choose_opponent: "Wähle einen Gegner" # select_your_language: "Select your language!" tutorial_play: "Spiele Tutorial" tutorial_recommended: "Empfohlen, wenn du noch nie zuvor gespielt hast." tutorial_skip: "Überspringe Tutorial" # tutorial_not_sure: "Not sure what's going on?" tutorial_play_first: "Spiele zuerst das Tutorial." simple_ai: "Einfache KI" warmup: "Aufwärmen" vs: "VS" friends_playing: "spielende Freunde" log_in_for_friends: "Melde dich an um mit deinen Freunden zu spielen!" social_connect_blurb: "Verbinde und spiele gegen deine Freunde!" # invite_friends_to_battle: "Invite your friends to join you in battle!" # fight: "Fight!" # watch_victory: "Watch your victory" # defeat_the: "Defeat the" # tournament_ends: "Tournament ends" # tournament_ended: "Tournament ended" tournament_rules: "Turnier-Regeln" # tournament_blurb: "Write code, collect gold, build armies, crush foes, win prizes, and upgrade your career in our $40,000 Greed tournament! Check out the details" # tournament_blurb_blog: "on our blog" rules: "Regeln" winners: "Gewinner" ladder_prizes: title: "Turnier Preise" # blurb_1: "These prizes will be awarded according to" # blurb_2: "the tournament rules" # blurb_3: "to the top human and ogre players." blurb_4: "Zwei Teams heißt die doppelte Anzahl zu gewinnender Preise!" # blurb_5: "(There will be two first place winners, two second-place winners, etc.)" rank: "Rang" prizes: "Gewinne" # total_value: "Total Value" # in_cash: "in cash" # custom_wizard: "Custom CodeCombat Wizard" # custom_avatar: "Custom CodeCombat avatar" # heap: "for six months of \"Startup\" access" # credits: "credits" # one_month_coupon: "coupon: choose either Rails or HTML" # one_month_discount: "discount, 30% off: choose either Rails or HTML" license: "Lizenz" oreilly: "Ebook deiner Wahl" # multiplayer_launch: # introducing_dungeon_arena: "Introducing Dungeon Arena" # new_way: "The new way to compete with code." # to_battle: "To Battle, Developers!" # modern_day_sorcerer: "You know how to code? That's badass. You're a modern-day sorcerer! Isn't about time that you used your magic coding powers to command your minions in epic combat? And we're not talking robots here." # arenas_are_here: "CodeCombat head-to-head multiplayer arenas are here." # ladder_explanation: "Choose your heroes, enchant your human or ogre armies, and climb your way over defeated fellow Wizards to reach the top of the ladders–then challenge your friends in our glorious, asynchronous multiplayer coding arenas. If you're feeling creative, you can even" # fork_our_arenas: "fork our arenas" # create_worlds: "and create your own worlds." # javascript_rusty: "JavaScript a bit rusty? Don't worry; there's a" # tutorial: "tutorial" # new_to_programming: ". New to programming? Hit our beginner campaign to skill up." # so_ready: "I Am So Ready for This" loading_error: could_not_load: "Fehler beim Laden vom Server" connection_failure: "Verbindung fehlgeschlagen." unauthorized: "Du musst angemeldet sein. Hast du Cookies ausgeschaltet?" forbidden: "Sie haben nicht die nötigen Berechtigungen." not_found: "Nicht gefunden." not_allowed: "Methode nicht erlaubt." timeout: "Server timeout." conflict: "Resourcen Konflikt." bad_input: "Falsche Eingabe." server_error: "Server Fehler." unknown: "Unbekannter Fehler." resources: your_sessions: "Meine Sessions" level: "Level" social_network_apis: "Social Network APIs" facebook_status: "Facebook Status" facebook_friends: "Facebook Freunde" facebook_friend_sessions: "Facebook Freunde Sessions" gplus_friends: "G+ Freunde" gplus_friend_sessions: "G+ Freunde Sessions" # leaderboard: "Leaderboard" user_schema: "Benutzerschema" user_profile: "Benutzerprofil" # patches: "Patches" # patched_model: "Source Document" model: "Model" system: "System" component: "Komponente" components: "Komponenten" thang: "Thang" thangs: "Thangs" level_session: "Deine Session" opponent_session: "Gegner-Session" article: "Artikel" user_names: "Benutzernamen" thang_names: "Thang Namen" files: "Dateien" top_simulators: "Top Simulatoren" # source_document: "Source Document" document: "Dokument" sprite_sheet: "Sprite Sheet" candidate_sessions: "Kandidat-Sessions" # user_remark: "User Remark" # versions: "Versions" delta: added: "hinzugefügt" modified: "modifiziert" deleted: "gelöscht" # moved_index: "Moved Index" # text_diff: "Text Diff" # merge_conflict_with: "MERGE CONFLICT WITH" # no_changes: "No Changes"
80197
module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: "German (Germany)", translation: common: loading: "Lade..." saving: "Speichere..." sending: "Übertrage..." send: "Senden" cancel: "Abbrechen" save: "Speichern" publish: "Publiziere" create: "Erstelle" delay_1_sec: "1 Sekunde" delay_3_sec: "3 Sekunden" delay_5_sec: "5 Sekunden" manual: "Manuell" fork: "Fork" play: "Abspielen" retry: "Erneut versuchen" # watch: "Watch" # unwatch: "Unwatch" # submit_patch: "Submit Patch" units: second: "Sekunde" seconds: "Sekunden" minute: "Minute" minutes: "Minuten" hour: "Stunde" hours: "Stunden" day: "Tag" days: "Tage" week: "Woche" weeks: "Wochen" month: "Monat" months: "Monate" year: "Jahr" years: "Jahre" modal: close: "Schließen" okay: "Okay" not_found: page_not_found: "Seite nicht gefunden" nav: play: "Spielen" # community: "Community" editor: "Editor" blog: "Blog" forum: "Forum" # account: "Account" admin: "Administration" home: "Home" contribute: "Helfen" legal: "Rechtliches" about: "Über" contact: "Kont<NAME>" twitter_follow: "Twitter" employers: "<NAME>" versions: save_version_title: "Neue Version speichern" new_major_version: "Neue Hauptversion" cla_prefix: "Damit Änderungen gespeichert werden können, musst du unsere Lizenzbedingungen (" cla_url: "CLA" cla_suffix: ") akzeptieren." cla_agree: "Ich stimme zu" login: sign_up: "Registrieren" log_in: "Einloggen" logging_in: "Logge ein" log_out: "Ausloggen" recover: "Account wiederherstellen" recover: recover_account_title: "Account Wiederherstellung" send_password: "<PASSWORD>" signup: create_account_title: "Account anlegen, um Fortschritt zu speichern" description: "Es ist kostenlos. Nur noch ein paar Dinge, dann kannst Du loslegen." email_announcements: "Erhalte Benachrichtigungen per Email" coppa: "Älter als 13 oder nicht aus den USA" coppa_why: "(Warum?)" creating: "Erzeuge Account..." sign_up: "Neuen Account anlegen" log_in: "mit Passwort einloggen" social_signup: "oder, du registriest dich über Facebook oder G+:" # required: "You need to log in before you can go that way." home: slogan: "Lerne spielend Programmieren" no_ie: "CodeCombat läuft nicht im IE8 oder älteren Browsern. Tut uns Leid!" no_mobile: "CodeCombat ist nicht für Mobilgeräte optimiert und funktioniert möglicherweise nicht." play: "Spielen" old_browser: "Oh! Dein Browser ist zu alt für CodeCombat. Sorry!" old_browser_suffix: "Du kannst es trotzdem versuchen, aber es wird wahrscheinlich nicht funktionieren." campaign: "Kampagne" for_beginners: "Für Anfänger" multiplayer: "Mehrspieler" for_developers: "Für Entwickler" # javascript_blurb: "The language of the web. Great for writing websites, web apps, HTML5 games, and servers." # python_blurb: "Simple yet powerful, Python is a great general purpose programming language." # coffeescript_blurb: "Nicer JavaScript syntax." # clojure_blurb: "A modern Lisp." # lua_blurb: "Game scripting language." # io_blurb: "Simple but obscure." play: choose_your_level: "Wähle dein Level" adventurer_prefix: "Du kannst zu jedem Level springen oder diskutiere die Level " adventurer_forum: "im Abenteurerforum" adventurer_suffix: "." campaign_beginner: "Anfängerkampagne" campaign_beginner_description: "... in der Du die Zauberei der Programmierung lernst." campaign_dev: "Beliebiges schwierigeres Level" campaign_dev_description: "... in welchem Du die Bedienung erlernst, indem Du etwas schwierigeres machst." campaign_multiplayer: "Multiplayerarena" campaign_multiplayer_description: "... in der Du Kopf-an-Kopf gegen andere Spieler programmierst." campaign_player_created: "Von Spielern erstellt" campaign_player_created_description: "... in welchem Du gegen die Kreativität eines <a href=\"/contribute#artisan\">Artisan Zauberers</a> kämpfst." level_difficulty: "Schwierigkeit: " play_as: "Spiele als " spectate: "Zuschauen" contact: contact_us: "Kontaktiere CodeCombat" welcome: "Schön von Dir zu hören! Benutze dieses Formular um uns eine Email zu schicken." contribute_prefix: "Wenn Du Interesse hast, uns zu unterstützen dann sieh dir die " contribute_page: "Unterstützer Seite" contribute_suffix: " an!" forum_prefix: "Für alle öffentlichen Themen, benutze stattdessen " forum_page: "unser Forum" forum_suffix: "." send: "Sende Feedback" contact_candidate: "Kontaktiere Kandidaten" recruitment_reminder: "Benutzen Sie dieses Formular um Kontakt zu Kandidaten aufzunehmen, an denen Sie interessiert sind. Bedenken Sie das CodeCombat 15% des ersten Jahresgehaltes berechnet. Diese Gebühr wird fällig wenn Sie den Kandidaten einstellen und ist für 90 Tage rückerstattungsfähig, sollte der Mitarbeiter nicht eingestellt bleiben. Mitarbeiter die für Teilzeit, Remote oder eine Auftragsarbeit eingestellt werden sind kostenlos, das gilt auch für Praktikanten." diplomat_suggestion: title: "Hilf CodeCombat zu übersetzen!" sub_heading: "Wir brauchen Deine Sprachfähigkeiten." pitch_body: "Wir entwickeln CodeCombat in Englisch, aber wir haben Spieler in der ganzen Welt. Viele von ihnen wollen in Deutsch spielen, sprechen aber kein Englisch. Wenn Du also beide Sprachen beherrscht, melde Dich an um ein Diplomat zu werden und hilf die Website und die Levels zu Deutsch zu übersetzen." missing_translations: "Solange wir nicht alles ins Deutsche übesetzt haben, siehst Du die englische Übersetzung, wo Deutsch leider noch nicht zur Verfügung steht." learn_more: "Finde heraus, wie Du ein Diplomat werden kannst" subscribe_as_diplomat: "Schreibe dich als Diplomat ein" wizard_settings: title: "Zauberer Einstellungen" customize_avatar: "Individualisiere deinen Avatar" active: "Aktiv" color: "Farbe" group: "Gruppe" clothes: "Kleidung" trim: "Applikationen" cloud: "Wolke" team: "Team" spell: "Zauber" boots: "Stiefel" hue: "<NAME>" saturation: "Sättigung" lightness: "Helligkeit" account_settings: title: "Accounteinstellungen" not_logged_in: "Logge Dich ein oder lege einen Account an, um deine Einstellungen ändern zu können." autosave: "Sichere Änderungen automatisch" me_tab: "Ich" picture_tab: "Bild" upload_picture: "Ein Bild hochladen" wizard_tab: "Zauberer" password_tab: "Passwort" emails_tab: "Emails" admin: "Admin" wizard_color: "Die Farbe der Kleidung des Zauberers" new_password: "<PASSWORD>" new_password_verify: "<PASSWORD>" email_subscriptions: "Email Abonnements" email_announcements: "Ankündigungen" email_announcements_description: "Erhalte regelmäßig Ankündigungen zu deinem Account." email_notifications: "Benachrichtigungen" # email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity." # email_any_notes: "Any Notifications" # email_any_notes_description: "Disable to stop all activity notification emails." email_recruit_notes: "Job-Angebote" # email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job." contributor_emails: "Unterstützer Email" contribute_prefix: "Wir suchen nach Leuten, die mitmachen! Schau dir die" contribute_page: "Unterstützer Seite" contribute_suffix: " an um mehr zu erfahren." email_toggle: "Alles wählen" error_saving: "Fehler beim Speichern" saved: "Änderungen gespeichert" password_mismatch: "Passwörter stimmen nicht überein." # password_repeat: "Please repeat your password." job_profile: "Jobprofil" job_profile_approved: "Dein Jobprofil wurde von CodeCombat freigegeben. Arbeitgeber können dieses solange einsehen, bis du es als inaktiv markiert oder wenn innerhalb von vier Wochen keine Änderung daran vorgenommen wurde." job_profile_explanation: "Hi! Fülle dies aus und wir melden uns bei dir bezüglich des Auffindens eines Jobs als Programmierer" sample_profile: "Ein Beispielprofil ansehen" view_profile: "Dein Profil ansehen" account_profile: settings: "Einstellungen" edit_profile: "Profil editieren" # done_editing: "Done Editing" profile_for_prefix: "Profil von " profile_for_suffix: "" # featured: "Featured" # not_featured: "Not Featured" # looking_for: "Looking for:" last_updated: "zuletzt geändert:" contact: "Kontakt" # active: "Looking for interview offers now" # inactive: "Not looking for offers right now" # complete: "complete" # next: "Next" next_city: "Stadt?" next_country: "Wähle dein Land." next_name: "Name?" next_short_description: "Schreibe eine kurze Beschreibung." next_long_description: "Beschreibe deine gewünschte Position" next_skills: "Liste mindestens fünf Fähigkeiten." # next_work: "chronicle your work history." # next_education: "recount your educational ordeals." next_projects: "Zeige bis zu 3 Projekte an denen du gearbeitet hast." # next_links: "add any personal or social links." next_photo: "Füge ein optionales professionelles Foto hinzu." # next_active: "mark yourself open to offers to show up in searches." example_blog: "Blog" example_personal_site: "Persönliche Seite" links_header: "Persönliche Links" links_blurb: "Verlinke zu anderen Seiten oder Profilen die du hervorheben möchtest, wie z.B. dein GitHub, dein LinkedIn oder deinen Blog." links_name: "Link-Name" # links_name_help: "What are you linking to?" links_link_blurb: "Link URL" # basics_header: "Update basic info" # basics_active: "Open to Offers" # basics_active_help: "Want interview offers right now?" # basics_job_title: "Desired Job Title" # basics_job_title_help: "What role are you looking for?" basics_city: "Stadt" basics_city_help: "Stadt in der du arbeiten möchtest (oder jetzt lebst)." basics_country: "Land" basics_country_help: "Land in dem du arbeiten möchtest (oder jetzt lebst)." # basics_visa: "US Work Status" # basics_visa_help: "Are you authorized to work in the US, or do you need visa sponsorship? (If you live in Canada or Australia, mark authorized.)" # basics_looking_for: "Looking For" basics_looking_for_full_time: "Vollzeit" basics_looking_for_part_time: "Teilzeit" basics_looking_for_remote: "Remote" # basics_looking_for_contracting: "Contracting" basics_looking_for_internship: "Praktikum" # basics_looking_for_help: "What kind of developer position do you want?" name_header: "Trage deinen Namen ein" name_anonymous: "An<NAME>" # name_help: "Name you want employers to see, like '<NAME>'." # short_description_header: "Write a short description of yourself" # short_description_blurb: "Add a tagline to help an employer quickly learn more about you." # short_description: "Tagline" # short_description_help: "Who are you, and what are you looking for? 140 characters max." skills_header: "Fähigkeiten" # skills_help: "Tag relevant developer skills in order of proficiency." long_description_header: "Beschreibe deine gewünschte Position" # long_description_blurb: "Tell employers how awesome you are and what role you want." # long_description: "Self Description" # long_description_help: "Describe yourself to potential employers. Keep it short and to the point. We recommend outlining the position that would most interest you. Tasteful markdown okay; 600 characters max." work_experience: "Berufserfahrung" # work_header: "Chronicle your work history" # work_years: "Years of Experience" # work_years_help: "How many years of professional experience (getting paid) developing software do you have?" # work_blurb: "List your relevant work experience, most recent first." work_employer: "<NAME>" work_employer_help: "Name deines Arbeitgebers." # work_role: "Job Title" # work_role_help: "What was your job title or role?" # work_duration: "Duration" # work_duration_help: "When did you hold this gig?" work_description: "Beschreibung" work_description_help: "Was hast du dort gemacht (140 Zeichen; optional)" # education: "Education" # education_header: "Recount your academic ordeals" # education_blurb: "List your academic ordeals." education_school: "Schule" education_school_help: "Name deiner Schule." education_degree: "Abschluss" # education_degree_help: "What was your degree and field of study?" # education_duration: "Dates" education_duration_help: "Wann?" education_description: "Beschreibung" # education_description_help: "Highlight anything about this educational experience. (140 chars; optional)" # our_notes: "CodeCombat's Notes" # remarks: "Remarks" projects: "Projekte" projects_header: "Füge 3 Projekte hinzu" projects_header_2: "Projekte (Top 3)" # projects_blurb: "Highlight your projects to amaze employers." project_name: "Projekt Name" project_name_help: "Wie wurde das Projekt genannt?" project_description: "Beschreibung" project_description_help: "Beschreibe kurz das Projekt." project_picture: "Bild" project_picture_help: "Lade ein 230x115px oder größeres Bild hoch, welches das Projekt darstellt." project_link: "Link" project_link_help: "Verlinke zu dem Projekt." player_code: "Spieler Code" employers: # hire_developers_not_credentials: "Hire developers, not credentials." # get_started: "Get Started" # already_screened: "We've already technically screened all our candidates" # filter_further: ", but you can also filter further:" # filter_visa: "Visa" # filter_visa_yes: "US Authorized" # filter_visa_no: "Not Authorized" # filter_education_top: "Top School" # filter_education_other: "Other" # filter_role_web_developer: "Web Developer" # filter_role_software_developer: "Software Developer" # filter_role_mobile_developer: "Mobile Developer" # filter_experience: "Experience" # filter_experience_senior: "Senior" # filter_experience_junior: "Junior" # filter_experience_recent_grad: "Recent Grad" # filter_experience_student: "College Student" # filter_results: "results" # start_hiring: "Start hiring." # reasons: "Three reasons you should hire through us:" # everyone_looking: "Everyone here is looking for their next opportunity." # everyone_looking_blurb: "Forget about 20% LinkedIn InMail response rates. Everyone that we list on this site wants to find their next position and will respond to your request for an introduction." # weeding: "Sit back; we've done the weeding for you." # weeding_blurb: "Every player that we list has been screened for technical ability. We also perform phone screens for select candidates and make notes on their profiles to save you time." # pass_screen: "They will pass your technical screen." # pass_screen_blurb: "Review each candidate's code before reaching out. One employer found that 5x as many of our devs passed their technical screen than hiring from Hacker News." # make_hiring_easier: "Make my hiring easier, please." what: "Was ist CodeCombat?" # what_blurb: "CodeCombat is a multiplayer browser programming game. Players write code to control their forces in battle against other developers. Our players have experience with all major tech stacks." # cost: "How much do we charge?" # cost_blurb: "We charge 15% of first year's salary and offer a 100% money back guarantee for 90 days. We don't charge for candidates who are already actively being interviewed at your company." candidate_name: "<NAME>" # candidate_location: "Location" # candidate_looking_for: "Looking For" candidate_role: "<NAME>" # candidate_top_skills: "Top Skills" # candidate_years_experience: "Yrs Exp" # candidate_last_updated: "Last Updated" # candidate_who: "Who" # featured_developers: "Featured Developers" # other_developers: "Other Developers" # inactive_developers: "Inactive Developers" play_level: done: "Fertig" grid: "Raster" customize_wizard: "Bearbeite den Zauberer" home: "Startseite" guide: "Hilfe" multiplayer: "Multiplayer" restart: "Neustart" goals: "Ziele" # success: "Success!" # incomplete: "Incomplete" # timed_out: "Ran out of time" # failing: "Failing" action_timeline: "Aktionszeitstrahl" click_to_select: "Klicke auf eine Einheit, um sie auszuwählen." reload_title: "Gesamten Code neu laden?" reload_really: "Bist Du sicher, dass Du das Level neu beginnen willst?" reload_confirm: "Alles neu laden" victory_title_prefix: "" victory_title_suffix: " Abgeschlossen" victory_sign_up: "Melde Dich an, um Fortschritte zu speichern" victory_sign_up_poke: "Möchtest Du Neuigkeiten per Mail erhalten? Erstelle einen kostenlosen Account und wir halten Dich auf dem Laufenden." victory_rate_the_level: "Bewerte das Level: " victory_return_to_ladder: "Zurück zur Rangliste" victory_play_next_level: "Spiel das nächste Level" victory_go_home: "Geh auf die Startseite" victory_review: "Erzähl uns davon!" victory_hour_of_code_done: "Bist Du fertig?" victory_hour_of_code_done_yes: "Ja, ich bin mit meiner Code-Stunde fertig!" multiplayer_title: "Multiplayer Einstellungen" multiplayer_link_description: "Gib diesen Link jedem, der mitmachen will." multiplayer_hint_label: "Hinweis:" multiplayer_hint: " Klick den Link, um alles auszuwählen, dann drück ⌘-C oder Strg-C um den Link zu kopieren." multiplayer_coming_soon: "Mehr Multiplayerfeatures werden kommen!" # multiplayer_sign_in_leaderboard: "Sign in or create an account and get your solution on the leaderboard." guide_title: "Anleitung" tome_minion_spells: "Die Zaubersprüche Deiner Knechte" tome_read_only_spells: "Nur-lesen Zauberspüche" tome_other_units: "Andere Einheiten" tome_cast_button_castable: "Führe aus" tome_cast_button_casting: "Ausführen" tome_cast_button_cast: "Zauberspuch ausführen" tome_autocast_delay: "Verzögerung der automatischen Ausführung" tome_select_spell: "Wähle einen Zauber" tome_select_a_thang: "Wähle jemanden aus, um " tome_available_spells: "Verfügbare Zauber" hud_continue: "Weiter (drücke Shift + Leertaste)" spell_saved: "Zauber gespeichert" skip_tutorial: "Überspringen (Esc)" editor_config: "Editor Einstellungen" editor_config_title: "Editor Einstellungen" editor_config_level_language_label: "Sprache für dieses Level" editor_config_level_language_description: "Lege die Programmiersprache für dieses bestimmte Level fest." editor_config_default_language_label: "Voreinstellung Programmiersprache" editor_config_default_language_description: "Definiere die Programmiersprache in der du programmieren möchtest wenn du ein neues Level beginnst." editor_config_keybindings_label: "Tastenbelegung" editor_config_keybindings_default: "Standard (Ace)" editor_config_keybindings_description: "Fügt zusätzliche Tastenkombinationen, bekannt aus anderen Editoren, hinzu" # editor_config_livecompletion_label: "Live Autocompletion" # editor_config_livecompletion_description: "Displays autocomplete suggestions while typing." editor_config_invisibles_label: "Zeige unsichtbare Zeichen" editor_config_invisibles_description: "Zeigt unsichtbare Zeichen wie Leertasten an." editor_config_indentguides_label: "Zeige Einrückungshilfe" editor_config_indentguides_description: "Zeigt vertikale Linien an um Einrückungen besser zu sehen." editor_config_behaviors_label: "Intelligentes Verhalten" editor_config_behaviors_description: "Vervollständigt automatisch Klammern und Anführungszeichen." keyboard_shortcuts: "Tastenkürzel" loading_ready: "Bereit!" tip_insert_positions: "Halte 'Umschalt' gedrückt und klicke auf die Karte um die Koordinaten einzufügen." tip_toggle_play: "Wechsel zwischen Play und Pause mit Strg+P." tip_scrub_shortcut: "Spule vor und zurück mit Strg+[ und Strg+]" tip_guide_exists: "Klicke auf die Anleitung am oberen Ende der Seite für nützliche Informationen" tip_open_source: "CodeCombat ist 100% quelloffen!" tip_beta_launch: "CodeCombat startete seine Beta im Oktober 2013." tip_js_beginning: "JavaScript ist nur der Anfang." tip_autocast_setting: "Ändere die Einstellungen für das automatische Ausführen über das Zahnrad neben dem Ausführen Knopf" think_solution: "Denke über die Lösung nach, nicht über das Problem." tip_theory_practice: "In der Theorie gibt es keinen Unterschied zwischen Theorie und Praxis. In der Praxis schon. - <NAME>" tip_error_free: "Es gibt zwei Wege fehlerfreie Programme zu schreiben; nur der Dritte funktioniert. - <NAME>" tip_debugging_program: "Wenn Debugging der Prozess zum Fehler entfernen ist, dann muss Programmieren der Prozess sein Fehler zu machen. - <NAME>" tip_forums: "Gehe zum Forum und sage uns was du denkst!" tip_baby_coders: "In der Zukunft werden sogar Babies Erzmagier sein." tip_morale_improves: "Das Laden wird weiter gehen bis die Stimmung sich verbessert." tip_all_species: "Wir glauben an gleiche Chancen für alle Arten Programmieren zu lernen." # tip_reticulating: "Reticulating spines." tip_harry: "Du bist ein Zauberer, " tip_great_responsibility: "Mit großen Programmierfähigkeiten kommt große Verantwortung." tip_munchkin: "Wenn du dein Gemüse nicht isst, besucht dich ein Zwerg während du schläfst." tip_binary: "Es gibt auf der Welt nur 10 Arten von Menschen: die, welche Binär verstehen und die, welche nicht." tip_commitment_yoda: "Ein Programmier muss die größte Hingabe haben, den ernstesten Verstand. ~ Yoda" tip_no_try: "Tu. Oder tu nicht. Es gibt kein Versuchen. - Yoda" tip_patience: "Geduld du musst haben, <NAME>. - Yoda" tip_documented_bug: "Ein dokumentierter Fehler ist kein Fehler; er ist ein Merkmal." tip_impossible: "Es wirkt immer unmöglich bis es vollbracht ist. - <NAME>" tip_talk_is_cheap: "Reden ist billig. Zeig mir den Code. - <NAME>" tip_first_language: "Das schwierigste, das du jemals lernen wirst, ist die erste Programmiersprache. - <NAME>" # tip_hardware_problem: "Q: How many programmers does it take to change a light bulb? A: None, it's a hardware problem." time_current: "Aktuell" time_total: "Total" time_goto: "Gehe zu" infinite_loop_try_again: "Erneut versuchen" # infinite_loop_reset_level: "Reset Level" infinite_loop_comment_out: "Meinen Code auskommentieren" keyboard_shortcuts: keyboard_shortcuts: "Tastaturkürzel" space: "Leertaste" enter: "Eingabetaste" # escape: "Escape" # cast_spell: "Cast current spell." # continue_script: "Continue past current script." # skip_scripts: "Skip past all skippable scripts." # toggle_playback: "Toggle play/pause." # scrub_playback: "Scrub back and forward through time." # single_scrub_playback: "Scrub back and forward through time by a single frame." # scrub_execution: "Scrub through current spell execution." # toggle_debug: "Toggle debug display." # toggle_grid: "Toggle grid overlay." # toggle_pathfinding: "Toggle pathfinding overlay." # beautify: "Beautify your code by standardizing its formatting." # move_wizard: "Move your Wizard around the level." admin: av_title: "Administrator Übersicht" av_entities_sub_title: "Entitäten" av_entities_users_url: "Benutzer" av_entities_active_instances_url: "Aktive Instanzen" av_entities_employer_list_url: "Arbeitgeberliste" av_other_sub_title: "Sonstige" # av_other_debug_base_url: "Base (for debugging base.jade)" u_title: "Benutzerliste" lg_title: "Letzte Spiele" # clas: "CLAs" community: level_editor: "Level Editor" main_title: "CodeCombat Community" facebook: "Facebook" twitter: "Twitter" gplus: "Google+" editor: main_title: "CodeCombat Editoren" main_description: "Entwerfe deine eigenen Level, Kampagnen, Einheiten und Lernmaterial. Wir stellen alle Werkzeuge zur Verfügung, die Du dafür benötigst!" article_title: "Artikel Editor" article_description: "Schreiben Sie Artikel, die anderen Spieler einen Überblick über Programmierkonzepte geben und in einer Vielzahl von Ebenen und Kampagnen genutzt werden können." thang_title: "Thang Editor" thang_description: "Entwerfe Einheiten, definiere ihre Standardlogik, Grafiken und Töne. Zurzeit werden nur Flash Vektorgrafiken unterstützt." level_title: "Level Editor" level_description: "Beinhaltet die Werkzeuge zum Scripten, Hochladen von Tönen und zur Konstruktion eigener Logik, damit jedes erdenkliches Level erstellt werden kann. Genau die Sachen, die wir selber benutzen!" # achievement_title: "Achievement Editor" got_questions: "Fragen zur Benutzung des CodeCombat Editors?" contact_us: "setze dich mit uns in Verbindung!" hipchat_prefix: "Besuche uns auch in unserem" hipchat_url: "HipChat room." back: "Zurück" revert: "Zurücksetzen" revert_models: "Models zurücksetzen." # pick_a_terrain: "Pick A Terrain" # small: "Small" # grassy: "Grassy" fork_title: "Forke neue Version" fork_creating: "Erzeuge Fork..." # randomize: "Randomize" more: "Mehr" wiki: "Wiki" live_chat: "Live Chat" level_some_options: "Einige Einstellungsmöglichkeiten?" level_tab_thangs: "Thangs" level_tab_scripts: "Skripte" level_tab_settings: "Einstellungen" level_tab_components: "Komponenten" level_tab_systems: "Systeme" level_tab_thangs_title: "Aktuelle Thangs" level_tab_thangs_all: "Alle" level_tab_thangs_conditions: "Startbedingungen" level_tab_thangs_add: "Thangs hinzufügen" delete: "Löschen" duplicate: "Duplizieren" level_settings_title: "Einstellungen" level_component_tab_title: "Aktuelle Komponenten" level_component_btn_new: "neue Komponente erstellen" level_systems_tab_title: "Aktuelle Systeme" level_systems_btn_new: "neues System erstellen" level_systems_btn_add: "System hinzufügen" level_components_title: "Zurück zu allen Thangs" level_components_type: "Typ" level_component_edit_title: "Komponente bearbeiten" level_component_config_schema: "Konfigurationsschema" level_component_settings: "Einstellungen" level_system_edit_title: "System bearbeiten" create_system_title: "neues System erstellen" new_component_title: "Neue Komponente erstellen" new_component_field_system: "System" new_article_title: "Erstelle einen neuen Artikel" new_thang_title: "Erstelle einen neuen Thang-Typen" new_level_title: "Erstelle ein neues Level" new_article_title_login: "Melde dich an um einen neuen Artikel zu erstellen" new_thang_title_login: "Melde dich an um einen neuen Thang-Typen zu erstellen" new_level_title_login: "Melde dich an um ein neues Level zu erstellen" # new_achievement_title: "Create a New Achievement" # new_achievement_title_login: "Log In to Create a New Achievement" article_search_title: "Durchsuche Artikel hier" thang_search_title: "Durchsuche Thang-Typen hier" level_search_title: "Durchsuche Levels hier" # achievement_search_title: "Search Achievements" # read_only_warning2: "Note: you can't save any edits here, because you're not logged in." article: edit_btn_preview: "Vorschau" edit_article_title: "Artikel bearbeiten" general: and: "und" name: "Name" body: "Inhalt" version: "Version" commit_msg: "Commit Nachricht" version_history: "Versionshistorie" version_history_for: "Versionsgeschichte für: " result: "Ergebnis" results: "Ergebnisse" description: "Beschreibung" or: "oder" subject: "Betreff" email: "Email" password: "<PASSWORD>" message: "Nachricht" code: "Code" ladder: "Rangliste" when: "Wann" opponent: "<NAME>" rank: "Rang" score: "Punktzahl" win: "Sieg" loss: "Niederlage" tie: "Unentschieden" easy: "Einfach" medium: "Mittel" hard: "Schwer" player: "<NAME>" about: who_is_codecombat: "Wer ist CodeCombat?" why_codecombat: "Warum CodeCombat?" who_description_prefix: "gründeten CodeCombat im Jahre 2013 zusammen. Wir entwickelten außerdem " who_description_suffix: ", die meist benutzte (#1) Web and iOS Applikation 2008 zum Lernen des Schreibens von chinesischen und japanischen Schriftzeichen." who_description_ending: "Nun ist es an der Zeit, den Leuten das Programmieren beizubringen." why_paragraph_1: "Als er Skritter machte, wusste George nicht wie man programmiert und war permanent darüber frustriert, dass er seine Ideen nicht umsetzen konnte. Danach versuchte er es zu lernen, aber das ging ihm zu langsam. Sein Mitbewohner versuchte Codecademy, als er sich umorientierte und aufhörte zu lehren, aber \"langweilte sich\". Jede Woche begann ein neuer Freund mit Codecademy und ließ es dann wieder bleiben. Wir erkannten, dass es das gleiche Problem war, welches wir mit Skritter gelöst hatten: Leute lernen eine Fähigkeit mittels langsamer, intersiver Lerneinheiten, wobei sie schnelle, umfassende Übung bräuchten. Wir kennen Abhilfe." why_paragraph_2: "Programmieren lernen? Du brauchst keine Stunden. Du musst einen Haufen Code schreiben und dabei Spaß haben." why_paragraph_3_prefix: "Darum geht's beim Programmieren. Es soll Spaß machen. Nicht so einen Spaß wie" why_paragraph_3_italic: "jau, 'ne Plakette" why_paragraph_3_center: "sondern Spaß wie" why_paragraph_3_italic_caps: "NEIN MUTTI ICH MUSS NOCH DEN LEVEL BEENDEN !" why_paragraph_3_suffix: "Deshalb ist CodeCombat ein Multiplayerspiel und kein spielähnlicher Kurs. Wir werden nicht aufhören bis du nicht mehr aufhören kannst -- nur diesmal ist das eine gute Sache." why_paragraph_4: "Wenn dich Spiele süchtig machen, dass lass dich von diesem süchtig machen und werde ein Zauberer des Technologiezeitalters." why_ending: "Und hey, es kostet nichts. " why_ending_url: "Beginne jetzt zu zaubern!" george_description: "CEO, Businesstyp, Web Designer, Game Designer und Champion der Programmieranfänger überall." scott_description: "Außergewöhnlicher Programmierer, Softwarearchitekt, Küchenzauberer und Finanzmeister. <NAME> ist der Vernünftige." nick_description: "Programmierzauberer, exzentrischer Motivationskünstler und Auf-den-Kopf-stell-Experimentierer. <NAME> könnte alles mögliche tun und entschied CodeCombat zu bauen." jeremy_description: "Kundendienstmagier, Usability Tester und Community-Organisator. Wahrscheinlich hast du schon mit <NAME> gesprochen." michael_description: "Programmierer, Systemadministrator und studentisch technisches Wunderkind, <NAME> hält unsere Server am Laufen." glen_description: "Programmier und leidenschaftlicher Spieleentwickler mit der Motivation die Welt, durch das Entwickeln von Sachen die zählen, zu einem besseren Platz zu machen. Das Wort 'unmöglich' kann nicht in seinem Wortschatz gefunden werden. Neue Fähigkeiten zu lernen ist seine Leidenschaft!" legal: page_title: "Rechtliches" opensource_intro: "CodeCombat ist Free-to-Play und vollständig Open Source." opensource_description_prefix: "Schau dir " github_url: "unsere GitHub-Seite" opensource_description_center: " an und mach mit wenn Du möchtest! CodeCombat baut auf duzenden Open Source Projekten auf, und wir lieben sie. Schau dir die Liste in " archmage_wiki_url: "unserem Erzmagier-Wiki" opensource_description_suffix: " an, welche Software dieses Spiel möglich macht." practices_title: "Best Practices" practices_description: "Dies sind unsere Versprechen an dich, den Spieler, in weniger Fachchinesisch." privacy_title: "Datenschutz" privacy_description: "Wir werden deine persönlichen Daten nicht verkaufen. Letztenendes beabsichtigen wir, durch Vermittlung von Jobs zu verdienen, aber sei versichert, dass wir nicht deine persönlichen Daten ohne deine ausdrückliche Einwilligung interessierten Firmen zur Verfügung stellen werden." security_title: "Datensicherheit" security_description: "Wir streben an, deine persönlichen Daten sicher zu verwahren. Als Open Source Projekt ist unsere Site frei zugänglich für jedermann, auch um unsere Sicherheitsmaßnahmen in Augenschein zu nehmen und zu verbessern." email_title: "Email" email_description_prefix: "Wir werden dich nicht mit Spam überschwemmen. Mittels" email_settings_url: "deiner Emaileinstellungen" email_description_suffix: "oder durch von uns gesendete Links kannst du jederzeit deine Einstellungen ändern und Abonnements kündigen." cost_title: "Kosten" cost_description: "CodeCombat ist zur Zeit 100% kostenlos! Eines unserer Hauptziele ist, es dabei zu belassen, so dass es so viele Leute wie möglich spielen können, unabhängig davon in welcher Lebenssituation sie sich befinden. Falls dunkle Wolken aufziehen, könnten wir manche Inhalte im Rahmen eines Abonnements anbieten, aber lieber nicht. Mit etwas Glück können wir die Firma erhalten durch:" recruitment_title: "Recruiting" recruitment_description_prefix: "Hier bei CodeCombat kannst du ein mächtiger Zauberer werden, nicht nur im Spiel, sondern auch in der Realität." url_hire_programmers: "Niemand kann schnell genug Programmierer einstellen." recruitment_description_suffix: "So wenn du deine Fähigkeiten entwickelt hast und zustimmst, werden wir deine besten Leistungen den tausenden Arbeitgebern demonstrieren, welche nur auf die Gelegentheit warten, dich einzustellen. Sie bezahlen uns ein bisschen, und sie bezahlen dir " recruitment_description_italic: "jede Menge" recruitment_description_ending: ", die Seite bleibt kostenlos und jeder ist glücklich. So der Plan." # copyrights_title: "Copyrights and Licenses" # contributor_title: "Contributor License Agreement" # contributor_description_prefix: "All contributions, both on the site and on our GitHub repository, are subject to our" # cla_url: "CLA" # contributor_description_suffix: "to which you should agree before contributing." # code_title: "Code - MIT" # code_description_prefix: "All code owned by CodeCombat or hosted on codecombat.com, both in the GitHub repository or in the codecombat.com database, is licensed under the" # mit_license_url: "MIT license" # code_description_suffix: "This includes all code in Systems and Components that are made available by CodeCombat for the purpose of creating levels." # art_title: "Art/Music - Creative Commons " # art_description_prefix: "All common content is available under the" # cc_license_url: "Creative Commons Attribution 4.0 International License" # art_description_suffix: "Common content is anything made generally available by CodeCombat for the purpose of creating Levels. This includes:" # art_music: "Music" # art_sound: "Sound" # art_artwork: "Artwork" # art_sprites: "Sprites" # art_other: "Any and all other non-code creative works that are made available when creating Levels." # art_access: "Currently there is no universal, easy system for fetching these assets. In general, fetch them from the URLs as used by the site, contact us for assistance, or help us in extending the site to make these assets more easily accessible." # art_paragraph_1: "For attribution, please name and link to codecombat.com near where the source is used or where appropriate for the medium. For example:" # use_list_1: "If used in a movie or another game, include codecombat.com in the credits." # use_list_2: "If used on a website, include a link near the usage, for example underneath an image, or in a general attributions page where you might also mention other Creative Commons works and open source software being used on the site. Something that's already clearly referencing CodeCombat, such as a blog post mentioning CodeCombat, does not need some separate attribution." # art_paragraph_2: "If the content being used is created not by CodeCombat but instead by a user of codecombat.com, attribute them instead, and follow attribution directions provided in that resource's description if there are any." # rights_title: "Rights Reserved" # rights_desc: "All rights are reserved for Levels themselves. This includes" # rights_scripts: "Scripts" # rights_unit: "Unit configuration" # rights_description: "Description" # rights_writings: "Writings" # rights_media: "Media (sounds, music) and any other creative content made specifically for that Level and not made generally available when creating Levels." # rights_clarification: "To clarify, anything that is made available in the Level Editor for the purpose of making levels is under CC, whereas the content created with the Level Editor or uploaded in the course of creation of Levels is not." nutshell_title: "Zusammenfassung" # nutshell_description: "Any resources we provide in the Level Editor are free to use as you like for creating Levels. But we reserve the right to restrict distribution of the Levels themselves (that are created on codecombat.com) so that they may be charged for in the future, if that's what ends up happening." canonical: "Die englische Version dieses Dokuments ist die definitive, kanonische Version. Sollte es Unterschiede zwischen den Übersetzungen geben, dann hat das englische Dokument Vorrang." contribute: # page_title: "Contributing" character_classes_title: "<NAME>" # introduction_desc_intro: "We have high hopes for CodeCombat." # introduction_desc_pref: "We want to be where programmers of all stripes come to learn and play together, introduce others to the wonderful world of coding, and reflect the best parts of the community. We can't and don't want to do that alone; what makes projects like GitHub, Stack Overflow and Linux great are the people who use them and build on them. To that end, " # introduction_desc_github_url: "CodeCombat is totally open source" # introduction_desc_suf: ", and we aim to provide as many ways as possible for you to take part and make this project as much yours as ours." # introduction_desc_ending: "We hope you'll join our party!" # introduction_desc_signature: "- <NAME>, <NAME>, <NAME>, <NAME> <NAME>" # alert_account_message_intro: "Hey there!" # alert_account_message: "To subscribe for class emails, you'll need to be logged in first." # archmage_summary: "Interested in working on game graphics, user interface design, database and server organization, multiplayer networking, physics, sound, or game engine performance? Want to help build a game to help other people learn what you are good at? We have a lot to do and if you are an experienced programmer and want to develop for CodeCombat, this class is for you. We would love your help building the best programming game ever." # archmage_introduction: "One of the best parts about building games is they synthesize so many different things. Graphics, sound, real-time networking, social networking, and of course many of the more common aspects of programming, from low-level database management, and server administration to user facing design and interface building. There's a lot to do, and if you're an experienced programmer with a hankering to really dive into the nitty-gritty of CodeCombat, this class might be for you. We would love to have your help building the best programming game ever." # class_attributes: "Class Attributes" # archmage_attribute_1_pref: "Knowledge in " # archmage_attribute_1_suf: ", or a desire to learn. Most of our code is in this language. If you're a fan of Ruby or Python, you'll feel right at home. It's JavaScript, but with a nicer syntax." # archmage_attribute_2: "Some experience in programming and personal initiative. We'll help you get oriented, but we can't spend much time training you." # how_to_join: "How To Join" # join_desc_1: "Anyone can help out! Just check out our " # join_desc_2: "to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email. Want to chat about what to do or how to get more deeply involved? " # join_desc_3: ", or find us in our " # join_desc_4: "and we'll go from there!" join_url_email: "Emaile uns" # join_url_hipchat: "public HipChat room" # more_about_archmage: "Learn More About Becoming an Archmage" # archmage_subscribe_desc: "Get emails on new coding opportunities and announcements." # artisan_summary_pref: "Want to design levels and expand CodeCombat's arsenal? People are playing through our content at a pace faster than we can build! Right now, our level editor is barebone, so be wary. Making levels will be a little challenging and buggy. If you have visions of campaigns spanning for-loops to" # artisan_summary_suf: ", then this class is for you." # artisan_introduction_pref: "We must construct additional levels! People be clamoring for more content, and we can only build so many ourselves. Right now your workstation is level one; our level editor is barely usable even by its creators, so be wary. If you have visions of campaigns spanning for-loops to" # artisan_introduction_suf: ", then this class might be for you." # artisan_attribute_1: "Any experience in building content like this would be nice, such as using Blizzard's level editors. But not required!" # artisan_attribute_2: "A hankering to do a whole lot of testing and iteration. To make good levels, you need to take it to others and watch them play it, and be prepared to find a lot of things to fix." # artisan_attribute_3: "For the time being, endurance en par with an Adventurer. Our Level Editor is super preliminary and frustrating to use. You have been warned!" # artisan_join_desc: "Use the Level Editor in these steps, give or take:" # artisan_join_step1: "Read the documentation." # artisan_join_step2: "Create a new level and explore existing levels." # artisan_join_step3: "Find us in our public HipChat room for help." # artisan_join_step4: "Post your levels on the forum for feedback." # more_about_artisan: "Learn More About Becoming an Artisan" # artisan_subscribe_desc: "Get emails on level editor updates and announcements." # adventurer_summary: "Let us be clear about your role: you are the tank. You are going to take heavy damage. We need people to try out brand-new levels and help identify how to make things better. The pain will be enormous; making good games is a long process and no one gets it right the first time. If you can endure and have a high constitution score, then this class is for you." # adventurer_introduction: "Let's be clear about your role: you are the tank. You're going to take heavy damage. We need people to try out brand-new levels and help identify how to make things better. The pain will be enormous; making good games is a long process and no one gets it right the first time. If you can endure and have a high constitution score, then this class might be for you." # adventurer_attribute_1: "A thirst for learning. You want to learn how to code and we want to teach you how to code. You'll probably be doing most of the teaching in this case, though." # adventurer_attribute_2: "Charismatic. Be gentle but articulate about what needs improving, and offer suggestions on how to improve." # adventurer_join_pref: "Either get together with (or recruit!) an Artisan and work with them, or check the box below to receive emails when there are new levels to test. We'll also be posting about levels to review on our networks like" # adventurer_forum_url: "our forum" # adventurer_join_suf: "so if you prefer to be notified those ways, sign up there!" # more_about_adventurer: "Learn More About Becoming an Adventurer" # adventurer_subscribe_desc: "Get emails when there are new levels to test." # scribe_summary_pref: "CodeCombat is not just going to be a bunch of levels. It will also be a resource of programming knowledge that players can hook into. That way, each Artisan can link to a detailed article that for the player's edification: documentation akin to what the " # scribe_summary_suf: " has built. If you enjoy explaining programming concepts, then this class is for you." # scribe_introduction_pref: "CodeCombat isn't just going to be a bunch of levels. It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into. That way rather than each Artisan having to describe in detail what a comparison operator is, they can simply link their level to the Article describing them that is already written for the player's edification. Something along the lines of what the " # scribe_introduction_url_mozilla: "Mozilla Developer Network" # scribe_introduction_suf: " has built. If your idea of fun is articulating the concepts of programming in Markdown form, then this class might be for you." # scribe_attribute_1: "Skill in words is pretty much all you need. Not only grammar and spelling, but able to convey complicated ideas to others." contact_us_url: "Kontaktiere uns" # scribe_join_description: "tell us a little about yourself, your experience with programming and what sort of things you'd like to write about. We'll go from there!" # more_about_scribe: "Learn More About Becoming a Scribe" # scribe_subscribe_desc: "Get emails about article writing announcements." # diplomat_summary: "There is a large interest in CodeCombat in other countries that do not speak English! We are looking for translators who are willing to spend their time translating the site's corpus of words so that CodeCombat is accessible across the world as soon as possible. If you'd like to help getting CodeCombat international, then this class is for you." # diplomat_introduction_pref: "So, if there's one thing we learned from the " # diplomat_launch_url: "launch in October" # diplomat_introduction_suf: "it's that there is sizeable interest in CodeCombat in other countries! We're building a corps of translators eager to turn one set of words into another set of words to get CodeCombat as accessible across the world as possible. If you like getting sneak peeks at upcoming content and getting these levels to your fellow nationals ASAP, then this class might be for you." # diplomat_attribute_1: "Fluency in English and the language you would like to translate to. When conveying complicated ideas, it's important to have a strong grasp in both!" # diplomat_join_pref_github: "Find your language locale file " # diplomat_github_url: "on GitHub" # diplomat_join_suf_github: ", edit it online, and submit a pull request. Also, check this box below to keep up-to-date on new internationalization developments!" # more_about_diplomat: "Learn More About Becoming a Diplomat" # diplomat_subscribe_desc: "Get emails about i18n developments and levels to translate." # ambassador_summary: "We are trying to build a community, and every community needs a support team when there are troubles. We have got chats, emails, and social networks so that our users can get acquainted with the game. If you want to help people get involved, have fun, and learn some programming, then this class is for you." # ambassador_introduction: "This is a community we're building, and you are the connections. We've got Olark chats, emails, and social networks with lots of people to talk with and help get acquainted with the game and learn from. If you want to help people get involved and have fun, and get a good feel of the pulse of CodeCombat and where we're going, then this class might be for you." # ambassador_attribute_1: "Communication skills. Be able to identify the problems players are having and help them solve them. Also, keep the rest of us informed about what players are saying, what they like and don't like and want more of!" # ambassador_join_desc: "tell us a little about yourself, what you've done and what you'd be interested in doing. We'll go from there!" # ambassador_join_note_strong: "Note" # ambassador_join_note_desc: "One of our top priorities is to build multiplayer where players having difficulty solving levels can summon higher level wizards to help them. This will be a great way for ambassadors to do their thing. We'll keep you posted!" # more_about_ambassador: "Learn More About Becoming an Ambassador" # ambassador_subscribe_desc: "Get emails on support updates and multiplayer developments." # changes_auto_save: "Changes are saved automatically when you toggle checkboxes." diligent_scribes: "Unsere fleißgen Schreiber:" powerful_archmages: "Unsere mächtigen Erzmagier:" creative_artisans: "Unsere kreativen Handwerker:" brave_adventurers: "Unsere mutigen Abenteurer:" translating_diplomats: "Unsere übersetzenden Diplomaten:" helpful_ambassadors: "Unsere hilfreichen Botschafter:" classes: archmage_title: "Erzmagier" archmage_title_description: "(Programmierer)" artisan_title: "Handwerker" artisan_title_description: "(Level Entwickler)" adventurer_title: "<NAME>" adventurer_title_description: "(Level Spieltester)" scribe_title: "<NAME>" scribe_title_description: "(Artikel Editor)" diplomat_title: "<NAME>" diplomat_title_description: "(Übersetzer)" ambassador_title: "<NAME>" ambassador_title_description: "(Support)" ladder: please_login: "Bitte logge dich zunächst ein, bevor du ein Ladder-Game spielst." my_matches: "Meine Matches" simulate: "Simuliere" # simulation_explanation: "By simulating games you can get your game ranked faster!" simulate_games: "Simuliere Spiele!" # simulate_all: "RESET AND SIMULATE GAMES" games_simulated_by: "Spiele die durch dich simuliert worden:" games_simulated_for: "Spiele die für dich simuliert worden:" games_simulated: "simulierte Spiele" games_played: "gespielte Spiele" ratio: "Ratio" # leaderboard: "Leaderboard" # battle_as: "Battle as " summary_your: "Deine " summary_matches: "Matches - " summary_wins: " Siege, " # summary_losses: " Losses" # rank_no_code: "No New Code to Rank" # rank_my_game: "Rank My Game!" # rank_submitting: "Submitting..." # rank_submitted: "Submitted for Ranking" # rank_failed: "Failed to Rank" # rank_being_ranked: "Game Being Ranked" # rank_last_submitted: "submitted " # help_simulate: "Help simulate games?" # code_being_simulated: "Your new code is being simulated by other players for ranking. This will refresh as new matches come in." # no_ranked_matches_pre: "No ranked matches for the " # no_ranked_matches_post: " team! Play against some competitors and then come back here to get your game ranked." choose_opponent: "<NAME>" # select_your_language: "Select your language!" tutorial_play: "Spiele Tutorial" tutorial_recommended: "Empfohlen, wenn du noch nie zuvor gespielt hast." tutorial_skip: "Überspringe Tutorial" # tutorial_not_sure: "Not sure what's going on?" tutorial_play_first: "Spiele zuerst das Tutorial." simple_ai: "Einfache KI" warmup: "Aufwärmen" vs: "VS" friends_playing: "spielende Freunde" log_in_for_friends: "Melde dich an um mit deinen Freunden zu spielen!" social_connect_blurb: "Verbinde und spiele gegen deine Freunde!" # invite_friends_to_battle: "Invite your friends to join you in battle!" # fight: "Fight!" # watch_victory: "Watch your victory" # defeat_the: "Defeat the" # tournament_ends: "Tournament ends" # tournament_ended: "Tournament ended" tournament_rules: "Turnier-Regeln" # tournament_blurb: "Write code, collect gold, build armies, crush foes, win prizes, and upgrade your career in our $40,000 Greed tournament! Check out the details" # tournament_blurb_blog: "on our blog" rules: "Regeln" winners: "<NAME>" ladder_prizes: title: "Turnier Preise" # blurb_1: "These prizes will be awarded according to" # blurb_2: "the tournament rules" # blurb_3: "to the top human and ogre players." blurb_4: "Zwei Teams heißt die doppelte Anzahl zu gewinnender Preise!" # blurb_5: "(There will be two first place winners, two second-place winners, etc.)" rank: "Rang" prizes: "Gewinne" # total_value: "Total Value" # in_cash: "in cash" # custom_wizard: "Custom CodeCombat Wizard" # custom_avatar: "Custom CodeCombat avatar" # heap: "for six months of \"Startup\" access" # credits: "credits" # one_month_coupon: "coupon: choose either Rails or HTML" # one_month_discount: "discount, 30% off: choose either Rails or HTML" license: "Lizenz" oreilly: "<NAME>" # multiplayer_launch: # introducing_dungeon_arena: "Introducing Dungeon Arena" # new_way: "The new way to compete with code." # to_battle: "To Battle, Developers!" # modern_day_sorcerer: "You know how to code? That's badass. You're a modern-day sorcerer! Isn't about time that you used your magic coding powers to command your minions in epic combat? And we're not talking robots here." # arenas_are_here: "CodeCombat head-to-head multiplayer arenas are here." # ladder_explanation: "Choose your heroes, enchant your human or ogre armies, and climb your way over defeated fellow Wizards to reach the top of the ladders–then challenge your friends in our glorious, asynchronous multiplayer coding arenas. If you're feeling creative, you can even" # fork_our_arenas: "fork our arenas" # create_worlds: "and create your own worlds." # javascript_rusty: "JavaScript a bit rusty? Don't worry; there's a" # tutorial: "tutorial" # new_to_programming: ". New to programming? Hit our beginner campaign to skill up." # so_ready: "I Am So Ready for This" loading_error: could_not_load: "Fehler beim Laden vom Server" connection_failure: "Verbindung fehlgeschlagen." unauthorized: "Du musst angemeldet sein. Hast du Cookies ausgeschaltet?" forbidden: "Sie haben nicht die nötigen Berechtigungen." not_found: "Nicht gefunden." not_allowed: "Methode nicht erlaubt." timeout: "Server timeout." conflict: "Resourcen Konflikt." bad_input: "Falsche Eingabe." server_error: "Server Fehler." unknown: "Unbekannter Fehler." resources: your_sessions: "Meine Sessions" level: "Level" social_network_apis: "Social Network APIs" facebook_status: "Facebook Status" facebook_friends: "Facebook Freunde" facebook_friend_sessions: "Facebook Freunde Sessions" gplus_friends: "G+ Freunde" gplus_friend_sessions: "G+ Freunde Sessions" # leaderboard: "Leaderboard" user_schema: "Benutzerschema" user_profile: "Benutzerprofil" # patches: "Patches" # patched_model: "Source Document" model: "Model" system: "System" component: "Komponente" components: "Komponenten" thang: "Thang" thangs: "Thangs" level_session: "Deine Session" opponent_session: "Gegner-Session" article: "Artikel" user_names: "<NAME>" thang_names: "<NAME>" files: "Dateien" top_simulators: "Top Simulatoren" # source_document: "Source Document" document: "Dokument" sprite_sheet: "Sprite Sheet" candidate_sessions: "Kandidat-Sessions" # user_remark: "User Remark" # versions: "Versions" delta: added: "hinzugefügt" modified: "modifiziert" deleted: "gelöscht" # moved_index: "Moved Index" # text_diff: "Text Diff" # merge_conflict_with: "MERGE CONFLICT WITH" # no_changes: "No Changes"
true
module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: "German (Germany)", translation: common: loading: "Lade..." saving: "Speichere..." sending: "Übertrage..." send: "Senden" cancel: "Abbrechen" save: "Speichern" publish: "Publiziere" create: "Erstelle" delay_1_sec: "1 Sekunde" delay_3_sec: "3 Sekunden" delay_5_sec: "5 Sekunden" manual: "Manuell" fork: "Fork" play: "Abspielen" retry: "Erneut versuchen" # watch: "Watch" # unwatch: "Unwatch" # submit_patch: "Submit Patch" units: second: "Sekunde" seconds: "Sekunden" minute: "Minute" minutes: "Minuten" hour: "Stunde" hours: "Stunden" day: "Tag" days: "Tage" week: "Woche" weeks: "Wochen" month: "Monat" months: "Monate" year: "Jahr" years: "Jahre" modal: close: "Schließen" okay: "Okay" not_found: page_not_found: "Seite nicht gefunden" nav: play: "Spielen" # community: "Community" editor: "Editor" blog: "Blog" forum: "Forum" # account: "Account" admin: "Administration" home: "Home" contribute: "Helfen" legal: "Rechtliches" about: "Über" contact: "KontPI:NAME:<NAME>END_PI" twitter_follow: "Twitter" employers: "PI:NAME:<NAME>END_PI" versions: save_version_title: "Neue Version speichern" new_major_version: "Neue Hauptversion" cla_prefix: "Damit Änderungen gespeichert werden können, musst du unsere Lizenzbedingungen (" cla_url: "CLA" cla_suffix: ") akzeptieren." cla_agree: "Ich stimme zu" login: sign_up: "Registrieren" log_in: "Einloggen" logging_in: "Logge ein" log_out: "Ausloggen" recover: "Account wiederherstellen" recover: recover_account_title: "Account Wiederherstellung" send_password: "PI:PASSWORD:<PASSWORD>END_PI" signup: create_account_title: "Account anlegen, um Fortschritt zu speichern" description: "Es ist kostenlos. Nur noch ein paar Dinge, dann kannst Du loslegen." email_announcements: "Erhalte Benachrichtigungen per Email" coppa: "Älter als 13 oder nicht aus den USA" coppa_why: "(Warum?)" creating: "Erzeuge Account..." sign_up: "Neuen Account anlegen" log_in: "mit Passwort einloggen" social_signup: "oder, du registriest dich über Facebook oder G+:" # required: "You need to log in before you can go that way." home: slogan: "Lerne spielend Programmieren" no_ie: "CodeCombat läuft nicht im IE8 oder älteren Browsern. Tut uns Leid!" no_mobile: "CodeCombat ist nicht für Mobilgeräte optimiert und funktioniert möglicherweise nicht." play: "Spielen" old_browser: "Oh! Dein Browser ist zu alt für CodeCombat. Sorry!" old_browser_suffix: "Du kannst es trotzdem versuchen, aber es wird wahrscheinlich nicht funktionieren." campaign: "Kampagne" for_beginners: "Für Anfänger" multiplayer: "Mehrspieler" for_developers: "Für Entwickler" # javascript_blurb: "The language of the web. Great for writing websites, web apps, HTML5 games, and servers." # python_blurb: "Simple yet powerful, Python is a great general purpose programming language." # coffeescript_blurb: "Nicer JavaScript syntax." # clojure_blurb: "A modern Lisp." # lua_blurb: "Game scripting language." # io_blurb: "Simple but obscure." play: choose_your_level: "Wähle dein Level" adventurer_prefix: "Du kannst zu jedem Level springen oder diskutiere die Level " adventurer_forum: "im Abenteurerforum" adventurer_suffix: "." campaign_beginner: "Anfängerkampagne" campaign_beginner_description: "... in der Du die Zauberei der Programmierung lernst." campaign_dev: "Beliebiges schwierigeres Level" campaign_dev_description: "... in welchem Du die Bedienung erlernst, indem Du etwas schwierigeres machst." campaign_multiplayer: "Multiplayerarena" campaign_multiplayer_description: "... in der Du Kopf-an-Kopf gegen andere Spieler programmierst." campaign_player_created: "Von Spielern erstellt" campaign_player_created_description: "... in welchem Du gegen die Kreativität eines <a href=\"/contribute#artisan\">Artisan Zauberers</a> kämpfst." level_difficulty: "Schwierigkeit: " play_as: "Spiele als " spectate: "Zuschauen" contact: contact_us: "Kontaktiere CodeCombat" welcome: "Schön von Dir zu hören! Benutze dieses Formular um uns eine Email zu schicken." contribute_prefix: "Wenn Du Interesse hast, uns zu unterstützen dann sieh dir die " contribute_page: "Unterstützer Seite" contribute_suffix: " an!" forum_prefix: "Für alle öffentlichen Themen, benutze stattdessen " forum_page: "unser Forum" forum_suffix: "." send: "Sende Feedback" contact_candidate: "Kontaktiere Kandidaten" recruitment_reminder: "Benutzen Sie dieses Formular um Kontakt zu Kandidaten aufzunehmen, an denen Sie interessiert sind. Bedenken Sie das CodeCombat 15% des ersten Jahresgehaltes berechnet. Diese Gebühr wird fällig wenn Sie den Kandidaten einstellen und ist für 90 Tage rückerstattungsfähig, sollte der Mitarbeiter nicht eingestellt bleiben. Mitarbeiter die für Teilzeit, Remote oder eine Auftragsarbeit eingestellt werden sind kostenlos, das gilt auch für Praktikanten." diplomat_suggestion: title: "Hilf CodeCombat zu übersetzen!" sub_heading: "Wir brauchen Deine Sprachfähigkeiten." pitch_body: "Wir entwickeln CodeCombat in Englisch, aber wir haben Spieler in der ganzen Welt. Viele von ihnen wollen in Deutsch spielen, sprechen aber kein Englisch. Wenn Du also beide Sprachen beherrscht, melde Dich an um ein Diplomat zu werden und hilf die Website und die Levels zu Deutsch zu übersetzen." missing_translations: "Solange wir nicht alles ins Deutsche übesetzt haben, siehst Du die englische Übersetzung, wo Deutsch leider noch nicht zur Verfügung steht." learn_more: "Finde heraus, wie Du ein Diplomat werden kannst" subscribe_as_diplomat: "Schreibe dich als Diplomat ein" wizard_settings: title: "Zauberer Einstellungen" customize_avatar: "Individualisiere deinen Avatar" active: "Aktiv" color: "Farbe" group: "Gruppe" clothes: "Kleidung" trim: "Applikationen" cloud: "Wolke" team: "Team" spell: "Zauber" boots: "Stiefel" hue: "PI:NAME:<NAME>END_PI" saturation: "Sättigung" lightness: "Helligkeit" account_settings: title: "Accounteinstellungen" not_logged_in: "Logge Dich ein oder lege einen Account an, um deine Einstellungen ändern zu können." autosave: "Sichere Änderungen automatisch" me_tab: "Ich" picture_tab: "Bild" upload_picture: "Ein Bild hochladen" wizard_tab: "Zauberer" password_tab: "Passwort" emails_tab: "Emails" admin: "Admin" wizard_color: "Die Farbe der Kleidung des Zauberers" new_password: "PI:PASSWORD:<PASSWORD>END_PI" new_password_verify: "PI:PASSWORD:<PASSWORD>END_PI" email_subscriptions: "Email Abonnements" email_announcements: "Ankündigungen" email_announcements_description: "Erhalte regelmäßig Ankündigungen zu deinem Account." email_notifications: "Benachrichtigungen" # email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity." # email_any_notes: "Any Notifications" # email_any_notes_description: "Disable to stop all activity notification emails." email_recruit_notes: "Job-Angebote" # email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job." contributor_emails: "Unterstützer Email" contribute_prefix: "Wir suchen nach Leuten, die mitmachen! Schau dir die" contribute_page: "Unterstützer Seite" contribute_suffix: " an um mehr zu erfahren." email_toggle: "Alles wählen" error_saving: "Fehler beim Speichern" saved: "Änderungen gespeichert" password_mismatch: "Passwörter stimmen nicht überein." # password_repeat: "Please repeat your password." job_profile: "Jobprofil" job_profile_approved: "Dein Jobprofil wurde von CodeCombat freigegeben. Arbeitgeber können dieses solange einsehen, bis du es als inaktiv markiert oder wenn innerhalb von vier Wochen keine Änderung daran vorgenommen wurde." job_profile_explanation: "Hi! Fülle dies aus und wir melden uns bei dir bezüglich des Auffindens eines Jobs als Programmierer" sample_profile: "Ein Beispielprofil ansehen" view_profile: "Dein Profil ansehen" account_profile: settings: "Einstellungen" edit_profile: "Profil editieren" # done_editing: "Done Editing" profile_for_prefix: "Profil von " profile_for_suffix: "" # featured: "Featured" # not_featured: "Not Featured" # looking_for: "Looking for:" last_updated: "zuletzt geändert:" contact: "Kontakt" # active: "Looking for interview offers now" # inactive: "Not looking for offers right now" # complete: "complete" # next: "Next" next_city: "Stadt?" next_country: "Wähle dein Land." next_name: "Name?" next_short_description: "Schreibe eine kurze Beschreibung." next_long_description: "Beschreibe deine gewünschte Position" next_skills: "Liste mindestens fünf Fähigkeiten." # next_work: "chronicle your work history." # next_education: "recount your educational ordeals." next_projects: "Zeige bis zu 3 Projekte an denen du gearbeitet hast." # next_links: "add any personal or social links." next_photo: "Füge ein optionales professionelles Foto hinzu." # next_active: "mark yourself open to offers to show up in searches." example_blog: "Blog" example_personal_site: "Persönliche Seite" links_header: "Persönliche Links" links_blurb: "Verlinke zu anderen Seiten oder Profilen die du hervorheben möchtest, wie z.B. dein GitHub, dein LinkedIn oder deinen Blog." links_name: "Link-Name" # links_name_help: "What are you linking to?" links_link_blurb: "Link URL" # basics_header: "Update basic info" # basics_active: "Open to Offers" # basics_active_help: "Want interview offers right now?" # basics_job_title: "Desired Job Title" # basics_job_title_help: "What role are you looking for?" basics_city: "Stadt" basics_city_help: "Stadt in der du arbeiten möchtest (oder jetzt lebst)." basics_country: "Land" basics_country_help: "Land in dem du arbeiten möchtest (oder jetzt lebst)." # basics_visa: "US Work Status" # basics_visa_help: "Are you authorized to work in the US, or do you need visa sponsorship? (If you live in Canada or Australia, mark authorized.)" # basics_looking_for: "Looking For" basics_looking_for_full_time: "Vollzeit" basics_looking_for_part_time: "Teilzeit" basics_looking_for_remote: "Remote" # basics_looking_for_contracting: "Contracting" basics_looking_for_internship: "Praktikum" # basics_looking_for_help: "What kind of developer position do you want?" name_header: "Trage deinen Namen ein" name_anonymous: "AnPI:NAME:<NAME>END_PI" # name_help: "Name you want employers to see, like 'PI:NAME:<NAME>END_PI'." # short_description_header: "Write a short description of yourself" # short_description_blurb: "Add a tagline to help an employer quickly learn more about you." # short_description: "Tagline" # short_description_help: "Who are you, and what are you looking for? 140 characters max." skills_header: "Fähigkeiten" # skills_help: "Tag relevant developer skills in order of proficiency." long_description_header: "Beschreibe deine gewünschte Position" # long_description_blurb: "Tell employers how awesome you are and what role you want." # long_description: "Self Description" # long_description_help: "Describe yourself to potential employers. Keep it short and to the point. We recommend outlining the position that would most interest you. Tasteful markdown okay; 600 characters max." work_experience: "Berufserfahrung" # work_header: "Chronicle your work history" # work_years: "Years of Experience" # work_years_help: "How many years of professional experience (getting paid) developing software do you have?" # work_blurb: "List your relevant work experience, most recent first." work_employer: "PI:NAME:<NAME>END_PI" work_employer_help: "Name deines Arbeitgebers." # work_role: "Job Title" # work_role_help: "What was your job title or role?" # work_duration: "Duration" # work_duration_help: "When did you hold this gig?" work_description: "Beschreibung" work_description_help: "Was hast du dort gemacht (140 Zeichen; optional)" # education: "Education" # education_header: "Recount your academic ordeals" # education_blurb: "List your academic ordeals." education_school: "Schule" education_school_help: "Name deiner Schule." education_degree: "Abschluss" # education_degree_help: "What was your degree and field of study?" # education_duration: "Dates" education_duration_help: "Wann?" education_description: "Beschreibung" # education_description_help: "Highlight anything about this educational experience. (140 chars; optional)" # our_notes: "CodeCombat's Notes" # remarks: "Remarks" projects: "Projekte" projects_header: "Füge 3 Projekte hinzu" projects_header_2: "Projekte (Top 3)" # projects_blurb: "Highlight your projects to amaze employers." project_name: "Projekt Name" project_name_help: "Wie wurde das Projekt genannt?" project_description: "Beschreibung" project_description_help: "Beschreibe kurz das Projekt." project_picture: "Bild" project_picture_help: "Lade ein 230x115px oder größeres Bild hoch, welches das Projekt darstellt." project_link: "Link" project_link_help: "Verlinke zu dem Projekt." player_code: "Spieler Code" employers: # hire_developers_not_credentials: "Hire developers, not credentials." # get_started: "Get Started" # already_screened: "We've already technically screened all our candidates" # filter_further: ", but you can also filter further:" # filter_visa: "Visa" # filter_visa_yes: "US Authorized" # filter_visa_no: "Not Authorized" # filter_education_top: "Top School" # filter_education_other: "Other" # filter_role_web_developer: "Web Developer" # filter_role_software_developer: "Software Developer" # filter_role_mobile_developer: "Mobile Developer" # filter_experience: "Experience" # filter_experience_senior: "Senior" # filter_experience_junior: "Junior" # filter_experience_recent_grad: "Recent Grad" # filter_experience_student: "College Student" # filter_results: "results" # start_hiring: "Start hiring." # reasons: "Three reasons you should hire through us:" # everyone_looking: "Everyone here is looking for their next opportunity." # everyone_looking_blurb: "Forget about 20% LinkedIn InMail response rates. Everyone that we list on this site wants to find their next position and will respond to your request for an introduction." # weeding: "Sit back; we've done the weeding for you." # weeding_blurb: "Every player that we list has been screened for technical ability. We also perform phone screens for select candidates and make notes on their profiles to save you time." # pass_screen: "They will pass your technical screen." # pass_screen_blurb: "Review each candidate's code before reaching out. One employer found that 5x as many of our devs passed their technical screen than hiring from Hacker News." # make_hiring_easier: "Make my hiring easier, please." what: "Was ist CodeCombat?" # what_blurb: "CodeCombat is a multiplayer browser programming game. Players write code to control their forces in battle against other developers. Our players have experience with all major tech stacks." # cost: "How much do we charge?" # cost_blurb: "We charge 15% of first year's salary and offer a 100% money back guarantee for 90 days. We don't charge for candidates who are already actively being interviewed at your company." candidate_name: "PI:NAME:<NAME>END_PI" # candidate_location: "Location" # candidate_looking_for: "Looking For" candidate_role: "PI:NAME:<NAME>END_PI" # candidate_top_skills: "Top Skills" # candidate_years_experience: "Yrs Exp" # candidate_last_updated: "Last Updated" # candidate_who: "Who" # featured_developers: "Featured Developers" # other_developers: "Other Developers" # inactive_developers: "Inactive Developers" play_level: done: "Fertig" grid: "Raster" customize_wizard: "Bearbeite den Zauberer" home: "Startseite" guide: "Hilfe" multiplayer: "Multiplayer" restart: "Neustart" goals: "Ziele" # success: "Success!" # incomplete: "Incomplete" # timed_out: "Ran out of time" # failing: "Failing" action_timeline: "Aktionszeitstrahl" click_to_select: "Klicke auf eine Einheit, um sie auszuwählen." reload_title: "Gesamten Code neu laden?" reload_really: "Bist Du sicher, dass Du das Level neu beginnen willst?" reload_confirm: "Alles neu laden" victory_title_prefix: "" victory_title_suffix: " Abgeschlossen" victory_sign_up: "Melde Dich an, um Fortschritte zu speichern" victory_sign_up_poke: "Möchtest Du Neuigkeiten per Mail erhalten? Erstelle einen kostenlosen Account und wir halten Dich auf dem Laufenden." victory_rate_the_level: "Bewerte das Level: " victory_return_to_ladder: "Zurück zur Rangliste" victory_play_next_level: "Spiel das nächste Level" victory_go_home: "Geh auf die Startseite" victory_review: "Erzähl uns davon!" victory_hour_of_code_done: "Bist Du fertig?" victory_hour_of_code_done_yes: "Ja, ich bin mit meiner Code-Stunde fertig!" multiplayer_title: "Multiplayer Einstellungen" multiplayer_link_description: "Gib diesen Link jedem, der mitmachen will." multiplayer_hint_label: "Hinweis:" multiplayer_hint: " Klick den Link, um alles auszuwählen, dann drück ⌘-C oder Strg-C um den Link zu kopieren." multiplayer_coming_soon: "Mehr Multiplayerfeatures werden kommen!" # multiplayer_sign_in_leaderboard: "Sign in or create an account and get your solution on the leaderboard." guide_title: "Anleitung" tome_minion_spells: "Die Zaubersprüche Deiner Knechte" tome_read_only_spells: "Nur-lesen Zauberspüche" tome_other_units: "Andere Einheiten" tome_cast_button_castable: "Führe aus" tome_cast_button_casting: "Ausführen" tome_cast_button_cast: "Zauberspuch ausführen" tome_autocast_delay: "Verzögerung der automatischen Ausführung" tome_select_spell: "Wähle einen Zauber" tome_select_a_thang: "Wähle jemanden aus, um " tome_available_spells: "Verfügbare Zauber" hud_continue: "Weiter (drücke Shift + Leertaste)" spell_saved: "Zauber gespeichert" skip_tutorial: "Überspringen (Esc)" editor_config: "Editor Einstellungen" editor_config_title: "Editor Einstellungen" editor_config_level_language_label: "Sprache für dieses Level" editor_config_level_language_description: "Lege die Programmiersprache für dieses bestimmte Level fest." editor_config_default_language_label: "Voreinstellung Programmiersprache" editor_config_default_language_description: "Definiere die Programmiersprache in der du programmieren möchtest wenn du ein neues Level beginnst." editor_config_keybindings_label: "Tastenbelegung" editor_config_keybindings_default: "Standard (Ace)" editor_config_keybindings_description: "Fügt zusätzliche Tastenkombinationen, bekannt aus anderen Editoren, hinzu" # editor_config_livecompletion_label: "Live Autocompletion" # editor_config_livecompletion_description: "Displays autocomplete suggestions while typing." editor_config_invisibles_label: "Zeige unsichtbare Zeichen" editor_config_invisibles_description: "Zeigt unsichtbare Zeichen wie Leertasten an." editor_config_indentguides_label: "Zeige Einrückungshilfe" editor_config_indentguides_description: "Zeigt vertikale Linien an um Einrückungen besser zu sehen." editor_config_behaviors_label: "Intelligentes Verhalten" editor_config_behaviors_description: "Vervollständigt automatisch Klammern und Anführungszeichen." keyboard_shortcuts: "Tastenkürzel" loading_ready: "Bereit!" tip_insert_positions: "Halte 'Umschalt' gedrückt und klicke auf die Karte um die Koordinaten einzufügen." tip_toggle_play: "Wechsel zwischen Play und Pause mit Strg+P." tip_scrub_shortcut: "Spule vor und zurück mit Strg+[ und Strg+]" tip_guide_exists: "Klicke auf die Anleitung am oberen Ende der Seite für nützliche Informationen" tip_open_source: "CodeCombat ist 100% quelloffen!" tip_beta_launch: "CodeCombat startete seine Beta im Oktober 2013." tip_js_beginning: "JavaScript ist nur der Anfang." tip_autocast_setting: "Ändere die Einstellungen für das automatische Ausführen über das Zahnrad neben dem Ausführen Knopf" think_solution: "Denke über die Lösung nach, nicht über das Problem." tip_theory_practice: "In der Theorie gibt es keinen Unterschied zwischen Theorie und Praxis. In der Praxis schon. - PI:NAME:<NAME>END_PI" tip_error_free: "Es gibt zwei Wege fehlerfreie Programme zu schreiben; nur der Dritte funktioniert. - PI:NAME:<NAME>END_PI" tip_debugging_program: "Wenn Debugging der Prozess zum Fehler entfernen ist, dann muss Programmieren der Prozess sein Fehler zu machen. - PI:NAME:<NAME>END_PI" tip_forums: "Gehe zum Forum und sage uns was du denkst!" tip_baby_coders: "In der Zukunft werden sogar Babies Erzmagier sein." tip_morale_improves: "Das Laden wird weiter gehen bis die Stimmung sich verbessert." tip_all_species: "Wir glauben an gleiche Chancen für alle Arten Programmieren zu lernen." # tip_reticulating: "Reticulating spines." tip_harry: "Du bist ein Zauberer, " tip_great_responsibility: "Mit großen Programmierfähigkeiten kommt große Verantwortung." tip_munchkin: "Wenn du dein Gemüse nicht isst, besucht dich ein Zwerg während du schläfst." tip_binary: "Es gibt auf der Welt nur 10 Arten von Menschen: die, welche Binär verstehen und die, welche nicht." tip_commitment_yoda: "Ein Programmier muss die größte Hingabe haben, den ernstesten Verstand. ~ Yoda" tip_no_try: "Tu. Oder tu nicht. Es gibt kein Versuchen. - Yoda" tip_patience: "Geduld du musst haben, PI:NAME:<NAME>END_PI. - Yoda" tip_documented_bug: "Ein dokumentierter Fehler ist kein Fehler; er ist ein Merkmal." tip_impossible: "Es wirkt immer unmöglich bis es vollbracht ist. - PI:NAME:<NAME>END_PI" tip_talk_is_cheap: "Reden ist billig. Zeig mir den Code. - PI:NAME:<NAME>END_PI" tip_first_language: "Das schwierigste, das du jemals lernen wirst, ist die erste Programmiersprache. - PI:NAME:<NAME>END_PI" # tip_hardware_problem: "Q: How many programmers does it take to change a light bulb? A: None, it's a hardware problem." time_current: "Aktuell" time_total: "Total" time_goto: "Gehe zu" infinite_loop_try_again: "Erneut versuchen" # infinite_loop_reset_level: "Reset Level" infinite_loop_comment_out: "Meinen Code auskommentieren" keyboard_shortcuts: keyboard_shortcuts: "Tastaturkürzel" space: "Leertaste" enter: "Eingabetaste" # escape: "Escape" # cast_spell: "Cast current spell." # continue_script: "Continue past current script." # skip_scripts: "Skip past all skippable scripts." # toggle_playback: "Toggle play/pause." # scrub_playback: "Scrub back and forward through time." # single_scrub_playback: "Scrub back and forward through time by a single frame." # scrub_execution: "Scrub through current spell execution." # toggle_debug: "Toggle debug display." # toggle_grid: "Toggle grid overlay." # toggle_pathfinding: "Toggle pathfinding overlay." # beautify: "Beautify your code by standardizing its formatting." # move_wizard: "Move your Wizard around the level." admin: av_title: "Administrator Übersicht" av_entities_sub_title: "Entitäten" av_entities_users_url: "Benutzer" av_entities_active_instances_url: "Aktive Instanzen" av_entities_employer_list_url: "Arbeitgeberliste" av_other_sub_title: "Sonstige" # av_other_debug_base_url: "Base (for debugging base.jade)" u_title: "Benutzerliste" lg_title: "Letzte Spiele" # clas: "CLAs" community: level_editor: "Level Editor" main_title: "CodeCombat Community" facebook: "Facebook" twitter: "Twitter" gplus: "Google+" editor: main_title: "CodeCombat Editoren" main_description: "Entwerfe deine eigenen Level, Kampagnen, Einheiten und Lernmaterial. Wir stellen alle Werkzeuge zur Verfügung, die Du dafür benötigst!" article_title: "Artikel Editor" article_description: "Schreiben Sie Artikel, die anderen Spieler einen Überblick über Programmierkonzepte geben und in einer Vielzahl von Ebenen und Kampagnen genutzt werden können." thang_title: "Thang Editor" thang_description: "Entwerfe Einheiten, definiere ihre Standardlogik, Grafiken und Töne. Zurzeit werden nur Flash Vektorgrafiken unterstützt." level_title: "Level Editor" level_description: "Beinhaltet die Werkzeuge zum Scripten, Hochladen von Tönen und zur Konstruktion eigener Logik, damit jedes erdenkliches Level erstellt werden kann. Genau die Sachen, die wir selber benutzen!" # achievement_title: "Achievement Editor" got_questions: "Fragen zur Benutzung des CodeCombat Editors?" contact_us: "setze dich mit uns in Verbindung!" hipchat_prefix: "Besuche uns auch in unserem" hipchat_url: "HipChat room." back: "Zurück" revert: "Zurücksetzen" revert_models: "Models zurücksetzen." # pick_a_terrain: "Pick A Terrain" # small: "Small" # grassy: "Grassy" fork_title: "Forke neue Version" fork_creating: "Erzeuge Fork..." # randomize: "Randomize" more: "Mehr" wiki: "Wiki" live_chat: "Live Chat" level_some_options: "Einige Einstellungsmöglichkeiten?" level_tab_thangs: "Thangs" level_tab_scripts: "Skripte" level_tab_settings: "Einstellungen" level_tab_components: "Komponenten" level_tab_systems: "Systeme" level_tab_thangs_title: "Aktuelle Thangs" level_tab_thangs_all: "Alle" level_tab_thangs_conditions: "Startbedingungen" level_tab_thangs_add: "Thangs hinzufügen" delete: "Löschen" duplicate: "Duplizieren" level_settings_title: "Einstellungen" level_component_tab_title: "Aktuelle Komponenten" level_component_btn_new: "neue Komponente erstellen" level_systems_tab_title: "Aktuelle Systeme" level_systems_btn_new: "neues System erstellen" level_systems_btn_add: "System hinzufügen" level_components_title: "Zurück zu allen Thangs" level_components_type: "Typ" level_component_edit_title: "Komponente bearbeiten" level_component_config_schema: "Konfigurationsschema" level_component_settings: "Einstellungen" level_system_edit_title: "System bearbeiten" create_system_title: "neues System erstellen" new_component_title: "Neue Komponente erstellen" new_component_field_system: "System" new_article_title: "Erstelle einen neuen Artikel" new_thang_title: "Erstelle einen neuen Thang-Typen" new_level_title: "Erstelle ein neues Level" new_article_title_login: "Melde dich an um einen neuen Artikel zu erstellen" new_thang_title_login: "Melde dich an um einen neuen Thang-Typen zu erstellen" new_level_title_login: "Melde dich an um ein neues Level zu erstellen" # new_achievement_title: "Create a New Achievement" # new_achievement_title_login: "Log In to Create a New Achievement" article_search_title: "Durchsuche Artikel hier" thang_search_title: "Durchsuche Thang-Typen hier" level_search_title: "Durchsuche Levels hier" # achievement_search_title: "Search Achievements" # read_only_warning2: "Note: you can't save any edits here, because you're not logged in." article: edit_btn_preview: "Vorschau" edit_article_title: "Artikel bearbeiten" general: and: "und" name: "Name" body: "Inhalt" version: "Version" commit_msg: "Commit Nachricht" version_history: "Versionshistorie" version_history_for: "Versionsgeschichte für: " result: "Ergebnis" results: "Ergebnisse" description: "Beschreibung" or: "oder" subject: "Betreff" email: "Email" password: "PI:PASSWORD:<PASSWORD>END_PI" message: "Nachricht" code: "Code" ladder: "Rangliste" when: "Wann" opponent: "PI:NAME:<NAME>END_PI" rank: "Rang" score: "Punktzahl" win: "Sieg" loss: "Niederlage" tie: "Unentschieden" easy: "Einfach" medium: "Mittel" hard: "Schwer" player: "PI:NAME:<NAME>END_PI" about: who_is_codecombat: "Wer ist CodeCombat?" why_codecombat: "Warum CodeCombat?" who_description_prefix: "gründeten CodeCombat im Jahre 2013 zusammen. Wir entwickelten außerdem " who_description_suffix: ", die meist benutzte (#1) Web and iOS Applikation 2008 zum Lernen des Schreibens von chinesischen und japanischen Schriftzeichen." who_description_ending: "Nun ist es an der Zeit, den Leuten das Programmieren beizubringen." why_paragraph_1: "Als er Skritter machte, wusste George nicht wie man programmiert und war permanent darüber frustriert, dass er seine Ideen nicht umsetzen konnte. Danach versuchte er es zu lernen, aber das ging ihm zu langsam. Sein Mitbewohner versuchte Codecademy, als er sich umorientierte und aufhörte zu lehren, aber \"langweilte sich\". Jede Woche begann ein neuer Freund mit Codecademy und ließ es dann wieder bleiben. Wir erkannten, dass es das gleiche Problem war, welches wir mit Skritter gelöst hatten: Leute lernen eine Fähigkeit mittels langsamer, intersiver Lerneinheiten, wobei sie schnelle, umfassende Übung bräuchten. Wir kennen Abhilfe." why_paragraph_2: "Programmieren lernen? Du brauchst keine Stunden. Du musst einen Haufen Code schreiben und dabei Spaß haben." why_paragraph_3_prefix: "Darum geht's beim Programmieren. Es soll Spaß machen. Nicht so einen Spaß wie" why_paragraph_3_italic: "jau, 'ne Plakette" why_paragraph_3_center: "sondern Spaß wie" why_paragraph_3_italic_caps: "NEIN MUTTI ICH MUSS NOCH DEN LEVEL BEENDEN !" why_paragraph_3_suffix: "Deshalb ist CodeCombat ein Multiplayerspiel und kein spielähnlicher Kurs. Wir werden nicht aufhören bis du nicht mehr aufhören kannst -- nur diesmal ist das eine gute Sache." why_paragraph_4: "Wenn dich Spiele süchtig machen, dass lass dich von diesem süchtig machen und werde ein Zauberer des Technologiezeitalters." why_ending: "Und hey, es kostet nichts. " why_ending_url: "Beginne jetzt zu zaubern!" george_description: "CEO, Businesstyp, Web Designer, Game Designer und Champion der Programmieranfänger überall." scott_description: "Außergewöhnlicher Programmierer, Softwarearchitekt, Küchenzauberer und Finanzmeister. PI:NAME:<NAME>END_PI ist der Vernünftige." nick_description: "Programmierzauberer, exzentrischer Motivationskünstler und Auf-den-Kopf-stell-Experimentierer. PI:NAME:<NAME>END_PI könnte alles mögliche tun und entschied CodeCombat zu bauen." jeremy_description: "Kundendienstmagier, Usability Tester und Community-Organisator. Wahrscheinlich hast du schon mit PI:NAME:<NAME>END_PI gesprochen." michael_description: "Programmierer, Systemadministrator und studentisch technisches Wunderkind, PI:NAME:<NAME>END_PI hält unsere Server am Laufen." glen_description: "Programmier und leidenschaftlicher Spieleentwickler mit der Motivation die Welt, durch das Entwickeln von Sachen die zählen, zu einem besseren Platz zu machen. Das Wort 'unmöglich' kann nicht in seinem Wortschatz gefunden werden. Neue Fähigkeiten zu lernen ist seine Leidenschaft!" legal: page_title: "Rechtliches" opensource_intro: "CodeCombat ist Free-to-Play und vollständig Open Source." opensource_description_prefix: "Schau dir " github_url: "unsere GitHub-Seite" opensource_description_center: " an und mach mit wenn Du möchtest! CodeCombat baut auf duzenden Open Source Projekten auf, und wir lieben sie. Schau dir die Liste in " archmage_wiki_url: "unserem Erzmagier-Wiki" opensource_description_suffix: " an, welche Software dieses Spiel möglich macht." practices_title: "Best Practices" practices_description: "Dies sind unsere Versprechen an dich, den Spieler, in weniger Fachchinesisch." privacy_title: "Datenschutz" privacy_description: "Wir werden deine persönlichen Daten nicht verkaufen. Letztenendes beabsichtigen wir, durch Vermittlung von Jobs zu verdienen, aber sei versichert, dass wir nicht deine persönlichen Daten ohne deine ausdrückliche Einwilligung interessierten Firmen zur Verfügung stellen werden." security_title: "Datensicherheit" security_description: "Wir streben an, deine persönlichen Daten sicher zu verwahren. Als Open Source Projekt ist unsere Site frei zugänglich für jedermann, auch um unsere Sicherheitsmaßnahmen in Augenschein zu nehmen und zu verbessern." email_title: "Email" email_description_prefix: "Wir werden dich nicht mit Spam überschwemmen. Mittels" email_settings_url: "deiner Emaileinstellungen" email_description_suffix: "oder durch von uns gesendete Links kannst du jederzeit deine Einstellungen ändern und Abonnements kündigen." cost_title: "Kosten" cost_description: "CodeCombat ist zur Zeit 100% kostenlos! Eines unserer Hauptziele ist, es dabei zu belassen, so dass es so viele Leute wie möglich spielen können, unabhängig davon in welcher Lebenssituation sie sich befinden. Falls dunkle Wolken aufziehen, könnten wir manche Inhalte im Rahmen eines Abonnements anbieten, aber lieber nicht. Mit etwas Glück können wir die Firma erhalten durch:" recruitment_title: "Recruiting" recruitment_description_prefix: "Hier bei CodeCombat kannst du ein mächtiger Zauberer werden, nicht nur im Spiel, sondern auch in der Realität." url_hire_programmers: "Niemand kann schnell genug Programmierer einstellen." recruitment_description_suffix: "So wenn du deine Fähigkeiten entwickelt hast und zustimmst, werden wir deine besten Leistungen den tausenden Arbeitgebern demonstrieren, welche nur auf die Gelegentheit warten, dich einzustellen. Sie bezahlen uns ein bisschen, und sie bezahlen dir " recruitment_description_italic: "jede Menge" recruitment_description_ending: ", die Seite bleibt kostenlos und jeder ist glücklich. So der Plan." # copyrights_title: "Copyrights and Licenses" # contributor_title: "Contributor License Agreement" # contributor_description_prefix: "All contributions, both on the site and on our GitHub repository, are subject to our" # cla_url: "CLA" # contributor_description_suffix: "to which you should agree before contributing." # code_title: "Code - MIT" # code_description_prefix: "All code owned by CodeCombat or hosted on codecombat.com, both in the GitHub repository or in the codecombat.com database, is licensed under the" # mit_license_url: "MIT license" # code_description_suffix: "This includes all code in Systems and Components that are made available by CodeCombat for the purpose of creating levels." # art_title: "Art/Music - Creative Commons " # art_description_prefix: "All common content is available under the" # cc_license_url: "Creative Commons Attribution 4.0 International License" # art_description_suffix: "Common content is anything made generally available by CodeCombat for the purpose of creating Levels. This includes:" # art_music: "Music" # art_sound: "Sound" # art_artwork: "Artwork" # art_sprites: "Sprites" # art_other: "Any and all other non-code creative works that are made available when creating Levels." # art_access: "Currently there is no universal, easy system for fetching these assets. In general, fetch them from the URLs as used by the site, contact us for assistance, or help us in extending the site to make these assets more easily accessible." # art_paragraph_1: "For attribution, please name and link to codecombat.com near where the source is used or where appropriate for the medium. For example:" # use_list_1: "If used in a movie or another game, include codecombat.com in the credits." # use_list_2: "If used on a website, include a link near the usage, for example underneath an image, or in a general attributions page where you might also mention other Creative Commons works and open source software being used on the site. Something that's already clearly referencing CodeCombat, such as a blog post mentioning CodeCombat, does not need some separate attribution." # art_paragraph_2: "If the content being used is created not by CodeCombat but instead by a user of codecombat.com, attribute them instead, and follow attribution directions provided in that resource's description if there are any." # rights_title: "Rights Reserved" # rights_desc: "All rights are reserved for Levels themselves. This includes" # rights_scripts: "Scripts" # rights_unit: "Unit configuration" # rights_description: "Description" # rights_writings: "Writings" # rights_media: "Media (sounds, music) and any other creative content made specifically for that Level and not made generally available when creating Levels." # rights_clarification: "To clarify, anything that is made available in the Level Editor for the purpose of making levels is under CC, whereas the content created with the Level Editor or uploaded in the course of creation of Levels is not." nutshell_title: "Zusammenfassung" # nutshell_description: "Any resources we provide in the Level Editor are free to use as you like for creating Levels. But we reserve the right to restrict distribution of the Levels themselves (that are created on codecombat.com) so that they may be charged for in the future, if that's what ends up happening." canonical: "Die englische Version dieses Dokuments ist die definitive, kanonische Version. Sollte es Unterschiede zwischen den Übersetzungen geben, dann hat das englische Dokument Vorrang." contribute: # page_title: "Contributing" character_classes_title: "PI:NAME:<NAME>END_PI" # introduction_desc_intro: "We have high hopes for CodeCombat." # introduction_desc_pref: "We want to be where programmers of all stripes come to learn and play together, introduce others to the wonderful world of coding, and reflect the best parts of the community. We can't and don't want to do that alone; what makes projects like GitHub, Stack Overflow and Linux great are the people who use them and build on them. To that end, " # introduction_desc_github_url: "CodeCombat is totally open source" # introduction_desc_suf: ", and we aim to provide as many ways as possible for you to take part and make this project as much yours as ours." # introduction_desc_ending: "We hope you'll join our party!" # introduction_desc_signature: "- PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI" # alert_account_message_intro: "Hey there!" # alert_account_message: "To subscribe for class emails, you'll need to be logged in first." # archmage_summary: "Interested in working on game graphics, user interface design, database and server organization, multiplayer networking, physics, sound, or game engine performance? Want to help build a game to help other people learn what you are good at? We have a lot to do and if you are an experienced programmer and want to develop for CodeCombat, this class is for you. We would love your help building the best programming game ever." # archmage_introduction: "One of the best parts about building games is they synthesize so many different things. Graphics, sound, real-time networking, social networking, and of course many of the more common aspects of programming, from low-level database management, and server administration to user facing design and interface building. There's a lot to do, and if you're an experienced programmer with a hankering to really dive into the nitty-gritty of CodeCombat, this class might be for you. We would love to have your help building the best programming game ever." # class_attributes: "Class Attributes" # archmage_attribute_1_pref: "Knowledge in " # archmage_attribute_1_suf: ", or a desire to learn. Most of our code is in this language. If you're a fan of Ruby or Python, you'll feel right at home. It's JavaScript, but with a nicer syntax." # archmage_attribute_2: "Some experience in programming and personal initiative. We'll help you get oriented, but we can't spend much time training you." # how_to_join: "How To Join" # join_desc_1: "Anyone can help out! Just check out our " # join_desc_2: "to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email. Want to chat about what to do or how to get more deeply involved? " # join_desc_3: ", or find us in our " # join_desc_4: "and we'll go from there!" join_url_email: "Emaile uns" # join_url_hipchat: "public HipChat room" # more_about_archmage: "Learn More About Becoming an Archmage" # archmage_subscribe_desc: "Get emails on new coding opportunities and announcements." # artisan_summary_pref: "Want to design levels and expand CodeCombat's arsenal? People are playing through our content at a pace faster than we can build! Right now, our level editor is barebone, so be wary. Making levels will be a little challenging and buggy. If you have visions of campaigns spanning for-loops to" # artisan_summary_suf: ", then this class is for you." # artisan_introduction_pref: "We must construct additional levels! People be clamoring for more content, and we can only build so many ourselves. Right now your workstation is level one; our level editor is barely usable even by its creators, so be wary. If you have visions of campaigns spanning for-loops to" # artisan_introduction_suf: ", then this class might be for you." # artisan_attribute_1: "Any experience in building content like this would be nice, such as using Blizzard's level editors. But not required!" # artisan_attribute_2: "A hankering to do a whole lot of testing and iteration. To make good levels, you need to take it to others and watch them play it, and be prepared to find a lot of things to fix." # artisan_attribute_3: "For the time being, endurance en par with an Adventurer. Our Level Editor is super preliminary and frustrating to use. You have been warned!" # artisan_join_desc: "Use the Level Editor in these steps, give or take:" # artisan_join_step1: "Read the documentation." # artisan_join_step2: "Create a new level and explore existing levels." # artisan_join_step3: "Find us in our public HipChat room for help." # artisan_join_step4: "Post your levels on the forum for feedback." # more_about_artisan: "Learn More About Becoming an Artisan" # artisan_subscribe_desc: "Get emails on level editor updates and announcements." # adventurer_summary: "Let us be clear about your role: you are the tank. You are going to take heavy damage. We need people to try out brand-new levels and help identify how to make things better. The pain will be enormous; making good games is a long process and no one gets it right the first time. If you can endure and have a high constitution score, then this class is for you." # adventurer_introduction: "Let's be clear about your role: you are the tank. You're going to take heavy damage. We need people to try out brand-new levels and help identify how to make things better. The pain will be enormous; making good games is a long process and no one gets it right the first time. If you can endure and have a high constitution score, then this class might be for you." # adventurer_attribute_1: "A thirst for learning. You want to learn how to code and we want to teach you how to code. You'll probably be doing most of the teaching in this case, though." # adventurer_attribute_2: "Charismatic. Be gentle but articulate about what needs improving, and offer suggestions on how to improve." # adventurer_join_pref: "Either get together with (or recruit!) an Artisan and work with them, or check the box below to receive emails when there are new levels to test. We'll also be posting about levels to review on our networks like" # adventurer_forum_url: "our forum" # adventurer_join_suf: "so if you prefer to be notified those ways, sign up there!" # more_about_adventurer: "Learn More About Becoming an Adventurer" # adventurer_subscribe_desc: "Get emails when there are new levels to test." # scribe_summary_pref: "CodeCombat is not just going to be a bunch of levels. It will also be a resource of programming knowledge that players can hook into. That way, each Artisan can link to a detailed article that for the player's edification: documentation akin to what the " # scribe_summary_suf: " has built. If you enjoy explaining programming concepts, then this class is for you." # scribe_introduction_pref: "CodeCombat isn't just going to be a bunch of levels. It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into. That way rather than each Artisan having to describe in detail what a comparison operator is, they can simply link their level to the Article describing them that is already written for the player's edification. Something along the lines of what the " # scribe_introduction_url_mozilla: "Mozilla Developer Network" # scribe_introduction_suf: " has built. If your idea of fun is articulating the concepts of programming in Markdown form, then this class might be for you." # scribe_attribute_1: "Skill in words is pretty much all you need. Not only grammar and spelling, but able to convey complicated ideas to others." contact_us_url: "Kontaktiere uns" # scribe_join_description: "tell us a little about yourself, your experience with programming and what sort of things you'd like to write about. We'll go from there!" # more_about_scribe: "Learn More About Becoming a Scribe" # scribe_subscribe_desc: "Get emails about article writing announcements." # diplomat_summary: "There is a large interest in CodeCombat in other countries that do not speak English! We are looking for translators who are willing to spend their time translating the site's corpus of words so that CodeCombat is accessible across the world as soon as possible. If you'd like to help getting CodeCombat international, then this class is for you." # diplomat_introduction_pref: "So, if there's one thing we learned from the " # diplomat_launch_url: "launch in October" # diplomat_introduction_suf: "it's that there is sizeable interest in CodeCombat in other countries! We're building a corps of translators eager to turn one set of words into another set of words to get CodeCombat as accessible across the world as possible. If you like getting sneak peeks at upcoming content and getting these levels to your fellow nationals ASAP, then this class might be for you." # diplomat_attribute_1: "Fluency in English and the language you would like to translate to. When conveying complicated ideas, it's important to have a strong grasp in both!" # diplomat_join_pref_github: "Find your language locale file " # diplomat_github_url: "on GitHub" # diplomat_join_suf_github: ", edit it online, and submit a pull request. Also, check this box below to keep up-to-date on new internationalization developments!" # more_about_diplomat: "Learn More About Becoming a Diplomat" # diplomat_subscribe_desc: "Get emails about i18n developments and levels to translate." # ambassador_summary: "We are trying to build a community, and every community needs a support team when there are troubles. We have got chats, emails, and social networks so that our users can get acquainted with the game. If you want to help people get involved, have fun, and learn some programming, then this class is for you." # ambassador_introduction: "This is a community we're building, and you are the connections. We've got Olark chats, emails, and social networks with lots of people to talk with and help get acquainted with the game and learn from. If you want to help people get involved and have fun, and get a good feel of the pulse of CodeCombat and where we're going, then this class might be for you." # ambassador_attribute_1: "Communication skills. Be able to identify the problems players are having and help them solve them. Also, keep the rest of us informed about what players are saying, what they like and don't like and want more of!" # ambassador_join_desc: "tell us a little about yourself, what you've done and what you'd be interested in doing. We'll go from there!" # ambassador_join_note_strong: "Note" # ambassador_join_note_desc: "One of our top priorities is to build multiplayer where players having difficulty solving levels can summon higher level wizards to help them. This will be a great way for ambassadors to do their thing. We'll keep you posted!" # more_about_ambassador: "Learn More About Becoming an Ambassador" # ambassador_subscribe_desc: "Get emails on support updates and multiplayer developments." # changes_auto_save: "Changes are saved automatically when you toggle checkboxes." diligent_scribes: "Unsere fleißgen Schreiber:" powerful_archmages: "Unsere mächtigen Erzmagier:" creative_artisans: "Unsere kreativen Handwerker:" brave_adventurers: "Unsere mutigen Abenteurer:" translating_diplomats: "Unsere übersetzenden Diplomaten:" helpful_ambassadors: "Unsere hilfreichen Botschafter:" classes: archmage_title: "Erzmagier" archmage_title_description: "(Programmierer)" artisan_title: "Handwerker" artisan_title_description: "(Level Entwickler)" adventurer_title: "PI:NAME:<NAME>END_PI" adventurer_title_description: "(Level Spieltester)" scribe_title: "PI:NAME:<NAME>END_PI" scribe_title_description: "(Artikel Editor)" diplomat_title: "PI:NAME:<NAME>END_PI" diplomat_title_description: "(Übersetzer)" ambassador_title: "PI:NAME:<NAME>END_PI" ambassador_title_description: "(Support)" ladder: please_login: "Bitte logge dich zunächst ein, bevor du ein Ladder-Game spielst." my_matches: "Meine Matches" simulate: "Simuliere" # simulation_explanation: "By simulating games you can get your game ranked faster!" simulate_games: "Simuliere Spiele!" # simulate_all: "RESET AND SIMULATE GAMES" games_simulated_by: "Spiele die durch dich simuliert worden:" games_simulated_for: "Spiele die für dich simuliert worden:" games_simulated: "simulierte Spiele" games_played: "gespielte Spiele" ratio: "Ratio" # leaderboard: "Leaderboard" # battle_as: "Battle as " summary_your: "Deine " summary_matches: "Matches - " summary_wins: " Siege, " # summary_losses: " Losses" # rank_no_code: "No New Code to Rank" # rank_my_game: "Rank My Game!" # rank_submitting: "Submitting..." # rank_submitted: "Submitted for Ranking" # rank_failed: "Failed to Rank" # rank_being_ranked: "Game Being Ranked" # rank_last_submitted: "submitted " # help_simulate: "Help simulate games?" # code_being_simulated: "Your new code is being simulated by other players for ranking. This will refresh as new matches come in." # no_ranked_matches_pre: "No ranked matches for the " # no_ranked_matches_post: " team! Play against some competitors and then come back here to get your game ranked." choose_opponent: "PI:NAME:<NAME>END_PI" # select_your_language: "Select your language!" tutorial_play: "Spiele Tutorial" tutorial_recommended: "Empfohlen, wenn du noch nie zuvor gespielt hast." tutorial_skip: "Überspringe Tutorial" # tutorial_not_sure: "Not sure what's going on?" tutorial_play_first: "Spiele zuerst das Tutorial." simple_ai: "Einfache KI" warmup: "Aufwärmen" vs: "VS" friends_playing: "spielende Freunde" log_in_for_friends: "Melde dich an um mit deinen Freunden zu spielen!" social_connect_blurb: "Verbinde und spiele gegen deine Freunde!" # invite_friends_to_battle: "Invite your friends to join you in battle!" # fight: "Fight!" # watch_victory: "Watch your victory" # defeat_the: "Defeat the" # tournament_ends: "Tournament ends" # tournament_ended: "Tournament ended" tournament_rules: "Turnier-Regeln" # tournament_blurb: "Write code, collect gold, build armies, crush foes, win prizes, and upgrade your career in our $40,000 Greed tournament! Check out the details" # tournament_blurb_blog: "on our blog" rules: "Regeln" winners: "PI:NAME:<NAME>END_PI" ladder_prizes: title: "Turnier Preise" # blurb_1: "These prizes will be awarded according to" # blurb_2: "the tournament rules" # blurb_3: "to the top human and ogre players." blurb_4: "Zwei Teams heißt die doppelte Anzahl zu gewinnender Preise!" # blurb_5: "(There will be two first place winners, two second-place winners, etc.)" rank: "Rang" prizes: "Gewinne" # total_value: "Total Value" # in_cash: "in cash" # custom_wizard: "Custom CodeCombat Wizard" # custom_avatar: "Custom CodeCombat avatar" # heap: "for six months of \"Startup\" access" # credits: "credits" # one_month_coupon: "coupon: choose either Rails or HTML" # one_month_discount: "discount, 30% off: choose either Rails or HTML" license: "Lizenz" oreilly: "PI:NAME:<NAME>END_PI" # multiplayer_launch: # introducing_dungeon_arena: "Introducing Dungeon Arena" # new_way: "The new way to compete with code." # to_battle: "To Battle, Developers!" # modern_day_sorcerer: "You know how to code? That's badass. You're a modern-day sorcerer! Isn't about time that you used your magic coding powers to command your minions in epic combat? And we're not talking robots here." # arenas_are_here: "CodeCombat head-to-head multiplayer arenas are here." # ladder_explanation: "Choose your heroes, enchant your human or ogre armies, and climb your way over defeated fellow Wizards to reach the top of the ladders–then challenge your friends in our glorious, asynchronous multiplayer coding arenas. If you're feeling creative, you can even" # fork_our_arenas: "fork our arenas" # create_worlds: "and create your own worlds." # javascript_rusty: "JavaScript a bit rusty? Don't worry; there's a" # tutorial: "tutorial" # new_to_programming: ". New to programming? Hit our beginner campaign to skill up." # so_ready: "I Am So Ready for This" loading_error: could_not_load: "Fehler beim Laden vom Server" connection_failure: "Verbindung fehlgeschlagen." unauthorized: "Du musst angemeldet sein. Hast du Cookies ausgeschaltet?" forbidden: "Sie haben nicht die nötigen Berechtigungen." not_found: "Nicht gefunden." not_allowed: "Methode nicht erlaubt." timeout: "Server timeout." conflict: "Resourcen Konflikt." bad_input: "Falsche Eingabe." server_error: "Server Fehler." unknown: "Unbekannter Fehler." resources: your_sessions: "Meine Sessions" level: "Level" social_network_apis: "Social Network APIs" facebook_status: "Facebook Status" facebook_friends: "Facebook Freunde" facebook_friend_sessions: "Facebook Freunde Sessions" gplus_friends: "G+ Freunde" gplus_friend_sessions: "G+ Freunde Sessions" # leaderboard: "Leaderboard" user_schema: "Benutzerschema" user_profile: "Benutzerprofil" # patches: "Patches" # patched_model: "Source Document" model: "Model" system: "System" component: "Komponente" components: "Komponenten" thang: "Thang" thangs: "Thangs" level_session: "Deine Session" opponent_session: "Gegner-Session" article: "Artikel" user_names: "PI:NAME:<NAME>END_PI" thang_names: "PI:NAME:<NAME>END_PI" files: "Dateien" top_simulators: "Top Simulatoren" # source_document: "Source Document" document: "Dokument" sprite_sheet: "Sprite Sheet" candidate_sessions: "Kandidat-Sessions" # user_remark: "User Remark" # versions: "Versions" delta: added: "hinzugefügt" modified: "modifiziert" deleted: "gelöscht" # moved_index: "Moved Index" # text_diff: "Text Diff" # merge_conflict_with: "MERGE CONFLICT WITH" # no_changes: "No Changes"
[ { "context": "###\n# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>\n# Copyright (C) 2014 Jesús Espino ", "end": 38, "score": 0.9998875856399536, "start": 25, "tag": "NAME", "value": "Andrey Antukh" }, { "context": "###\n# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>\n# Copyright...
public/taiga-front/app/coffee/modules/feedback.coffee
mabotech/maboss
0
### # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com> # Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # File: modules/feedback.coffee ### taiga = @.taiga groupBy = @.taiga.groupBy bindOnce = @.taiga.bindOnce mixOf = @.taiga.mixOf debounce = @.taiga.debounce trim = @.taiga.trim module = angular.module("taigaFeedback", []) FeedbackDirective = ($lightboxService, $repo, $confirm, $loading)-> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley() submit = debounce 2000, (event) => event.preventDefault() if not form.validate() return $loading.start(submitButton) promise = $repo.create("feedback", $scope.feedback) promise.then (data) -> $loading.finish(submitButton) $lightboxService.close($el) $confirm.notify("success", "\\o/ we'll be happy to read your") promise.then null, -> $loading.finish(submitButton) $confirm.notify("error") submitButton = $el.find(".submit-button") $el.on "submit", "form", submit $el.on "click", ".submit-button", submit $scope.$on "feedback:show", -> $scope.$apply -> $scope.feedback = {} $lightboxService.open($el) $el.find("textarea").focus() $scope.$on "$destroy", -> $el.off() return {link:link} module.directive("tgLbFeedback", ["lightboxService", "$tgRepo", "$tgConfirm", "$tgLoading", FeedbackDirective])
190464
### # Copyright (C) 2014 <NAME> <<EMAIL>> # Copyright (C) 2014 <NAME> <<EMAIL>> # Copyright (C) 2014 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # File: modules/feedback.coffee ### taiga = @.taiga groupBy = @.taiga.groupBy bindOnce = @.taiga.bindOnce mixOf = @.taiga.mixOf debounce = @.taiga.debounce trim = @.taiga.trim module = angular.module("taigaFeedback", []) FeedbackDirective = ($lightboxService, $repo, $confirm, $loading)-> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley() submit = debounce 2000, (event) => event.preventDefault() if not form.validate() return $loading.start(submitButton) promise = $repo.create("feedback", $scope.feedback) promise.then (data) -> $loading.finish(submitButton) $lightboxService.close($el) $confirm.notify("success", "\\o/ we'll be happy to read your") promise.then null, -> $loading.finish(submitButton) $confirm.notify("error") submitButton = $el.find(".submit-button") $el.on "submit", "form", submit $el.on "click", ".submit-button", submit $scope.$on "feedback:show", -> $scope.$apply -> $scope.feedback = {} $lightboxService.open($el) $el.find("textarea").focus() $scope.$on "$destroy", -> $el.off() return {link:link} module.directive("tgLbFeedback", ["lightboxService", "$tgRepo", "$tgConfirm", "$tgLoading", FeedbackDirective])
true
### # Copyright (C) 2014 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> # Copyright (C) 2014 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> # Copyright (C) 2014 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # # File: modules/feedback.coffee ### taiga = @.taiga groupBy = @.taiga.groupBy bindOnce = @.taiga.bindOnce mixOf = @.taiga.mixOf debounce = @.taiga.debounce trim = @.taiga.trim module = angular.module("taigaFeedback", []) FeedbackDirective = ($lightboxService, $repo, $confirm, $loading)-> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley() submit = debounce 2000, (event) => event.preventDefault() if not form.validate() return $loading.start(submitButton) promise = $repo.create("feedback", $scope.feedback) promise.then (data) -> $loading.finish(submitButton) $lightboxService.close($el) $confirm.notify("success", "\\o/ we'll be happy to read your") promise.then null, -> $loading.finish(submitButton) $confirm.notify("error") submitButton = $el.find(".submit-button") $el.on "submit", "form", submit $el.on "click", ".submit-button", submit $scope.$on "feedback:show", -> $scope.$apply -> $scope.feedback = {} $lightboxService.open($el) $el.find("textarea").focus() $scope.$on "$destroy", -> $el.off() return {link:link} module.directive("tgLbFeedback", ["lightboxService", "$tgRepo", "$tgConfirm", "$tgLoading", FeedbackDirective])
[ { "context": "ase = @thisPageConfig.base;\n\n\n\t\tdocument.title = \"Daniele Pelagatti - \"+@thisPageConfig.meta.title\n\n\t\tobj3D = @page3", "end": 6911, "score": 0.9997891187667847, "start": 6894, "tag": "NAME", "value": "Daniele Pelagatti" } ]
src/coffee/App.coffee
daniele-pelagatti/danielepelagatti.com
0
#import utils/MotionAnalysis #import utils/QueryString class App CONTAINER_X : 200; SCREEN_WIDTH : window.innerWidth - @CONTAINER_X; SCREEN_HEIGHT : window.innerHeight; FLOOR : -50; TRANSITION_DURATION : 0.5; PAGE_SCALE_MULTIPLIER : 0.1; SCENE_SCALE_MULTIPLIER : 100; CSS3D_SCALE_MULTIPLIER : 1; container : null; camera : null; scene : null; css3DScene : null; renderer : null; css3dRenderer : null; isWebGLCapable : false; isCSS3DCapable : false; isCanvasCapable : false; isIE11 : false; mouseX : 0; mouseY : 0; pickMouseX : -90000; pickMouseY : -90000; windowHalfX : @SCREEN_WIDTH / 2; windowHalfY : @SCREEN_HEIGHT / 2; projector : null; raycaster : null; overObject : null; excludeFromPicking : ["scene_baked_pPlane1"] initialObjectsProperties : {}; clickedObject : null; clickedObjectWPosition : null; clickedObjectWRotation : null; clickedObjectWScale : null; isFocused : false; doRender : true; pageLanguage : window.PAGE_LANG; pagePermalink : window.PAGE_PERMALINK; pageDepth : window.PAGE_DEPTH; pageBase : window.PAGE_BASE; pageId : ""; config : [] allLanguagesConfig : [] thisPageConfig : null page3DObjects : {} doPicking : true currentHistoryState : {} cameraLookAt : new THREE.Vector3(-50,-300,0) htmlMain : null delayID : -1 minCameraX : -250 maxCameraX : 250 minCameraY : -50 maxCameraY : 300 unfocusingTween : null motionAnalysis : null lockedOnDeviceMotion : false deviceMotionChangeTimes : 0 prevMotionAnalysis : x : 0 y : 0 z : 0 constructor:-> @isIE11 = !!window.MSInputMethodContext; @isCSS3DCapable = Modernizr.csstransforms3d && !@isIE11#Modernizr.transformstylepreserve3d @isWebGLCapable = @checkWebGL() && Modernizr.webgl @isPushStateCapable = Modernizr.history # disable canvas mode, too slow on ipads # @isCanvasCapable = Modernizr.canvas if @isCSS3DCapable && @isPushStateCapable && ( @isCanvasCapable || @isWebGLCapable )# minimum requirements @htmlMain = $("main") ga('send', 'event', 'webgl-test', 'passed'); $("body").css("overflow-y","hidden"); $("html").css("overflow-y","hidden"); TweenMax.to @htmlMain, 1, css: opacity:0 onComplete:(thisPage)=> @showLoading() TweenMax.to(@htmlMain,0,{css:{opacity: 1}}); @htmlMain.remove() $.ajax @pageBase+"config.json", success : @onConfigLoaded error : @onConfigError @init(); @animate(); else # we cannot continue, no webgl support ga('send', 'event', 'webgl-test', 'failed'); null init:-> @container = $( '.javascriptContent' ); @CONTAINER_X = @container.position().left; @SCREEN_WIDTH = window.innerWidth - @CONTAINER_X; @SCREEN_HEIGHT = window.innerHeight; @windowHalfX = @SCREEN_WIDTH / 2; @windowHalfY = @SCREEN_HEIGHT / 2; @motionAnalysis = new MotionAnalysis() @camera = new THREE.PerspectiveCamera( 75, @SCREEN_WIDTH / @SCREEN_HEIGHT, 1, 10000 ); @camera.position.z = 300; @scene = new THREE.Scene(); @css3DScene = new THREE.Scene(); @css3DScene.scale.set(@CSS3D_SCALE_MULTIPLIER,@CSS3D_SCALE_MULTIPLIER,@CSS3D_SCALE_MULTIPLIER) @css3DScene.updateMatrix(); if @isWebGLCapable @renderer = new THREE.WebGLRenderer antialias : true # sortObjects : false @renderer.gammeInput = true; @renderer.gammeOutput = true; else if @isCanvasCapable @renderer = new THREE.CanvasRenderer # sortObjects : false # sortElements : false @renderer.setClearColor( 0xffffff, 1 ); @renderer.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @renderer.domElement.style.position = "relative"; $(@renderer.domElement).addClass("threejs-container"); @container.append( @renderer.domElement ); @css3dRenderer = new THREE.CSS3DRenderer() @css3dRenderer.setClearColor( 0xffffff ); @css3dRenderer.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @css3dRenderer.domElement.style.position = "absolute"; @css3dRenderer.domElement.style.top = "0"; @css3dRenderer.domElement.style.left = "0"; $(@css3dRenderer.domElement).addClass("css3d-container"); @container.append( @css3dRenderer.domElement ); @projector = new THREE.Projector(); @raycaster = new THREE.Raycaster(); $(window).bind( 'resize', @onWindowResize ); @container.bind( 'mousemove touchmove touchstart', @onMouseMove ); @container.bind( 'click touchend', @on3DSceneMouseClick ); @container.bind( "transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd" , @onWindowResize); # link overrides $(".projectsMenu").find("a").mouseover(@onMenuLinkOver) $(".projectsMenu").find("a").mouseout(@onMenuLinkOut) $(".projectsMenu").find("a").click(@onMenuLinkClick) $(".menu").find("a").mouseover => @doPicking = false $(".menu").find("a").mouseout => @doPicking = true $(".close-page").click(@onCloseClick) $(window).bind("popstate",@onPopStateChange); @onWindowResize() TweenMax.to( $(".threejs-container"), 0, {css:{opacity:0}} ) TweenMax.to( $(".css3d-container"), 0, {css:{opacity:0}} ) if @pagePermalink? && @pagePermalink != "" @currentHistoryState = "/"+@pageLanguage+"/"+@pagePermalink+"/" else @currentHistoryState = "/"+@pageLanguage+"/" null onConfigLoaded:( data, textStatus, jqXHR )=> @allLanguagesConfig = data; @config = data[@pageLanguage] if !@config? throw "Cannot find config for this language" # load scene loader = new THREE.SceneLoader(); if @isWebGLCapable loader.load( @pageBase+"maya/data/scene.json", @sceneLoadCallback ); else loader.load( @pageBase+"maya/data/scene_canvas.json", @sceneLoadCallback ); null onPopStateChange:(event)=> return if !event.originalEvent.state? newPath = event.originalEvent.state.path; for page in @config if page.link == newPath @pageId = page.meta.id @thisPageConfig = page break @pageLanguage = @thisPageConfig.lang @pagePermalink = @thisPageConfig.meta.permalink @pageDepth = @thisPageConfig.depth if @pageBase == "./" && @thisPageConfig.base == "../" # this happens in the root doc @pageBase = "./" else @pageBase = @thisPageConfig.base; document.title = "Daniele Pelagatti - "+@thisPageConfig.meta.title obj3D = @page3DObjects[newPath]; if @unfocusingTween? && !@unfocusingTween._active @unfocusingTween = null if @unfocusingTween? # we are in the middle of an unfocus tween # we need to replace what happens next on the fly @unfocusingTween.vars.onCompleteParams[1] = => @clickedObject = @overObject = obj3D @unfocusingTween = null @focus() else if @isFocused # we are focused on a page if newPath != @currentHistoryState # a different page needs to be focused # we need to unfocus then focus again next @unfocus => @clickedObject = @overObject = obj3D @focus() else # we are roaming free in the 3d space, we need to focus on a page @overObject = @clickedObject = obj3D; @focus() if newPath != @currentHistoryState # change language change link on languages menu to go to the current page languageLinks = $(".languagesMenu").find("a"); for languageLink in languageLinks languageConfig = @allLanguagesConfig[languageLink.id] for page in languageConfig if page.meta.id == @pageId $(languageLink).attr("href", @getRelativeLink(page.link) ) #update selected project on the menu selectedMenuItem = @findMenuItemByPermalink( newPath, (item)=> item.removeClass("selected") , (item)=> item.attr("href", @pageBase+@getRelativeLink( item.attr("permalink") ).substr(1) ) item.removeClass("hover") ); # scroll menu to selected item if selectedMenuItem? selectedMenuItem.addClass("selected") @scrollMenuToItem(selectedMenuItem) ga('send', 'pageview', @thisPageConfig.link); @currentHistoryState = newPath; null scrollMenuToItem:(item)=> scrollTarget = $(".menu") targetPosition = item.position() scroller = scrollTarget.scrollTop() scrollToY = (targetPosition.top+scroller) - (@SCREEN_HEIGHT/2) TweenMax.to(scrollTarget[0], 0.5, {scrollTo:{y:scrollToY}, ease:Power2.easeOut}); null onMenuLinkOver:(event)=> if !@isFocused obj3D = @page3DObjects[ $(event.currentTarget).attr("permalink") ]; @handle3DPlaneMouseInteraction(obj3D,"menu") null onMenuLinkOut:(event)=> null onMenuLinkClick:(event)=> event.originalEvent.preventDefault(); @on3DPlaneMouseOut(@overObject) @overObject = null @handlePushState( $(event.currentTarget).attr("permalink") ) null onCloseClick:=> ga('send', 'event', 'close-page-button', 'click'); @unfocus() null on3DPlaneMouseOver:(plane,source)=> if !@isFocused if @isWebGLCapable TweenMax.to( plane.material.uniforms.color_opacity, 0.5, {value:1} ); if source != "menu" menuItem = @findMenuItemByPermalink plane.page.attr("permalink"), (item) -> item.removeClass("hover") menuItem.addClass("hover") @scrollMenuToItem(menuItem) null on3DPlaneMouseOut:(plane,source)=> return if !plane? if @isWebGLCapable TweenMax.to( plane.material.uniforms.color_opacity, 0.5, {value:0} ); if !@isFocused menuItem = @findMenuItemByPermalink( plane.page.attr("permalink") ) menuItem.removeClass("hover") null findMenuItemByPermalink:(permalink,executeOnOthers,executeOnAll)=> projectsLinks = $(".projectsMenu").find("a"); retValue = null for menuItem in projectsLinks projectLink = $(menuItem) if projectLink.attr("permalink") == permalink retValue = projectLink else executeOnOthers?( projectLink ) executeOnAll?( projectLink ) return retValue on3DSceneMouseClick:(event)=> @calcPicking() if !@overObject? # required to unfocus ( click outside focused plane ) if !@isFocused if @overObject @clickedObject = @overObject; @focus(); else if !@overObject @unfocus(); ga('send', 'event', '3d-empty-space', 'click'); return; ga('send', 'event', '3d-plane:'+@overObject.link, 'click'); @handlePushState(@overObject.link) handlePushState:(path)=> stateObj = {path:path} if path != @currentHistoryState history.pushState(stateObj,"Title",@pageBase+path.substr(1)) @onPopStateChange originalEvent: state: stateObj onConfigError:(jqXHR,textStatus,errorThrown )=> throw errorThrown onTouchStart:(event)=> onTouchMove:(event)=> onTouchEnd:(event)=> setupCSS3DPage: ( pageObj, object, link )=> pageObj.css opacity : 0 display : "none" cssObj = new THREE.CSS3DObject( pageObj[0] ); cssObj.rotation.order = "ZYX"; cssObj.position.set(object.position.x * @SCENE_SCALE_MULTIPLIER,object.position.y * @SCENE_SCALE_MULTIPLIER,object.position.z * @SCENE_SCALE_MULTIPLIER); cssObj.quaternion.set(object.quaternion.x,object.quaternion.y,object.quaternion.z,object.quaternion.w); rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI / 2 ); cssObj.quaternion.multiply(rot2); cssObj.scale.set(object.scale.x * @PAGE_SCALE_MULTIPLIER,object.scale.y * @PAGE_SCALE_MULTIPLIER,object.scale.z * @PAGE_SCALE_MULTIPLIER); object.page = pageObj; object.cssObj = cssObj; @css3DScene.add( cssObj ) null; sceneLoadCallback: ( result )=> $(".page-container").css display : "none" # Generate colors (as Chroma.js objects) @colors = paletteGenerator.generate result.scene.children.length, # Colors (color)-> # This function filters valid colors hcl = color.hcl(); return hcl[0] >= 0 && hcl[0] <= 360 && hcl[1] >= 0 && hcl[1] <= 0.9 && hcl[2] >= 1 && hcl[2] <= 1.5; , false, # Using Force Vector instead of k-Means 50 # Steps (quality) # Sort colors by differenciation first @colors = paletteGenerator.diffSort(@colors); objectIndex = 0; thisPage = null; result.scene.traverse (object)=> object.rotation.order = "ZYX"; if object.material? if @excludeFromPicking.indexOf(object.name) == -1 @initialObjectsProperties[object.name] = {} @initialObjectsProperties[object.name].position = object.position.clone(); @initialObjectsProperties[object.name].quaternion = object.quaternion.clone(); @initialObjectsProperties[object.name].scale = object.scale.clone(); if @config[objectIndex]? object.config = @config[objectIndex] @page3DObjects[@config[objectIndex].link] = object; link = object.link = @config[objectIndex].link; container = $("<div class='object3DContainer' permalink='"+link+"'></div>") if object.config.meta.permalink == @pagePermalink || ( object.config.meta.permalink == null && @pagePermalink == "" ) # don't load ourselves @htmlMain.find("#no-webgl-warning").remove() @htmlMain.find(".no-webgl-warning-button").remove() container.append(@htmlMain) thisPage = link @setupCSS3DPage( container , object, link ) else @excludeFromPicking.push(object.name) objectIndex++; if @isWebGLCapable # replace material with our simple webgl one @replaceThreeJsMaterial(object,objectIndex) if object.name != "scene_baked_pPlane1" object.material.uniforms.fresnelIntensity.value = 1; else # replace material with a simple threejs one object.material = new THREE.MeshBasicMaterial lights : false fog: false shading: THREE.FlatShading map : object.material.map object.material.overdraw = true object.material.transparent = true; object.material.opacity = 1; object.material.side = THREE.DoubleSide; if object.geometry? object.geometry.computeFaceNormals(); object.geometry.computeVertexNormals(); # object.geometry.computeCentroids(); object.geometry.computeTangents(); object.geometry.computeBoundingBox(); object.updateMatrix(); @scene = result.scene; @scene.position.set(0,-450,0) @css3DScene.position.set(0,-450,0) @scene.scale.set(@SCENE_SCALE_MULTIPLIER,@SCENE_SCALE_MULTIPLIER,@SCENE_SCALE_MULTIPLIER) @scene.updateMatrix(); @css3DScene.updateMatrix(); @hideLoading() TweenMax.to $(".threejs-container"), 1, css: opacity:1 TweenMax.to $(".css3d-container"), 1, css: opacity:1 onCompleteParams: [thisPage] onCompleteParams: [thisPage] onComplete:(thisPage)=> if thisPage? @handlePushState(thisPage) null; replaceThreeJsMaterial:(object,objectIndex)=> uniforms = THREE.UniformsUtils.clone(THREE.PlaneShader.uniforms) # uniforms.focus_balance.value = 0; uniforms.color_opacity.value = 0; uniforms.opacity.value = 1; uniforms.diffuse.value.set( @colors[objectIndex].rgb[0] / 255 , @colors[objectIndex].rgb[1] /255 , @colors[objectIndex].rgb[2] /255 ) uniforms.map.value = object.material.map defines = {} defines["USE_MAP"] = ""; # defines["GAMMA_OUTPUT"] = ""; if @isIE11 # IE11 doesn't support gl_frontFacing defines["NO_FRESNEL"] = ""; material = new THREE.ShaderMaterial uniforms: uniforms attributes: {} vertexShader: THREE.PlaneShader.vertexShader fragmentShader: THREE.PlaneShader.fragmentShader transparent: true lights : false fog : false shading: THREE.FlatShading defines : defines; object.material = material; focus:(callback)=> @isFocused = true; pageIsLoaded = @clickedObject.page.find("main").length > 0 if !pageIsLoaded @showLoading() $.ajax @getRelativeLink( @clickedObject.page.attr("permalink") ), success : ( data, textStatus, jqXHR ) => mainArticle = $(data).find("main") mainArticle.find("#no-webgl-warning").remove() mainArticle.find(".no-webgl-warning-button").remove() @clickedObject.page.append( mainArticle ) @focus() error : (jqXHR,textStatus,errorThrown ) => console.error(textStatus); return @hideLoading(); # mouseout all planes @scene.traverse (object)=> if object.material? @on3DPlaneMouseOut(object) @clickedObjectWPosition = @initialObjectsProperties[@clickedObject.name].position.clone(); @clickedObjectWRotation = @initialObjectsProperties[@clickedObject.name].quaternion.clone(); @clickedObjectWScale = @initialObjectsProperties[@clickedObject.name].scale.clone(); newPos = @getFocusedPagePosition(); @clickedObject.page.css "pointer-events" : "none" TweenMax.to @clickedObject.position, @TRANSITION_DURATION, x : newPos.x y : newPos.y z : newPos.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlanePosition onCompleteParams : [@clickedObject,callback] onComplete : (object,callback)=> object.page.css "pointer-events" : "" @doRender = false; @syncCss3dPlanePosition(object); @onWindowResize(); @render(); callback?(); camRot = @camera.quaternion.clone(); rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), Math.PI / 2 ); camRot.multiply(rot2); TweenMax.to @clickedObject.quaternion, @TRANSITION_DURATION, x : camRot.x y : camRot.y z : camRot.z w : camRot.w onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneRotation onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneRotation TweenMax.to @clickedObject.scale, @TRANSITION_DURATION, x : 1 y : 1 z : 1 onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneScale onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneScale if @isWebGLCapable TweenMax.to @clickedObject.material.uniforms.opacity, @TRANSITION_DURATION, value:0 else TweenMax.to @clickedObject.material, @TRANSITION_DURATION, opacity:0 @clickedObject.page.css display : "block" TweenMax.to @clickedObject.page[0], @TRANSITION_DURATION, css: opacity:1 $(".close-page").show(); null; unfocus:(callback)=> @doRender = true @isFocused = false; @animate() TweenMax.to @clickedObject.position, @TRANSITION_DURATION, x : @clickedObjectWPosition.x y : @clickedObjectWPosition.y z : @clickedObjectWPosition.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlanePosition onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlanePosition TweenMax.to @clickedObject.quaternion, @TRANSITION_DURATION, x : @clickedObjectWRotation.x y : @clickedObjectWRotation.y z : @clickedObjectWRotation.z w : @clickedObjectWRotation.w onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneRotation onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneRotation TweenMax.to @clickedObject.scale, @TRANSITION_DURATION, x : @clickedObjectWScale.x y : @clickedObjectWScale.y z : @clickedObjectWScale.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneScale onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneScale if @isWebGLCapable TweenMax.to @clickedObject.material.uniforms.opacity, @TRANSITION_DURATION, value:1 else TweenMax.to @clickedObject.material, @TRANSITION_DURATION, opacity:1 @unfocusingTween = TweenMax.to @clickedObject.page[0], @TRANSITION_DURATION, css: opacity:0 onCompleteParams: [@clickedObject,callback] onComplete:(object,callback)=> object.page.find("main").remove() object.page.css display : "none" @unfocusingTween = null callback?(); $(".close-page").hide(); null; syncCss3dPlaneScale:(object)=> object.cssObj.scale.set(object.scale.x * @PAGE_SCALE_MULTIPLIER,object.scale.y * @PAGE_SCALE_MULTIPLIER,object.scale.z * @PAGE_SCALE_MULTIPLIER) syncCss3dPlanePosition:(object)=> object.cssObj.position.set(object.position.x * @SCENE_SCALE_MULTIPLIER,object.position.y * @SCENE_SCALE_MULTIPLIER,object.position.z * @SCENE_SCALE_MULTIPLIER) syncCss3dPlaneRotation:(object)=> object.cssObj.quaternion.set(object.quaternion.x,object.quaternion.y,object.quaternion.z,object.quaternion.w) rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI / 2 ); object.cssObj.quaternion.multiply(rot2); getFocusedPagePosition:=> rotMat = new THREE.Matrix4(); rotMat.makeRotationFromQuaternion(@camera.quaternion); forward = new THREE.Vector3(0,0,-1); forward.applyMatrix4( rotMat ); forward.normalize(); right = new THREE.Vector3(1,0,0); right.applyMatrix4( rotMat ); right.normalize(); # 600 : 0.4 = height : x zDistance = (window.innerHeight*0.00065)#/600 # 1050 : 0 = width : x xDistance = 0 #- ( ( window.innerWidth- 1050) * 0.00054 ) right.multiplyScalar(xDistance); forward.multiplyScalar(zDistance); newPos = @camera.position.clone(); newPos.x -= @scene.position.x; newPos.y -= @scene.position.y; newPos.z -= @scene.position.z; newPos.x /= @SCENE_SCALE_MULTIPLIER; newPos.y /= @SCENE_SCALE_MULTIPLIER; newPos.z /= @SCENE_SCALE_MULTIPLIER; newPos.add(right); newPos.add(forward); return newPos; onWindowResize:()=> @CONTAINER_X = @container.position().left; @SCREEN_WIDTH = window.innerWidth - @CONTAINER_X @SCREEN_HEIGHT = window.innerHeight @windowHalfX = @SCREEN_WIDTH / 2; @windowHalfY = @SCREEN_HEIGHT / 2; @camera.aspect = @SCREEN_WIDTH / @SCREEN_HEIGHT; @camera.updateProjectionMatrix(); @renderer?.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @css3dRenderer?.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); if @isFocused pos = @getFocusedPagePosition() @clickedObject.position.set(pos.x,pos.y,pos.z) @clickedObject.cssObj.position.set(pos.x* @SCENE_SCALE_MULTIPLIER,pos.y* @SCENE_SCALE_MULTIPLIER,pos.z* @SCENE_SCALE_MULTIPLIER) @render() onMouseMove:(event)=> if !@isFocused event.originalEvent.preventDefault(); mx = event.clientX || event.originalEvent.touches?[0]?.clientX || 0 my = event.clientY || event.originalEvent.touches?[0]?.clientY || 0 @mouseX = ( (mx - @CONTAINER_X) - @windowHalfX ); @mouseY = ( my - @windowHalfY ); # @mouseX = mx - @CONTAINER_X; # @mouseY = my; @pickMouseX = ( (mx - @CONTAINER_X) / @SCREEN_WIDTH ) * 2 - 1; @pickMouseY = - ( my / @SCREEN_HEIGHT ) * 2 + 1; # console.log("MOVE") animate:()=> @render(); # @stats.update(); requestAnimationFrame( @animate ) if @doRender; render:()=> if !@isFocused rangeX = @maxCameraX - @minCameraX rangeY = @maxCameraY - @minCameraY if @lockedOnDeviceMotion || @prevMotionAnalysis.x != @motionAnalysis.rotation.x || @prevMotionAnalysis.y != @motionAnalysis.rotation.y || @prevMotionAnalysis.z != @motionAnalysis.rotation.z @deviceMotionChangeTimes++; if @deviceMotionChangeTimes >= 4 @lockedOnDeviceMotion = true lim = 4 mrX = Math.max( Math.min( @motionAnalysis.rotation.x , lim ), -lim ); mrY = Math.max( Math.min( @motionAnalysis.rotation.z , lim ), -lim ); camX = ( mrX * rangeX ) / (lim*2) camY = ( mrY * rangeY ) / (lim*2) else camX = ( @mouseX * rangeX ) / @SCREEN_WIDTH camY = ( -@mouseY * rangeY ) / @SCREEN_HEIGHT # console.log(camX,camY, @camera.position.x, @camera.position.y) if camX? && camY? && !isNaN(camX) && !isNaN(camY) @camera.position.x += ( camX - @camera.position.x ) * 0.05; @camera.position.y += ( camY - @camera.position.y ) * 0.05; # @camera.position.z += ( camZ - @camera.position.z ) * 0.05; @camera.lookAt( @cameraLookAt ); @prevMotionAnalysis.x = @motionAnalysis.rotation.x @prevMotionAnalysis.y = @motionAnalysis.rotation.y @prevMotionAnalysis.z = @motionAnalysis.rotation.z @calcPicking(); @renderer?.render( @scene, @camera ); @css3dRenderer?.render( @css3DScene, @camera ); calcPicking:()=> vector = new THREE.Vector3( @pickMouseX, @pickMouseY, 1 ); @projector.unprojectVector( vector, @camera ); @raycaster.set( @camera.position, vector.sub( @camera.position ).normalize() ); intersects = @raycaster.intersectObjects( @scene.children ); if @doPicking if intersects.length > 0 @handle3DPlaneMouseInteraction(intersects[ 0 ].object,"3d") else @handle3DPlaneMouseInteraction(null,"3d") @overObject = null; if @overObject? && !@isFocused $("body").css('cursor', 'pointer'); else $("body").css('cursor', ''); handle3DPlaneMouseInteraction:(object,initiator)=> if !object? && @overObject? @on3DPlaneMouseOut(@overObject) return if @overObject != object # intersects and it's different from before if @overObject @on3DPlaneMouseOut(@overObject,initiator) if @excludeFromPicking.indexOf(object.name) == -1 # filter picked objects @overObject = object; @on3DPlaneMouseOver(@overObject,initiator) if !@isFocused ga('send', 'event', '3d-plane:'+@overObject.link, 'over'); else @overObject = null; getUpDirs:(howMany)=> retValue = "" for i in [0...howMany] by 1 retValue += "../" return retValue; getRelativeLink:(objectPermalink)=> updirs = @getUpDirs(@pageDepth); if(@pageDepth > 0) return updirs.substr(0,updirs.length-1)+objectPermalink; else return "."+objectPermalink; checkWebGL:-> ua = navigator.userAgent.toLowerCase() isStockAndroid = /android/.test(ua) and !/chrome/.test(ua) try return !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl') and !isStockAndroid catch return false showLoading:=> $("body").spin lines : 8, # The number of lines to draw length : 8, # The length of each line width : 5, # The line thickness radius : 11, # The radius of the inner circle corners : 1, # Corner roundness (0..1) rotate : 0, # The rotation offset direction : 1, # 1: clockwise, -1: counterclockwise color : '#444', # #rgb or #rrggbb or array of colors speed : 1.3, # Rounds per second trail : 60, # Afterglow percentage shadow : true, # Whether to render a shadow hwaccel : true, # Whether to use hardware acceleration className : 'spinner', # The CSS class to assign to the spinner zIndex : 2e9, # The z-index (defaults to 2000000000) top : '50%', # Top position relative to parent in px left : '50%' # Left position relative to parent in px null hideLoading:=> $("body").spin(false) null
24908
#import utils/MotionAnalysis #import utils/QueryString class App CONTAINER_X : 200; SCREEN_WIDTH : window.innerWidth - @CONTAINER_X; SCREEN_HEIGHT : window.innerHeight; FLOOR : -50; TRANSITION_DURATION : 0.5; PAGE_SCALE_MULTIPLIER : 0.1; SCENE_SCALE_MULTIPLIER : 100; CSS3D_SCALE_MULTIPLIER : 1; container : null; camera : null; scene : null; css3DScene : null; renderer : null; css3dRenderer : null; isWebGLCapable : false; isCSS3DCapable : false; isCanvasCapable : false; isIE11 : false; mouseX : 0; mouseY : 0; pickMouseX : -90000; pickMouseY : -90000; windowHalfX : @SCREEN_WIDTH / 2; windowHalfY : @SCREEN_HEIGHT / 2; projector : null; raycaster : null; overObject : null; excludeFromPicking : ["scene_baked_pPlane1"] initialObjectsProperties : {}; clickedObject : null; clickedObjectWPosition : null; clickedObjectWRotation : null; clickedObjectWScale : null; isFocused : false; doRender : true; pageLanguage : window.PAGE_LANG; pagePermalink : window.PAGE_PERMALINK; pageDepth : window.PAGE_DEPTH; pageBase : window.PAGE_BASE; pageId : ""; config : [] allLanguagesConfig : [] thisPageConfig : null page3DObjects : {} doPicking : true currentHistoryState : {} cameraLookAt : new THREE.Vector3(-50,-300,0) htmlMain : null delayID : -1 minCameraX : -250 maxCameraX : 250 minCameraY : -50 maxCameraY : 300 unfocusingTween : null motionAnalysis : null lockedOnDeviceMotion : false deviceMotionChangeTimes : 0 prevMotionAnalysis : x : 0 y : 0 z : 0 constructor:-> @isIE11 = !!window.MSInputMethodContext; @isCSS3DCapable = Modernizr.csstransforms3d && !@isIE11#Modernizr.transformstylepreserve3d @isWebGLCapable = @checkWebGL() && Modernizr.webgl @isPushStateCapable = Modernizr.history # disable canvas mode, too slow on ipads # @isCanvasCapable = Modernizr.canvas if @isCSS3DCapable && @isPushStateCapable && ( @isCanvasCapable || @isWebGLCapable )# minimum requirements @htmlMain = $("main") ga('send', 'event', 'webgl-test', 'passed'); $("body").css("overflow-y","hidden"); $("html").css("overflow-y","hidden"); TweenMax.to @htmlMain, 1, css: opacity:0 onComplete:(thisPage)=> @showLoading() TweenMax.to(@htmlMain,0,{css:{opacity: 1}}); @htmlMain.remove() $.ajax @pageBase+"config.json", success : @onConfigLoaded error : @onConfigError @init(); @animate(); else # we cannot continue, no webgl support ga('send', 'event', 'webgl-test', 'failed'); null init:-> @container = $( '.javascriptContent' ); @CONTAINER_X = @container.position().left; @SCREEN_WIDTH = window.innerWidth - @CONTAINER_X; @SCREEN_HEIGHT = window.innerHeight; @windowHalfX = @SCREEN_WIDTH / 2; @windowHalfY = @SCREEN_HEIGHT / 2; @motionAnalysis = new MotionAnalysis() @camera = new THREE.PerspectiveCamera( 75, @SCREEN_WIDTH / @SCREEN_HEIGHT, 1, 10000 ); @camera.position.z = 300; @scene = new THREE.Scene(); @css3DScene = new THREE.Scene(); @css3DScene.scale.set(@CSS3D_SCALE_MULTIPLIER,@CSS3D_SCALE_MULTIPLIER,@CSS3D_SCALE_MULTIPLIER) @css3DScene.updateMatrix(); if @isWebGLCapable @renderer = new THREE.WebGLRenderer antialias : true # sortObjects : false @renderer.gammeInput = true; @renderer.gammeOutput = true; else if @isCanvasCapable @renderer = new THREE.CanvasRenderer # sortObjects : false # sortElements : false @renderer.setClearColor( 0xffffff, 1 ); @renderer.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @renderer.domElement.style.position = "relative"; $(@renderer.domElement).addClass("threejs-container"); @container.append( @renderer.domElement ); @css3dRenderer = new THREE.CSS3DRenderer() @css3dRenderer.setClearColor( 0xffffff ); @css3dRenderer.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @css3dRenderer.domElement.style.position = "absolute"; @css3dRenderer.domElement.style.top = "0"; @css3dRenderer.domElement.style.left = "0"; $(@css3dRenderer.domElement).addClass("css3d-container"); @container.append( @css3dRenderer.domElement ); @projector = new THREE.Projector(); @raycaster = new THREE.Raycaster(); $(window).bind( 'resize', @onWindowResize ); @container.bind( 'mousemove touchmove touchstart', @onMouseMove ); @container.bind( 'click touchend', @on3DSceneMouseClick ); @container.bind( "transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd" , @onWindowResize); # link overrides $(".projectsMenu").find("a").mouseover(@onMenuLinkOver) $(".projectsMenu").find("a").mouseout(@onMenuLinkOut) $(".projectsMenu").find("a").click(@onMenuLinkClick) $(".menu").find("a").mouseover => @doPicking = false $(".menu").find("a").mouseout => @doPicking = true $(".close-page").click(@onCloseClick) $(window).bind("popstate",@onPopStateChange); @onWindowResize() TweenMax.to( $(".threejs-container"), 0, {css:{opacity:0}} ) TweenMax.to( $(".css3d-container"), 0, {css:{opacity:0}} ) if @pagePermalink? && @pagePermalink != "" @currentHistoryState = "/"+@pageLanguage+"/"+@pagePermalink+"/" else @currentHistoryState = "/"+@pageLanguage+"/" null onConfigLoaded:( data, textStatus, jqXHR )=> @allLanguagesConfig = data; @config = data[@pageLanguage] if !@config? throw "Cannot find config for this language" # load scene loader = new THREE.SceneLoader(); if @isWebGLCapable loader.load( @pageBase+"maya/data/scene.json", @sceneLoadCallback ); else loader.load( @pageBase+"maya/data/scene_canvas.json", @sceneLoadCallback ); null onPopStateChange:(event)=> return if !event.originalEvent.state? newPath = event.originalEvent.state.path; for page in @config if page.link == newPath @pageId = page.meta.id @thisPageConfig = page break @pageLanguage = @thisPageConfig.lang @pagePermalink = @thisPageConfig.meta.permalink @pageDepth = @thisPageConfig.depth if @pageBase == "./" && @thisPageConfig.base == "../" # this happens in the root doc @pageBase = "./" else @pageBase = @thisPageConfig.base; document.title = "<NAME> - "+@thisPageConfig.meta.title obj3D = @page3DObjects[newPath]; if @unfocusingTween? && !@unfocusingTween._active @unfocusingTween = null if @unfocusingTween? # we are in the middle of an unfocus tween # we need to replace what happens next on the fly @unfocusingTween.vars.onCompleteParams[1] = => @clickedObject = @overObject = obj3D @unfocusingTween = null @focus() else if @isFocused # we are focused on a page if newPath != @currentHistoryState # a different page needs to be focused # we need to unfocus then focus again next @unfocus => @clickedObject = @overObject = obj3D @focus() else # we are roaming free in the 3d space, we need to focus on a page @overObject = @clickedObject = obj3D; @focus() if newPath != @currentHistoryState # change language change link on languages menu to go to the current page languageLinks = $(".languagesMenu").find("a"); for languageLink in languageLinks languageConfig = @allLanguagesConfig[languageLink.id] for page in languageConfig if page.meta.id == @pageId $(languageLink).attr("href", @getRelativeLink(page.link) ) #update selected project on the menu selectedMenuItem = @findMenuItemByPermalink( newPath, (item)=> item.removeClass("selected") , (item)=> item.attr("href", @pageBase+@getRelativeLink( item.attr("permalink") ).substr(1) ) item.removeClass("hover") ); # scroll menu to selected item if selectedMenuItem? selectedMenuItem.addClass("selected") @scrollMenuToItem(selectedMenuItem) ga('send', 'pageview', @thisPageConfig.link); @currentHistoryState = newPath; null scrollMenuToItem:(item)=> scrollTarget = $(".menu") targetPosition = item.position() scroller = scrollTarget.scrollTop() scrollToY = (targetPosition.top+scroller) - (@SCREEN_HEIGHT/2) TweenMax.to(scrollTarget[0], 0.5, {scrollTo:{y:scrollToY}, ease:Power2.easeOut}); null onMenuLinkOver:(event)=> if !@isFocused obj3D = @page3DObjects[ $(event.currentTarget).attr("permalink") ]; @handle3DPlaneMouseInteraction(obj3D,"menu") null onMenuLinkOut:(event)=> null onMenuLinkClick:(event)=> event.originalEvent.preventDefault(); @on3DPlaneMouseOut(@overObject) @overObject = null @handlePushState( $(event.currentTarget).attr("permalink") ) null onCloseClick:=> ga('send', 'event', 'close-page-button', 'click'); @unfocus() null on3DPlaneMouseOver:(plane,source)=> if !@isFocused if @isWebGLCapable TweenMax.to( plane.material.uniforms.color_opacity, 0.5, {value:1} ); if source != "menu" menuItem = @findMenuItemByPermalink plane.page.attr("permalink"), (item) -> item.removeClass("hover") menuItem.addClass("hover") @scrollMenuToItem(menuItem) null on3DPlaneMouseOut:(plane,source)=> return if !plane? if @isWebGLCapable TweenMax.to( plane.material.uniforms.color_opacity, 0.5, {value:0} ); if !@isFocused menuItem = @findMenuItemByPermalink( plane.page.attr("permalink") ) menuItem.removeClass("hover") null findMenuItemByPermalink:(permalink,executeOnOthers,executeOnAll)=> projectsLinks = $(".projectsMenu").find("a"); retValue = null for menuItem in projectsLinks projectLink = $(menuItem) if projectLink.attr("permalink") == permalink retValue = projectLink else executeOnOthers?( projectLink ) executeOnAll?( projectLink ) return retValue on3DSceneMouseClick:(event)=> @calcPicking() if !@overObject? # required to unfocus ( click outside focused plane ) if !@isFocused if @overObject @clickedObject = @overObject; @focus(); else if !@overObject @unfocus(); ga('send', 'event', '3d-empty-space', 'click'); return; ga('send', 'event', '3d-plane:'+@overObject.link, 'click'); @handlePushState(@overObject.link) handlePushState:(path)=> stateObj = {path:path} if path != @currentHistoryState history.pushState(stateObj,"Title",@pageBase+path.substr(1)) @onPopStateChange originalEvent: state: stateObj onConfigError:(jqXHR,textStatus,errorThrown )=> throw errorThrown onTouchStart:(event)=> onTouchMove:(event)=> onTouchEnd:(event)=> setupCSS3DPage: ( pageObj, object, link )=> pageObj.css opacity : 0 display : "none" cssObj = new THREE.CSS3DObject( pageObj[0] ); cssObj.rotation.order = "ZYX"; cssObj.position.set(object.position.x * @SCENE_SCALE_MULTIPLIER,object.position.y * @SCENE_SCALE_MULTIPLIER,object.position.z * @SCENE_SCALE_MULTIPLIER); cssObj.quaternion.set(object.quaternion.x,object.quaternion.y,object.quaternion.z,object.quaternion.w); rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI / 2 ); cssObj.quaternion.multiply(rot2); cssObj.scale.set(object.scale.x * @PAGE_SCALE_MULTIPLIER,object.scale.y * @PAGE_SCALE_MULTIPLIER,object.scale.z * @PAGE_SCALE_MULTIPLIER); object.page = pageObj; object.cssObj = cssObj; @css3DScene.add( cssObj ) null; sceneLoadCallback: ( result )=> $(".page-container").css display : "none" # Generate colors (as Chroma.js objects) @colors = paletteGenerator.generate result.scene.children.length, # Colors (color)-> # This function filters valid colors hcl = color.hcl(); return hcl[0] >= 0 && hcl[0] <= 360 && hcl[1] >= 0 && hcl[1] <= 0.9 && hcl[2] >= 1 && hcl[2] <= 1.5; , false, # Using Force Vector instead of k-Means 50 # Steps (quality) # Sort colors by differenciation first @colors = paletteGenerator.diffSort(@colors); objectIndex = 0; thisPage = null; result.scene.traverse (object)=> object.rotation.order = "ZYX"; if object.material? if @excludeFromPicking.indexOf(object.name) == -1 @initialObjectsProperties[object.name] = {} @initialObjectsProperties[object.name].position = object.position.clone(); @initialObjectsProperties[object.name].quaternion = object.quaternion.clone(); @initialObjectsProperties[object.name].scale = object.scale.clone(); if @config[objectIndex]? object.config = @config[objectIndex] @page3DObjects[@config[objectIndex].link] = object; link = object.link = @config[objectIndex].link; container = $("<div class='object3DContainer' permalink='"+link+"'></div>") if object.config.meta.permalink == @pagePermalink || ( object.config.meta.permalink == null && @pagePermalink == "" ) # don't load ourselves @htmlMain.find("#no-webgl-warning").remove() @htmlMain.find(".no-webgl-warning-button").remove() container.append(@htmlMain) thisPage = link @setupCSS3DPage( container , object, link ) else @excludeFromPicking.push(object.name) objectIndex++; if @isWebGLCapable # replace material with our simple webgl one @replaceThreeJsMaterial(object,objectIndex) if object.name != "scene_baked_pPlane1" object.material.uniforms.fresnelIntensity.value = 1; else # replace material with a simple threejs one object.material = new THREE.MeshBasicMaterial lights : false fog: false shading: THREE.FlatShading map : object.material.map object.material.overdraw = true object.material.transparent = true; object.material.opacity = 1; object.material.side = THREE.DoubleSide; if object.geometry? object.geometry.computeFaceNormals(); object.geometry.computeVertexNormals(); # object.geometry.computeCentroids(); object.geometry.computeTangents(); object.geometry.computeBoundingBox(); object.updateMatrix(); @scene = result.scene; @scene.position.set(0,-450,0) @css3DScene.position.set(0,-450,0) @scene.scale.set(@SCENE_SCALE_MULTIPLIER,@SCENE_SCALE_MULTIPLIER,@SCENE_SCALE_MULTIPLIER) @scene.updateMatrix(); @css3DScene.updateMatrix(); @hideLoading() TweenMax.to $(".threejs-container"), 1, css: opacity:1 TweenMax.to $(".css3d-container"), 1, css: opacity:1 onCompleteParams: [thisPage] onCompleteParams: [thisPage] onComplete:(thisPage)=> if thisPage? @handlePushState(thisPage) null; replaceThreeJsMaterial:(object,objectIndex)=> uniforms = THREE.UniformsUtils.clone(THREE.PlaneShader.uniforms) # uniforms.focus_balance.value = 0; uniforms.color_opacity.value = 0; uniforms.opacity.value = 1; uniforms.diffuse.value.set( @colors[objectIndex].rgb[0] / 255 , @colors[objectIndex].rgb[1] /255 , @colors[objectIndex].rgb[2] /255 ) uniforms.map.value = object.material.map defines = {} defines["USE_MAP"] = ""; # defines["GAMMA_OUTPUT"] = ""; if @isIE11 # IE11 doesn't support gl_frontFacing defines["NO_FRESNEL"] = ""; material = new THREE.ShaderMaterial uniforms: uniforms attributes: {} vertexShader: THREE.PlaneShader.vertexShader fragmentShader: THREE.PlaneShader.fragmentShader transparent: true lights : false fog : false shading: THREE.FlatShading defines : defines; object.material = material; focus:(callback)=> @isFocused = true; pageIsLoaded = @clickedObject.page.find("main").length > 0 if !pageIsLoaded @showLoading() $.ajax @getRelativeLink( @clickedObject.page.attr("permalink") ), success : ( data, textStatus, jqXHR ) => mainArticle = $(data).find("main") mainArticle.find("#no-webgl-warning").remove() mainArticle.find(".no-webgl-warning-button").remove() @clickedObject.page.append( mainArticle ) @focus() error : (jqXHR,textStatus,errorThrown ) => console.error(textStatus); return @hideLoading(); # mouseout all planes @scene.traverse (object)=> if object.material? @on3DPlaneMouseOut(object) @clickedObjectWPosition = @initialObjectsProperties[@clickedObject.name].position.clone(); @clickedObjectWRotation = @initialObjectsProperties[@clickedObject.name].quaternion.clone(); @clickedObjectWScale = @initialObjectsProperties[@clickedObject.name].scale.clone(); newPos = @getFocusedPagePosition(); @clickedObject.page.css "pointer-events" : "none" TweenMax.to @clickedObject.position, @TRANSITION_DURATION, x : newPos.x y : newPos.y z : newPos.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlanePosition onCompleteParams : [@clickedObject,callback] onComplete : (object,callback)=> object.page.css "pointer-events" : "" @doRender = false; @syncCss3dPlanePosition(object); @onWindowResize(); @render(); callback?(); camRot = @camera.quaternion.clone(); rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), Math.PI / 2 ); camRot.multiply(rot2); TweenMax.to @clickedObject.quaternion, @TRANSITION_DURATION, x : camRot.x y : camRot.y z : camRot.z w : camRot.w onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneRotation onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneRotation TweenMax.to @clickedObject.scale, @TRANSITION_DURATION, x : 1 y : 1 z : 1 onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneScale onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneScale if @isWebGLCapable TweenMax.to @clickedObject.material.uniforms.opacity, @TRANSITION_DURATION, value:0 else TweenMax.to @clickedObject.material, @TRANSITION_DURATION, opacity:0 @clickedObject.page.css display : "block" TweenMax.to @clickedObject.page[0], @TRANSITION_DURATION, css: opacity:1 $(".close-page").show(); null; unfocus:(callback)=> @doRender = true @isFocused = false; @animate() TweenMax.to @clickedObject.position, @TRANSITION_DURATION, x : @clickedObjectWPosition.x y : @clickedObjectWPosition.y z : @clickedObjectWPosition.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlanePosition onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlanePosition TweenMax.to @clickedObject.quaternion, @TRANSITION_DURATION, x : @clickedObjectWRotation.x y : @clickedObjectWRotation.y z : @clickedObjectWRotation.z w : @clickedObjectWRotation.w onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneRotation onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneRotation TweenMax.to @clickedObject.scale, @TRANSITION_DURATION, x : @clickedObjectWScale.x y : @clickedObjectWScale.y z : @clickedObjectWScale.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneScale onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneScale if @isWebGLCapable TweenMax.to @clickedObject.material.uniforms.opacity, @TRANSITION_DURATION, value:1 else TweenMax.to @clickedObject.material, @TRANSITION_DURATION, opacity:1 @unfocusingTween = TweenMax.to @clickedObject.page[0], @TRANSITION_DURATION, css: opacity:0 onCompleteParams: [@clickedObject,callback] onComplete:(object,callback)=> object.page.find("main").remove() object.page.css display : "none" @unfocusingTween = null callback?(); $(".close-page").hide(); null; syncCss3dPlaneScale:(object)=> object.cssObj.scale.set(object.scale.x * @PAGE_SCALE_MULTIPLIER,object.scale.y * @PAGE_SCALE_MULTIPLIER,object.scale.z * @PAGE_SCALE_MULTIPLIER) syncCss3dPlanePosition:(object)=> object.cssObj.position.set(object.position.x * @SCENE_SCALE_MULTIPLIER,object.position.y * @SCENE_SCALE_MULTIPLIER,object.position.z * @SCENE_SCALE_MULTIPLIER) syncCss3dPlaneRotation:(object)=> object.cssObj.quaternion.set(object.quaternion.x,object.quaternion.y,object.quaternion.z,object.quaternion.w) rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI / 2 ); object.cssObj.quaternion.multiply(rot2); getFocusedPagePosition:=> rotMat = new THREE.Matrix4(); rotMat.makeRotationFromQuaternion(@camera.quaternion); forward = new THREE.Vector3(0,0,-1); forward.applyMatrix4( rotMat ); forward.normalize(); right = new THREE.Vector3(1,0,0); right.applyMatrix4( rotMat ); right.normalize(); # 600 : 0.4 = height : x zDistance = (window.innerHeight*0.00065)#/600 # 1050 : 0 = width : x xDistance = 0 #- ( ( window.innerWidth- 1050) * 0.00054 ) right.multiplyScalar(xDistance); forward.multiplyScalar(zDistance); newPos = @camera.position.clone(); newPos.x -= @scene.position.x; newPos.y -= @scene.position.y; newPos.z -= @scene.position.z; newPos.x /= @SCENE_SCALE_MULTIPLIER; newPos.y /= @SCENE_SCALE_MULTIPLIER; newPos.z /= @SCENE_SCALE_MULTIPLIER; newPos.add(right); newPos.add(forward); return newPos; onWindowResize:()=> @CONTAINER_X = @container.position().left; @SCREEN_WIDTH = window.innerWidth - @CONTAINER_X @SCREEN_HEIGHT = window.innerHeight @windowHalfX = @SCREEN_WIDTH / 2; @windowHalfY = @SCREEN_HEIGHT / 2; @camera.aspect = @SCREEN_WIDTH / @SCREEN_HEIGHT; @camera.updateProjectionMatrix(); @renderer?.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @css3dRenderer?.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); if @isFocused pos = @getFocusedPagePosition() @clickedObject.position.set(pos.x,pos.y,pos.z) @clickedObject.cssObj.position.set(pos.x* @SCENE_SCALE_MULTIPLIER,pos.y* @SCENE_SCALE_MULTIPLIER,pos.z* @SCENE_SCALE_MULTIPLIER) @render() onMouseMove:(event)=> if !@isFocused event.originalEvent.preventDefault(); mx = event.clientX || event.originalEvent.touches?[0]?.clientX || 0 my = event.clientY || event.originalEvent.touches?[0]?.clientY || 0 @mouseX = ( (mx - @CONTAINER_X) - @windowHalfX ); @mouseY = ( my - @windowHalfY ); # @mouseX = mx - @CONTAINER_X; # @mouseY = my; @pickMouseX = ( (mx - @CONTAINER_X) / @SCREEN_WIDTH ) * 2 - 1; @pickMouseY = - ( my / @SCREEN_HEIGHT ) * 2 + 1; # console.log("MOVE") animate:()=> @render(); # @stats.update(); requestAnimationFrame( @animate ) if @doRender; render:()=> if !@isFocused rangeX = @maxCameraX - @minCameraX rangeY = @maxCameraY - @minCameraY if @lockedOnDeviceMotion || @prevMotionAnalysis.x != @motionAnalysis.rotation.x || @prevMotionAnalysis.y != @motionAnalysis.rotation.y || @prevMotionAnalysis.z != @motionAnalysis.rotation.z @deviceMotionChangeTimes++; if @deviceMotionChangeTimes >= 4 @lockedOnDeviceMotion = true lim = 4 mrX = Math.max( Math.min( @motionAnalysis.rotation.x , lim ), -lim ); mrY = Math.max( Math.min( @motionAnalysis.rotation.z , lim ), -lim ); camX = ( mrX * rangeX ) / (lim*2) camY = ( mrY * rangeY ) / (lim*2) else camX = ( @mouseX * rangeX ) / @SCREEN_WIDTH camY = ( -@mouseY * rangeY ) / @SCREEN_HEIGHT # console.log(camX,camY, @camera.position.x, @camera.position.y) if camX? && camY? && !isNaN(camX) && !isNaN(camY) @camera.position.x += ( camX - @camera.position.x ) * 0.05; @camera.position.y += ( camY - @camera.position.y ) * 0.05; # @camera.position.z += ( camZ - @camera.position.z ) * 0.05; @camera.lookAt( @cameraLookAt ); @prevMotionAnalysis.x = @motionAnalysis.rotation.x @prevMotionAnalysis.y = @motionAnalysis.rotation.y @prevMotionAnalysis.z = @motionAnalysis.rotation.z @calcPicking(); @renderer?.render( @scene, @camera ); @css3dRenderer?.render( @css3DScene, @camera ); calcPicking:()=> vector = new THREE.Vector3( @pickMouseX, @pickMouseY, 1 ); @projector.unprojectVector( vector, @camera ); @raycaster.set( @camera.position, vector.sub( @camera.position ).normalize() ); intersects = @raycaster.intersectObjects( @scene.children ); if @doPicking if intersects.length > 0 @handle3DPlaneMouseInteraction(intersects[ 0 ].object,"3d") else @handle3DPlaneMouseInteraction(null,"3d") @overObject = null; if @overObject? && !@isFocused $("body").css('cursor', 'pointer'); else $("body").css('cursor', ''); handle3DPlaneMouseInteraction:(object,initiator)=> if !object? && @overObject? @on3DPlaneMouseOut(@overObject) return if @overObject != object # intersects and it's different from before if @overObject @on3DPlaneMouseOut(@overObject,initiator) if @excludeFromPicking.indexOf(object.name) == -1 # filter picked objects @overObject = object; @on3DPlaneMouseOver(@overObject,initiator) if !@isFocused ga('send', 'event', '3d-plane:'+@overObject.link, 'over'); else @overObject = null; getUpDirs:(howMany)=> retValue = "" for i in [0...howMany] by 1 retValue += "../" return retValue; getRelativeLink:(objectPermalink)=> updirs = @getUpDirs(@pageDepth); if(@pageDepth > 0) return updirs.substr(0,updirs.length-1)+objectPermalink; else return "."+objectPermalink; checkWebGL:-> ua = navigator.userAgent.toLowerCase() isStockAndroid = /android/.test(ua) and !/chrome/.test(ua) try return !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl') and !isStockAndroid catch return false showLoading:=> $("body").spin lines : 8, # The number of lines to draw length : 8, # The length of each line width : 5, # The line thickness radius : 11, # The radius of the inner circle corners : 1, # Corner roundness (0..1) rotate : 0, # The rotation offset direction : 1, # 1: clockwise, -1: counterclockwise color : '#444', # #rgb or #rrggbb or array of colors speed : 1.3, # Rounds per second trail : 60, # Afterglow percentage shadow : true, # Whether to render a shadow hwaccel : true, # Whether to use hardware acceleration className : 'spinner', # The CSS class to assign to the spinner zIndex : 2e9, # The z-index (defaults to 2000000000) top : '50%', # Top position relative to parent in px left : '50%' # Left position relative to parent in px null hideLoading:=> $("body").spin(false) null
true
#import utils/MotionAnalysis #import utils/QueryString class App CONTAINER_X : 200; SCREEN_WIDTH : window.innerWidth - @CONTAINER_X; SCREEN_HEIGHT : window.innerHeight; FLOOR : -50; TRANSITION_DURATION : 0.5; PAGE_SCALE_MULTIPLIER : 0.1; SCENE_SCALE_MULTIPLIER : 100; CSS3D_SCALE_MULTIPLIER : 1; container : null; camera : null; scene : null; css3DScene : null; renderer : null; css3dRenderer : null; isWebGLCapable : false; isCSS3DCapable : false; isCanvasCapable : false; isIE11 : false; mouseX : 0; mouseY : 0; pickMouseX : -90000; pickMouseY : -90000; windowHalfX : @SCREEN_WIDTH / 2; windowHalfY : @SCREEN_HEIGHT / 2; projector : null; raycaster : null; overObject : null; excludeFromPicking : ["scene_baked_pPlane1"] initialObjectsProperties : {}; clickedObject : null; clickedObjectWPosition : null; clickedObjectWRotation : null; clickedObjectWScale : null; isFocused : false; doRender : true; pageLanguage : window.PAGE_LANG; pagePermalink : window.PAGE_PERMALINK; pageDepth : window.PAGE_DEPTH; pageBase : window.PAGE_BASE; pageId : ""; config : [] allLanguagesConfig : [] thisPageConfig : null page3DObjects : {} doPicking : true currentHistoryState : {} cameraLookAt : new THREE.Vector3(-50,-300,0) htmlMain : null delayID : -1 minCameraX : -250 maxCameraX : 250 minCameraY : -50 maxCameraY : 300 unfocusingTween : null motionAnalysis : null lockedOnDeviceMotion : false deviceMotionChangeTimes : 0 prevMotionAnalysis : x : 0 y : 0 z : 0 constructor:-> @isIE11 = !!window.MSInputMethodContext; @isCSS3DCapable = Modernizr.csstransforms3d && !@isIE11#Modernizr.transformstylepreserve3d @isWebGLCapable = @checkWebGL() && Modernizr.webgl @isPushStateCapable = Modernizr.history # disable canvas mode, too slow on ipads # @isCanvasCapable = Modernizr.canvas if @isCSS3DCapable && @isPushStateCapable && ( @isCanvasCapable || @isWebGLCapable )# minimum requirements @htmlMain = $("main") ga('send', 'event', 'webgl-test', 'passed'); $("body").css("overflow-y","hidden"); $("html").css("overflow-y","hidden"); TweenMax.to @htmlMain, 1, css: opacity:0 onComplete:(thisPage)=> @showLoading() TweenMax.to(@htmlMain,0,{css:{opacity: 1}}); @htmlMain.remove() $.ajax @pageBase+"config.json", success : @onConfigLoaded error : @onConfigError @init(); @animate(); else # we cannot continue, no webgl support ga('send', 'event', 'webgl-test', 'failed'); null init:-> @container = $( '.javascriptContent' ); @CONTAINER_X = @container.position().left; @SCREEN_WIDTH = window.innerWidth - @CONTAINER_X; @SCREEN_HEIGHT = window.innerHeight; @windowHalfX = @SCREEN_WIDTH / 2; @windowHalfY = @SCREEN_HEIGHT / 2; @motionAnalysis = new MotionAnalysis() @camera = new THREE.PerspectiveCamera( 75, @SCREEN_WIDTH / @SCREEN_HEIGHT, 1, 10000 ); @camera.position.z = 300; @scene = new THREE.Scene(); @css3DScene = new THREE.Scene(); @css3DScene.scale.set(@CSS3D_SCALE_MULTIPLIER,@CSS3D_SCALE_MULTIPLIER,@CSS3D_SCALE_MULTIPLIER) @css3DScene.updateMatrix(); if @isWebGLCapable @renderer = new THREE.WebGLRenderer antialias : true # sortObjects : false @renderer.gammeInput = true; @renderer.gammeOutput = true; else if @isCanvasCapable @renderer = new THREE.CanvasRenderer # sortObjects : false # sortElements : false @renderer.setClearColor( 0xffffff, 1 ); @renderer.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @renderer.domElement.style.position = "relative"; $(@renderer.domElement).addClass("threejs-container"); @container.append( @renderer.domElement ); @css3dRenderer = new THREE.CSS3DRenderer() @css3dRenderer.setClearColor( 0xffffff ); @css3dRenderer.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @css3dRenderer.domElement.style.position = "absolute"; @css3dRenderer.domElement.style.top = "0"; @css3dRenderer.domElement.style.left = "0"; $(@css3dRenderer.domElement).addClass("css3d-container"); @container.append( @css3dRenderer.domElement ); @projector = new THREE.Projector(); @raycaster = new THREE.Raycaster(); $(window).bind( 'resize', @onWindowResize ); @container.bind( 'mousemove touchmove touchstart', @onMouseMove ); @container.bind( 'click touchend', @on3DSceneMouseClick ); @container.bind( "transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd" , @onWindowResize); # link overrides $(".projectsMenu").find("a").mouseover(@onMenuLinkOver) $(".projectsMenu").find("a").mouseout(@onMenuLinkOut) $(".projectsMenu").find("a").click(@onMenuLinkClick) $(".menu").find("a").mouseover => @doPicking = false $(".menu").find("a").mouseout => @doPicking = true $(".close-page").click(@onCloseClick) $(window).bind("popstate",@onPopStateChange); @onWindowResize() TweenMax.to( $(".threejs-container"), 0, {css:{opacity:0}} ) TweenMax.to( $(".css3d-container"), 0, {css:{opacity:0}} ) if @pagePermalink? && @pagePermalink != "" @currentHistoryState = "/"+@pageLanguage+"/"+@pagePermalink+"/" else @currentHistoryState = "/"+@pageLanguage+"/" null onConfigLoaded:( data, textStatus, jqXHR )=> @allLanguagesConfig = data; @config = data[@pageLanguage] if !@config? throw "Cannot find config for this language" # load scene loader = new THREE.SceneLoader(); if @isWebGLCapable loader.load( @pageBase+"maya/data/scene.json", @sceneLoadCallback ); else loader.load( @pageBase+"maya/data/scene_canvas.json", @sceneLoadCallback ); null onPopStateChange:(event)=> return if !event.originalEvent.state? newPath = event.originalEvent.state.path; for page in @config if page.link == newPath @pageId = page.meta.id @thisPageConfig = page break @pageLanguage = @thisPageConfig.lang @pagePermalink = @thisPageConfig.meta.permalink @pageDepth = @thisPageConfig.depth if @pageBase == "./" && @thisPageConfig.base == "../" # this happens in the root doc @pageBase = "./" else @pageBase = @thisPageConfig.base; document.title = "PI:NAME:<NAME>END_PI - "+@thisPageConfig.meta.title obj3D = @page3DObjects[newPath]; if @unfocusingTween? && !@unfocusingTween._active @unfocusingTween = null if @unfocusingTween? # we are in the middle of an unfocus tween # we need to replace what happens next on the fly @unfocusingTween.vars.onCompleteParams[1] = => @clickedObject = @overObject = obj3D @unfocusingTween = null @focus() else if @isFocused # we are focused on a page if newPath != @currentHistoryState # a different page needs to be focused # we need to unfocus then focus again next @unfocus => @clickedObject = @overObject = obj3D @focus() else # we are roaming free in the 3d space, we need to focus on a page @overObject = @clickedObject = obj3D; @focus() if newPath != @currentHistoryState # change language change link on languages menu to go to the current page languageLinks = $(".languagesMenu").find("a"); for languageLink in languageLinks languageConfig = @allLanguagesConfig[languageLink.id] for page in languageConfig if page.meta.id == @pageId $(languageLink).attr("href", @getRelativeLink(page.link) ) #update selected project on the menu selectedMenuItem = @findMenuItemByPermalink( newPath, (item)=> item.removeClass("selected") , (item)=> item.attr("href", @pageBase+@getRelativeLink( item.attr("permalink") ).substr(1) ) item.removeClass("hover") ); # scroll menu to selected item if selectedMenuItem? selectedMenuItem.addClass("selected") @scrollMenuToItem(selectedMenuItem) ga('send', 'pageview', @thisPageConfig.link); @currentHistoryState = newPath; null scrollMenuToItem:(item)=> scrollTarget = $(".menu") targetPosition = item.position() scroller = scrollTarget.scrollTop() scrollToY = (targetPosition.top+scroller) - (@SCREEN_HEIGHT/2) TweenMax.to(scrollTarget[0], 0.5, {scrollTo:{y:scrollToY}, ease:Power2.easeOut}); null onMenuLinkOver:(event)=> if !@isFocused obj3D = @page3DObjects[ $(event.currentTarget).attr("permalink") ]; @handle3DPlaneMouseInteraction(obj3D,"menu") null onMenuLinkOut:(event)=> null onMenuLinkClick:(event)=> event.originalEvent.preventDefault(); @on3DPlaneMouseOut(@overObject) @overObject = null @handlePushState( $(event.currentTarget).attr("permalink") ) null onCloseClick:=> ga('send', 'event', 'close-page-button', 'click'); @unfocus() null on3DPlaneMouseOver:(plane,source)=> if !@isFocused if @isWebGLCapable TweenMax.to( plane.material.uniforms.color_opacity, 0.5, {value:1} ); if source != "menu" menuItem = @findMenuItemByPermalink plane.page.attr("permalink"), (item) -> item.removeClass("hover") menuItem.addClass("hover") @scrollMenuToItem(menuItem) null on3DPlaneMouseOut:(plane,source)=> return if !plane? if @isWebGLCapable TweenMax.to( plane.material.uniforms.color_opacity, 0.5, {value:0} ); if !@isFocused menuItem = @findMenuItemByPermalink( plane.page.attr("permalink") ) menuItem.removeClass("hover") null findMenuItemByPermalink:(permalink,executeOnOthers,executeOnAll)=> projectsLinks = $(".projectsMenu").find("a"); retValue = null for menuItem in projectsLinks projectLink = $(menuItem) if projectLink.attr("permalink") == permalink retValue = projectLink else executeOnOthers?( projectLink ) executeOnAll?( projectLink ) return retValue on3DSceneMouseClick:(event)=> @calcPicking() if !@overObject? # required to unfocus ( click outside focused plane ) if !@isFocused if @overObject @clickedObject = @overObject; @focus(); else if !@overObject @unfocus(); ga('send', 'event', '3d-empty-space', 'click'); return; ga('send', 'event', '3d-plane:'+@overObject.link, 'click'); @handlePushState(@overObject.link) handlePushState:(path)=> stateObj = {path:path} if path != @currentHistoryState history.pushState(stateObj,"Title",@pageBase+path.substr(1)) @onPopStateChange originalEvent: state: stateObj onConfigError:(jqXHR,textStatus,errorThrown )=> throw errorThrown onTouchStart:(event)=> onTouchMove:(event)=> onTouchEnd:(event)=> setupCSS3DPage: ( pageObj, object, link )=> pageObj.css opacity : 0 display : "none" cssObj = new THREE.CSS3DObject( pageObj[0] ); cssObj.rotation.order = "ZYX"; cssObj.position.set(object.position.x * @SCENE_SCALE_MULTIPLIER,object.position.y * @SCENE_SCALE_MULTIPLIER,object.position.z * @SCENE_SCALE_MULTIPLIER); cssObj.quaternion.set(object.quaternion.x,object.quaternion.y,object.quaternion.z,object.quaternion.w); rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI / 2 ); cssObj.quaternion.multiply(rot2); cssObj.scale.set(object.scale.x * @PAGE_SCALE_MULTIPLIER,object.scale.y * @PAGE_SCALE_MULTIPLIER,object.scale.z * @PAGE_SCALE_MULTIPLIER); object.page = pageObj; object.cssObj = cssObj; @css3DScene.add( cssObj ) null; sceneLoadCallback: ( result )=> $(".page-container").css display : "none" # Generate colors (as Chroma.js objects) @colors = paletteGenerator.generate result.scene.children.length, # Colors (color)-> # This function filters valid colors hcl = color.hcl(); return hcl[0] >= 0 && hcl[0] <= 360 && hcl[1] >= 0 && hcl[1] <= 0.9 && hcl[2] >= 1 && hcl[2] <= 1.5; , false, # Using Force Vector instead of k-Means 50 # Steps (quality) # Sort colors by differenciation first @colors = paletteGenerator.diffSort(@colors); objectIndex = 0; thisPage = null; result.scene.traverse (object)=> object.rotation.order = "ZYX"; if object.material? if @excludeFromPicking.indexOf(object.name) == -1 @initialObjectsProperties[object.name] = {} @initialObjectsProperties[object.name].position = object.position.clone(); @initialObjectsProperties[object.name].quaternion = object.quaternion.clone(); @initialObjectsProperties[object.name].scale = object.scale.clone(); if @config[objectIndex]? object.config = @config[objectIndex] @page3DObjects[@config[objectIndex].link] = object; link = object.link = @config[objectIndex].link; container = $("<div class='object3DContainer' permalink='"+link+"'></div>") if object.config.meta.permalink == @pagePermalink || ( object.config.meta.permalink == null && @pagePermalink == "" ) # don't load ourselves @htmlMain.find("#no-webgl-warning").remove() @htmlMain.find(".no-webgl-warning-button").remove() container.append(@htmlMain) thisPage = link @setupCSS3DPage( container , object, link ) else @excludeFromPicking.push(object.name) objectIndex++; if @isWebGLCapable # replace material with our simple webgl one @replaceThreeJsMaterial(object,objectIndex) if object.name != "scene_baked_pPlane1" object.material.uniforms.fresnelIntensity.value = 1; else # replace material with a simple threejs one object.material = new THREE.MeshBasicMaterial lights : false fog: false shading: THREE.FlatShading map : object.material.map object.material.overdraw = true object.material.transparent = true; object.material.opacity = 1; object.material.side = THREE.DoubleSide; if object.geometry? object.geometry.computeFaceNormals(); object.geometry.computeVertexNormals(); # object.geometry.computeCentroids(); object.geometry.computeTangents(); object.geometry.computeBoundingBox(); object.updateMatrix(); @scene = result.scene; @scene.position.set(0,-450,0) @css3DScene.position.set(0,-450,0) @scene.scale.set(@SCENE_SCALE_MULTIPLIER,@SCENE_SCALE_MULTIPLIER,@SCENE_SCALE_MULTIPLIER) @scene.updateMatrix(); @css3DScene.updateMatrix(); @hideLoading() TweenMax.to $(".threejs-container"), 1, css: opacity:1 TweenMax.to $(".css3d-container"), 1, css: opacity:1 onCompleteParams: [thisPage] onCompleteParams: [thisPage] onComplete:(thisPage)=> if thisPage? @handlePushState(thisPage) null; replaceThreeJsMaterial:(object,objectIndex)=> uniforms = THREE.UniformsUtils.clone(THREE.PlaneShader.uniforms) # uniforms.focus_balance.value = 0; uniforms.color_opacity.value = 0; uniforms.opacity.value = 1; uniforms.diffuse.value.set( @colors[objectIndex].rgb[0] / 255 , @colors[objectIndex].rgb[1] /255 , @colors[objectIndex].rgb[2] /255 ) uniforms.map.value = object.material.map defines = {} defines["USE_MAP"] = ""; # defines["GAMMA_OUTPUT"] = ""; if @isIE11 # IE11 doesn't support gl_frontFacing defines["NO_FRESNEL"] = ""; material = new THREE.ShaderMaterial uniforms: uniforms attributes: {} vertexShader: THREE.PlaneShader.vertexShader fragmentShader: THREE.PlaneShader.fragmentShader transparent: true lights : false fog : false shading: THREE.FlatShading defines : defines; object.material = material; focus:(callback)=> @isFocused = true; pageIsLoaded = @clickedObject.page.find("main").length > 0 if !pageIsLoaded @showLoading() $.ajax @getRelativeLink( @clickedObject.page.attr("permalink") ), success : ( data, textStatus, jqXHR ) => mainArticle = $(data).find("main") mainArticle.find("#no-webgl-warning").remove() mainArticle.find(".no-webgl-warning-button").remove() @clickedObject.page.append( mainArticle ) @focus() error : (jqXHR,textStatus,errorThrown ) => console.error(textStatus); return @hideLoading(); # mouseout all planes @scene.traverse (object)=> if object.material? @on3DPlaneMouseOut(object) @clickedObjectWPosition = @initialObjectsProperties[@clickedObject.name].position.clone(); @clickedObjectWRotation = @initialObjectsProperties[@clickedObject.name].quaternion.clone(); @clickedObjectWScale = @initialObjectsProperties[@clickedObject.name].scale.clone(); newPos = @getFocusedPagePosition(); @clickedObject.page.css "pointer-events" : "none" TweenMax.to @clickedObject.position, @TRANSITION_DURATION, x : newPos.x y : newPos.y z : newPos.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlanePosition onCompleteParams : [@clickedObject,callback] onComplete : (object,callback)=> object.page.css "pointer-events" : "" @doRender = false; @syncCss3dPlanePosition(object); @onWindowResize(); @render(); callback?(); camRot = @camera.quaternion.clone(); rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), Math.PI / 2 ); camRot.multiply(rot2); TweenMax.to @clickedObject.quaternion, @TRANSITION_DURATION, x : camRot.x y : camRot.y z : camRot.z w : camRot.w onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneRotation onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneRotation TweenMax.to @clickedObject.scale, @TRANSITION_DURATION, x : 1 y : 1 z : 1 onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneScale onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneScale if @isWebGLCapable TweenMax.to @clickedObject.material.uniforms.opacity, @TRANSITION_DURATION, value:0 else TweenMax.to @clickedObject.material, @TRANSITION_DURATION, opacity:0 @clickedObject.page.css display : "block" TweenMax.to @clickedObject.page[0], @TRANSITION_DURATION, css: opacity:1 $(".close-page").show(); null; unfocus:(callback)=> @doRender = true @isFocused = false; @animate() TweenMax.to @clickedObject.position, @TRANSITION_DURATION, x : @clickedObjectWPosition.x y : @clickedObjectWPosition.y z : @clickedObjectWPosition.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlanePosition onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlanePosition TweenMax.to @clickedObject.quaternion, @TRANSITION_DURATION, x : @clickedObjectWRotation.x y : @clickedObjectWRotation.y z : @clickedObjectWRotation.z w : @clickedObjectWRotation.w onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneRotation onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneRotation TweenMax.to @clickedObject.scale, @TRANSITION_DURATION, x : @clickedObjectWScale.x y : @clickedObjectWScale.y z : @clickedObjectWScale.z onUpdateParams : [@clickedObject] onUpdate : @syncCss3dPlaneScale onCompleteParams : [@clickedObject] onComplete : @syncCss3dPlaneScale if @isWebGLCapable TweenMax.to @clickedObject.material.uniforms.opacity, @TRANSITION_DURATION, value:1 else TweenMax.to @clickedObject.material, @TRANSITION_DURATION, opacity:1 @unfocusingTween = TweenMax.to @clickedObject.page[0], @TRANSITION_DURATION, css: opacity:0 onCompleteParams: [@clickedObject,callback] onComplete:(object,callback)=> object.page.find("main").remove() object.page.css display : "none" @unfocusingTween = null callback?(); $(".close-page").hide(); null; syncCss3dPlaneScale:(object)=> object.cssObj.scale.set(object.scale.x * @PAGE_SCALE_MULTIPLIER,object.scale.y * @PAGE_SCALE_MULTIPLIER,object.scale.z * @PAGE_SCALE_MULTIPLIER) syncCss3dPlanePosition:(object)=> object.cssObj.position.set(object.position.x * @SCENE_SCALE_MULTIPLIER,object.position.y * @SCENE_SCALE_MULTIPLIER,object.position.z * @SCENE_SCALE_MULTIPLIER) syncCss3dPlaneRotation:(object)=> object.cssObj.quaternion.set(object.quaternion.x,object.quaternion.y,object.quaternion.z,object.quaternion.w) rot2 = new THREE.Quaternion(); rot2.setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI / 2 ); object.cssObj.quaternion.multiply(rot2); getFocusedPagePosition:=> rotMat = new THREE.Matrix4(); rotMat.makeRotationFromQuaternion(@camera.quaternion); forward = new THREE.Vector3(0,0,-1); forward.applyMatrix4( rotMat ); forward.normalize(); right = new THREE.Vector3(1,0,0); right.applyMatrix4( rotMat ); right.normalize(); # 600 : 0.4 = height : x zDistance = (window.innerHeight*0.00065)#/600 # 1050 : 0 = width : x xDistance = 0 #- ( ( window.innerWidth- 1050) * 0.00054 ) right.multiplyScalar(xDistance); forward.multiplyScalar(zDistance); newPos = @camera.position.clone(); newPos.x -= @scene.position.x; newPos.y -= @scene.position.y; newPos.z -= @scene.position.z; newPos.x /= @SCENE_SCALE_MULTIPLIER; newPos.y /= @SCENE_SCALE_MULTIPLIER; newPos.z /= @SCENE_SCALE_MULTIPLIER; newPos.add(right); newPos.add(forward); return newPos; onWindowResize:()=> @CONTAINER_X = @container.position().left; @SCREEN_WIDTH = window.innerWidth - @CONTAINER_X @SCREEN_HEIGHT = window.innerHeight @windowHalfX = @SCREEN_WIDTH / 2; @windowHalfY = @SCREEN_HEIGHT / 2; @camera.aspect = @SCREEN_WIDTH / @SCREEN_HEIGHT; @camera.updateProjectionMatrix(); @renderer?.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); @css3dRenderer?.setSize( @SCREEN_WIDTH, @SCREEN_HEIGHT ); if @isFocused pos = @getFocusedPagePosition() @clickedObject.position.set(pos.x,pos.y,pos.z) @clickedObject.cssObj.position.set(pos.x* @SCENE_SCALE_MULTIPLIER,pos.y* @SCENE_SCALE_MULTIPLIER,pos.z* @SCENE_SCALE_MULTIPLIER) @render() onMouseMove:(event)=> if !@isFocused event.originalEvent.preventDefault(); mx = event.clientX || event.originalEvent.touches?[0]?.clientX || 0 my = event.clientY || event.originalEvent.touches?[0]?.clientY || 0 @mouseX = ( (mx - @CONTAINER_X) - @windowHalfX ); @mouseY = ( my - @windowHalfY ); # @mouseX = mx - @CONTAINER_X; # @mouseY = my; @pickMouseX = ( (mx - @CONTAINER_X) / @SCREEN_WIDTH ) * 2 - 1; @pickMouseY = - ( my / @SCREEN_HEIGHT ) * 2 + 1; # console.log("MOVE") animate:()=> @render(); # @stats.update(); requestAnimationFrame( @animate ) if @doRender; render:()=> if !@isFocused rangeX = @maxCameraX - @minCameraX rangeY = @maxCameraY - @minCameraY if @lockedOnDeviceMotion || @prevMotionAnalysis.x != @motionAnalysis.rotation.x || @prevMotionAnalysis.y != @motionAnalysis.rotation.y || @prevMotionAnalysis.z != @motionAnalysis.rotation.z @deviceMotionChangeTimes++; if @deviceMotionChangeTimes >= 4 @lockedOnDeviceMotion = true lim = 4 mrX = Math.max( Math.min( @motionAnalysis.rotation.x , lim ), -lim ); mrY = Math.max( Math.min( @motionAnalysis.rotation.z , lim ), -lim ); camX = ( mrX * rangeX ) / (lim*2) camY = ( mrY * rangeY ) / (lim*2) else camX = ( @mouseX * rangeX ) / @SCREEN_WIDTH camY = ( -@mouseY * rangeY ) / @SCREEN_HEIGHT # console.log(camX,camY, @camera.position.x, @camera.position.y) if camX? && camY? && !isNaN(camX) && !isNaN(camY) @camera.position.x += ( camX - @camera.position.x ) * 0.05; @camera.position.y += ( camY - @camera.position.y ) * 0.05; # @camera.position.z += ( camZ - @camera.position.z ) * 0.05; @camera.lookAt( @cameraLookAt ); @prevMotionAnalysis.x = @motionAnalysis.rotation.x @prevMotionAnalysis.y = @motionAnalysis.rotation.y @prevMotionAnalysis.z = @motionAnalysis.rotation.z @calcPicking(); @renderer?.render( @scene, @camera ); @css3dRenderer?.render( @css3DScene, @camera ); calcPicking:()=> vector = new THREE.Vector3( @pickMouseX, @pickMouseY, 1 ); @projector.unprojectVector( vector, @camera ); @raycaster.set( @camera.position, vector.sub( @camera.position ).normalize() ); intersects = @raycaster.intersectObjects( @scene.children ); if @doPicking if intersects.length > 0 @handle3DPlaneMouseInteraction(intersects[ 0 ].object,"3d") else @handle3DPlaneMouseInteraction(null,"3d") @overObject = null; if @overObject? && !@isFocused $("body").css('cursor', 'pointer'); else $("body").css('cursor', ''); handle3DPlaneMouseInteraction:(object,initiator)=> if !object? && @overObject? @on3DPlaneMouseOut(@overObject) return if @overObject != object # intersects and it's different from before if @overObject @on3DPlaneMouseOut(@overObject,initiator) if @excludeFromPicking.indexOf(object.name) == -1 # filter picked objects @overObject = object; @on3DPlaneMouseOver(@overObject,initiator) if !@isFocused ga('send', 'event', '3d-plane:'+@overObject.link, 'over'); else @overObject = null; getUpDirs:(howMany)=> retValue = "" for i in [0...howMany] by 1 retValue += "../" return retValue; getRelativeLink:(objectPermalink)=> updirs = @getUpDirs(@pageDepth); if(@pageDepth > 0) return updirs.substr(0,updirs.length-1)+objectPermalink; else return "."+objectPermalink; checkWebGL:-> ua = navigator.userAgent.toLowerCase() isStockAndroid = /android/.test(ua) and !/chrome/.test(ua) try return !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl') and !isStockAndroid catch return false showLoading:=> $("body").spin lines : 8, # The number of lines to draw length : 8, # The length of each line width : 5, # The line thickness radius : 11, # The radius of the inner circle corners : 1, # Corner roundness (0..1) rotate : 0, # The rotation offset direction : 1, # 1: clockwise, -1: counterclockwise color : '#444', # #rgb or #rrggbb or array of colors speed : 1.3, # Rounds per second trail : 60, # Afterglow percentage shadow : true, # Whether to render a shadow hwaccel : true, # Whether to use hardware acceleration className : 'spinner', # The CSS class to assign to the spinner zIndex : 2e9, # The z-index (defaults to 2000000000) top : '50%', # Top position relative to parent in px left : '50%' # Left position relative to parent in px null hideLoading:=> $("body").spin(false) null
[ { "context": "Through()\n input = 'https://github.com/janraasch?tab=repositories'\n\n $('#typeahead')\n ", "end": 3063, "score": 0.999727725982666, "start": 3054, "tag": "USERNAME", "value": "janraasch" }, { "context": " $('#typeahead')\n ...
test/popup.spec.coffee
leao-nardo/tab-ahead
80
describe 'Tab Ahead. Popup', -> # --> Constants shared with `options.coffee` QUERY = ALL: 'all' CURRENT: 'current' PREF_QUERY = 'pref/query' # Constants shared with `options.coffee` <-- # Mocking birds window.chrome = windows: update: (windowId, updateInfo, callback) -> callback?() WINDOW_ID_CURRENT: 271 tabs: query: (queryInfo, callback) -> if queryInfo.currentWindow $.getJSON 'base/test/fixtures/currentwindow.json', (data) -> callback data else $.getJSON 'base/test/fixtures/allwindows.json', (data) -> callback data update: (tabId, updateProperties, callback) -> callback() beforeEach -> setFixtures window.__html__['test/fixtures/form.html'] window.localStorage[PREF_QUERY] = undefined window.tabahead window.jQuery, window.Fuse, window.chrome, window.setTimeout, window.localStorage describe 'loaded without exploding', -> it 'is available', -> (expect window.tabahead).toBeDefined() (expect window.tabahead).toEqual jasmine.any Function describe 'expects the chrome environment', -> it 'expects to find a form.navbar-search', -> (expect $ 'body').toContainElement 'form.navbar-search' it 'expects to find an input#typeahead', -> (expect $ 'form.navbar-search').toContainElement 'input#typeahead' describe 'Initially the input', -> it 'should be focused', -> (expect $ 'input#typeahead').toBeFocused() describe 'Typing some text into the input field', -> queryTabsSpy = {} beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() $('#typeahead') .val('jan') .trigger('keyup') it 'should ask chrome API `tabs.query', -> (expect queryTabsSpy).toHaveBeenCalled() it 'should query the current window by default', -> (expect queryTabsSpy.calls.all()[0].args[0].currentWindow).toBe true it 'should show suggestions', (done) -> interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval (expect $ 'ul').toHaveLength(1) # Add `\n` due to `new line at the end of the fixture. # console.log(($ 'ul').html()) # uncomment when updating fuse.js :-) (expect ($ 'ul').html() + '\n').toBe window.__html__['test/fixtures/suggestions.html'] done() , 1 describe 'even with query input longer than 32 characters', -> queryTabsSpy = {} beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() input = 'https://github.com/janraasch?tab=repositories' $('#typeahead') .val(input) .trigger('keyup') it 'should show suggestions', (done) -> interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval (expect $ 'ul').toHaveLength(1) # Add `\n` due to `new line at the end of the fixture. (expect ($ 'ul').html() + '\n').toBe window.__html__['test/fixtures/suggestions2.html'] done() , 1 describe 'with the `pref/query` set to `all`', -> queryTabsSpy = {} beforeEach -> window.localStorage[PREF_QUERY] = QUERY.ALL beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() $('#typeahead') .val('jan') .trigger('keyup') it 'should query all windows', -> (expect queryTabsSpy.calls.all()[0].args[0]).toEqual({}) describe 'Selecting a suggestion', -> closeSpy = {} updateSpy = {} result = {} li = {} beforeEach -> updateSpy = (spyOn window.chrome.tabs, 'update').and.callThrough() closeSpy = spyOn window, 'close' describe 'inside the current window', -> beforeEach (done) -> $('#typeahead') .val('jan') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'by hitting return', -> beforeEach -> li = $ 'li:nth-child(1)' result = li.data 'value' $('input').trigger($.Event 'keyup', keyCode: 13) it 'should update the tab and close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'by click', -> beforeEach -> li = $ 'li:nth-child(2)' result = li.data 'value' ($ li).trigger 'mouseenter' ($ li).trigger 'click' it 'should update the tab and close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'inside a different window', -> updateWindowSpy = {} beforeEach -> updateWindowSpy = (spyOn window.chrome.windows, 'update').and.callThrough() window.localStorage[PREF_QUERY] = QUERY.ALL beforeEach (done) -> $('#typeahead') .val('jan') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'by click', -> beforeEach -> li = $ 'li:nth-child(2)' result = li.data 'value' ($ li).trigger 'mouseenter' ($ li).trigger 'click' it 'should update the tab and focus the other window, plus close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect updateWindowSpy).toHaveBeenCalled() (expect updateWindowSpy.calls.mostRecent().args[0]).toBe result.item.windowId (expect updateWindowSpy.calls.mostRecent().args[1]).toEqual focused: true (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'If there is no match', -> updateSpy = {} beforeEach (done) -> updateSpy = spyOn window.chrome.tabs, 'update' $('#typeahead') .val('jan') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'hitting enter', -> beforeEach (done) -> $('#typeahead') .val('janjanjanjanjanjanjanjan') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval jasmine.clock().install() ($ '#typeahead').trigger($.Event 'keyup', keyCode: 13) jasmine.clock().tick 100 done() , 1 afterEach -> jasmine.clock().uninstall() it 'should not update the tab', -> (expect updateSpy).not.toHaveBeenCalled() it 'should clear the input', -> ($ '#typeahead').trigger('submit') (expect ($ '#typeahead').val()).toBe ''
48181
describe 'Tab Ahead. Popup', -> # --> Constants shared with `options.coffee` QUERY = ALL: 'all' CURRENT: 'current' PREF_QUERY = 'pref/query' # Constants shared with `options.coffee` <-- # Mocking birds window.chrome = windows: update: (windowId, updateInfo, callback) -> callback?() WINDOW_ID_CURRENT: 271 tabs: query: (queryInfo, callback) -> if queryInfo.currentWindow $.getJSON 'base/test/fixtures/currentwindow.json', (data) -> callback data else $.getJSON 'base/test/fixtures/allwindows.json', (data) -> callback data update: (tabId, updateProperties, callback) -> callback() beforeEach -> setFixtures window.__html__['test/fixtures/form.html'] window.localStorage[PREF_QUERY] = undefined window.tabahead window.jQuery, window.Fuse, window.chrome, window.setTimeout, window.localStorage describe 'loaded without exploding', -> it 'is available', -> (expect window.tabahead).toBeDefined() (expect window.tabahead).toEqual jasmine.any Function describe 'expects the chrome environment', -> it 'expects to find a form.navbar-search', -> (expect $ 'body').toContainElement 'form.navbar-search' it 'expects to find an input#typeahead', -> (expect $ 'form.navbar-search').toContainElement 'input#typeahead' describe 'Initially the input', -> it 'should be focused', -> (expect $ 'input#typeahead').toBeFocused() describe 'Typing some text into the input field', -> queryTabsSpy = {} beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() $('#typeahead') .val('jan') .trigger('keyup') it 'should ask chrome API `tabs.query', -> (expect queryTabsSpy).toHaveBeenCalled() it 'should query the current window by default', -> (expect queryTabsSpy.calls.all()[0].args[0].currentWindow).toBe true it 'should show suggestions', (done) -> interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval (expect $ 'ul').toHaveLength(1) # Add `\n` due to `new line at the end of the fixture. # console.log(($ 'ul').html()) # uncomment when updating fuse.js :-) (expect ($ 'ul').html() + '\n').toBe window.__html__['test/fixtures/suggestions.html'] done() , 1 describe 'even with query input longer than 32 characters', -> queryTabsSpy = {} beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() input = 'https://github.com/janraasch?tab=repositories' $('#typeahead') .val(input) .trigger('keyup') it 'should show suggestions', (done) -> interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval (expect $ 'ul').toHaveLength(1) # Add `\n` due to `new line at the end of the fixture. (expect ($ 'ul').html() + '\n').toBe window.__html__['test/fixtures/suggestions2.html'] done() , 1 describe 'with the `pref/query` set to `all`', -> queryTabsSpy = {} beforeEach -> window.localStorage[PREF_QUERY] = QUERY.ALL beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() $('#typeahead') .val('<NAME>') .trigger('keyup') it 'should query all windows', -> (expect queryTabsSpy.calls.all()[0].args[0]).toEqual({}) describe 'Selecting a suggestion', -> closeSpy = {} updateSpy = {} result = {} li = {} beforeEach -> updateSpy = (spyOn window.chrome.tabs, 'update').and.callThrough() closeSpy = spyOn window, 'close' describe 'inside the current window', -> beforeEach (done) -> $('#typeahead') .val('<NAME>') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'by hitting return', -> beforeEach -> li = $ 'li:nth-child(1)' result = li.data 'value' $('input').trigger($.Event 'keyup', keyCode: 13) it 'should update the tab and close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'by click', -> beforeEach -> li = $ 'li:nth-child(2)' result = li.data 'value' ($ li).trigger 'mouseenter' ($ li).trigger 'click' it 'should update the tab and close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'inside a different window', -> updateWindowSpy = {} beforeEach -> updateWindowSpy = (spyOn window.chrome.windows, 'update').and.callThrough() window.localStorage[PREF_QUERY] = QUERY.ALL beforeEach (done) -> $('#typeahead') .val('<NAME>') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'by click', -> beforeEach -> li = $ 'li:nth-child(2)' result = li.data 'value' ($ li).trigger 'mouseenter' ($ li).trigger 'click' it 'should update the tab and focus the other window, plus close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect updateWindowSpy).toHaveBeenCalled() (expect updateWindowSpy.calls.mostRecent().args[0]).toBe result.item.windowId (expect updateWindowSpy.calls.mostRecent().args[1]).toEqual focused: true (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'If there is no match', -> updateSpy = {} beforeEach (done) -> updateSpy = spyOn window.chrome.tabs, 'update' $('#typeahead') .val('<NAME>') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'hitting enter', -> beforeEach (done) -> $('#typeahead') .val('<NAME>janjanjanjanjan<NAME>') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval jasmine.clock().install() ($ '#typeahead').trigger($.Event 'keyup', keyCode: 13) jasmine.clock().tick 100 done() , 1 afterEach -> jasmine.clock().uninstall() it 'should not update the tab', -> (expect updateSpy).not.toHaveBeenCalled() it 'should clear the input', -> ($ '#typeahead').trigger('submit') (expect ($ '#typeahead').val()).toBe ''
true
describe 'Tab Ahead. Popup', -> # --> Constants shared with `options.coffee` QUERY = ALL: 'all' CURRENT: 'current' PREF_QUERY = 'pref/query' # Constants shared with `options.coffee` <-- # Mocking birds window.chrome = windows: update: (windowId, updateInfo, callback) -> callback?() WINDOW_ID_CURRENT: 271 tabs: query: (queryInfo, callback) -> if queryInfo.currentWindow $.getJSON 'base/test/fixtures/currentwindow.json', (data) -> callback data else $.getJSON 'base/test/fixtures/allwindows.json', (data) -> callback data update: (tabId, updateProperties, callback) -> callback() beforeEach -> setFixtures window.__html__['test/fixtures/form.html'] window.localStorage[PREF_QUERY] = undefined window.tabahead window.jQuery, window.Fuse, window.chrome, window.setTimeout, window.localStorage describe 'loaded without exploding', -> it 'is available', -> (expect window.tabahead).toBeDefined() (expect window.tabahead).toEqual jasmine.any Function describe 'expects the chrome environment', -> it 'expects to find a form.navbar-search', -> (expect $ 'body').toContainElement 'form.navbar-search' it 'expects to find an input#typeahead', -> (expect $ 'form.navbar-search').toContainElement 'input#typeahead' describe 'Initially the input', -> it 'should be focused', -> (expect $ 'input#typeahead').toBeFocused() describe 'Typing some text into the input field', -> queryTabsSpy = {} beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() $('#typeahead') .val('jan') .trigger('keyup') it 'should ask chrome API `tabs.query', -> (expect queryTabsSpy).toHaveBeenCalled() it 'should query the current window by default', -> (expect queryTabsSpy.calls.all()[0].args[0].currentWindow).toBe true it 'should show suggestions', (done) -> interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval (expect $ 'ul').toHaveLength(1) # Add `\n` due to `new line at the end of the fixture. # console.log(($ 'ul').html()) # uncomment when updating fuse.js :-) (expect ($ 'ul').html() + '\n').toBe window.__html__['test/fixtures/suggestions.html'] done() , 1 describe 'even with query input longer than 32 characters', -> queryTabsSpy = {} beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() input = 'https://github.com/janraasch?tab=repositories' $('#typeahead') .val(input) .trigger('keyup') it 'should show suggestions', (done) -> interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval (expect $ 'ul').toHaveLength(1) # Add `\n` due to `new line at the end of the fixture. (expect ($ 'ul').html() + '\n').toBe window.__html__['test/fixtures/suggestions2.html'] done() , 1 describe 'with the `pref/query` set to `all`', -> queryTabsSpy = {} beforeEach -> window.localStorage[PREF_QUERY] = QUERY.ALL beforeEach -> queryTabsSpy = (spyOn window.chrome.tabs, 'query').and.callThrough() $('#typeahead') .val('PI:NAME:<NAME>END_PI') .trigger('keyup') it 'should query all windows', -> (expect queryTabsSpy.calls.all()[0].args[0]).toEqual({}) describe 'Selecting a suggestion', -> closeSpy = {} updateSpy = {} result = {} li = {} beforeEach -> updateSpy = (spyOn window.chrome.tabs, 'update').and.callThrough() closeSpy = spyOn window, 'close' describe 'inside the current window', -> beforeEach (done) -> $('#typeahead') .val('PI:NAME:<NAME>END_PI') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'by hitting return', -> beforeEach -> li = $ 'li:nth-child(1)' result = li.data 'value' $('input').trigger($.Event 'keyup', keyCode: 13) it 'should update the tab and close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'by click', -> beforeEach -> li = $ 'li:nth-child(2)' result = li.data 'value' ($ li).trigger 'mouseenter' ($ li).trigger 'click' it 'should update the tab and close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'inside a different window', -> updateWindowSpy = {} beforeEach -> updateWindowSpy = (spyOn window.chrome.windows, 'update').and.callThrough() window.localStorage[PREF_QUERY] = QUERY.ALL beforeEach (done) -> $('#typeahead') .val('PI:NAME:<NAME>END_PI') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'by click', -> beforeEach -> li = $ 'li:nth-child(2)' result = li.data 'value' ($ li).trigger 'mouseenter' ($ li).trigger 'click' it 'should update the tab and focus the other window, plus close the popup', (done) -> interval = setInterval -> if updateSpy.calls.count() clearInterval interval (expect updateSpy).toHaveBeenCalled() (expect updateSpy.calls.mostRecent().args[0]).toBe result.item.id (expect updateSpy.calls.mostRecent().args[1]).toEqual active: true (expect updateSpy.calls.mostRecent().args[2]).toEqual jasmine.any Function (expect updateWindowSpy).toHaveBeenCalled() (expect updateWindowSpy.calls.mostRecent().args[0]).toBe result.item.windowId (expect updateWindowSpy.calls.mostRecent().args[1]).toEqual focused: true (expect closeSpy).toHaveBeenCalled() done() , 1 describe 'If there is no match', -> updateSpy = {} beforeEach (done) -> updateSpy = spyOn window.chrome.tabs, 'update' $('#typeahead') .val('PI:NAME:<NAME>END_PI') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval done() , 1 describe 'hitting enter', -> beforeEach (done) -> $('#typeahead') .val('PI:NAME:<NAME>END_PIjanjanjanjanjanPI:NAME:<NAME>END_PI') .trigger('keyup') interval = setInterval -> if ($ 'ul').length > 0 clearInterval interval jasmine.clock().install() ($ '#typeahead').trigger($.Event 'keyup', keyCode: 13) jasmine.clock().tick 100 done() , 1 afterEach -> jasmine.clock().uninstall() it 'should not update the tab', -> (expect updateSpy).not.toHaveBeenCalled() it 'should clear the input', -> ($ '#typeahead').trigger('submit') (expect ($ '#typeahead').val()).toBe ''
[ { "context": "###\nGlobal Functionalities and Boot Up\n\n@author\t\tMichael Owens\n@website\t\thttp://www.michaelowens.nl\n@copyright\tM", "end": 62, "score": 0.9998984336853027, "start": 49, "tag": "NAME", "value": "Michael Owens" }, { "context": "s\n@website\t\thttp://www.michaelow...
plugins/global.coffee
andreineculau/coffee-bot
0
### Global Functionalities and Boot Up @author Michael Owens @website http://www.michaelowens.nl @copyright Michael Owens 2011 ### Plugin = require '../lib/plugin' Channel = require '../lib/channel' module.exports = class PluginGlobal extends Plugin onNumeric: (context) -> # 376 is end of MOTD/modes return if context.command isnt '376' userchans = @irc.config.channels # userchannels i = 0 while i < userchans.length channelName = userchans[i] password = undefined if typeof (channelName) is 'object' password = channelName.password channelName = channelName.name chan = new Channel(@irc, channelName, true, password) @irc.channels[chan.name] = chan i++
15916
### Global Functionalities and Boot Up @author <NAME> @website http://www.michaelowens.nl @copyright <NAME> 2011 ### Plugin = require '../lib/plugin' Channel = require '../lib/channel' module.exports = class PluginGlobal extends Plugin onNumeric: (context) -> # 376 is end of MOTD/modes return if context.command isnt '376' userchans = @irc.config.channels # userchannels i = 0 while i < userchans.length channelName = userchans[i] password = <PASSWORD> if typeof (channelName) is 'object' password = <PASSWORD> channelName = channelName.name chan = new Channel(@irc, channelName, true, password) @irc.channels[chan.name] = chan i++
true
### Global Functionalities and Boot Up @author PI:NAME:<NAME>END_PI @website http://www.michaelowens.nl @copyright PI:NAME:<NAME>END_PI 2011 ### Plugin = require '../lib/plugin' Channel = require '../lib/channel' module.exports = class PluginGlobal extends Plugin onNumeric: (context) -> # 376 is end of MOTD/modes return if context.command isnt '376' userchans = @irc.config.channels # userchannels i = 0 while i < userchans.length channelName = userchans[i] password = PI:PASSWORD:<PASSWORD>END_PI if typeof (channelName) is 'object' password = PI:PASSWORD:<PASSWORD>END_PI channelName = channelName.name chan = new Channel(@irc, channelName, true, password) @irc.channels[chan.name] = chan i++
[ { "context": "le: 'test'\n inspired: no\n users: [\n {email: 'house@gmail.com', name: 'house'}\n {email: 'cuddy@gmail.com', n", "end": 167, "score": 0.999921441078186, "start": 152, "tag": "EMAIL", "value": "house@gmail.com" }, { "context": "\n users: [\n {email: 'house@g...
profile.coffee
jaekwon/CoffeeMugg
3
coffeemugg = require './src/coffeemugg' profiler = require 'profiler' log = console.log data = title: 'test' inspired: no users: [ {email: 'house@gmail.com', name: 'house'} {email: 'cuddy@gmail.com', name: 'cuddy'} {email: 'wilson@gmail.com', name: 'wilson'} ] coffeemugg_template = -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 data.title if data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email coffeemugg_template_args = (data) -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 data.title if data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email coffeemugg_template_context = -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title @data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 @data.title if @data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in @data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email benchmark = (title, code) -> start = new Date profiler.resume() for i in [1..15000] code() profiler.pause() log "#{title}: #{new Date - start} ms" @run = -> benchmark 'CoffeeMugg (none)', -> coffeemugg.render coffeemugg_template #benchmark 'CoffeeMugg (args)', -> coffeemugg.render coffeemugg_template_args, null, data #benchmark 'CoffeeMugg (context)', -> coffeemugg.render coffeemugg_template_context, context: {data: data} #benchmark 'CoffeeMugg (format) (none)', -> coffeemugg.render coffeemugg_template, format: on @run()
48161
coffeemugg = require './src/coffeemugg' profiler = require 'profiler' log = console.log data = title: 'test' inspired: no users: [ {email: '<EMAIL>', name: 'house'} {email: '<EMAIL>', name: 'cuddy'} {email: '<EMAIL>', name: '<NAME>'} ] coffeemugg_template = -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 data.title if data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email coffeemugg_template_args = (data) -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 data.title if data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email coffeemugg_template_context = -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title @data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 @data.title if @data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in @data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email benchmark = (title, code) -> start = new Date profiler.resume() for i in [1..15000] code() profiler.pause() log "#{title}: #{new Date - start} ms" @run = -> benchmark 'CoffeeMugg (none)', -> coffeemugg.render coffeemugg_template #benchmark 'CoffeeMugg (args)', -> coffeemugg.render coffeemugg_template_args, null, data #benchmark 'CoffeeMugg (context)', -> coffeemugg.render coffeemugg_template_context, context: {data: data} #benchmark 'CoffeeMugg (format) (none)', -> coffeemugg.render coffeemugg_template, format: on @run()
true
coffeemugg = require './src/coffeemugg' profiler = require 'profiler' log = console.log data = title: 'test' inspired: no users: [ {email: 'PI:EMAIL:<EMAIL>END_PI', name: 'house'} {email: 'PI:EMAIL:<EMAIL>END_PI', name: 'cuddy'} {email: 'PI:EMAIL:<EMAIL>END_PI', name: 'PI:NAME:<NAME>END_PI'} ] coffeemugg_template = -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 data.title if data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email coffeemugg_template_args = (data) -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 data.title if data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email coffeemugg_template_context = -> @doctype 5 @html lang: 'en', -> @head -> @meta charset: 'utf-8' @title @data.title @style ''' body {font-family: "sans-serif"} section, header {display: block} ''' @body -> @section -> @header -> @h1 @data.title if @data.inspired @p 'Create a witty example' else @p 'Go meta' @ul -> for user in @data.users @li user.name @li -> @a href: "mailto:#{user.email}", -> user.email benchmark = (title, code) -> start = new Date profiler.resume() for i in [1..15000] code() profiler.pause() log "#{title}: #{new Date - start} ms" @run = -> benchmark 'CoffeeMugg (none)', -> coffeemugg.render coffeemugg_template #benchmark 'CoffeeMugg (args)', -> coffeemugg.render coffeemugg_template_args, null, data #benchmark 'CoffeeMugg (context)', -> coffeemugg.render coffeemugg_template_context, context: {data: data} #benchmark 'CoffeeMugg (format) (none)', -> coffeemugg.render coffeemugg_template, format: on @run()
[ { "context": "> approves - Approve of something\n#\n# Developed by One Mighty Roar (http://github.com/onemightyroar)\n\nmodule.exports", "end": 159, "score": 0.9990497827529907, "start": 144, "tag": "NAME", "value": "One Mighty Roar" }, { "context": "# Developed by One Mighty Roar (h...
src/scripts/romanemperor.coffee
aroben/hubot-scripts
1
# Approve or disapprove of something # # <user> disapproves - Disapprove of something # <user> approves - Approve of something # # Developed by One Mighty Roar (http://github.com/onemightyroar) module.exports = (robot) -> robot.respond /@?([\w .-_]+) disapproves/i, (msg) -> name = msg.match[1] user = msg.message.user firstname = user.name.toLowerCase().split(" ")[0] if (firstname is name) msg.send "http://i3.kym-cdn.com/photos/images/newsfeed/000/254/517/a70.gif" else msg.send firstname + ", stop pretending to be " + name robot.respond /@?([\w .-_]+) approves/i, (msg) -> name = msg.match[1] user = msg.message.user firstname = user.name.toLowerCase().split(" ")[0] if (firstname is name) msg.send "http://i1.kym-cdn.com/photos/images/newsfeed/000/254/655/849.gif" else msg.send firstname + ", stop pretending to be " + name
24646
# Approve or disapprove of something # # <user> disapproves - Disapprove of something # <user> approves - Approve of something # # Developed by <NAME> (http://github.com/onemightyroar) module.exports = (robot) -> robot.respond /@?([\w .-_]+) disapproves/i, (msg) -> name = msg.match[1] user = msg.message.user firstname = user.name.toLowerCase().split(" ")[0] if (firstname is name) msg.send "http://i3.kym-cdn.com/photos/images/newsfeed/000/254/517/a70.gif" else msg.send firstname + ", stop pretending to be " + name robot.respond /@?([\w .-_]+) approves/i, (msg) -> name = msg.match[1] user = msg.message.user firstname = user.name.toLowerCase().split(" ")[0] if (firstname is name) msg.send "http://i1.kym-cdn.com/photos/images/newsfeed/000/254/655/849.gif" else msg.send firstname + ", stop pretending to be " + name
true
# Approve or disapprove of something # # <user> disapproves - Disapprove of something # <user> approves - Approve of something # # Developed by PI:NAME:<NAME>END_PI (http://github.com/onemightyroar) module.exports = (robot) -> robot.respond /@?([\w .-_]+) disapproves/i, (msg) -> name = msg.match[1] user = msg.message.user firstname = user.name.toLowerCase().split(" ")[0] if (firstname is name) msg.send "http://i3.kym-cdn.com/photos/images/newsfeed/000/254/517/a70.gif" else msg.send firstname + ", stop pretending to be " + name robot.respond /@?([\w .-_]+) approves/i, (msg) -> name = msg.match[1] user = msg.message.user firstname = user.name.toLowerCase().split(" ")[0] if (firstname is name) msg.send "http://i1.kym-cdn.com/photos/images/newsfeed/000/254/655/849.gif" else msg.send firstname + ", stop pretending to be " + name
[ { "context": "r).length\n $.ajax\n url: \"//formspree.io/andrew@skotzko.com\",\n method: \"POST\",\n data: $(formSel", "end": 152, "score": 0.9998996257781982, "start": 134, "tag": "EMAIL", "value": "andrew@skotzko.com" } ]
js/app.coffee
skotzko/oldblog
0
--- --- window.submitForm = (containerSelector, formSelector) -> if $(formSelector).length $.ajax url: "//formspree.io/andrew@skotzko.com", method: "POST", data: $(formSelector).serialize(), dataType: "json", success: hideForm(containerSelector) window.showLoading = -> $('#loading').removeClass("hidden") window.hideLoading = -> $('#loading').addClass("hidden") hideForm = (containerSelector) -> $(containerSelector).html("<p class='text-italic text-green'>Thanks for reaching out!<i class='fa fa-lg fa-thumbs-up text-green' style='padding-left: 10px;'></i></p>").css("font-size", 20).css("padding-bottom", "20px") checkDebugMode = -> # disable console.debug unless we are in debug mode (local dev) unless "{{ site.debug_mode }}" is "true" # YML is all strings window.console = window.console || {} window.console.debug = -> {} window.scrollToAnchor = (anchorName) -> console.debug "scrolling to #{anchorName}" ot = $("a[name='#{anchorName}']").offset().top nav = $('nav.top-bar') navHeight = if nav? then nav.innerHeight() else 0 target = ot - navHeight window.scrollTo(0, target) console.debug "nav height: #{navHeight} | offset: #{ot} | target: #{target}" setupSmoothScroll = -> $('a[href*="#"]:not([href="#"])').click -> if location.pathname.replace(/^\//, '') == @pathname.replace(/^\//, '') and location.hostname == @hostname target = $(@hash) target = if target.length then target else $('[name=' + @hash.slice(1) + ']') if target.length $('html, body').animate { scrollTop: target.offset().top }, 1000 return false return return # DOC READY $ -> checkDebugMode() setupSmoothScroll() console.debug "Foundation version: #{Foundation.version}" $(document).foundation()
115518
--- --- window.submitForm = (containerSelector, formSelector) -> if $(formSelector).length $.ajax url: "//formspree.io/<EMAIL>", method: "POST", data: $(formSelector).serialize(), dataType: "json", success: hideForm(containerSelector) window.showLoading = -> $('#loading').removeClass("hidden") window.hideLoading = -> $('#loading').addClass("hidden") hideForm = (containerSelector) -> $(containerSelector).html("<p class='text-italic text-green'>Thanks for reaching out!<i class='fa fa-lg fa-thumbs-up text-green' style='padding-left: 10px;'></i></p>").css("font-size", 20).css("padding-bottom", "20px") checkDebugMode = -> # disable console.debug unless we are in debug mode (local dev) unless "{{ site.debug_mode }}" is "true" # YML is all strings window.console = window.console || {} window.console.debug = -> {} window.scrollToAnchor = (anchorName) -> console.debug "scrolling to #{anchorName}" ot = $("a[name='#{anchorName}']").offset().top nav = $('nav.top-bar') navHeight = if nav? then nav.innerHeight() else 0 target = ot - navHeight window.scrollTo(0, target) console.debug "nav height: #{navHeight} | offset: #{ot} | target: #{target}" setupSmoothScroll = -> $('a[href*="#"]:not([href="#"])').click -> if location.pathname.replace(/^\//, '') == @pathname.replace(/^\//, '') and location.hostname == @hostname target = $(@hash) target = if target.length then target else $('[name=' + @hash.slice(1) + ']') if target.length $('html, body').animate { scrollTop: target.offset().top }, 1000 return false return return # DOC READY $ -> checkDebugMode() setupSmoothScroll() console.debug "Foundation version: #{Foundation.version}" $(document).foundation()
true
--- --- window.submitForm = (containerSelector, formSelector) -> if $(formSelector).length $.ajax url: "//formspree.io/PI:EMAIL:<EMAIL>END_PI", method: "POST", data: $(formSelector).serialize(), dataType: "json", success: hideForm(containerSelector) window.showLoading = -> $('#loading').removeClass("hidden") window.hideLoading = -> $('#loading').addClass("hidden") hideForm = (containerSelector) -> $(containerSelector).html("<p class='text-italic text-green'>Thanks for reaching out!<i class='fa fa-lg fa-thumbs-up text-green' style='padding-left: 10px;'></i></p>").css("font-size", 20).css("padding-bottom", "20px") checkDebugMode = -> # disable console.debug unless we are in debug mode (local dev) unless "{{ site.debug_mode }}" is "true" # YML is all strings window.console = window.console || {} window.console.debug = -> {} window.scrollToAnchor = (anchorName) -> console.debug "scrolling to #{anchorName}" ot = $("a[name='#{anchorName}']").offset().top nav = $('nav.top-bar') navHeight = if nav? then nav.innerHeight() else 0 target = ot - navHeight window.scrollTo(0, target) console.debug "nav height: #{navHeight} | offset: #{ot} | target: #{target}" setupSmoothScroll = -> $('a[href*="#"]:not([href="#"])').click -> if location.pathname.replace(/^\//, '') == @pathname.replace(/^\//, '') and location.hostname == @hostname target = $(@hash) target = if target.length then target else $('[name=' + @hash.slice(1) + ']') if target.length $('html, body').animate { scrollTop: target.offset().top }, 1000 return false return return # DOC READY $ -> checkDebugMode() setupSmoothScroll() console.debug "Foundation version: #{Foundation.version}" $(document).foundation()
[ { "context": "UD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_SECRET: \"blahblahblah\"\nENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM", "end": 459, "score": 0.9775752425193787, "start": 447, "tag": "KEY", "value": "blahblahblah" } ]
environment_REMOTE_862.cson
ratokeshi/endo-google-cloud-platform
0
PORT: 8080 ENDO_GOOGLE_CLOUD_PLATFORM_SERVICE_URL: "https://endogooglecloudplatform.localtunnel.me" APP_OCTOBLU_HOST: "https://app.octoblu.com/" ENDO_GOOGLE_CLOUD_PLATFORM_MANAGER_URL: "https://endo-manager.octoblu.com" MESHBLU_PRIVATE_KEY: "U" MESHBLU_UUID: "" MESHBLU_TOKEN: "" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_ID: "blahblahblah.apps.googleusercontent.com" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_SECRET: "blahblahblah" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CALLBACK_URL: "https://endogcpratu.localtunnel.me:8000/auth/api/callback" ENDO_OCTOBLU_OAUTH_URL: "https://endogcpratu.localtunnel.me:8000/auth/octoblu/callback"
167923
PORT: 8080 ENDO_GOOGLE_CLOUD_PLATFORM_SERVICE_URL: "https://endogooglecloudplatform.localtunnel.me" APP_OCTOBLU_HOST: "https://app.octoblu.com/" ENDO_GOOGLE_CLOUD_PLATFORM_MANAGER_URL: "https://endo-manager.octoblu.com" MESHBLU_PRIVATE_KEY: "U" MESHBLU_UUID: "" MESHBLU_TOKEN: "" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_ID: "blahblahblah.apps.googleusercontent.com" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_SECRET: "<KEY>" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CALLBACK_URL: "https://endogcpratu.localtunnel.me:8000/auth/api/callback" ENDO_OCTOBLU_OAUTH_URL: "https://endogcpratu.localtunnel.me:8000/auth/octoblu/callback"
true
PORT: 8080 ENDO_GOOGLE_CLOUD_PLATFORM_SERVICE_URL: "https://endogooglecloudplatform.localtunnel.me" APP_OCTOBLU_HOST: "https://app.octoblu.com/" ENDO_GOOGLE_CLOUD_PLATFORM_MANAGER_URL: "https://endo-manager.octoblu.com" MESHBLU_PRIVATE_KEY: "U" MESHBLU_UUID: "" MESHBLU_TOKEN: "" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_ID: "blahblahblah.apps.googleusercontent.com" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CLIENT_SECRET: "PI:KEY:<KEY>END_PI" ENDO_GOOGLE_CLOUD_PLATFORM_GOOGLE_CLOUD_PLATFORM_CALLBACK_URL: "https://endogcpratu.localtunnel.me:8000/auth/api/callback" ENDO_OCTOBLU_OAUTH_URL: "https://endogcpratu.localtunnel.me:8000/auth/octoblu/callback"
[ { "context": " pos_y = args.y\n [\n Common.Name.merge(name: 'Skree')\n Common.Enemy.merge\n hp: Enemy.Skree.ge", "end": 176, "score": 0.8020471334457397, "start": 171, "tag": "NAME", "value": "Skree" }, { "context": "s_y = args.y + 8\n [\n Common.Name.merge(name: 'Zo...
src/javascript/game/entity/enemies/factory.coffee
dcrosby42/metroid-clone
5
Enemy = require('./components') Common = require('../components') F = {} F.basicSkree = (args) -> pos_x = args.x + 8 pos_y = args.y [ Common.Name.merge(name: 'Skree') Common.Enemy.merge hp: Enemy.Skree.get('max_hp') Enemy.Skree Common.Harmful.merge damage: 8 Common.Animation.merge layer: 'creatures' spriteName: 'basic_skree' state: 'spinSlow' time: 0 Common.Position.merge x: pos_x y: pos_y Common.Velocity.merge x: 0 y: 0 Common.MapCollider Common.HitBox.merge width: 14 height: 24 anchorX: 0.5 # halfway across anchorY: 0 # all the way at the top Common.HitBoxVisual.merge color: 0x55FF55 ] F.basicZoomer = (args) -> pos_x = args.x + 8 pos_y = args.y + 8 [ Common.Name.merge(name: 'Zoomer') Common.Enemy.merge hp: 10 # TODO Enemy.Zoomer Enemy.Crawl Common.Harmful.merge damage: 8 Common.Animation.merge layer: 'creatures' spriteName: 'basic_zoomer' state: 'crawl-up' time: 0 Common.Position.merge x: pos_x y: pos_y Common.Velocity.merge x: 0 y: 0 Common.MapCollider Common.HitBox.merge width: 14 height: 14 anchorX: 0.5 anchorY: 0.5 Common.HitBoxVisual.merge color: 0x55FF55 ] module.exports = createComponents: (entityType, args) -> F[entityType](args)
11760
Enemy = require('./components') Common = require('../components') F = {} F.basicSkree = (args) -> pos_x = args.x + 8 pos_y = args.y [ Common.Name.merge(name: '<NAME>') Common.Enemy.merge hp: Enemy.Skree.get('max_hp') Enemy.Skree Common.Harmful.merge damage: 8 Common.Animation.merge layer: 'creatures' spriteName: 'basic_skree' state: 'spinSlow' time: 0 Common.Position.merge x: pos_x y: pos_y Common.Velocity.merge x: 0 y: 0 Common.MapCollider Common.HitBox.merge width: 14 height: 24 anchorX: 0.5 # halfway across anchorY: 0 # all the way at the top Common.HitBoxVisual.merge color: 0x55FF55 ] F.basicZoomer = (args) -> pos_x = args.x + 8 pos_y = args.y + 8 [ Common.Name.merge(name: '<NAME>') Common.Enemy.merge hp: 10 # TODO Enemy.Zoomer Enemy.Crawl Common.Harmful.merge damage: 8 Common.Animation.merge layer: 'creatures' spriteName: 'basic_zoomer' state: 'crawl-up' time: 0 Common.Position.merge x: pos_x y: pos_y Common.Velocity.merge x: 0 y: 0 Common.MapCollider Common.HitBox.merge width: 14 height: 14 anchorX: 0.5 anchorY: 0.5 Common.HitBoxVisual.merge color: 0x55FF55 ] module.exports = createComponents: (entityType, args) -> F[entityType](args)
true
Enemy = require('./components') Common = require('../components') F = {} F.basicSkree = (args) -> pos_x = args.x + 8 pos_y = args.y [ Common.Name.merge(name: 'PI:NAME:<NAME>END_PI') Common.Enemy.merge hp: Enemy.Skree.get('max_hp') Enemy.Skree Common.Harmful.merge damage: 8 Common.Animation.merge layer: 'creatures' spriteName: 'basic_skree' state: 'spinSlow' time: 0 Common.Position.merge x: pos_x y: pos_y Common.Velocity.merge x: 0 y: 0 Common.MapCollider Common.HitBox.merge width: 14 height: 24 anchorX: 0.5 # halfway across anchorY: 0 # all the way at the top Common.HitBoxVisual.merge color: 0x55FF55 ] F.basicZoomer = (args) -> pos_x = args.x + 8 pos_y = args.y + 8 [ Common.Name.merge(name: 'PI:NAME:<NAME>END_PI') Common.Enemy.merge hp: 10 # TODO Enemy.Zoomer Enemy.Crawl Common.Harmful.merge damage: 8 Common.Animation.merge layer: 'creatures' spriteName: 'basic_zoomer' state: 'crawl-up' time: 0 Common.Position.merge x: pos_x y: pos_y Common.Velocity.merge x: 0 y: 0 Common.MapCollider Common.HitBox.merge width: 14 height: 14 anchorX: 0.5 anchorY: 0.5 Common.HitBoxVisual.merge color: 0x55FF55 ] module.exports = createComponents: (entityType, args) -> F[entityType](args)
[ { "context": "nselectify: true,\n\n layout: {\n name: 'dagre'\n nodeSep: 50, # the separation between ad", "end": 307, "score": 0.9960009455680847, "start": 302, "tag": "NAME", "value": "dagre" } ]
app/coffee/modules/lib/views/dagre/index.coffee
tetherless-world/magellan
0
class DagreGraph extends Mn.LayoutView template: require './templates/dagre' className: 'row' renderGraph: (elements) -> @cy = window.cytoscape({ container: document.getElementById('cy'), boxSelectionEnabled: false, autounselectify: true, layout: { name: 'dagre' nodeSep: 50, # the separation between adjacent nodes in the same rank edgeSep: 100, # the separation between adjacent edges in the same rank rankSep: 200, # the separation between adjacent nodes in the same rank rankDir: 'BT', # 'TB' for top to bottom flow, 'LR' for left to right, nodeDimensionsIncludeLabels: true }, style: [ { selector: 'node', style: { 'content': 'data(label)', 'text-opacity': 0.5, 'text-valign': 'center', 'text-halign': 'right', 'background-color': '#11479e' } }, { selector: 'node', style: { 'label': 'data(label)', 'text-wrap': 'wrap', 'text-opacity': 0.5, 'text-valign': 'center', 'text-halign': 'right', 'background-color': '#11479e' } }, { selector: 'edge', style: { 'content': 'data(label)', 'curve-style': 'bezier', 'width': 4, 'target-arrow-shape': 'triangle', 'line-color': '#9dbaea', 'target-arrow-color': '#9dbaea' } } ], elements: elements }) # Ready event handler @cy.ready (event) => @onCytoscapeReady() # onCytoscapeReady # Hides the loading message onCytoscapeReady: -> # console.log 'CYTOSCAPE READY' return true # onBeforeDestroy # Destroyes the Cytoscape.js graph onBeforeDestroy: -> return @cy?.destroy() # # # # # module.exports = DagreGraph
78338
class DagreGraph extends Mn.LayoutView template: require './templates/dagre' className: 'row' renderGraph: (elements) -> @cy = window.cytoscape({ container: document.getElementById('cy'), boxSelectionEnabled: false, autounselectify: true, layout: { name: '<NAME>' nodeSep: 50, # the separation between adjacent nodes in the same rank edgeSep: 100, # the separation between adjacent edges in the same rank rankSep: 200, # the separation between adjacent nodes in the same rank rankDir: 'BT', # 'TB' for top to bottom flow, 'LR' for left to right, nodeDimensionsIncludeLabels: true }, style: [ { selector: 'node', style: { 'content': 'data(label)', 'text-opacity': 0.5, 'text-valign': 'center', 'text-halign': 'right', 'background-color': '#11479e' } }, { selector: 'node', style: { 'label': 'data(label)', 'text-wrap': 'wrap', 'text-opacity': 0.5, 'text-valign': 'center', 'text-halign': 'right', 'background-color': '#11479e' } }, { selector: 'edge', style: { 'content': 'data(label)', 'curve-style': 'bezier', 'width': 4, 'target-arrow-shape': 'triangle', 'line-color': '#9dbaea', 'target-arrow-color': '#9dbaea' } } ], elements: elements }) # Ready event handler @cy.ready (event) => @onCytoscapeReady() # onCytoscapeReady # Hides the loading message onCytoscapeReady: -> # console.log 'CYTOSCAPE READY' return true # onBeforeDestroy # Destroyes the Cytoscape.js graph onBeforeDestroy: -> return @cy?.destroy() # # # # # module.exports = DagreGraph
true
class DagreGraph extends Mn.LayoutView template: require './templates/dagre' className: 'row' renderGraph: (elements) -> @cy = window.cytoscape({ container: document.getElementById('cy'), boxSelectionEnabled: false, autounselectify: true, layout: { name: 'PI:NAME:<NAME>END_PI' nodeSep: 50, # the separation between adjacent nodes in the same rank edgeSep: 100, # the separation between adjacent edges in the same rank rankSep: 200, # the separation between adjacent nodes in the same rank rankDir: 'BT', # 'TB' for top to bottom flow, 'LR' for left to right, nodeDimensionsIncludeLabels: true }, style: [ { selector: 'node', style: { 'content': 'data(label)', 'text-opacity': 0.5, 'text-valign': 'center', 'text-halign': 'right', 'background-color': '#11479e' } }, { selector: 'node', style: { 'label': 'data(label)', 'text-wrap': 'wrap', 'text-opacity': 0.5, 'text-valign': 'center', 'text-halign': 'right', 'background-color': '#11479e' } }, { selector: 'edge', style: { 'content': 'data(label)', 'curve-style': 'bezier', 'width': 4, 'target-arrow-shape': 'triangle', 'line-color': '#9dbaea', 'target-arrow-color': '#9dbaea' } } ], elements: elements }) # Ready event handler @cy.ready (event) => @onCytoscapeReady() # onCytoscapeReady # Hides the loading message onCytoscapeReady: -> # console.log 'CYTOSCAPE READY' return true # onBeforeDestroy # Destroyes the Cytoscape.js graph onBeforeDestroy: -> return @cy?.destroy() # # # # # module.exports = DagreGraph
[ { "context": "tance, the following are valid values:\n# http://12.34.56.78\n# https://bothost.example.com\n# htt", "end": 933, "score": 0.5677956938743591, "start": 932, "tag": "IP_ADDRESS", "value": "1" }, { "context": "nce, the following are valid values:\n# http://12.34.56...
src/index.coffee
bmuller/hubot-aws-sesame
6
# Description # Open / close ports on security groups automatically in AWS based on a user's presence # # Dependencies: # "aws-sesame": "0.0.1" # # Configuration: # HUBOT_AWS_REGION # HUBOT_AWS_KEY_ID # HUBOT_AWS_SECRET_KEY # HUBOT_AWS_SEC_RULES # HUBOT_ROOT_URL # # Commands: # hubot show firewall - Show all users who currently have access to AWS # # Notes: # HUBOT_AWS_SEC_RULES should be of the form (spaces are ignored): # <sec group id>: <port start>[ - <port end>][, <port start> - <port end>]; # # For instance, each of the following would work: # sg-123: 22 # sg-123: 20 - 222 # sg-123: 22; sg-456: 1-1600 # sg-123: 10 - 20; sg-456: 30 # # HUBOT_ROOT_URL should be the root URL of an internet visible host. This # is necessary so that a message can be sent to the client containing a link # to this bot's Hubot web server. # # For instance, the following are valid values: # http://12.34.56.78 # https://bothost.example.com # http://12.34.56.78:123 # # Author: # bmuller UUID = require 'node-uuid', HTTP = require 'http', AWSSesame = require 'aws-sesame' class Sesame constructor: (@robot) -> @aws = new AWSSesame sslEnabled: true region: process.env.HUBOT_AWS_REGION accessKeyId: process.env.HUBOT_AWS_KEY_ID secretAccessKey: process.env.HUBOT_AWS_SECRET_KEY @rules = @parseGroups(process.env.HUBOT_AWS_SEC_RULES or "") parseGroups: (parts) -> groups = [] for group in parts.replace(new RegExp(" ", "g"), "").split ";" [sgid, ranges] = group.split(':') for range in ranges.split "," [lower, upper] = range.split "-" upper ?= lower groups.push [sgid, lower, upper] throw new Error("You must set the HUBOT_AWS_SEC_RULES environment variable.") unless groups.length console.log "Using the following rules in aws-sesame:" console.log groups groups close: (ip) -> for [sgid, lower, upper] in @rules @aws.revokeAccess sgid, 'tcp', ip, lower, upper, (result) -> if result console.log "closed ports #{lower} - #{upper} for #{ip} in #{sgid}" else console.log "issue while trying to close ports #{lower} - #{upper} for #{ip} in #{sgid}" open: (ip) -> for [sgid, lower, upper] in @rules @aws.grantAccess sgid, 'tcp', ip, lower, upper, (result) -> if result console.log "opened ports #{lower} - #{upper} for #{ip} in #{sgid}" else console.log "issue while trying to open ports #{lower} - #{upper} for #{ip} in #{sgid}" usersWithIp: (ip) -> (user for user in @robot.brain.users when user.ip is ip) module.exports = (robot) -> sesame = new Sesame(robot) for env in "AWS_SEC_RULES AWS_REGION AWS_SECRET_KEY AWS_SEC_RULES ROOT_URL".split(' ') unless process.env["HUBOT_#{env}"]? throw new Error("You must set the HUBOT_#{env} environment variable.") robot.router.get '/hubot/aws-gateway/:jid/:secret.jpg', (req, res) -> user = robot.brain.userForId req.params.jid if req.params.secret != user.ip_secret res.send 'invalid secret :(' return user.ip_secret = UUID.v4() oldip = user.ip user.ip = req.headers['x-forwarded-for']?[0] or req.connection.remoteAddress if oldip isnt user.ip # close old connection if this is a new one for the user sesame.close oldip if oldip? and sesame.usersWithIp(oldip).length is 0 # only open new connection if one doesn't already exist sesame.open user.ip unless sesame.usersWithIp(user.ip).length > 1 robot.send user: user, "You now have access to AWS from #{user.ip}" sendKitty robot, res robot.enter (msg) -> user = robot.brain.userForId msg.message.user.id return if user.last_entered? and (Date.now() - user.last_entered) < 3000 user.last_entered = Date.now() user.ip_secret = UUID.v4() msg.send "#{process.env.HUBOT_ROOT_URL}/hubot/aws-gateway/#{msg.message.user.id}/#{user.ip_secret}.jpg" robot.leave (msg) -> user = robot.brain.userForId msg.message.user.id console.log "closing connection to #{user.ip}" oldip = user.ip user.ip = null # close access if this was the last user to be using that ip sesame.close oldip if oldip? and sesame.usersWithIp(oldip).length is 0 robot.respond /show firewall/i, (msg) -> users = ("#{id} (#{user.ip})" for id, user of robot.brain.users() when user.ip?) msg.send "The following users have access:\n#{users.join('\n')}" sendKitty = (robot, tres) -> q = v: '1.0', rsz: '8', q: 'kitten', safe: 'active', imgsz: 'small' url = 'http://ajax.googleapis.com/ajax/services/search/images' robot.http(url).query(q).get() (err, res, body) -> images = JSON.parse(body) images = images.responseData?.results if images?.length > 0 image = images[ Math.floor(Math.random() * images.length) ] HTTP.get image.unescapedUrl, (res) -> tres.writeHead 200, 'Content-Type': res.headers['content-type'], 'Content-Length': res.headers['content-length'] res.pipe(tres) else tres.send ""
185254
# Description # Open / close ports on security groups automatically in AWS based on a user's presence # # Dependencies: # "aws-sesame": "0.0.1" # # Configuration: # HUBOT_AWS_REGION # HUBOT_AWS_KEY_ID # HUBOT_AWS_SECRET_KEY # HUBOT_AWS_SEC_RULES # HUBOT_ROOT_URL # # Commands: # hubot show firewall - Show all users who currently have access to AWS # # Notes: # HUBOT_AWS_SEC_RULES should be of the form (spaces are ignored): # <sec group id>: <port start>[ - <port end>][, <port start> - <port end>]; # # For instance, each of the following would work: # sg-123: 22 # sg-123: 20 - 222 # sg-123: 22; sg-456: 1-1600 # sg-123: 10 - 20; sg-456: 30 # # HUBOT_ROOT_URL should be the root URL of an internet visible host. This # is necessary so that a message can be sent to the client containing a link # to this bot's Hubot web server. # # For instance, the following are valid values: # http://12.34.56.78 # https://bothost.example.com # http://192.168.3.11:123 # # Author: # bmuller UUID = require 'node-uuid', HTTP = require 'http', AWSSesame = require 'aws-sesame' class Sesame constructor: (@robot) -> @aws = new AWSSesame sslEnabled: true region: process.env.HUBOT_AWS_REGION accessKeyId: process.env.HUBOT_AWS_KEY_ID secretAccessKey: process.env.HUBOT_AWS_SECRET_KEY @rules = @parseGroups(process.env.HUBOT_AWS_SEC_RULES or "") parseGroups: (parts) -> groups = [] for group in parts.replace(new RegExp(" ", "g"), "").split ";" [sgid, ranges] = group.split(':') for range in ranges.split "," [lower, upper] = range.split "-" upper ?= lower groups.push [sgid, lower, upper] throw new Error("You must set the HUBOT_AWS_SEC_RULES environment variable.") unless groups.length console.log "Using the following rules in aws-sesame:" console.log groups groups close: (ip) -> for [sgid, lower, upper] in @rules @aws.revokeAccess sgid, 'tcp', ip, lower, upper, (result) -> if result console.log "closed ports #{lower} - #{upper} for #{ip} in #{sgid}" else console.log "issue while trying to close ports #{lower} - #{upper} for #{ip} in #{sgid}" open: (ip) -> for [sgid, lower, upper] in @rules @aws.grantAccess sgid, 'tcp', ip, lower, upper, (result) -> if result console.log "opened ports #{lower} - #{upper} for #{ip} in #{sgid}" else console.log "issue while trying to open ports #{lower} - #{upper} for #{ip} in #{sgid}" usersWithIp: (ip) -> (user for user in @robot.brain.users when user.ip is ip) module.exports = (robot) -> sesame = new Sesame(robot) for env in "AWS_SEC_RULES AWS_REGION AWS_SECRET_KEY AWS_SEC_RULES ROOT_URL".split(' ') unless process.env["HUBOT_#{env}"]? throw new Error("You must set the HUBOT_#{env} environment variable.") robot.router.get '/hubot/aws-gateway/:jid/:secret.jpg', (req, res) -> user = robot.brain.userForId req.params.jid if req.params.secret != user.ip_secret res.send 'invalid secret :(' return user.ip_secret = <KEY>() oldip = user.ip user.ip = req.headers['x-forwarded-for']?[0] or req.connection.remoteAddress if oldip isnt user.ip # close old connection if this is a new one for the user sesame.close oldip if oldip? and sesame.usersWithIp(oldip).length is 0 # only open new connection if one doesn't already exist sesame.open user.ip unless sesame.usersWithIp(user.ip).length > 1 robot.send user: user, "You now have access to AWS from #{user.ip}" sendKitty robot, res robot.enter (msg) -> user = robot.brain.userForId msg.message.user.id return if user.last_entered? and (Date.now() - user.last_entered) < 3000 user.last_entered = Date.now() user.ip_secret = <KEY>() msg.send "#{process.env.HUBOT_ROOT_URL}/hubot/aws-gateway/#{msg.message.user.id}/#{user.ip_secret}.jpg" robot.leave (msg) -> user = robot.brain.userForId msg.message.user.id console.log "closing connection to #{user.ip}" oldip = user.ip user.ip = null # close access if this was the last user to be using that ip sesame.close oldip if oldip? and sesame.usersWithIp(oldip).length is 0 robot.respond /show firewall/i, (msg) -> users = ("#{id} (#{user.ip})" for id, user of robot.brain.users() when user.ip?) msg.send "The following users have access:\n#{users.join('\n')}" sendKitty = (robot, tres) -> q = v: '1.0', rsz: '8', q: 'kitten', safe: 'active', imgsz: 'small' url = 'http://ajax.googleapis.com/ajax/services/search/images' robot.http(url).query(q).get() (err, res, body) -> images = JSON.parse(body) images = images.responseData?.results if images?.length > 0 image = images[ Math.floor(Math.random() * images.length) ] HTTP.get image.unescapedUrl, (res) -> tres.writeHead 200, 'Content-Type': res.headers['content-type'], 'Content-Length': res.headers['content-length'] res.pipe(tres) else tres.send ""
true
# Description # Open / close ports on security groups automatically in AWS based on a user's presence # # Dependencies: # "aws-sesame": "0.0.1" # # Configuration: # HUBOT_AWS_REGION # HUBOT_AWS_KEY_ID # HUBOT_AWS_SECRET_KEY # HUBOT_AWS_SEC_RULES # HUBOT_ROOT_URL # # Commands: # hubot show firewall - Show all users who currently have access to AWS # # Notes: # HUBOT_AWS_SEC_RULES should be of the form (spaces are ignored): # <sec group id>: <port start>[ - <port end>][, <port start> - <port end>]; # # For instance, each of the following would work: # sg-123: 22 # sg-123: 20 - 222 # sg-123: 22; sg-456: 1-1600 # sg-123: 10 - 20; sg-456: 30 # # HUBOT_ROOT_URL should be the root URL of an internet visible host. This # is necessary so that a message can be sent to the client containing a link # to this bot's Hubot web server. # # For instance, the following are valid values: # http://12.34.56.78 # https://bothost.example.com # http://PI:IP_ADDRESS:192.168.3.11END_PI:123 # # Author: # bmuller UUID = require 'node-uuid', HTTP = require 'http', AWSSesame = require 'aws-sesame' class Sesame constructor: (@robot) -> @aws = new AWSSesame sslEnabled: true region: process.env.HUBOT_AWS_REGION accessKeyId: process.env.HUBOT_AWS_KEY_ID secretAccessKey: process.env.HUBOT_AWS_SECRET_KEY @rules = @parseGroups(process.env.HUBOT_AWS_SEC_RULES or "") parseGroups: (parts) -> groups = [] for group in parts.replace(new RegExp(" ", "g"), "").split ";" [sgid, ranges] = group.split(':') for range in ranges.split "," [lower, upper] = range.split "-" upper ?= lower groups.push [sgid, lower, upper] throw new Error("You must set the HUBOT_AWS_SEC_RULES environment variable.") unless groups.length console.log "Using the following rules in aws-sesame:" console.log groups groups close: (ip) -> for [sgid, lower, upper] in @rules @aws.revokeAccess sgid, 'tcp', ip, lower, upper, (result) -> if result console.log "closed ports #{lower} - #{upper} for #{ip} in #{sgid}" else console.log "issue while trying to close ports #{lower} - #{upper} for #{ip} in #{sgid}" open: (ip) -> for [sgid, lower, upper] in @rules @aws.grantAccess sgid, 'tcp', ip, lower, upper, (result) -> if result console.log "opened ports #{lower} - #{upper} for #{ip} in #{sgid}" else console.log "issue while trying to open ports #{lower} - #{upper} for #{ip} in #{sgid}" usersWithIp: (ip) -> (user for user in @robot.brain.users when user.ip is ip) module.exports = (robot) -> sesame = new Sesame(robot) for env in "AWS_SEC_RULES AWS_REGION AWS_SECRET_KEY AWS_SEC_RULES ROOT_URL".split(' ') unless process.env["HUBOT_#{env}"]? throw new Error("You must set the HUBOT_#{env} environment variable.") robot.router.get '/hubot/aws-gateway/:jid/:secret.jpg', (req, res) -> user = robot.brain.userForId req.params.jid if req.params.secret != user.ip_secret res.send 'invalid secret :(' return user.ip_secret = PI:KEY:<KEY>END_PI() oldip = user.ip user.ip = req.headers['x-forwarded-for']?[0] or req.connection.remoteAddress if oldip isnt user.ip # close old connection if this is a new one for the user sesame.close oldip if oldip? and sesame.usersWithIp(oldip).length is 0 # only open new connection if one doesn't already exist sesame.open user.ip unless sesame.usersWithIp(user.ip).length > 1 robot.send user: user, "You now have access to AWS from #{user.ip}" sendKitty robot, res robot.enter (msg) -> user = robot.brain.userForId msg.message.user.id return if user.last_entered? and (Date.now() - user.last_entered) < 3000 user.last_entered = Date.now() user.ip_secret = PI:KEY:<KEY>END_PI() msg.send "#{process.env.HUBOT_ROOT_URL}/hubot/aws-gateway/#{msg.message.user.id}/#{user.ip_secret}.jpg" robot.leave (msg) -> user = robot.brain.userForId msg.message.user.id console.log "closing connection to #{user.ip}" oldip = user.ip user.ip = null # close access if this was the last user to be using that ip sesame.close oldip if oldip? and sesame.usersWithIp(oldip).length is 0 robot.respond /show firewall/i, (msg) -> users = ("#{id} (#{user.ip})" for id, user of robot.brain.users() when user.ip?) msg.send "The following users have access:\n#{users.join('\n')}" sendKitty = (robot, tres) -> q = v: '1.0', rsz: '8', q: 'kitten', safe: 'active', imgsz: 'small' url = 'http://ajax.googleapis.com/ajax/services/search/images' robot.http(url).query(q).get() (err, res, body) -> images = JSON.parse(body) images = images.responseData?.results if images?.length > 0 image = images[ Math.floor(Math.random() * images.length) ] HTTP.get image.unescapedUrl, (res) -> tres.writeHead 200, 'Content-Type': res.headers['content-type'], 'Content-Length': res.headers['content-length'] res.pipe(tres) else tres.send ""
[ { "context": " email: smartnoraConfig.email\n password: smartnoraConfig.password\n group: smartnoraConfig.group\n vali", "end": 1004, "score": 0.9993510842323303, "start": 980, "tag": "PASSWORD", "value": "smartnoraConfig.password" }, { "context": "tatus) =>\n...
adapters/blinds.coffee
bertreb/pimatic-smartnora
0
module.exports = (env) -> Promise = env.require 'bluebird' assert = env.require 'cassert' events = require 'events' childProcess = require("child_process") rxjs = require("rxjs") operators = require("rxjs/operators") connection = require("../node_modules/node-red-contrib-smartnora/build/firebase/connection.js") device_context = require("../node_modules/node-red-contrib-smartnora/build/firebase/device-context.js") util = require("../node_modules/node-red-contrib-smartnora/build/nodes/util.js") _ = require "lodash" class ShutterUpDownAdapter extends events.EventEmitter constructor: (config, pimaticDevice, smartnoraConfig) -> @id = config.pimatic_device_id #pimaticDevice.config.id @type = "noraf-blinds" @pimaticDevice = pimaticDevice @rollerTime = if config.auxiliary is "" then 20000 else (Number config.auxiliary) * 1000 @position = 0 noraConfig = email: smartnoraConfig.email password: smartnoraConfig.password group: smartnoraConfig.group valid: true localExecution: false deviceConfig = id: config.pimatic_device_id type: "action.devices.types.BLINDS" traits: [ "action.devices.traits.OpenClose" ] name: { name: config.name } roomHint: config.roomHint willReportState: true state: online: true openPercent: 100 attributes: {} noraSpecific: {} @close$ = new rxjs.Subject() ctx = new device_context.DeviceContext(@) ctx.update(@close$) notifyState = (state) => stateString = state.openPercent ctx.state$.next(stateString) # setup device stream from smartnora cloud # @device$ = connection.FirebaseConnection .withLogger(env.logger) .fromConfig(noraConfig, ctx) .pipe(operators.switchMap((connection) => connection.withDevice(deviceConfig, ctx)), util.withLocalExecution(noraConfig), operators.publishReplay(1), operators.refCount(), operators.takeUntil(@close$)) @device$.pipe(operators.switchMap((d) => d.state$), operators.tap((state) => notifyState(state)), operators.takeUntil(@close$)).subscribe() @device$.pipe(operators.switchMap((d) => d.stateUpdates$), operators.takeUntil(@close$)).subscribe((state) => env.logger.debug("Blinds received state: " + JSON.stringify(state,null,2)) @changePositionTo(state.openPercent) ) env.logger.debug "Tot hierooooo" # setup device handling in Pimatic # @pimaticDevice.on "position", @devicePositionHandler @pimaticDevice.system = @ @state = online: true openPercent: 0 status: (status) => env.logger.debug("Blinds device '#{@id}' status: " + JSON.stringify(status.text,null,2)) devicePositionHandler: (position) -> # device status changed, updating device status in Nora # position = ["up","down","stop"] switch position when "up" newPosition = 100 @system.updatePosition(newPosition) @system.postiontimer = setTimeout(()=> @system.pimaticDevice.stop() , @system.rollerTime) when "down" newPosition = 0 @system.updatePosition(newPosition) @system.postiontimer = setTimeout(()=> @system.pimaticDevice.stop() , @system.rollerTime) when "stopped" env.logger.debug "Stopped received, no further action" else env.logger.debug "Unknown position command '#{position}' from '#{@system.id}'" changePositionTo: (position) => # position is number. actions moveUp, moveDown, stop, rollingtime # if position is @position return if position > @position @pimaticDevice.moveUp() env.logger.debug "Blinds action: up" if position < @position @pimaticDevice.moveDown() env.logger.debug "Blinds action: down" clearTimeout(@positionTimer) if @positionTimer? stopShutter = () => @pimaticDevice.stop() env.logger.debug "Blinds action: stop" @positionTimer = setTimeout(stopShutter, @rollerTime) updatePosition: (newPosition) => unless newPosition is @state.openPercent env.logger.debug "Update position to " + newPosition @state.openPercent = newPosition @position = newPosition try @device$.pipe(operators.first()).toPromise() .then (device)=> device.updateState(@state) catch err env.logger.debug("while updating state #{err.message}: #{err.stack}") getType: () -> return "blinds" getState: () -> return @state destroy: -> return new Promise (resolve,reject) => @state.online = false; @updatePosition(@state.openPercent) @device.removeListener "position", @devicePositionHandler if @devicePositionHandler? clearTimeout(@positionTimer) if @positionTimer? @close$.next() @close$.complete() resolve(@id)
103371
module.exports = (env) -> Promise = env.require 'bluebird' assert = env.require 'cassert' events = require 'events' childProcess = require("child_process") rxjs = require("rxjs") operators = require("rxjs/operators") connection = require("../node_modules/node-red-contrib-smartnora/build/firebase/connection.js") device_context = require("../node_modules/node-red-contrib-smartnora/build/firebase/device-context.js") util = require("../node_modules/node-red-contrib-smartnora/build/nodes/util.js") _ = require "lodash" class ShutterUpDownAdapter extends events.EventEmitter constructor: (config, pimaticDevice, smartnoraConfig) -> @id = config.pimatic_device_id #pimaticDevice.config.id @type = "noraf-blinds" @pimaticDevice = pimaticDevice @rollerTime = if config.auxiliary is "" then 20000 else (Number config.auxiliary) * 1000 @position = 0 noraConfig = email: smartnoraConfig.email password: <PASSWORD> group: smartnoraConfig.group valid: true localExecution: false deviceConfig = id: config.pimatic_device_id type: "action.devices.types.BLINDS" traits: [ "action.devices.traits.OpenClose" ] name: { name: config.name } roomHint: config.roomHint willReportState: true state: online: true openPercent: 100 attributes: {} noraSpecific: {} @close$ = new rxjs.Subject() ctx = new device_context.DeviceContext(@) ctx.update(@close$) notifyState = (state) => stateString = state.openPercent ctx.state$.next(stateString) # setup device stream from smartnora cloud # @device$ = connection.FirebaseConnection .withLogger(env.logger) .fromConfig(noraConfig, ctx) .pipe(operators.switchMap((connection) => connection.withDevice(deviceConfig, ctx)), util.withLocalExecution(noraConfig), operators.publishReplay(1), operators.refCount(), operators.takeUntil(@close$)) @device$.pipe(operators.switchMap((d) => d.state$), operators.tap((state) => notifyState(state)), operators.takeUntil(@close$)).subscribe() @device$.pipe(operators.switchMap((d) => d.stateUpdates$), operators.takeUntil(@close$)).subscribe((state) => env.logger.debug("Blinds received state: " + JSON.stringify(state,null,2)) @changePositionTo(state.openPercent) ) env.logger.debug "Tot hierooooo" # setup device handling in Pimatic # @pimaticDevice.on "position", @devicePositionHandler @pimaticDevice.system = @ @state = online: true openPercent: 0 status: (status) => env.logger.debug("Blinds device '#{@id}' status: " + JSON.stringify(status.text,null,2)) devicePositionHandler: (position) -> # device status changed, updating device status in Nora # position = ["up","down","stop"] switch position when "up" newPosition = 100 @system.updatePosition(newPosition) @system.postiontimer = setTimeout(()=> @system.pimaticDevice.stop() , @system.rollerTime) when "down" newPosition = 0 @system.updatePosition(newPosition) @system.postiontimer = setTimeout(()=> @system.pimaticDevice.stop() , @system.rollerTime) when "stopped" env.logger.debug "Stopped received, no further action" else env.logger.debug "Unknown position command '#{position}' from '#{@system.id}'" changePositionTo: (position) => # position is number. actions moveUp, moveDown, stop, rollingtime # if position is @position return if position > @position @pimaticDevice.moveUp() env.logger.debug "Blinds action: up" if position < @position @pimaticDevice.moveDown() env.logger.debug "Blinds action: down" clearTimeout(@positionTimer) if @positionTimer? stopShutter = () => @pimaticDevice.stop() env.logger.debug "Blinds action: stop" @positionTimer = setTimeout(stopShutter, @rollerTime) updatePosition: (newPosition) => unless newPosition is @state.openPercent env.logger.debug "Update position to " + newPosition @state.openPercent = newPosition @position = newPosition try @device$.pipe(operators.first()).toPromise() .then (device)=> device.updateState(@state) catch err env.logger.debug("while updating state #{err.message}: #{err.stack}") getType: () -> return "blinds" getState: () -> return @state destroy: -> return new Promise (resolve,reject) => @state.online = false; @updatePosition(@state.openPercent) @device.removeListener "position", @devicePositionHandler if @devicePositionHandler? clearTimeout(@positionTimer) if @positionTimer? @close$.next() @close$.complete() resolve(@id)
true
module.exports = (env) -> Promise = env.require 'bluebird' assert = env.require 'cassert' events = require 'events' childProcess = require("child_process") rxjs = require("rxjs") operators = require("rxjs/operators") connection = require("../node_modules/node-red-contrib-smartnora/build/firebase/connection.js") device_context = require("../node_modules/node-red-contrib-smartnora/build/firebase/device-context.js") util = require("../node_modules/node-red-contrib-smartnora/build/nodes/util.js") _ = require "lodash" class ShutterUpDownAdapter extends events.EventEmitter constructor: (config, pimaticDevice, smartnoraConfig) -> @id = config.pimatic_device_id #pimaticDevice.config.id @type = "noraf-blinds" @pimaticDevice = pimaticDevice @rollerTime = if config.auxiliary is "" then 20000 else (Number config.auxiliary) * 1000 @position = 0 noraConfig = email: smartnoraConfig.email password: PI:PASSWORD:<PASSWORD>END_PI group: smartnoraConfig.group valid: true localExecution: false deviceConfig = id: config.pimatic_device_id type: "action.devices.types.BLINDS" traits: [ "action.devices.traits.OpenClose" ] name: { name: config.name } roomHint: config.roomHint willReportState: true state: online: true openPercent: 100 attributes: {} noraSpecific: {} @close$ = new rxjs.Subject() ctx = new device_context.DeviceContext(@) ctx.update(@close$) notifyState = (state) => stateString = state.openPercent ctx.state$.next(stateString) # setup device stream from smartnora cloud # @device$ = connection.FirebaseConnection .withLogger(env.logger) .fromConfig(noraConfig, ctx) .pipe(operators.switchMap((connection) => connection.withDevice(deviceConfig, ctx)), util.withLocalExecution(noraConfig), operators.publishReplay(1), operators.refCount(), operators.takeUntil(@close$)) @device$.pipe(operators.switchMap((d) => d.state$), operators.tap((state) => notifyState(state)), operators.takeUntil(@close$)).subscribe() @device$.pipe(operators.switchMap((d) => d.stateUpdates$), operators.takeUntil(@close$)).subscribe((state) => env.logger.debug("Blinds received state: " + JSON.stringify(state,null,2)) @changePositionTo(state.openPercent) ) env.logger.debug "Tot hierooooo" # setup device handling in Pimatic # @pimaticDevice.on "position", @devicePositionHandler @pimaticDevice.system = @ @state = online: true openPercent: 0 status: (status) => env.logger.debug("Blinds device '#{@id}' status: " + JSON.stringify(status.text,null,2)) devicePositionHandler: (position) -> # device status changed, updating device status in Nora # position = ["up","down","stop"] switch position when "up" newPosition = 100 @system.updatePosition(newPosition) @system.postiontimer = setTimeout(()=> @system.pimaticDevice.stop() , @system.rollerTime) when "down" newPosition = 0 @system.updatePosition(newPosition) @system.postiontimer = setTimeout(()=> @system.pimaticDevice.stop() , @system.rollerTime) when "stopped" env.logger.debug "Stopped received, no further action" else env.logger.debug "Unknown position command '#{position}' from '#{@system.id}'" changePositionTo: (position) => # position is number. actions moveUp, moveDown, stop, rollingtime # if position is @position return if position > @position @pimaticDevice.moveUp() env.logger.debug "Blinds action: up" if position < @position @pimaticDevice.moveDown() env.logger.debug "Blinds action: down" clearTimeout(@positionTimer) if @positionTimer? stopShutter = () => @pimaticDevice.stop() env.logger.debug "Blinds action: stop" @positionTimer = setTimeout(stopShutter, @rollerTime) updatePosition: (newPosition) => unless newPosition is @state.openPercent env.logger.debug "Update position to " + newPosition @state.openPercent = newPosition @position = newPosition try @device$.pipe(operators.first()).toPromise() .then (device)=> device.updateState(@state) catch err env.logger.debug("while updating state #{err.message}: #{err.stack}") getType: () -> return "blinds" getState: () -> return @state destroy: -> return new Promise (resolve,reject) => @state.online = false; @updatePosition(@state.openPercent) @device.removeListener "position", @devicePositionHandler if @devicePositionHandler? clearTimeout(@positionTimer) if @positionTimer? @close$.next() @close$.complete() resolve(@id)
[ { "context": "###\nAuthor: Chris Baigorri\n###\n\n$ ->\n\n", "end": 26, "score": 0.9998815655708313, "start": 12, "tag": "NAME", "value": "Chris Baigorri" } ]
app/src/js/script.coffee
cbaigorri/ExpressBoilerplate
0
### Author: Chris Baigorri ### $ ->
63913
### Author: <NAME> ### $ ->
true
### Author: PI:NAME:<NAME>END_PI ### $ ->
[ { "context": "atchers'\n\n# TinyColor v1.3.0\n# https://github.com/bgrins/TinyColor\n# Brian Grinstead, MIT License\n# Conver", "end": 99, "score": 0.9995337128639221, "start": 93, "tag": "USERNAME", "value": "bgrins" }, { "context": "lor v1.3.0\n# https://github.com/bgrins/TinyColor...
lib/modules/helper/TinyColor.coffee
puranjayjain/chrome-color-picker
17
ColorMatchers = require './TinyColor/ColorMatchers' # TinyColor v1.3.0 # https://github.com/bgrins/TinyColor # Brian Grinstead, MIT License # Converted to coffescript # convert colors between formats module.exports = class TinyColor extends ColorMatchers tinyCounter: 0 # Big List of Colors # ------------------ # <http://www.w3.org/TR/css3-color/#svg-color> names: { aliceblue: 'f0f8ff' antiquewhite: 'faebd7' aqua: '0ff' aquamarine: '7fffd4' azure: 'f0ffff' beige: 'f5f5dc' bisque: 'ffe4c4' black: '000' blanchedalmond: 'ffebcd' blue: '00f' blueviolet: '8a2be2' brown: 'a52a2a' burlywood: 'deb887' burntsienna: 'ea7e5d' cadetblue: '5f9ea0' chartreuse: '7fff00' chocolate: 'd2691e' coral: 'ff7f50' cornflowerblue: '6495ed' cornsilk: 'fff8dc' crimson: 'dc143c' cyan: '0ff' darkblue: '00008b' darkcyan: '008b8b' darkgoldenrod: 'b8860b' darkgray: 'a9a9a9' darkgreen: '006400' darkgrey: 'a9a9a9' darkkhaki: 'bdb76b' darkmagenta: '8b008b' darkolivegreen: '556b2f' darkorange: 'ff8c00' darkorchid: '9932cc' darkred: '8b0000' darksalmon: 'e9967a' darkseagreen: '8fbc8f' darkslateblue: '483d8b' darkslategray: '2f4f4f' darkslategrey: '2f4f4f' darkturquoise: '00ced1' darkviolet: '9400d3' deeppink: 'ff1493' deepskyblue: '00bfff' dimgray: '696969' dimgrey: '696969' dodgerblue: '1e90ff' firebrick: 'b22222' floralwhite: 'fffaf0' forestgreen: '228b22' fuchsia: 'f0f' gainsboro: 'dcdcdc' ghostwhite: 'f8f8ff' gold: 'ffd700' goldenrod: 'daa520' gray: '808080' green: '008000' greenyellow: 'adff2f' grey: '808080' honeydew: 'f0fff0' hotpink: 'ff69b4' indianred: 'cd5c5c' indigo: '4b0082' ivory: 'fffff0' khaki: 'f0e68c' lavender: 'e6e6fa' lavenderblush: 'fff0f5' lawngreen: '7cfc00' lemonchiffon: 'fffacd' lightblue: 'add8e6' lightcoral: 'f08080' lightcyan: 'e0ffff' lightgoldenrodyellow: 'fafad2' lightgray: 'd3d3d3' lightgreen: '90ee90' lightgrey: 'd3d3d3' lightpink: 'ffb6c1' lightsalmon: 'ffa07a' lightseagreen: '20b2aa' lightskyblue: '87cefa' lightslategray: '789' lightslategrey: '789' lightsteelblue: 'b0c4de' lightyellow: 'ffffe0' lime: '0f0' limegreen: '32cd32' linen: 'faf0e6' magenta: 'f0f' maroon: '800000' mediumaquamarine: '66cdaa' mediumblue: '0000cd' mediumorchid: 'ba55d3' mediumpurple: '9370db' mediumseagreen: '3cb371' mediumslateblue: '7b68ee' mediumspringgreen: '00fa9a' mediumturquoise: '48d1cc' mediumvioletred: 'c71585' midnightblue: '191970' mintcream: 'f5fffa' mistyrose: 'ffe4e1' moccasin: 'ffe4b5' navajowhite: 'ffdead' navy: '000080' oldlace: 'fdf5e6' olive: '808000' olivedrab: '6b8e23' orange: 'ffa500' orangered: 'ff4500' orchid: 'da70d6' palegoldenrod: 'eee8aa' palegreen: '98fb98' paleturquoise: 'afeeee' palevioletred: 'db7093' papayawhip: 'ffefd5' peachpuff: 'ffdab9' peru: 'cd853f' pink: 'ffc0cb' plum: 'dda0dd' powderblue: 'b0e0e6' purple: '800080' rebeccapurple: '663399' red: 'f00' rosybrown: 'bc8f8f' royalblue: '4169e1' saddlebrown: '8b4513' salmon: 'fa8072' sandybrown: 'f4a460' seagreen: '2e8b57' seashell: 'fff5ee' sienna: 'a0522d' silver: 'c0c0c0' skyblue: '87ceeb' slateblue: '6a5acd' slategray: '708090' slategrey: '708090' snow: 'fffafa' springgreen: '00ff7f' steelblue: '4682b4' tan: 'd2b48c' teal: '008080' thistle: 'd8bfd8' tomato: 'ff6347' turquoise: '40e0d0' violet: 'ee82ee' wheat: 'f5deb3' white: 'fff' whitesmoke: 'f5f5f5' yellow: 'ff0' yellowgreen: '9acd32' } # Make it easy to access colors via `hexNames[hex]` hexNames: [] constructor: (color = '', opts = {}) -> # If input is already a TinyColor, return itself if color instanceof TinyColor return color # If we are called as a function, call using new instead if not (@ instanceof TinyColor) return new TinyColor color, opts # Make it easy to access colors via `hexNames[hex]` @hexNames = @flip @names rgb = @inputToRGB color @_originalInput = color @_r = rgb.r @_g = rgb.g @_b = rgb.b @_a = rgb.a @_roundA = Math.round(100 * @_a) / 100 @_format = opts.format or rgb.format @_gradientType = opts.gradientType # Don't let the range of [0,255] come back in [0,1]. # Potentially lose a little bit of precision here, but will fix issues where # .5 gets interpreted as half of the total, instead of half of 1 # If it was supposed to be 128, @ was already taken care of by `inputToRgb` if @_r < 1 @_r = Math.round(@_r) if @_g < 1 @_g = Math.round(@_g) if @_b < 1 @_b = Math.round(@_b) @_ok = rgb.ok @_tc_id = @tinyCounter++ return # If input is an object, force 1 into "1.0" to handle ratios properly # String input requires "1.0" as input, so 1 will be treated as 1 fromRatio: (color, opts) -> if typeof color is 'object' newColor = {} for i of color if color.hasOwnProperty i if i is 'a' newColor[i] = color[i] else newColor[i] = @convertToPercentage color[i] color = newColor TinyColor color, opts # Given a string or object, convert that input to RGB # Possible string inputs: # # "red" # "#f00" or "f00" # "#ff0000" or "ff0000" # "#ff000000" or "ff000000" # "rgb 255 0 0" or "rgb (255, 0, 0)" # "rgb 1.0 0 0" or "rgb (1, 0, 0)" # "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" # "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" # "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" # "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" # "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" # inputToRGB: (color) -> rgb = r: 0 g: 0 b: 0 a = 1 ok = false format = false if typeof color is 'string' color = @stringInputToObject color if typeof color is 'object' if @isValidCSSUnit(color.r) and @isValidCSSUnit(color.g) and @isValidCSSUnit(color.b) rgb = @rgbToRgb color.r, color.g, color.b ok = true format = if String(color.r).substr(-1) is '%' then 'prgb' else 'rgb' else if @isValidCSSUnit(color.h) and @isValidCSSUnit(color.s) and @isValidCSSUnit(color.v) color.s = @convertToPercentage color.s color.v = @convertToPercentage color.v rgb = @hsvToRgb color.h, color.s, color.v ok = true format = 'hsv' else if @isValidCSSUnit(color.h) and @isValidCSSUnit(color.s) and @isValidCSSUnit(color.l) color.s = @convertToPercentage color.s color.l = @convertToPercentage color.l rgb = @hslToRgb color.h, color.s, color.l ok = true format = 'hsl' if color.hasOwnProperty 'a' a = color.a a = @boundAlpha a { ok: ok format: color.format or format r: Math.min(255, Math.max(rgb.r, 0)) g: Math.min(255, Math.max(rgb.g, 0)) b: Math.min(255, Math.max(rgb.b, 0)) a: a } # Conversion Functions # -------------------- # `@rgbToHsl`, `@rgbToHsv`, `@hslToRgb`, `@hsvToRgb` modified from: # <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript> # `@rgbToRgb` # Handle bounds / percentage checking to conform to CSS color spec # <http://www.w3.org/TR/css3-color/> # *Assumes:* r, g, b in [0, 255] or [0, 1] # *Returns:* { r, g, b } in [0, 255] rgbToRgb: (r, g, b) -> { r: @bound01(r, 255) * 255 g: @bound01(g, 255) * 255 b: @bound01(b, 255) * 255 } # `@rgbToHsl` # Converts an RGB color value to HSL. # *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] # *Returns:* { h, s, l } in [0,1] rgbToHsl: (r, g, b) -> r = @bound01(r, 255) g = @bound01(g, 255) b = @bound01(b, 255) max = Math.max(r, g, b) min = Math.min(r, g, b) h = undefined s = undefined l = (max + min) / 2 if max is min h = s = 0 # achromatic else d = max - min s = if l > 0.5 then d / (2 - max - min) else d / (max + min) switch max when r h = (g - b) / d + (if g < b then 6 else 0) when g h = (b - r) / d + 2 when b h = (r - g) / d + 4 h /= 6 { h: h s: s l: l } # `@hslToRgb` # Converts an HSL color value to RGB. # *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] # *Returns:* { r, g, b } in the set [0, 255] hslToRgb: (h, s, l) -> r = undefined g = undefined b = undefined h = @bound01(h, 360) s = @bound01(s, 100) l = @bound01(l, 100) if s is 0 r = g = b = l # achromatic else q = if l < 0.5 then l * (1 + s) else l + s - (l * s) p = 2 * l - q r = @hue2rgb p, q, h + 1 / 3 g = @hue2rgb p, q, h b = @hue2rgb p, q, h - (1 / 3) { r: r * 255 g: g * 255 b: b * 255 } hue2rgb: (p, q, t) -> if t < 0 t += 1 if t > 1 t -= 1 if t < 1 / 6 return p + (q - p) * 6 * t if t < 1 / 2 return q if t < 2 / 3 return p + (q - p) * (2 / 3 - t) * 6 p # `@rgbToHsv` # Converts an RGB color value to HSV # *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] # *Returns:* { h, s, v } in [0,1] rgbToHsv: (r, g, b) -> r = @bound01(r, 255) g = @bound01(g, 255) b = @bound01(b, 255) max = Math.max(r, g, b) min = Math.min(r, g, b) h = undefined s = undefined v = max d = max - min s = if max is 0 then 0 else d / max if max is min h = 0 # achromatic else switch max when r h = (g - b) / d + (if g < b then 6 else 0) when g h = (b - r) / d + 2 when b h = (r - g) / d + 4 h /= 6 { h: h s: s v: v } # `@hsvToRgb` # Converts an HSV color value to RGB. # *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] # *Returns:* { r, g, b } in the set [0, 255] hsvToRgb: (h, s, v) -> h = @bound01(h, 360) * 6 s = @bound01(s, 100) v = @bound01(v, 100) i = Math.floor(h) f = h - i p = v * (1 - s) q = v * (1 - (f * s)) t = v * (1 - ((1 - f) * s)) mod = i % 6 r = [ v q p p t v ][mod] g = [ t v v q p p ][mod] b = [ p p t v v q ][mod] { r: r * 255 g: g * 255 b: b * 255 } # `@rgbToHex` # Converts an RGB color to hex # Assumes r, g, and b are contained in the set [0, 255] # Returns a 3 or 6 character hex rgbToHex: (r, g, b, allow3Char) -> hex = [ @pad2(Math.round(r).toString(16)) @pad2(Math.round(g).toString(16)) @pad2(Math.round(b).toString(16)) ] # Return a 3 character hex if possible if allow3Char and hex[0].charAt(0) is hex[0].charAt(1) and hex[1].charAt(0) is hex[1].charAt(1) and hex[2].charAt(0) is hex[2].charAt(1) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) hex.join '' # `@rgbaToHex` # Converts an RGBA color plus alpha transparency to hex # Assumes r, g, b and a are contained in the set [0, 255] # Returns an 8 character hex rgbaToHex: (r, g, b, a) -> hex = [ @pad2(@convertDecimalToHex(a)) @pad2(Math.round(r).toString(16)) @pad2(Math.round(g).toString(16)) @pad2(Math.round(b).toString(16)) ] hex.join '' # Utilities # --------- # `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` flip: (o) -> flipped = {} for i of o if o.hasOwnProperty(i) flipped[o[i]] = i flipped # Return a valid alpha value [0,1] with all invalid values being set to 1 boundAlpha: (a) -> a = parseFloat(a) if isNaN(a) or a < 0 or a > 1 a = 1 a # Take input from [0, n] and return it as [0, 1] bound01: (n, max) -> if @isOnePointZero(n) n = '100%' processPercent = @isPercentage(n) n = Math.min(max, Math.max(0, parseFloat(n))) # Automatically convert percentage into number if processPercent n = parseInt(n * max, 10) / 100 # Handle floating point rounding errors if Math.abs(n - max) < 0.000001 return 1 # Convert into [0, 1] range if it isn't already n % max / parseFloat(max) # Force a number between 0 and 1 clamp01: (val) -> Math.min 1, Math.max(0, val) # Parse a base-16 hex value into a base-10 integer parseIntFromHex: (val) -> parseInt val, 16 # Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 # <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0> isOnePointZero: (n) -> typeof n is 'string' and n.indexOf('.') isnt -1 and parseFloat(n) is 1 # Check to see if string passed in is a percentage isPercentage: (n) -> typeof n is 'string' and n.indexOf('%') isnt -1 # Force a hex value to have 2 characters pad2: (c) -> if c.length is 1 then "0#{c}" else "#{c}" # Replace a decimal with it's percentage value convertToPercentage: (n) -> if n <= 1 n = "#{n * 100}%" n # Converts a decimal to a hex value convertDecimalToHex: (d) -> Math.round(parseFloat(d) * 255).toString 16 # Converts a hex value to a decimal convertHexToDecimal: (h) -> @parseIntFromHex(h) / 255 # `@isValidCSSUnit` # Take in a single string / number and check to see if it looks like a CSS unit # (see `matchers` above for definition). isValidCSSUnit: (color) -> !! @matchers.CSS_UNIT.exec color # `@stringInputToObject` # Permissive string parsing. Take in a number of formats, and output an object # based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` stringInputToObject: (color) -> color = color.replace(/^\s+/, '').replace(/\s+$/, '').toLowerCase() named = false if @names[color] color = @names[color] named = true else if color is 'transparent' return { r: 0 g: 0 b: 0 a: 0 format: 'name' } # Try to match string input using regular expressions. # Keep most of the number bounding out of @ function - don't worry about [0,1] or [0,100] or [0,360] # Just return an object and let the conversion functions handle that. # @ way the result will be the same whether the TinyColor is initialized with string or object. match = undefined if match = @matchers.rgb.exec(color) return { r: match[1] g: match[2] b: match[3] } if match = @matchers.rgba.exec(color) return { r: match[1] g: match[2] b: match[3] a: match[4] } if match = @matchers.hsl.exec(color) return { h: match[1] s: match[2] l: match[3] } if match = @matchers.hsla.exec(color) return { h: match[1] s: match[2] l: match[3] a: match[4] } if match = @matchers.hsv.exec(color) return { h: match[1] s: match[2] v: match[3] } if match = @matchers.hsva.exec(color) return { h: match[1] s: match[2] v: match[3] a: match[4] } if match = @matchers.hex8.exec(color) return { a: @convertHexToDecimal(match[1]) r: @parseIntFromHex(match[2]) g: @parseIntFromHex(match[3]) b: @parseIntFromHex(match[4]) format: if named then 'name' else 'hex8' } if match = @matchers.hex6.exec(color) return { r: @parseIntFromHex(match[1]) g: @parseIntFromHex(match[2]) b: @parseIntFromHex(match[3]) format: if named then 'name' else 'hex' } if match = @matchers.hex3.exec(color) return { r: @parseIntFromHex(match[1] + '' + match[1]) g: @parseIntFromHex(match[2] + '' + match[2]) b: @parseIntFromHex(match[3] + '' + match[3]) format: if named then 'name' else 'hex' } false isDark: -> @getBrightness() < 128 isLight: -> not @isDark() isValid: -> @_ok getOriginalInput: -> @_originalInput getFormat: -> @_format getAlpha: -> @_a getBrightness: -> #http://www.w3.org/TR/AERT#color-contrast rgb = @toRgb() (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000 getLuminance: -> #http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef rgb = @toRgb() RsRGB = undefined GsRGB = undefined BsRGB = undefined R = undefined G = undefined B = undefined RsRGB = rgb.r / 255 GsRGB = rgb.g / 255 BsRGB = rgb.b / 255 if RsRGB <= 0.03928 R = RsRGB / 12.92 else R = ((RsRGB + 0.055) / 1.055) ** 2.4 if GsRGB <= 0.03928 G = GsRGB / 12.92 else G = ((GsRGB + 0.055) / 1.055) ** 2.4 if BsRGB <= 0.03928 B = BsRGB / 12.92 else B = ((BsRGB + 0.055) / 1.055) ** 2.4 0.2126 * R + 0.7152 * G + 0.0722 * B setAlpha: (value) -> @_a = @boundAlpha(value) @_roundA = Math.round(100 * @_a) / 100 @ toHsv: -> hsv = @rgbToHsv(@_r, @_g, @_b) { h: hsv.h * 360 s: hsv.s v: hsv.v a: @_a } toHsvString: -> hsv = @rgbToHsv(@_r, @_g, @_b) h = Math.round(hsv.h * 360) s = Math.round(hsv.s * 100) v = Math.round(hsv.v * 100) if @_a is 1 then "hsv(#{h}, #{s}%, #{v}%)" else "hsva(#{h}, #{s}%, #{v}%, #{@_roundA})" toHsl: -> hsl = @rgbToHsl(@_r, @_g, @_b) { h: hsl.h * 360 s: hsl.s l: hsl.l a: @_a } toHslString: -> hsl = @rgbToHsl(@_r, @_g, @_b) h = Math.round(hsl.h * 360) s = Math.round(hsl.s * 100) l = Math.round(hsl.l * 100) if @_a is 1 then "hsl(#{h}, #{s}%, #{l}%)" else "hsla(#{h}, #{s}%, #{l}%, #{@_roundA})" toRatioHslString: -> hsl = @rgbToHsl(@_r, @_g, @_b) h = Math.round(hsl.h * 360) s = Math.round(hsl.s) l = Math.round(hsl.l) if @_a is 1 then "hsl(#{h}, #{s}, #{l})" else "hsla(#{h}, #{s}, #{l}, #{@_roundA})" toHex: (allow3Char) -> @rgbToHex @_r, @_g, @_b, allow3Char toHexString: (allow3Char) -> "##{@toHex(allow3Char)}" toHex8: -> @rgbaToHex @_r, @_g, @_b, @_a toHex8String: -> "##{@toHex8()}" toRgb: -> # fix to make them below 255 c_r = Math.round(@_r) c_g = Math.round(@_g) c_b = Math.round(@_b) if c_r > 255 c_r = 255 if c_g > 255 c_g = 255 if c_b > 255 c_ b = 255 { r: c_r g: c_g b: c_b a: @_a } toRgbString: -> if @_a is 1 then "rgb(#{Math.round(@_r)}, #{Math.round(@_g)}, #{Math.round(@_b)})" else "rgba(#{Math.round(@_r)}, #{Math.round(@_g)}, #{Math.round(@_b)}, #{@_roundA})" toPercentageRgb: -> { r: "#{Math.round(@bound01(@_r, 255) * 100)}%" g: "#{Math.round(@bound01(@_g, 255) * 100)}%" b: "#{Math.round(@bound01(@_b, 255) * 100)}%" a: @_a } toPercentageRgbString: -> if @_a is 1 "rgb(#{Math.round(@bound01(@_r, 255) * 100)}%, #{Math.round(@bound01(@_g, 255) * 100)}%, #{Math.round(@bound01(@_b, 255) * 100)}%)" else "rgba(#{Math.round(@bound01(@_r, 255) * 100)}%, #{Math.round(@bound01(@_g, 255) * 100)}%, #{Math.round(@bound01(@_b, 255) * 100)}%, #{@_roundA})" toRatioRgbString: -> if @_a is 1 "rgb(#{Math.round(@bound01(@_r, 255))}, #{Math.round(@bound01(@_g, 255))}, #{Math.round(@bound01(@_b, 255))})" else "rgba(#{Math.round(@bound01(@_r, 255))}, #{Math.round(@bound01(@_g, 255))}, #{Math.round(@bound01(@_b, 255))}, #{@_roundA})" toName: -> if @_a is 0 return 'transparent' if @_a < 1 return false @hexNames[@rgbToHex(@_r, @_g, @_b, true)] or false toString: (format) -> formatSet = !!format format = format or @_format formattedString = false hasAlpha = @_a < 1 and @_a >= 0 needsAlphaFormat = not formatSet and hasAlpha and (format is 'hex' or format is 'hex6' or format is 'hex3' or format is 'name') if needsAlphaFormat # Special case for "transparent", all other non-alpha formats # will return rgba when there is transparency. if format is 'name' and @_a is 0 return @toName() return @toRgbString() if format is 'rgb' formattedString = @toRgbString() if format is 'prgb' formattedString = @toPercentageRgbString() if format is 'rrgb' formattedString = @toRatioRgbString() if format is 'hex' or format is 'hex6' formattedString = @toHexString() if format is 'hex3' formattedString = @toHexString(true) if format is 'hex8' formattedString = @toHex8String() if format is 'name' formattedString = @toName() if format is 'hsl' formattedString = @toHslString() if format is 'rhsl' formattedString = @toRatioHslString() if format is 'hsv' formattedString = @toHsvString() formattedString or @toHexString() clone: -> TinyColor @toString() random: -> @fromRatio r: Math.random() g: Math.random() b: Math.random() # `equals` # Can be called with any TinyColor input equals: (color1, color2) -> if not color1 or not color2 return false TinyColor(color1).toRgbString() is TinyColor(color2).toRgbString()
27178
ColorMatchers = require './TinyColor/ColorMatchers' # TinyColor v1.3.0 # https://github.com/bgrins/TinyColor # <NAME>, MIT License # Converted to coffescript # convert colors between formats module.exports = class TinyColor extends ColorMatchers tinyCounter: 0 # Big List of Colors # ------------------ # <http://www.w3.org/TR/css3-color/#svg-color> names: { aliceblue: 'f0f8ff' antiquewhite: 'faebd7' aqua: '0ff' aquamarine: '7fffd4' azure: 'f0ffff' beige: 'f5f5dc' bisque: 'ffe4c4' black: '000' blanchedalmond: 'ffebcd' blue: '00f' blueviolet: '8a2be2' brown: 'a52a2a' burlywood: 'deb887' burntsienna: 'ea7e5d' cadetblue: '5f9ea0' chartreuse: '7fff00' chocolate: 'd2691e' coral: 'ff7f50' cornflowerblue: '6495ed' cornsilk: 'fff8dc' crimson: 'dc143c' cyan: '0ff' darkblue: '00008b' darkcyan: '008b8b' darkgoldenrod: 'b8860b' darkgray: 'a9a9a9' darkgreen: '006400' darkgrey: 'a9a9a9' darkkhaki: 'bdb76b' darkmagenta: '8b008b' darkolivegreen: '556b2f' darkorange: 'ff8c00' darkorchid: '9932cc' darkred: '8b0000' darksalmon: 'e9967a' darkseagreen: '8fbc8f' darkslateblue: '483d8b' darkslategray: '2f4f4f' darkslategrey: '2f4f4f' darkturquoise: '00ced1' darkviolet: '9400d3' deeppink: 'ff1493' deepskyblue: '00bfff' dimgray: '696969' dimgrey: '696969' dodgerblue: '1e90ff' firebrick: 'b22222' floralwhite: 'fffaf0' forestgreen: '228b22' fuchsia: 'f0f' gainsboro: 'dcdcdc' ghostwhite: 'f8f8ff' gold: 'ffd700' goldenrod: 'daa520' gray: '808080' green: '008000' greenyellow: 'adff2f' grey: '808080' honeydew: 'f0fff0' hotpink: 'ff69b4' indianred: 'cd5c5c' indigo: '4b0082' ivory: 'fffff0' khaki: 'f0e68c' lavender: 'e6e6fa' lavenderblush: 'fff0f5' lawngreen: '7cfc00' lemonchiffon: 'fffacd' lightblue: 'add8e6' lightcoral: 'f08080' lightcyan: 'e0ffff' lightgoldenrodyellow: 'fafad2' lightgray: 'd3d3d3' lightgreen: '90ee90' lightgrey: 'd3d3d3' lightpink: 'ffb6c1' lightsalmon: 'ffa07a' lightseagreen: '20b2aa' lightskyblue: '87cefa' lightslategray: '789' lightslategrey: '789' lightsteelblue: 'b0c4de' lightyellow: 'ffffe0' lime: '0f0' limegreen: '32cd32' linen: 'faf0e6' magenta: 'f0f' maroon: '800000' mediumaquamarine: '66cdaa' mediumblue: '0000cd' mediumorchid: 'ba55d3' mediumpurple: '9370db' mediumseagreen: '3cb371' mediumslateblue: '7b68ee' mediumspringgreen: '00fa9a' mediumturquoise: '48d1cc' mediumvioletred: 'c71585' midnightblue: '191970' mintcream: 'f5fffa' mistyrose: 'ffe4e1' moccasin: 'ffe4b5' navajowhite: 'ffdead' navy: '000080' oldlace: 'fdf5e6' olive: '808000' olivedrab: '6b8e23' orange: 'ffa500' orangered: 'ff4500' orchid: 'da70d6' palegoldenrod: 'eee8aa' palegreen: '98fb98' paleturquoise: 'afeeee' palevioletred: 'db7093' papayawhip: 'ffefd5' peachpuff: 'ffdab9' peru: 'cd853f' pink: 'ffc0cb' plum: 'dda0dd' powderblue: 'b0e0e6' purple: '800080' rebeccapurple: '663399' red: 'f00' rosybrown: 'bc8f8f' royalblue: '4169e1' saddlebrown: '8b4513' salmon: 'fa8072' sandybrown: 'f4a460' seagreen: '2e8b57' seashell: 'fff5ee' sienna: 'a0522d' silver: 'c0c0c0' skyblue: '87ceeb' slateblue: '6a5acd' slategray: '708090' slategrey: '708090' snow: 'fffafa' springgreen: '00ff7f' steelblue: '4682b4' tan: 'd2b48c' teal: '008080' thistle: 'd8bfd8' tomato: 'ff6347' turquoise: '40e0d0' violet: 'ee82ee' wheat: 'f5deb3' white: 'fff' whitesmoke: 'f5f5f5' yellow: 'ff0' yellowgreen: '9acd32' } # Make it easy to access colors via `hexNames[hex]` hexNames: [] constructor: (color = '', opts = {}) -> # If input is already a TinyColor, return itself if color instanceof TinyColor return color # If we are called as a function, call using new instead if not (@ instanceof TinyColor) return new TinyColor color, opts # Make it easy to access colors via `hexNames[hex]` @hexNames = @flip @names rgb = @inputToRGB color @_originalInput = color @_r = rgb.r @_g = rgb.g @_b = rgb.b @_a = rgb.a @_roundA = Math.round(100 * @_a) / 100 @_format = opts.format or rgb.format @_gradientType = opts.gradientType # Don't let the range of [0,255] come back in [0,1]. # Potentially lose a little bit of precision here, but will fix issues where # .5 gets interpreted as half of the total, instead of half of 1 # If it was supposed to be 128, @ was already taken care of by `inputToRgb` if @_r < 1 @_r = Math.round(@_r) if @_g < 1 @_g = Math.round(@_g) if @_b < 1 @_b = Math.round(@_b) @_ok = rgb.ok @_tc_id = @tinyCounter++ return # If input is an object, force 1 into "1.0" to handle ratios properly # String input requires "1.0" as input, so 1 will be treated as 1 fromRatio: (color, opts) -> if typeof color is 'object' newColor = {} for i of color if color.hasOwnProperty i if i is 'a' newColor[i] = color[i] else newColor[i] = @convertToPercentage color[i] color = newColor TinyColor color, opts # Given a string or object, convert that input to RGB # Possible string inputs: # # "red" # "#f00" or "f00" # "#ff0000" or "ff0000" # "#ff000000" or "ff000000" # "rgb 255 0 0" or "rgb (255, 0, 0)" # "rgb 1.0 0 0" or "rgb (1, 0, 0)" # "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" # "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" # "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" # "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" # "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" # inputToRGB: (color) -> rgb = r: 0 g: 0 b: 0 a = 1 ok = false format = false if typeof color is 'string' color = @stringInputToObject color if typeof color is 'object' if @isValidCSSUnit(color.r) and @isValidCSSUnit(color.g) and @isValidCSSUnit(color.b) rgb = @rgbToRgb color.r, color.g, color.b ok = true format = if String(color.r).substr(-1) is '%' then 'prgb' else 'rgb' else if @isValidCSSUnit(color.h) and @isValidCSSUnit(color.s) and @isValidCSSUnit(color.v) color.s = @convertToPercentage color.s color.v = @convertToPercentage color.v rgb = @hsvToRgb color.h, color.s, color.v ok = true format = 'hsv' else if @isValidCSSUnit(color.h) and @isValidCSSUnit(color.s) and @isValidCSSUnit(color.l) color.s = @convertToPercentage color.s color.l = @convertToPercentage color.l rgb = @hslToRgb color.h, color.s, color.l ok = true format = 'hsl' if color.hasOwnProperty 'a' a = color.a a = @boundAlpha a { ok: ok format: color.format or format r: Math.min(255, Math.max(rgb.r, 0)) g: Math.min(255, Math.max(rgb.g, 0)) b: Math.min(255, Math.max(rgb.b, 0)) a: a } # Conversion Functions # -------------------- # `@rgbToHsl`, `@rgbToHsv`, `@hslToRgb`, `@hsvToRgb` modified from: # <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript> # `@rgbToRgb` # Handle bounds / percentage checking to conform to CSS color spec # <http://www.w3.org/TR/css3-color/> # *Assumes:* r, g, b in [0, 255] or [0, 1] # *Returns:* { r, g, b } in [0, 255] rgbToRgb: (r, g, b) -> { r: @bound01(r, 255) * 255 g: @bound01(g, 255) * 255 b: @bound01(b, 255) * 255 } # `@rgbToHsl` # Converts an RGB color value to HSL. # *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] # *Returns:* { h, s, l } in [0,1] rgbToHsl: (r, g, b) -> r = @bound01(r, 255) g = @bound01(g, 255) b = @bound01(b, 255) max = Math.max(r, g, b) min = Math.min(r, g, b) h = undefined s = undefined l = (max + min) / 2 if max is min h = s = 0 # achromatic else d = max - min s = if l > 0.5 then d / (2 - max - min) else d / (max + min) switch max when r h = (g - b) / d + (if g < b then 6 else 0) when g h = (b - r) / d + 2 when b h = (r - g) / d + 4 h /= 6 { h: h s: s l: l } # `@hslToRgb` # Converts an HSL color value to RGB. # *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] # *Returns:* { r, g, b } in the set [0, 255] hslToRgb: (h, s, l) -> r = undefined g = undefined b = undefined h = @bound01(h, 360) s = @bound01(s, 100) l = @bound01(l, 100) if s is 0 r = g = b = l # achromatic else q = if l < 0.5 then l * (1 + s) else l + s - (l * s) p = 2 * l - q r = @hue2rgb p, q, h + 1 / 3 g = @hue2rgb p, q, h b = @hue2rgb p, q, h - (1 / 3) { r: r * 255 g: g * 255 b: b * 255 } hue2rgb: (p, q, t) -> if t < 0 t += 1 if t > 1 t -= 1 if t < 1 / 6 return p + (q - p) * 6 * t if t < 1 / 2 return q if t < 2 / 3 return p + (q - p) * (2 / 3 - t) * 6 p # `@rgbToHsv` # Converts an RGB color value to HSV # *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] # *Returns:* { h, s, v } in [0,1] rgbToHsv: (r, g, b) -> r = @bound01(r, 255) g = @bound01(g, 255) b = @bound01(b, 255) max = Math.max(r, g, b) min = Math.min(r, g, b) h = undefined s = undefined v = max d = max - min s = if max is 0 then 0 else d / max if max is min h = 0 # achromatic else switch max when r h = (g - b) / d + (if g < b then 6 else 0) when g h = (b - r) / d + 2 when b h = (r - g) / d + 4 h /= 6 { h: h s: s v: v } # `@hsvToRgb` # Converts an HSV color value to RGB. # *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] # *Returns:* { r, g, b } in the set [0, 255] hsvToRgb: (h, s, v) -> h = @bound01(h, 360) * 6 s = @bound01(s, 100) v = @bound01(v, 100) i = Math.floor(h) f = h - i p = v * (1 - s) q = v * (1 - (f * s)) t = v * (1 - ((1 - f) * s)) mod = i % 6 r = [ v q p p t v ][mod] g = [ t v v q p p ][mod] b = [ p p t v v q ][mod] { r: r * 255 g: g * 255 b: b * 255 } # `@rgbToHex` # Converts an RGB color to hex # Assumes r, g, and b are contained in the set [0, 255] # Returns a 3 or 6 character hex rgbToHex: (r, g, b, allow3Char) -> hex = [ @pad2(Math.round(r).toString(16)) @pad2(Math.round(g).toString(16)) @pad2(Math.round(b).toString(16)) ] # Return a 3 character hex if possible if allow3Char and hex[0].charAt(0) is hex[0].charAt(1) and hex[1].charAt(0) is hex[1].charAt(1) and hex[2].charAt(0) is hex[2].charAt(1) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) hex.join '' # `@rgbaToHex` # Converts an RGBA color plus alpha transparency to hex # Assumes r, g, b and a are contained in the set [0, 255] # Returns an 8 character hex rgbaToHex: (r, g, b, a) -> hex = [ @pad2(@convertDecimalToHex(a)) @pad2(Math.round(r).toString(16)) @pad2(Math.round(g).toString(16)) @pad2(Math.round(b).toString(16)) ] hex.join '' # Utilities # --------- # `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` flip: (o) -> flipped = {} for i of o if o.hasOwnProperty(i) flipped[o[i]] = i flipped # Return a valid alpha value [0,1] with all invalid values being set to 1 boundAlpha: (a) -> a = parseFloat(a) if isNaN(a) or a < 0 or a > 1 a = 1 a # Take input from [0, n] and return it as [0, 1] bound01: (n, max) -> if @isOnePointZero(n) n = '100%' processPercent = @isPercentage(n) n = Math.min(max, Math.max(0, parseFloat(n))) # Automatically convert percentage into number if processPercent n = parseInt(n * max, 10) / 100 # Handle floating point rounding errors if Math.abs(n - max) < 0.000001 return 1 # Convert into [0, 1] range if it isn't already n % max / parseFloat(max) # Force a number between 0 and 1 clamp01: (val) -> Math.min 1, Math.max(0, val) # Parse a base-16 hex value into a base-10 integer parseIntFromHex: (val) -> parseInt val, 16 # Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 # <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0> isOnePointZero: (n) -> typeof n is 'string' and n.indexOf('.') isnt -1 and parseFloat(n) is 1 # Check to see if string passed in is a percentage isPercentage: (n) -> typeof n is 'string' and n.indexOf('%') isnt -1 # Force a hex value to have 2 characters pad2: (c) -> if c.length is 1 then "0#{c}" else "#{c}" # Replace a decimal with it's percentage value convertToPercentage: (n) -> if n <= 1 n = "#{n * 100}%" n # Converts a decimal to a hex value convertDecimalToHex: (d) -> Math.round(parseFloat(d) * 255).toString 16 # Converts a hex value to a decimal convertHexToDecimal: (h) -> @parseIntFromHex(h) / 255 # `@isValidCSSUnit` # Take in a single string / number and check to see if it looks like a CSS unit # (see `matchers` above for definition). isValidCSSUnit: (color) -> !! @matchers.CSS_UNIT.exec color # `@stringInputToObject` # Permissive string parsing. Take in a number of formats, and output an object # based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` stringInputToObject: (color) -> color = color.replace(/^\s+/, '').replace(/\s+$/, '').toLowerCase() named = false if @names[color] color = @names[color] named = true else if color is 'transparent' return { r: 0 g: 0 b: 0 a: 0 format: 'name' } # Try to match string input using regular expressions. # Keep most of the number bounding out of @ function - don't worry about [0,1] or [0,100] or [0,360] # Just return an object and let the conversion functions handle that. # @ way the result will be the same whether the TinyColor is initialized with string or object. match = undefined if match = @matchers.rgb.exec(color) return { r: match[1] g: match[2] b: match[3] } if match = @matchers.rgba.exec(color) return { r: match[1] g: match[2] b: match[3] a: match[4] } if match = @matchers.hsl.exec(color) return { h: match[1] s: match[2] l: match[3] } if match = @matchers.hsla.exec(color) return { h: match[1] s: match[2] l: match[3] a: match[4] } if match = @matchers.hsv.exec(color) return { h: match[1] s: match[2] v: match[3] } if match = @matchers.hsva.exec(color) return { h: match[1] s: match[2] v: match[3] a: match[4] } if match = @matchers.hex8.exec(color) return { a: @convertHexToDecimal(match[1]) r: @parseIntFromHex(match[2]) g: @parseIntFromHex(match[3]) b: @parseIntFromHex(match[4]) format: if named then 'name' else 'hex8' } if match = @matchers.hex6.exec(color) return { r: @parseIntFromHex(match[1]) g: @parseIntFromHex(match[2]) b: @parseIntFromHex(match[3]) format: if named then 'name' else 'hex' } if match = @matchers.hex3.exec(color) return { r: @parseIntFromHex(match[1] + '' + match[1]) g: @parseIntFromHex(match[2] + '' + match[2]) b: @parseIntFromHex(match[3] + '' + match[3]) format: if named then 'name' else 'hex' } false isDark: -> @getBrightness() < 128 isLight: -> not @isDark() isValid: -> @_ok getOriginalInput: -> @_originalInput getFormat: -> @_format getAlpha: -> @_a getBrightness: -> #http://www.w3.org/TR/AERT#color-contrast rgb = @toRgb() (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000 getLuminance: -> #http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef rgb = @toRgb() RsRGB = undefined GsRGB = undefined BsRGB = undefined R = undefined G = undefined B = undefined RsRGB = rgb.r / 255 GsRGB = rgb.g / 255 BsRGB = rgb.b / 255 if RsRGB <= 0.03928 R = RsRGB / 12.92 else R = ((RsRGB + 0.055) / 1.055) ** 2.4 if GsRGB <= 0.03928 G = GsRGB / 12.92 else G = ((GsRGB + 0.055) / 1.055) ** 2.4 if BsRGB <= 0.03928 B = BsRGB / 12.92 else B = ((BsRGB + 0.055) / 1.055) ** 2.4 0.2126 * R + 0.7152 * G + 0.0722 * B setAlpha: (value) -> @_a = @boundAlpha(value) @_roundA = Math.round(100 * @_a) / 100 @ toHsv: -> hsv = @rgbToHsv(@_r, @_g, @_b) { h: hsv.h * 360 s: hsv.s v: hsv.v a: @_a } toHsvString: -> hsv = @rgbToHsv(@_r, @_g, @_b) h = Math.round(hsv.h * 360) s = Math.round(hsv.s * 100) v = Math.round(hsv.v * 100) if @_a is 1 then "hsv(#{h}, #{s}%, #{v}%)" else "hsva(#{h}, #{s}%, #{v}%, #{@_roundA})" toHsl: -> hsl = @rgbToHsl(@_r, @_g, @_b) { h: hsl.h * 360 s: hsl.s l: hsl.l a: @_a } toHslString: -> hsl = @rgbToHsl(@_r, @_g, @_b) h = Math.round(hsl.h * 360) s = Math.round(hsl.s * 100) l = Math.round(hsl.l * 100) if @_a is 1 then "hsl(#{h}, #{s}%, #{l}%)" else "hsla(#{h}, #{s}%, #{l}%, #{@_roundA})" toRatioHslString: -> hsl = @rgbToHsl(@_r, @_g, @_b) h = Math.round(hsl.h * 360) s = Math.round(hsl.s) l = Math.round(hsl.l) if @_a is 1 then "hsl(#{h}, #{s}, #{l})" else "hsla(#{h}, #{s}, #{l}, #{@_roundA})" toHex: (allow3Char) -> @rgbToHex @_r, @_g, @_b, allow3Char toHexString: (allow3Char) -> "##{@toHex(allow3Char)}" toHex8: -> @rgbaToHex @_r, @_g, @_b, @_a toHex8String: -> "##{@toHex8()}" toRgb: -> # fix to make them below 255 c_r = Math.round(@_r) c_g = Math.round(@_g) c_b = Math.round(@_b) if c_r > 255 c_r = 255 if c_g > 255 c_g = 255 if c_b > 255 c_ b = 255 { r: c_r g: c_g b: c_b a: @_a } toRgbString: -> if @_a is 1 then "rgb(#{Math.round(@_r)}, #{Math.round(@_g)}, #{Math.round(@_b)})" else "rgba(#{Math.round(@_r)}, #{Math.round(@_g)}, #{Math.round(@_b)}, #{@_roundA})" toPercentageRgb: -> { r: "#{Math.round(@bound01(@_r, 255) * 100)}%" g: "#{Math.round(@bound01(@_g, 255) * 100)}%" b: "#{Math.round(@bound01(@_b, 255) * 100)}%" a: @_a } toPercentageRgbString: -> if @_a is 1 "rgb(#{Math.round(@bound01(@_r, 255) * 100)}%, #{Math.round(@bound01(@_g, 255) * 100)}%, #{Math.round(@bound01(@_b, 255) * 100)}%)" else "rgba(#{Math.round(@bound01(@_r, 255) * 100)}%, #{Math.round(@bound01(@_g, 255) * 100)}%, #{Math.round(@bound01(@_b, 255) * 100)}%, #{@_roundA})" toRatioRgbString: -> if @_a is 1 "rgb(#{Math.round(@bound01(@_r, 255))}, #{Math.round(@bound01(@_g, 255))}, #{Math.round(@bound01(@_b, 255))})" else "rgba(#{Math.round(@bound01(@_r, 255))}, #{Math.round(@bound01(@_g, 255))}, #{Math.round(@bound01(@_b, 255))}, #{@_roundA})" toName: -> if @_a is 0 return 'transparent' if @_a < 1 return false @hexNames[@rgbToHex(@_r, @_g, @_b, true)] or false toString: (format) -> formatSet = !!format format = format or @_format formattedString = false hasAlpha = @_a < 1 and @_a >= 0 needsAlphaFormat = not formatSet and hasAlpha and (format is 'hex' or format is 'hex6' or format is 'hex3' or format is 'name') if needsAlphaFormat # Special case for "transparent", all other non-alpha formats # will return rgba when there is transparency. if format is 'name' and @_a is 0 return @toName() return @toRgbString() if format is 'rgb' formattedString = @toRgbString() if format is 'prgb' formattedString = @toPercentageRgbString() if format is 'rrgb' formattedString = @toRatioRgbString() if format is 'hex' or format is 'hex6' formattedString = @toHexString() if format is 'hex3' formattedString = @toHexString(true) if format is 'hex8' formattedString = @toHex8String() if format is 'name' formattedString = @toName() if format is 'hsl' formattedString = @toHslString() if format is 'rhsl' formattedString = @toRatioHslString() if format is 'hsv' formattedString = @toHsvString() formattedString or @toHexString() clone: -> TinyColor @toString() random: -> @fromRatio r: Math.random() g: Math.random() b: Math.random() # `equals` # Can be called with any TinyColor input equals: (color1, color2) -> if not color1 or not color2 return false TinyColor(color1).toRgbString() is TinyColor(color2).toRgbString()
true
ColorMatchers = require './TinyColor/ColorMatchers' # TinyColor v1.3.0 # https://github.com/bgrins/TinyColor # PI:NAME:<NAME>END_PI, MIT License # Converted to coffescript # convert colors between formats module.exports = class TinyColor extends ColorMatchers tinyCounter: 0 # Big List of Colors # ------------------ # <http://www.w3.org/TR/css3-color/#svg-color> names: { aliceblue: 'f0f8ff' antiquewhite: 'faebd7' aqua: '0ff' aquamarine: '7fffd4' azure: 'f0ffff' beige: 'f5f5dc' bisque: 'ffe4c4' black: '000' blanchedalmond: 'ffebcd' blue: '00f' blueviolet: '8a2be2' brown: 'a52a2a' burlywood: 'deb887' burntsienna: 'ea7e5d' cadetblue: '5f9ea0' chartreuse: '7fff00' chocolate: 'd2691e' coral: 'ff7f50' cornflowerblue: '6495ed' cornsilk: 'fff8dc' crimson: 'dc143c' cyan: '0ff' darkblue: '00008b' darkcyan: '008b8b' darkgoldenrod: 'b8860b' darkgray: 'a9a9a9' darkgreen: '006400' darkgrey: 'a9a9a9' darkkhaki: 'bdb76b' darkmagenta: '8b008b' darkolivegreen: '556b2f' darkorange: 'ff8c00' darkorchid: '9932cc' darkred: '8b0000' darksalmon: 'e9967a' darkseagreen: '8fbc8f' darkslateblue: '483d8b' darkslategray: '2f4f4f' darkslategrey: '2f4f4f' darkturquoise: '00ced1' darkviolet: '9400d3' deeppink: 'ff1493' deepskyblue: '00bfff' dimgray: '696969' dimgrey: '696969' dodgerblue: '1e90ff' firebrick: 'b22222' floralwhite: 'fffaf0' forestgreen: '228b22' fuchsia: 'f0f' gainsboro: 'dcdcdc' ghostwhite: 'f8f8ff' gold: 'ffd700' goldenrod: 'daa520' gray: '808080' green: '008000' greenyellow: 'adff2f' grey: '808080' honeydew: 'f0fff0' hotpink: 'ff69b4' indianred: 'cd5c5c' indigo: '4b0082' ivory: 'fffff0' khaki: 'f0e68c' lavender: 'e6e6fa' lavenderblush: 'fff0f5' lawngreen: '7cfc00' lemonchiffon: 'fffacd' lightblue: 'add8e6' lightcoral: 'f08080' lightcyan: 'e0ffff' lightgoldenrodyellow: 'fafad2' lightgray: 'd3d3d3' lightgreen: '90ee90' lightgrey: 'd3d3d3' lightpink: 'ffb6c1' lightsalmon: 'ffa07a' lightseagreen: '20b2aa' lightskyblue: '87cefa' lightslategray: '789' lightslategrey: '789' lightsteelblue: 'b0c4de' lightyellow: 'ffffe0' lime: '0f0' limegreen: '32cd32' linen: 'faf0e6' magenta: 'f0f' maroon: '800000' mediumaquamarine: '66cdaa' mediumblue: '0000cd' mediumorchid: 'ba55d3' mediumpurple: '9370db' mediumseagreen: '3cb371' mediumslateblue: '7b68ee' mediumspringgreen: '00fa9a' mediumturquoise: '48d1cc' mediumvioletred: 'c71585' midnightblue: '191970' mintcream: 'f5fffa' mistyrose: 'ffe4e1' moccasin: 'ffe4b5' navajowhite: 'ffdead' navy: '000080' oldlace: 'fdf5e6' olive: '808000' olivedrab: '6b8e23' orange: 'ffa500' orangered: 'ff4500' orchid: 'da70d6' palegoldenrod: 'eee8aa' palegreen: '98fb98' paleturquoise: 'afeeee' palevioletred: 'db7093' papayawhip: 'ffefd5' peachpuff: 'ffdab9' peru: 'cd853f' pink: 'ffc0cb' plum: 'dda0dd' powderblue: 'b0e0e6' purple: '800080' rebeccapurple: '663399' red: 'f00' rosybrown: 'bc8f8f' royalblue: '4169e1' saddlebrown: '8b4513' salmon: 'fa8072' sandybrown: 'f4a460' seagreen: '2e8b57' seashell: 'fff5ee' sienna: 'a0522d' silver: 'c0c0c0' skyblue: '87ceeb' slateblue: '6a5acd' slategray: '708090' slategrey: '708090' snow: 'fffafa' springgreen: '00ff7f' steelblue: '4682b4' tan: 'd2b48c' teal: '008080' thistle: 'd8bfd8' tomato: 'ff6347' turquoise: '40e0d0' violet: 'ee82ee' wheat: 'f5deb3' white: 'fff' whitesmoke: 'f5f5f5' yellow: 'ff0' yellowgreen: '9acd32' } # Make it easy to access colors via `hexNames[hex]` hexNames: [] constructor: (color = '', opts = {}) -> # If input is already a TinyColor, return itself if color instanceof TinyColor return color # If we are called as a function, call using new instead if not (@ instanceof TinyColor) return new TinyColor color, opts # Make it easy to access colors via `hexNames[hex]` @hexNames = @flip @names rgb = @inputToRGB color @_originalInput = color @_r = rgb.r @_g = rgb.g @_b = rgb.b @_a = rgb.a @_roundA = Math.round(100 * @_a) / 100 @_format = opts.format or rgb.format @_gradientType = opts.gradientType # Don't let the range of [0,255] come back in [0,1]. # Potentially lose a little bit of precision here, but will fix issues where # .5 gets interpreted as half of the total, instead of half of 1 # If it was supposed to be 128, @ was already taken care of by `inputToRgb` if @_r < 1 @_r = Math.round(@_r) if @_g < 1 @_g = Math.round(@_g) if @_b < 1 @_b = Math.round(@_b) @_ok = rgb.ok @_tc_id = @tinyCounter++ return # If input is an object, force 1 into "1.0" to handle ratios properly # String input requires "1.0" as input, so 1 will be treated as 1 fromRatio: (color, opts) -> if typeof color is 'object' newColor = {} for i of color if color.hasOwnProperty i if i is 'a' newColor[i] = color[i] else newColor[i] = @convertToPercentage color[i] color = newColor TinyColor color, opts # Given a string or object, convert that input to RGB # Possible string inputs: # # "red" # "#f00" or "f00" # "#ff0000" or "ff0000" # "#ff000000" or "ff000000" # "rgb 255 0 0" or "rgb (255, 0, 0)" # "rgb 1.0 0 0" or "rgb (1, 0, 0)" # "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" # "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" # "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" # "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" # "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" # inputToRGB: (color) -> rgb = r: 0 g: 0 b: 0 a = 1 ok = false format = false if typeof color is 'string' color = @stringInputToObject color if typeof color is 'object' if @isValidCSSUnit(color.r) and @isValidCSSUnit(color.g) and @isValidCSSUnit(color.b) rgb = @rgbToRgb color.r, color.g, color.b ok = true format = if String(color.r).substr(-1) is '%' then 'prgb' else 'rgb' else if @isValidCSSUnit(color.h) and @isValidCSSUnit(color.s) and @isValidCSSUnit(color.v) color.s = @convertToPercentage color.s color.v = @convertToPercentage color.v rgb = @hsvToRgb color.h, color.s, color.v ok = true format = 'hsv' else if @isValidCSSUnit(color.h) and @isValidCSSUnit(color.s) and @isValidCSSUnit(color.l) color.s = @convertToPercentage color.s color.l = @convertToPercentage color.l rgb = @hslToRgb color.h, color.s, color.l ok = true format = 'hsl' if color.hasOwnProperty 'a' a = color.a a = @boundAlpha a { ok: ok format: color.format or format r: Math.min(255, Math.max(rgb.r, 0)) g: Math.min(255, Math.max(rgb.g, 0)) b: Math.min(255, Math.max(rgb.b, 0)) a: a } # Conversion Functions # -------------------- # `@rgbToHsl`, `@rgbToHsv`, `@hslToRgb`, `@hsvToRgb` modified from: # <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript> # `@rgbToRgb` # Handle bounds / percentage checking to conform to CSS color spec # <http://www.w3.org/TR/css3-color/> # *Assumes:* r, g, b in [0, 255] or [0, 1] # *Returns:* { r, g, b } in [0, 255] rgbToRgb: (r, g, b) -> { r: @bound01(r, 255) * 255 g: @bound01(g, 255) * 255 b: @bound01(b, 255) * 255 } # `@rgbToHsl` # Converts an RGB color value to HSL. # *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] # *Returns:* { h, s, l } in [0,1] rgbToHsl: (r, g, b) -> r = @bound01(r, 255) g = @bound01(g, 255) b = @bound01(b, 255) max = Math.max(r, g, b) min = Math.min(r, g, b) h = undefined s = undefined l = (max + min) / 2 if max is min h = s = 0 # achromatic else d = max - min s = if l > 0.5 then d / (2 - max - min) else d / (max + min) switch max when r h = (g - b) / d + (if g < b then 6 else 0) when g h = (b - r) / d + 2 when b h = (r - g) / d + 4 h /= 6 { h: h s: s l: l } # `@hslToRgb` # Converts an HSL color value to RGB. # *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] # *Returns:* { r, g, b } in the set [0, 255] hslToRgb: (h, s, l) -> r = undefined g = undefined b = undefined h = @bound01(h, 360) s = @bound01(s, 100) l = @bound01(l, 100) if s is 0 r = g = b = l # achromatic else q = if l < 0.5 then l * (1 + s) else l + s - (l * s) p = 2 * l - q r = @hue2rgb p, q, h + 1 / 3 g = @hue2rgb p, q, h b = @hue2rgb p, q, h - (1 / 3) { r: r * 255 g: g * 255 b: b * 255 } hue2rgb: (p, q, t) -> if t < 0 t += 1 if t > 1 t -= 1 if t < 1 / 6 return p + (q - p) * 6 * t if t < 1 / 2 return q if t < 2 / 3 return p + (q - p) * (2 / 3 - t) * 6 p # `@rgbToHsv` # Converts an RGB color value to HSV # *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] # *Returns:* { h, s, v } in [0,1] rgbToHsv: (r, g, b) -> r = @bound01(r, 255) g = @bound01(g, 255) b = @bound01(b, 255) max = Math.max(r, g, b) min = Math.min(r, g, b) h = undefined s = undefined v = max d = max - min s = if max is 0 then 0 else d / max if max is min h = 0 # achromatic else switch max when r h = (g - b) / d + (if g < b then 6 else 0) when g h = (b - r) / d + 2 when b h = (r - g) / d + 4 h /= 6 { h: h s: s v: v } # `@hsvToRgb` # Converts an HSV color value to RGB. # *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] # *Returns:* { r, g, b } in the set [0, 255] hsvToRgb: (h, s, v) -> h = @bound01(h, 360) * 6 s = @bound01(s, 100) v = @bound01(v, 100) i = Math.floor(h) f = h - i p = v * (1 - s) q = v * (1 - (f * s)) t = v * (1 - ((1 - f) * s)) mod = i % 6 r = [ v q p p t v ][mod] g = [ t v v q p p ][mod] b = [ p p t v v q ][mod] { r: r * 255 g: g * 255 b: b * 255 } # `@rgbToHex` # Converts an RGB color to hex # Assumes r, g, and b are contained in the set [0, 255] # Returns a 3 or 6 character hex rgbToHex: (r, g, b, allow3Char) -> hex = [ @pad2(Math.round(r).toString(16)) @pad2(Math.round(g).toString(16)) @pad2(Math.round(b).toString(16)) ] # Return a 3 character hex if possible if allow3Char and hex[0].charAt(0) is hex[0].charAt(1) and hex[1].charAt(0) is hex[1].charAt(1) and hex[2].charAt(0) is hex[2].charAt(1) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) hex.join '' # `@rgbaToHex` # Converts an RGBA color plus alpha transparency to hex # Assumes r, g, b and a are contained in the set [0, 255] # Returns an 8 character hex rgbaToHex: (r, g, b, a) -> hex = [ @pad2(@convertDecimalToHex(a)) @pad2(Math.round(r).toString(16)) @pad2(Math.round(g).toString(16)) @pad2(Math.round(b).toString(16)) ] hex.join '' # Utilities # --------- # `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` flip: (o) -> flipped = {} for i of o if o.hasOwnProperty(i) flipped[o[i]] = i flipped # Return a valid alpha value [0,1] with all invalid values being set to 1 boundAlpha: (a) -> a = parseFloat(a) if isNaN(a) or a < 0 or a > 1 a = 1 a # Take input from [0, n] and return it as [0, 1] bound01: (n, max) -> if @isOnePointZero(n) n = '100%' processPercent = @isPercentage(n) n = Math.min(max, Math.max(0, parseFloat(n))) # Automatically convert percentage into number if processPercent n = parseInt(n * max, 10) / 100 # Handle floating point rounding errors if Math.abs(n - max) < 0.000001 return 1 # Convert into [0, 1] range if it isn't already n % max / parseFloat(max) # Force a number between 0 and 1 clamp01: (val) -> Math.min 1, Math.max(0, val) # Parse a base-16 hex value into a base-10 integer parseIntFromHex: (val) -> parseInt val, 16 # Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 # <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0> isOnePointZero: (n) -> typeof n is 'string' and n.indexOf('.') isnt -1 and parseFloat(n) is 1 # Check to see if string passed in is a percentage isPercentage: (n) -> typeof n is 'string' and n.indexOf('%') isnt -1 # Force a hex value to have 2 characters pad2: (c) -> if c.length is 1 then "0#{c}" else "#{c}" # Replace a decimal with it's percentage value convertToPercentage: (n) -> if n <= 1 n = "#{n * 100}%" n # Converts a decimal to a hex value convertDecimalToHex: (d) -> Math.round(parseFloat(d) * 255).toString 16 # Converts a hex value to a decimal convertHexToDecimal: (h) -> @parseIntFromHex(h) / 255 # `@isValidCSSUnit` # Take in a single string / number and check to see if it looks like a CSS unit # (see `matchers` above for definition). isValidCSSUnit: (color) -> !! @matchers.CSS_UNIT.exec color # `@stringInputToObject` # Permissive string parsing. Take in a number of formats, and output an object # based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` stringInputToObject: (color) -> color = color.replace(/^\s+/, '').replace(/\s+$/, '').toLowerCase() named = false if @names[color] color = @names[color] named = true else if color is 'transparent' return { r: 0 g: 0 b: 0 a: 0 format: 'name' } # Try to match string input using regular expressions. # Keep most of the number bounding out of @ function - don't worry about [0,1] or [0,100] or [0,360] # Just return an object and let the conversion functions handle that. # @ way the result will be the same whether the TinyColor is initialized with string or object. match = undefined if match = @matchers.rgb.exec(color) return { r: match[1] g: match[2] b: match[3] } if match = @matchers.rgba.exec(color) return { r: match[1] g: match[2] b: match[3] a: match[4] } if match = @matchers.hsl.exec(color) return { h: match[1] s: match[2] l: match[3] } if match = @matchers.hsla.exec(color) return { h: match[1] s: match[2] l: match[3] a: match[4] } if match = @matchers.hsv.exec(color) return { h: match[1] s: match[2] v: match[3] } if match = @matchers.hsva.exec(color) return { h: match[1] s: match[2] v: match[3] a: match[4] } if match = @matchers.hex8.exec(color) return { a: @convertHexToDecimal(match[1]) r: @parseIntFromHex(match[2]) g: @parseIntFromHex(match[3]) b: @parseIntFromHex(match[4]) format: if named then 'name' else 'hex8' } if match = @matchers.hex6.exec(color) return { r: @parseIntFromHex(match[1]) g: @parseIntFromHex(match[2]) b: @parseIntFromHex(match[3]) format: if named then 'name' else 'hex' } if match = @matchers.hex3.exec(color) return { r: @parseIntFromHex(match[1] + '' + match[1]) g: @parseIntFromHex(match[2] + '' + match[2]) b: @parseIntFromHex(match[3] + '' + match[3]) format: if named then 'name' else 'hex' } false isDark: -> @getBrightness() < 128 isLight: -> not @isDark() isValid: -> @_ok getOriginalInput: -> @_originalInput getFormat: -> @_format getAlpha: -> @_a getBrightness: -> #http://www.w3.org/TR/AERT#color-contrast rgb = @toRgb() (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000 getLuminance: -> #http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef rgb = @toRgb() RsRGB = undefined GsRGB = undefined BsRGB = undefined R = undefined G = undefined B = undefined RsRGB = rgb.r / 255 GsRGB = rgb.g / 255 BsRGB = rgb.b / 255 if RsRGB <= 0.03928 R = RsRGB / 12.92 else R = ((RsRGB + 0.055) / 1.055) ** 2.4 if GsRGB <= 0.03928 G = GsRGB / 12.92 else G = ((GsRGB + 0.055) / 1.055) ** 2.4 if BsRGB <= 0.03928 B = BsRGB / 12.92 else B = ((BsRGB + 0.055) / 1.055) ** 2.4 0.2126 * R + 0.7152 * G + 0.0722 * B setAlpha: (value) -> @_a = @boundAlpha(value) @_roundA = Math.round(100 * @_a) / 100 @ toHsv: -> hsv = @rgbToHsv(@_r, @_g, @_b) { h: hsv.h * 360 s: hsv.s v: hsv.v a: @_a } toHsvString: -> hsv = @rgbToHsv(@_r, @_g, @_b) h = Math.round(hsv.h * 360) s = Math.round(hsv.s * 100) v = Math.round(hsv.v * 100) if @_a is 1 then "hsv(#{h}, #{s}%, #{v}%)" else "hsva(#{h}, #{s}%, #{v}%, #{@_roundA})" toHsl: -> hsl = @rgbToHsl(@_r, @_g, @_b) { h: hsl.h * 360 s: hsl.s l: hsl.l a: @_a } toHslString: -> hsl = @rgbToHsl(@_r, @_g, @_b) h = Math.round(hsl.h * 360) s = Math.round(hsl.s * 100) l = Math.round(hsl.l * 100) if @_a is 1 then "hsl(#{h}, #{s}%, #{l}%)" else "hsla(#{h}, #{s}%, #{l}%, #{@_roundA})" toRatioHslString: -> hsl = @rgbToHsl(@_r, @_g, @_b) h = Math.round(hsl.h * 360) s = Math.round(hsl.s) l = Math.round(hsl.l) if @_a is 1 then "hsl(#{h}, #{s}, #{l})" else "hsla(#{h}, #{s}, #{l}, #{@_roundA})" toHex: (allow3Char) -> @rgbToHex @_r, @_g, @_b, allow3Char toHexString: (allow3Char) -> "##{@toHex(allow3Char)}" toHex8: -> @rgbaToHex @_r, @_g, @_b, @_a toHex8String: -> "##{@toHex8()}" toRgb: -> # fix to make them below 255 c_r = Math.round(@_r) c_g = Math.round(@_g) c_b = Math.round(@_b) if c_r > 255 c_r = 255 if c_g > 255 c_g = 255 if c_b > 255 c_ b = 255 { r: c_r g: c_g b: c_b a: @_a } toRgbString: -> if @_a is 1 then "rgb(#{Math.round(@_r)}, #{Math.round(@_g)}, #{Math.round(@_b)})" else "rgba(#{Math.round(@_r)}, #{Math.round(@_g)}, #{Math.round(@_b)}, #{@_roundA})" toPercentageRgb: -> { r: "#{Math.round(@bound01(@_r, 255) * 100)}%" g: "#{Math.round(@bound01(@_g, 255) * 100)}%" b: "#{Math.round(@bound01(@_b, 255) * 100)}%" a: @_a } toPercentageRgbString: -> if @_a is 1 "rgb(#{Math.round(@bound01(@_r, 255) * 100)}%, #{Math.round(@bound01(@_g, 255) * 100)}%, #{Math.round(@bound01(@_b, 255) * 100)}%)" else "rgba(#{Math.round(@bound01(@_r, 255) * 100)}%, #{Math.round(@bound01(@_g, 255) * 100)}%, #{Math.round(@bound01(@_b, 255) * 100)}%, #{@_roundA})" toRatioRgbString: -> if @_a is 1 "rgb(#{Math.round(@bound01(@_r, 255))}, #{Math.round(@bound01(@_g, 255))}, #{Math.round(@bound01(@_b, 255))})" else "rgba(#{Math.round(@bound01(@_r, 255))}, #{Math.round(@bound01(@_g, 255))}, #{Math.round(@bound01(@_b, 255))}, #{@_roundA})" toName: -> if @_a is 0 return 'transparent' if @_a < 1 return false @hexNames[@rgbToHex(@_r, @_g, @_b, true)] or false toString: (format) -> formatSet = !!format format = format or @_format formattedString = false hasAlpha = @_a < 1 and @_a >= 0 needsAlphaFormat = not formatSet and hasAlpha and (format is 'hex' or format is 'hex6' or format is 'hex3' or format is 'name') if needsAlphaFormat # Special case for "transparent", all other non-alpha formats # will return rgba when there is transparency. if format is 'name' and @_a is 0 return @toName() return @toRgbString() if format is 'rgb' formattedString = @toRgbString() if format is 'prgb' formattedString = @toPercentageRgbString() if format is 'rrgb' formattedString = @toRatioRgbString() if format is 'hex' or format is 'hex6' formattedString = @toHexString() if format is 'hex3' formattedString = @toHexString(true) if format is 'hex8' formattedString = @toHex8String() if format is 'name' formattedString = @toName() if format is 'hsl' formattedString = @toHslString() if format is 'rhsl' formattedString = @toRatioHslString() if format is 'hsv' formattedString = @toHsvString() formattedString or @toHexString() clone: -> TinyColor @toString() random: -> @fromRatio r: Math.random() g: Math.random() b: Math.random() # `equals` # Can be called with any TinyColor input equals: (color1, color2) -> if not color1 or not color2 return false TinyColor(color1).toRgbString() is TinyColor(color2).toRgbString()
[ { "context": "ent, ctrl, shift, alt, meta, raw}={}) ->\n key = \"U+#{key.charCodeAt(0).toString(16)}\" unless key is 'es", "end": 1357, "score": 0.7604110240936279, "start": 1353, "tag": "KEY", "value": "U+#{" }, { "context": " meta, raw}={}) ->\n key = \"U+#{key.charCodeAt(0).toSt...
spec/spec-helper.coffee
oslerw/ex-mode
194
ExState = require '../lib/ex-state' GlobalExState = require '../lib/global-ex-state' beforeEach -> atom.workspace ||= {} activateExMode = -> atom.workspace.open().then -> atom.commands.dispatch(atom.views.getView(atom.workspace), 'ex-mode:open') keydown('escape') atom.workspace.getActivePane().destroyActiveItem() getEditorElement = (callback) -> textEditor = null waitsForPromise -> atom.workspace.open().then (e) -> textEditor = e runs -> # element = document.createElement("atom-text-editor") # element.setModel(textEditor) # element.classList.add('vim-mode') # element.exState = new ExState(element, new GlobalExState) # # element.addEventListener "keydown", (e) -> # atom.keymaps.handleKeyboardEvent(e) element = atom.views.getView(textEditor) callback(element) dispatchKeyboardEvent = (target, eventArgs...) -> e = document.createEvent('KeyboardEvent') e.initKeyboardEvent(eventArgs...) # 0 is the default, and it's valid ASCII, but it's wrong. Object.defineProperty(e, 'keyCode', get: -> undefined) if e.keyCode is 0 target.dispatchEvent e dispatchTextEvent = (target, eventArgs...) -> e = document.createEvent('TextEvent') e.initTextEvent(eventArgs...) target.dispatchEvent e keydown = (key, {element, ctrl, shift, alt, meta, raw}={}) -> key = "U+#{key.charCodeAt(0).toString(16)}" unless key is 'escape' or raw? element ||= document.activeElement eventArgs = [ true, # bubbles true, # cancelable null, # view key, # key 0, # location ctrl, alt, shift, meta ] canceled = not dispatchKeyboardEvent(element, 'keydown', eventArgs...) dispatchKeyboardEvent(element, 'keypress', eventArgs...) if not canceled if dispatchTextEvent(element, 'textInput', eventArgs...) element.value += key dispatchKeyboardEvent(element, 'keyup', eventArgs...) module.exports = {keydown, getEditorElement, activateExMode}
76288
ExState = require '../lib/ex-state' GlobalExState = require '../lib/global-ex-state' beforeEach -> atom.workspace ||= {} activateExMode = -> atom.workspace.open().then -> atom.commands.dispatch(atom.views.getView(atom.workspace), 'ex-mode:open') keydown('escape') atom.workspace.getActivePane().destroyActiveItem() getEditorElement = (callback) -> textEditor = null waitsForPromise -> atom.workspace.open().then (e) -> textEditor = e runs -> # element = document.createElement("atom-text-editor") # element.setModel(textEditor) # element.classList.add('vim-mode') # element.exState = new ExState(element, new GlobalExState) # # element.addEventListener "keydown", (e) -> # atom.keymaps.handleKeyboardEvent(e) element = atom.views.getView(textEditor) callback(element) dispatchKeyboardEvent = (target, eventArgs...) -> e = document.createEvent('KeyboardEvent') e.initKeyboardEvent(eventArgs...) # 0 is the default, and it's valid ASCII, but it's wrong. Object.defineProperty(e, 'keyCode', get: -> undefined) if e.keyCode is 0 target.dispatchEvent e dispatchTextEvent = (target, eventArgs...) -> e = document.createEvent('TextEvent') e.initTextEvent(eventArgs...) target.dispatchEvent e keydown = (key, {element, ctrl, shift, alt, meta, raw}={}) -> key = "<KEY>key.charCodeAt(0).<KEY>(16)}" unless key is 'escape' or raw? element ||= document.activeElement eventArgs = [ true, # bubbles true, # cancelable null, # view key, # key 0, # location ctrl, alt, shift, meta ] canceled = not dispatchKeyboardEvent(element, 'keydown', eventArgs...) dispatchKeyboardEvent(element, 'keypress', eventArgs...) if not canceled if dispatchTextEvent(element, 'textInput', eventArgs...) element.value += key dispatchKeyboardEvent(element, 'keyup', eventArgs...) module.exports = {keydown, getEditorElement, activateExMode}
true
ExState = require '../lib/ex-state' GlobalExState = require '../lib/global-ex-state' beforeEach -> atom.workspace ||= {} activateExMode = -> atom.workspace.open().then -> atom.commands.dispatch(atom.views.getView(atom.workspace), 'ex-mode:open') keydown('escape') atom.workspace.getActivePane().destroyActiveItem() getEditorElement = (callback) -> textEditor = null waitsForPromise -> atom.workspace.open().then (e) -> textEditor = e runs -> # element = document.createElement("atom-text-editor") # element.setModel(textEditor) # element.classList.add('vim-mode') # element.exState = new ExState(element, new GlobalExState) # # element.addEventListener "keydown", (e) -> # atom.keymaps.handleKeyboardEvent(e) element = atom.views.getView(textEditor) callback(element) dispatchKeyboardEvent = (target, eventArgs...) -> e = document.createEvent('KeyboardEvent') e.initKeyboardEvent(eventArgs...) # 0 is the default, and it's valid ASCII, but it's wrong. Object.defineProperty(e, 'keyCode', get: -> undefined) if e.keyCode is 0 target.dispatchEvent e dispatchTextEvent = (target, eventArgs...) -> e = document.createEvent('TextEvent') e.initTextEvent(eventArgs...) target.dispatchEvent e keydown = (key, {element, ctrl, shift, alt, meta, raw}={}) -> key = "PI:KEY:<KEY>END_PIkey.charCodeAt(0).PI:KEY:<KEY>END_PI(16)}" unless key is 'escape' or raw? element ||= document.activeElement eventArgs = [ true, # bubbles true, # cancelable null, # view key, # key 0, # location ctrl, alt, shift, meta ] canceled = not dispatchKeyboardEvent(element, 'keydown', eventArgs...) dispatchKeyboardEvent(element, 'keypress', eventArgs...) if not canceled if dispatchTextEvent(element, 'textInput', eventArgs...) element.value += key dispatchKeyboardEvent(element, 'keyup', eventArgs...) module.exports = {keydown, getEditorElement, activateExMode}
[ { "context": "uddy.Inputs.Text\n model: model\n key: @id\n mask: @attributes.mask\n attributes", "end": 506, "score": 0.6218137741088867, "start": 503, "tag": "KEY", "value": "@id" } ]
app/vendor/kalnoy/cruddy/resources/assets/coffee/fields/input.coffee
EH7AN/lawyers
0
class Cruddy.Fields.Input extends Cruddy.Fields.Base createEditableInput: (model, inputId) -> input = @createBaseInput model, inputId if @attributes.prepend or @attributes.append return new Cruddy.Fields.Input.PrependAppendWrapper prepend: @attributes.prepend append: @attributes.append input: input return input createBaseInput: (model, inputId) -> new Cruddy.Inputs.Text model: model key: @id mask: @attributes.mask attributes: placeholder: @attributes.placeholder id: inputId type: @attributes.input_type or "input" format: (value) -> return NOT_AVAILABLE if value is null or value is "" value += " " + @attributes.append if @attributes.append value = @attributes.prepend + " " + value if @attributes.prepend return value prepareAttribute: (value) -> if _.isArray value then value.join "," else value getType: -> "string"
77769
class Cruddy.Fields.Input extends Cruddy.Fields.Base createEditableInput: (model, inputId) -> input = @createBaseInput model, inputId if @attributes.prepend or @attributes.append return new Cruddy.Fields.Input.PrependAppendWrapper prepend: @attributes.prepend append: @attributes.append input: input return input createBaseInput: (model, inputId) -> new Cruddy.Inputs.Text model: model key: <KEY> mask: @attributes.mask attributes: placeholder: @attributes.placeholder id: inputId type: @attributes.input_type or "input" format: (value) -> return NOT_AVAILABLE if value is null or value is "" value += " " + @attributes.append if @attributes.append value = @attributes.prepend + " " + value if @attributes.prepend return value prepareAttribute: (value) -> if _.isArray value then value.join "," else value getType: -> "string"
true
class Cruddy.Fields.Input extends Cruddy.Fields.Base createEditableInput: (model, inputId) -> input = @createBaseInput model, inputId if @attributes.prepend or @attributes.append return new Cruddy.Fields.Input.PrependAppendWrapper prepend: @attributes.prepend append: @attributes.append input: input return input createBaseInput: (model, inputId) -> new Cruddy.Inputs.Text model: model key: PI:KEY:<KEY>END_PI mask: @attributes.mask attributes: placeholder: @attributes.placeholder id: inputId type: @attributes.input_type or "input" format: (value) -> return NOT_AVAILABLE if value is null or value is "" value += " " + @attributes.append if @attributes.append value = @attributes.prepend + " " + value if @attributes.prepend return value prepareAttribute: (value) -> if _.isArray value then value.join "," else value getType: -> "string"
[ { "context": "tact the project team at the address below:\n\n Professor Chris Lintott\n Oxford Astrophysics\n Den", "end": 10959, "score": 0.992951512336731, "start": 10950, "tag": "NAME", "value": "Professor" }, { "context": "roject team at the address below:\n\n ...
app/pages/privacy-policy.cjsx
Crentist/Panoptes-frontend-spanish
1
counterpart = require 'counterpart' React = require 'react' {Markdown} = require 'markdownz' Translate = require 'react-translate-component' counterpart.registerTranslations 'en', privacy: title: 'Zooniverse User Agreement and Privacy Policy' userAgreement: ''' ## User Agreement **Summary** The Zooniverse is a suite of citizen science projects operated by the Citizen Science Alliance (CSA), which support scientific research by involving members of the public - you - in the processes of analyzing and discussing data. Data from these projects is used to study online community design and theory, interface design, and other topics. This document describes what will happen to your contributions if you choose to contribute and what data we collect, how we use it and how we protect it. **What you agree to if you contribute to the Zooniverse** Projects involving the public are needed to enable researchers to cope with the otherwise unmanageable flood of data. The web provides a means of reaching a large audience willing to devote their free time to projects that can add to our knowledge of the world and the Universe. The major goal for this project is for the analyzed data to be available to the researchers for use, modification and redistribution in order to further scientific research. Therefore, if you contribute to the Zooniverse, you grant the CSA and its collaborators, permission to use your contributions however we like to further this goal, trusting us to do the right thing with your data. However, you give us this permission non-exclusively, meaning that you yourself still own your contribution. We ask you to grant us these broad permissions, because they allow us to change the legal details by which we keep the data available; this is important because the legal environment can change and we need to be able to respond without obtaining permission from every single contributor. Finally, you must not contribute data to the Zooniverse that you do not own. For example, do not copy information from published journal articles. If people do this, it can cause major legal headaches for us. **What you may do with Zooniverse data** You retain ownership of any contribution you make to the Zooniverse, and any recorded interaction with the dataset associated with the Zooniverse. You may use, distribute or modify your individual contribution in any way you like. However, you do not possess ownership of the dataset itself. This license does not apply to data about you, covered in the Privacy Policy. **Legal details** By submitting your contribution to the Zooniverse, you agree to grant the CSA a perpetual, royalty-free, non-exclusive, sub-licensable license to: use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and exercise all copyright and publicity rights with respect to your contribution worldwide and/or to incorporate your contribution in other works in any media now known or later developed for the full term of any rights that may exist in your contribution. If you do not want to grant to the CSA the rights set out above, you cannot interact with the Zooniverse. By interacting with the Zooniverse, you: * Warrant that your contribution contains only data that you have the right to make available to the CSA for all the purposes specified above, is not defamatory, and does not infringe any law; and * Indemnify the CSA against all legal fees, damages and other expenses that may be incurred by the CSA as a result of your breach of the above warranty; and * Waive any moral rights in your contribution for the purposes specified above. This license does not apply to data about you, covered in the Privacy Policy. ''' privacyPolicy: ''' ## Privacy Policy In addition to the contributions you make towards the scientific goals of the Zooniverse, we collect additional data about you to support and improve the operation of the project. We also conduct experiments on the design of the website that we evaluate based on your reactions and behavior. This Privacy Policy describes what data we collect, how we use it and how we protect it. We respect the privacy of every individual who participates in the Zooniverse. We operate in accordance with the United Kingdom Data Protection Act 1998 and the Freedom of Information Act 2000, as well as with United States regulations regarding protection of human subjects in research. **Data we collect** _Identifying information_: If you register with the Zooniverse, we ask you to create a username and supply your e-mail address. Your e-mail address is not visible to other users, but others will see your username in various contexts. Notably, your username is associated with any classifications or other contributions you make, e.g., on Talk pages. You may optionally provide your real name to be included when we publically thank participants, e.g., in presentations, publications or discoveries. _Usage information_: We also monitor how people use our website, and aggregate general statistics about users and traffic patterns as well as data about how users respond to various site features. This includes, among other things, recording: * When you log in. * Pages you request. * Classifications you make. * Other contributions, such as posts on Talk pages. If you register and log in, the logs associate these activities with your username. Otherwise, they are associated with your IP address. In order to collect this data, we may use software that collects statistics from IP data. This software can determine what times of day people access our site, which country they access the websites from, how long they visit for, what browser they are using, etc. **What we do with the information we gather** Usage information is collected to help us improve our website in particular for the following reasons: * Internal record keeping. * We may periodically send email promoting new research-related projects or other information relating to our research. Information about these contacts is given below. We will not use your contact information for commercial purposes. * We may use the information to customize the website. * We may use the information to conduct experiments regarding the use of various site features. **What is shared with third parties** We will never release e-mail addresses to third parties without your express permission. We will also never share data we collect about you unless (a) it cannot be associated with you or your username, and (b) it is necessary to accomplish our research goals. Specifically, we may share your anonymized data with research study participants, other researchers, or in scholarly work describing our research. For example, we might use one of your classifications as an illustration in a paper, show some of your classifications to another user to see if they agree or disagree, or publish statistics about user interaction. Contributions you make to the Talk pages are widely available to others. Aside from the above, information is held as confidentially as is practical within our secured database. **How we use cookies** In some areas of our site, a cookie may be placed on your computer. A cookie is a small file that resides on your computer's hard drive that allows us to improve the quality of your visit to our websites by responding to you as an individual. We use traffic log cookies to identify which pages are being used and improve our website. We only use this information for statistical analysis purposes, they are not shared with other sites and are not used for advertisements. You can choose to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. However, if you choose to decline cookies from the Zooniverse then functionality, including your ability to log-in and participate, will be impaired. Acceptance of cookies is implied if you continue to access our website without adjusting your browser settings. **Where we store your data** We use Amazon Web Services so we can quickly and reliably serve our website to an unpredictable number of people. This means that your data will be stored in multiple locations, including the United States of America (USA). Amazon is a participant in the Safe Harbor program developed by the USA Department of Commerce and the European Union (EU). Amazon has certified that it adheres to the Safe Harbor Privacy Principles agreed upon by the USA and the EU. **Security measures** Members of the research teams are made aware of our privacy policy and practices by reviewing this statement upon joining the team. We follow industry best practices to secure user data, and access to the database and logs are limited to members of the research group and system administrative staff. **Removing your data** Due to the way in which we archive data, it is generally not possible to completely remove your personal data from our systems. However, if you have specific concerns, please contact us and we will see what we can do. **When we will contact you** If you do not register, we will never contact you. If you do register, we will contact you by e-mail in the following circumstances: * Occasionally, we will send e-mail messages to you highlighting a particular aspect of our research, announcing new features, explaining changes to the system, or inviting you to special events. * We may also use your information to contact you for the purpose of research into our site's operation. We may contact you by email. We may ask for additional information at that time. Providing additional information is entirely optional and will in no way affect your service in the site. * We may contact you with a newsletter about the progress of the project. You are unlikely to receive more than two messages per month. The Zooniverse email newsletter service is provided by JISCmail, which is operated by the United Kingdom Science and Technology Facilities Council. JISCmail does not sell or otherwise transfer any personal data to commercial companies or other organisations. Please review the full JISCmail privacy policy. You can 'opt out' of the newsletter at any time by visiting the Zooniverse [unsubscribe](https://www.zooniverse.org/unsubscribe) page. **Further information and requests** The Data Controller is the Department of Physics, University of Oxford. For a copy of the information we hold on you please contact the project team at the address below: Professor Chris Lintott Oxford Astrophysics Denys Wilkinson Building Keble Road Oxford, OX1 3RH United Kingdom ''' counterpart.registerTranslations 'es', privacy: title: 'Zooniverse User Agreement and Privacy Policy' userAgreement: ''' ## User Agreement **Summary** The Zooniverse is a suite of citizen science projects operated by the Citizen Science Alliance (CSA), which support scientific research by involving members of the public - you - in the processes of analyzing and discussing data. Data from these projects is used to study online community design and theory, interface design, and other topics. This document describes what will happen to your contributions if you choose to contribute and what data we collect, how we use it and how we protect it. **What you agree to if you contribute to the Zooniverse** Projects involving the public are needed to enable researchers to cope with the otherwise unmanageable flood of data. The web provides a means of reaching a large audience willing to devote their free time to projects that can add to our knowledge of the world and the Universe. The major goal for this project is for the analyzed data to be available to the researchers for use, modification and redistribution in order to further scientific research. Therefore, if you contribute to the Zooniverse, you grant the CSA and its collaborators, permission to use your contributions however we like to further this goal, trusting us to do the right thing with your data. However, you give us this permission non-exclusively, meaning that you yourself still own your contribution. We ask you to grant us these broad permissions, because they allow us to change the legal details by which we keep the data available; this is important because the legal environment can change and we need to be able to respond without obtaining permission from every single contributor. Finally, you must not contribute data to the Zooniverse that you do not own. For example, do not copy information from published journal articles. If people do this, it can cause major legal headaches for us. **What you may do with Zooniverse data** You retain ownership of any contribution you make to the Zooniverse, and any recorded interaction with the dataset associated with the Zooniverse. You may use, distribute or modify your individual contribution in any way you like. However, you do not possess ownership of the dataset itself. This license does not apply to data about you, covered in the Privacy Policy. **Legal details** By submitting your contribution to the Zooniverse, you agree to grant the CSA a perpetual, royalty-free, non-exclusive, sub-licensable license to: use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and exercise all copyright and publicity rights with respect to your contribution worldwide and/or to incorporate your contribution in other works in any media now known or later developed for the full term of any rights that may exist in your contribution. If you do not want to grant to the CSA the rights set out above, you cannot interact with the Zooniverse. By interacting with the Zooniverse, you: * Warrant that your contribution contains only data that you have the right to make available to the CSA for all the purposes specified above, is not defamatory, and does not infringe any law; and * Indemnify the CSA against all legal fees, damages and other expenses that may be incurred by the CSA as a result of your breach of the above warranty; and * Waive any moral rights in your contribution for the purposes specified above. This license does not apply to data about you, covered in the Privacy Policy. ''' privacyPolicy: ''' ## Privacy Policy In addition to the contributions you make towards the scientific goals of the Zooniverse, we collect additional data about you to support and improve the operation of the project. We also conduct experiments on the design of the website that we evaluate based on your reactions and behavior. This Privacy Policy describes what data we collect, how we use it and how we protect it. We respect the privacy of every individual who participates in the Zooniverse. We operate in accordance with the United Kingdom Data Protection Act 1998 and the Freedom of Information Act 2000, as well as with United States regulations regarding protection of human subjects in research. **Data we collect** _Identifying information_: If you register with the Zooniverse, we ask you to create a username and supply your e-mail address. Your e-mail address is not visible to other users, but others will see your username in various contexts. Notably, your username is associated with any classifications or other contributions you make, e.g., on Talk pages. You may optionally provide your real name to be included when we publically thank participants, e.g., in presentations, publications or discoveries. _Usage information_: We also monitor how people use our website, and aggregate general statistics about users and traffic patterns as well as data about how users respond to various site features. This includes, among other things, recording: * When you log in. * Pages you request. * Classifications you make. * Other contributions, such as posts on Talk pages. If you register and log in, the logs associate these activities with your username. Otherwise, they are associated with your IP address. In order to collect this data, we may use software that collects statistics from IP data. This software can determine what times of day people access our site, which country they access the websites from, how long they visit for, what browser they are using, etc. **What we do with the information we gather** Usage information is collected to help us improve our website in particular for the following reasons: * Internal record keeping. * We may periodically send email promoting new research-related projects or other information relating to our research. Information about these contacts is given below. We will not use your contact information for commercial purposes. * We may use the information to customize the website. * We may use the information to conduct experiments regarding the use of various site features. **What is shared with third parties** We will never release e-mail addresses to third parties without your express permission. We will also never share data we collect about you unless (a) it cannot be associated with you or your username, and (b) it is necessary to accomplish our research goals. Specifically, we may share your anonymized data with research study participants, other researchers, or in scholarly work describing our research. For example, we might use one of your classifications as an illustration in a paper, show some of your classifications to another user to see if they agree or disagree, or publish statistics about user interaction. Contributions you make to the Talk pages are widely available to others. Aside from the above, information is held as confidentially as is practical within our secured database. **How we use cookies** In some areas of our site, a cookie may be placed on your computer. A cookie is a small file that resides on your computer's hard drive that allows us to improve the quality of your visit to our websites by responding to you as an individual. We use traffic log cookies to identify which pages are being used and improve our website. We only use this information for statistical analysis purposes, they are not shared with other sites and are not used for advertisements. You can choose to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. However, if you choose to decline cookies from the Zooniverse then functionality, including your ability to log-in and participate, will be impaired. Acceptance of cookies is implied if you continue to access our website without adjusting your browser settings. **Where we store your data** We use Amazon Web Services so we can quickly and reliably serve our website to an unpredictable number of people. This means that your data will be stored in multiple locations, including the United States of America (USA). Amazon is a participant in the Safe Harbor program developed by the USA Department of Commerce and the European Union (EU). Amazon has certified that it adheres to the Safe Harbor Privacy Principles agreed upon by the USA and the EU. **Security measures** Members of the research teams are made aware of our privacy policy and practices by reviewing this statement upon joining the team. We follow industry best practices to secure user data, and access to the database and logs are limited to members of the research group and system administrative staff. **Removing your data** Due to the way in which we archive data, it is generally not possible to completely remove your personal data from our systems. However, if you have specific concerns, please contact us and we will see what we can do. **When we will contact you** If you do not register, we will never contact you. If you do register, we will contact you by e-mail in the following circumstances: * Occasionally, we will send e-mail messages to you highlighting a particular aspect of our research, announcing new features, explaining changes to the system, or inviting you to special events. * We may also use your information to contact you for the purpose of research into our site's operation. We may contact you by email. We may ask for additional information at that time. Providing additional information is entirely optional and will in no way affect your service in the site. * We may contact you with a newsletter about the progress of the project. You are unlikely to receive more than two messages per month. The Zooniverse email newsletter service is provided by JISCmail, which is operated by the United Kingdom Science and Technology Facilities Council. JISCmail does not sell or otherwise transfer any personal data to commercial companies or other organisations. Please review the full JISCmail privacy policy. You can 'opt out' of the newsletter at any time by visiting the Zooniverse [unsubscribe](https://www.zooniverse.org/unsubscribe) page. **Further information and requests** The Data Controller is the Department of Physics, University of Oxford. For a copy of the information we hold on you please contact the project team at the address below: Professor Chris Lintott Oxford Astrophysics Denys Wilkinson Building Keble Road Oxford, OX1 3RH United Kingdom ''' module.exports = React.createClass displayName: 'PrivacyPage' componentDidMount: -> counterpart.onLocaleChange @handleLocaleChange componentWillUnmount: -> counterpart.offLocaleChange @handleLocaleChange handleLocaleChange: -> @forceUpdate() render: -> <div className="content-container"> <Translate component="h1" content="privacy.title" /> <div className="columns-container"> <Markdown className="column">{counterpart 'privacy.userAgreement'}</Markdown> <Markdown className="column">{counterpart 'privacy.privacyPolicy'}</Markdown> </div> </div>
21670
counterpart = require 'counterpart' React = require 'react' {Markdown} = require 'markdownz' Translate = require 'react-translate-component' counterpart.registerTranslations 'en', privacy: title: 'Zooniverse User Agreement and Privacy Policy' userAgreement: ''' ## User Agreement **Summary** The Zooniverse is a suite of citizen science projects operated by the Citizen Science Alliance (CSA), which support scientific research by involving members of the public - you - in the processes of analyzing and discussing data. Data from these projects is used to study online community design and theory, interface design, and other topics. This document describes what will happen to your contributions if you choose to contribute and what data we collect, how we use it and how we protect it. **What you agree to if you contribute to the Zooniverse** Projects involving the public are needed to enable researchers to cope with the otherwise unmanageable flood of data. The web provides a means of reaching a large audience willing to devote their free time to projects that can add to our knowledge of the world and the Universe. The major goal for this project is for the analyzed data to be available to the researchers for use, modification and redistribution in order to further scientific research. Therefore, if you contribute to the Zooniverse, you grant the CSA and its collaborators, permission to use your contributions however we like to further this goal, trusting us to do the right thing with your data. However, you give us this permission non-exclusively, meaning that you yourself still own your contribution. We ask you to grant us these broad permissions, because they allow us to change the legal details by which we keep the data available; this is important because the legal environment can change and we need to be able to respond without obtaining permission from every single contributor. Finally, you must not contribute data to the Zooniverse that you do not own. For example, do not copy information from published journal articles. If people do this, it can cause major legal headaches for us. **What you may do with Zooniverse data** You retain ownership of any contribution you make to the Zooniverse, and any recorded interaction with the dataset associated with the Zooniverse. You may use, distribute or modify your individual contribution in any way you like. However, you do not possess ownership of the dataset itself. This license does not apply to data about you, covered in the Privacy Policy. **Legal details** By submitting your contribution to the Zooniverse, you agree to grant the CSA a perpetual, royalty-free, non-exclusive, sub-licensable license to: use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and exercise all copyright and publicity rights with respect to your contribution worldwide and/or to incorporate your contribution in other works in any media now known or later developed for the full term of any rights that may exist in your contribution. If you do not want to grant to the CSA the rights set out above, you cannot interact with the Zooniverse. By interacting with the Zooniverse, you: * Warrant that your contribution contains only data that you have the right to make available to the CSA for all the purposes specified above, is not defamatory, and does not infringe any law; and * Indemnify the CSA against all legal fees, damages and other expenses that may be incurred by the CSA as a result of your breach of the above warranty; and * Waive any moral rights in your contribution for the purposes specified above. This license does not apply to data about you, covered in the Privacy Policy. ''' privacyPolicy: ''' ## Privacy Policy In addition to the contributions you make towards the scientific goals of the Zooniverse, we collect additional data about you to support and improve the operation of the project. We also conduct experiments on the design of the website that we evaluate based on your reactions and behavior. This Privacy Policy describes what data we collect, how we use it and how we protect it. We respect the privacy of every individual who participates in the Zooniverse. We operate in accordance with the United Kingdom Data Protection Act 1998 and the Freedom of Information Act 2000, as well as with United States regulations regarding protection of human subjects in research. **Data we collect** _Identifying information_: If you register with the Zooniverse, we ask you to create a username and supply your e-mail address. Your e-mail address is not visible to other users, but others will see your username in various contexts. Notably, your username is associated with any classifications or other contributions you make, e.g., on Talk pages. You may optionally provide your real name to be included when we publically thank participants, e.g., in presentations, publications or discoveries. _Usage information_: We also monitor how people use our website, and aggregate general statistics about users and traffic patterns as well as data about how users respond to various site features. This includes, among other things, recording: * When you log in. * Pages you request. * Classifications you make. * Other contributions, such as posts on Talk pages. If you register and log in, the logs associate these activities with your username. Otherwise, they are associated with your IP address. In order to collect this data, we may use software that collects statistics from IP data. This software can determine what times of day people access our site, which country they access the websites from, how long they visit for, what browser they are using, etc. **What we do with the information we gather** Usage information is collected to help us improve our website in particular for the following reasons: * Internal record keeping. * We may periodically send email promoting new research-related projects or other information relating to our research. Information about these contacts is given below. We will not use your contact information for commercial purposes. * We may use the information to customize the website. * We may use the information to conduct experiments regarding the use of various site features. **What is shared with third parties** We will never release e-mail addresses to third parties without your express permission. We will also never share data we collect about you unless (a) it cannot be associated with you or your username, and (b) it is necessary to accomplish our research goals. Specifically, we may share your anonymized data with research study participants, other researchers, or in scholarly work describing our research. For example, we might use one of your classifications as an illustration in a paper, show some of your classifications to another user to see if they agree or disagree, or publish statistics about user interaction. Contributions you make to the Talk pages are widely available to others. Aside from the above, information is held as confidentially as is practical within our secured database. **How we use cookies** In some areas of our site, a cookie may be placed on your computer. A cookie is a small file that resides on your computer's hard drive that allows us to improve the quality of your visit to our websites by responding to you as an individual. We use traffic log cookies to identify which pages are being used and improve our website. We only use this information for statistical analysis purposes, they are not shared with other sites and are not used for advertisements. You can choose to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. However, if you choose to decline cookies from the Zooniverse then functionality, including your ability to log-in and participate, will be impaired. Acceptance of cookies is implied if you continue to access our website without adjusting your browser settings. **Where we store your data** We use Amazon Web Services so we can quickly and reliably serve our website to an unpredictable number of people. This means that your data will be stored in multiple locations, including the United States of America (USA). Amazon is a participant in the Safe Harbor program developed by the USA Department of Commerce and the European Union (EU). Amazon has certified that it adheres to the Safe Harbor Privacy Principles agreed upon by the USA and the EU. **Security measures** Members of the research teams are made aware of our privacy policy and practices by reviewing this statement upon joining the team. We follow industry best practices to secure user data, and access to the database and logs are limited to members of the research group and system administrative staff. **Removing your data** Due to the way in which we archive data, it is generally not possible to completely remove your personal data from our systems. However, if you have specific concerns, please contact us and we will see what we can do. **When we will contact you** If you do not register, we will never contact you. If you do register, we will contact you by e-mail in the following circumstances: * Occasionally, we will send e-mail messages to you highlighting a particular aspect of our research, announcing new features, explaining changes to the system, or inviting you to special events. * We may also use your information to contact you for the purpose of research into our site's operation. We may contact you by email. We may ask for additional information at that time. Providing additional information is entirely optional and will in no way affect your service in the site. * We may contact you with a newsletter about the progress of the project. You are unlikely to receive more than two messages per month. The Zooniverse email newsletter service is provided by JISCmail, which is operated by the United Kingdom Science and Technology Facilities Council. JISCmail does not sell or otherwise transfer any personal data to commercial companies or other organisations. Please review the full JISCmail privacy policy. You can 'opt out' of the newsletter at any time by visiting the Zooniverse [unsubscribe](https://www.zooniverse.org/unsubscribe) page. **Further information and requests** The Data Controller is the Department of Physics, University of Oxford. For a copy of the information we hold on you please contact the project team at the address below: <NAME> <NAME> Oxford Astrophysics <NAME> Building Keble Road Oxford, OX1 3RH United Kingdom ''' counterpart.registerTranslations 'es', privacy: title: 'Zooniverse User Agreement and Privacy Policy' userAgreement: ''' ## User Agreement **Summary** The Zooniverse is a suite of citizen science projects operated by the Citizen Science Alliance (CSA), which support scientific research by involving members of the public - you - in the processes of analyzing and discussing data. Data from these projects is used to study online community design and theory, interface design, and other topics. This document describes what will happen to your contributions if you choose to contribute and what data we collect, how we use it and how we protect it. **What you agree to if you contribute to the Zooniverse** Projects involving the public are needed to enable researchers to cope with the otherwise unmanageable flood of data. The web provides a means of reaching a large audience willing to devote their free time to projects that can add to our knowledge of the world and the Universe. The major goal for this project is for the analyzed data to be available to the researchers for use, modification and redistribution in order to further scientific research. Therefore, if you contribute to the Zooniverse, you grant the CSA and its collaborators, permission to use your contributions however we like to further this goal, trusting us to do the right thing with your data. However, you give us this permission non-exclusively, meaning that you yourself still own your contribution. We ask you to grant us these broad permissions, because they allow us to change the legal details by which we keep the data available; this is important because the legal environment can change and we need to be able to respond without obtaining permission from every single contributor. Finally, you must not contribute data to the Zooniverse that you do not own. For example, do not copy information from published journal articles. If people do this, it can cause major legal headaches for us. **What you may do with Zooniverse data** You retain ownership of any contribution you make to the Zooniverse, and any recorded interaction with the dataset associated with the Zooniverse. You may use, distribute or modify your individual contribution in any way you like. However, you do not possess ownership of the dataset itself. This license does not apply to data about you, covered in the Privacy Policy. **Legal details** By submitting your contribution to the Zooniverse, you agree to grant the CSA a perpetual, royalty-free, non-exclusive, sub-licensable license to: use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and exercise all copyright and publicity rights with respect to your contribution worldwide and/or to incorporate your contribution in other works in any media now known or later developed for the full term of any rights that may exist in your contribution. If you do not want to grant to the CSA the rights set out above, you cannot interact with the Zooniverse. By interacting with the Zooniverse, you: * Warrant that your contribution contains only data that you have the right to make available to the CSA for all the purposes specified above, is not defamatory, and does not infringe any law; and * Indemnify the CSA against all legal fees, damages and other expenses that may be incurred by the CSA as a result of your breach of the above warranty; and * Waive any moral rights in your contribution for the purposes specified above. This license does not apply to data about you, covered in the Privacy Policy. ''' privacyPolicy: ''' ## Privacy Policy In addition to the contributions you make towards the scientific goals of the Zooniverse, we collect additional data about you to support and improve the operation of the project. We also conduct experiments on the design of the website that we evaluate based on your reactions and behavior. This Privacy Policy describes what data we collect, how we use it and how we protect it. We respect the privacy of every individual who participates in the Zooniverse. We operate in accordance with the United Kingdom Data Protection Act 1998 and the Freedom of Information Act 2000, as well as with United States regulations regarding protection of human subjects in research. **Data we collect** _Identifying information_: If you register with the Zooniverse, we ask you to create a username and supply your e-mail address. Your e-mail address is not visible to other users, but others will see your username in various contexts. Notably, your username is associated with any classifications or other contributions you make, e.g., on Talk pages. You may optionally provide your real name to be included when we publically thank participants, e.g., in presentations, publications or discoveries. _Usage information_: We also monitor how people use our website, and aggregate general statistics about users and traffic patterns as well as data about how users respond to various site features. This includes, among other things, recording: * When you log in. * Pages you request. * Classifications you make. * Other contributions, such as posts on Talk pages. If you register and log in, the logs associate these activities with your username. Otherwise, they are associated with your IP address. In order to collect this data, we may use software that collects statistics from IP data. This software can determine what times of day people access our site, which country they access the websites from, how long they visit for, what browser they are using, etc. **What we do with the information we gather** Usage information is collected to help us improve our website in particular for the following reasons: * Internal record keeping. * We may periodically send email promoting new research-related projects or other information relating to our research. Information about these contacts is given below. We will not use your contact information for commercial purposes. * We may use the information to customize the website. * We may use the information to conduct experiments regarding the use of various site features. **What is shared with third parties** We will never release e-mail addresses to third parties without your express permission. We will also never share data we collect about you unless (a) it cannot be associated with you or your username, and (b) it is necessary to accomplish our research goals. Specifically, we may share your anonymized data with research study participants, other researchers, or in scholarly work describing our research. For example, we might use one of your classifications as an illustration in a paper, show some of your classifications to another user to see if they agree or disagree, or publish statistics about user interaction. Contributions you make to the Talk pages are widely available to others. Aside from the above, information is held as confidentially as is practical within our secured database. **How we use cookies** In some areas of our site, a cookie may be placed on your computer. A cookie is a small file that resides on your computer's hard drive that allows us to improve the quality of your visit to our websites by responding to you as an individual. We use traffic log cookies to identify which pages are being used and improve our website. We only use this information for statistical analysis purposes, they are not shared with other sites and are not used for advertisements. You can choose to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. However, if you choose to decline cookies from the Zooniverse then functionality, including your ability to log-in and participate, will be impaired. Acceptance of cookies is implied if you continue to access our website without adjusting your browser settings. **Where we store your data** We use Amazon Web Services so we can quickly and reliably serve our website to an unpredictable number of people. This means that your data will be stored in multiple locations, including the United States of America (USA). Amazon is a participant in the Safe Harbor program developed by the USA Department of Commerce and the European Union (EU). Amazon has certified that it adheres to the Safe Harbor Privacy Principles agreed upon by the USA and the EU. **Security measures** Members of the research teams are made aware of our privacy policy and practices by reviewing this statement upon joining the team. We follow industry best practices to secure user data, and access to the database and logs are limited to members of the research group and system administrative staff. **Removing your data** Due to the way in which we archive data, it is generally not possible to completely remove your personal data from our systems. However, if you have specific concerns, please contact us and we will see what we can do. **When we will contact you** If you do not register, we will never contact you. If you do register, we will contact you by e-mail in the following circumstances: * Occasionally, we will send e-mail messages to you highlighting a particular aspect of our research, announcing new features, explaining changes to the system, or inviting you to special events. * We may also use your information to contact you for the purpose of research into our site's operation. We may contact you by email. We may ask for additional information at that time. Providing additional information is entirely optional and will in no way affect your service in the site. * We may contact you with a newsletter about the progress of the project. You are unlikely to receive more than two messages per month. The Zooniverse email newsletter service is provided by JISCmail, which is operated by the United Kingdom Science and Technology Facilities Council. JISCmail does not sell or otherwise transfer any personal data to commercial companies or other organisations. Please review the full JISCmail privacy policy. You can 'opt out' of the newsletter at any time by visiting the Zooniverse [unsubscribe](https://www.zooniverse.org/unsubscribe) page. **Further information and requests** The Data Controller is the Department of Physics, University of Oxford. For a copy of the information we hold on you please contact the project team at the address below: Professor <NAME> Oxford Astrophysics Denys Wilkinson Building Keble Road Oxford, OX1 3RH United Kingdom ''' module.exports = React.createClass displayName: 'PrivacyPage' componentDidMount: -> counterpart.onLocaleChange @handleLocaleChange componentWillUnmount: -> counterpart.offLocaleChange @handleLocaleChange handleLocaleChange: -> @forceUpdate() render: -> <div className="content-container"> <Translate component="h1" content="privacy.title" /> <div className="columns-container"> <Markdown className="column">{counterpart 'privacy.userAgreement'}</Markdown> <Markdown className="column">{counterpart 'privacy.privacyPolicy'}</Markdown> </div> </div>
true
counterpart = require 'counterpart' React = require 'react' {Markdown} = require 'markdownz' Translate = require 'react-translate-component' counterpart.registerTranslations 'en', privacy: title: 'Zooniverse User Agreement and Privacy Policy' userAgreement: ''' ## User Agreement **Summary** The Zooniverse is a suite of citizen science projects operated by the Citizen Science Alliance (CSA), which support scientific research by involving members of the public - you - in the processes of analyzing and discussing data. Data from these projects is used to study online community design and theory, interface design, and other topics. This document describes what will happen to your contributions if you choose to contribute and what data we collect, how we use it and how we protect it. **What you agree to if you contribute to the Zooniverse** Projects involving the public are needed to enable researchers to cope with the otherwise unmanageable flood of data. The web provides a means of reaching a large audience willing to devote their free time to projects that can add to our knowledge of the world and the Universe. The major goal for this project is for the analyzed data to be available to the researchers for use, modification and redistribution in order to further scientific research. Therefore, if you contribute to the Zooniverse, you grant the CSA and its collaborators, permission to use your contributions however we like to further this goal, trusting us to do the right thing with your data. However, you give us this permission non-exclusively, meaning that you yourself still own your contribution. We ask you to grant us these broad permissions, because they allow us to change the legal details by which we keep the data available; this is important because the legal environment can change and we need to be able to respond without obtaining permission from every single contributor. Finally, you must not contribute data to the Zooniverse that you do not own. For example, do not copy information from published journal articles. If people do this, it can cause major legal headaches for us. **What you may do with Zooniverse data** You retain ownership of any contribution you make to the Zooniverse, and any recorded interaction with the dataset associated with the Zooniverse. You may use, distribute or modify your individual contribution in any way you like. However, you do not possess ownership of the dataset itself. This license does not apply to data about you, covered in the Privacy Policy. **Legal details** By submitting your contribution to the Zooniverse, you agree to grant the CSA a perpetual, royalty-free, non-exclusive, sub-licensable license to: use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and exercise all copyright and publicity rights with respect to your contribution worldwide and/or to incorporate your contribution in other works in any media now known or later developed for the full term of any rights that may exist in your contribution. If you do not want to grant to the CSA the rights set out above, you cannot interact with the Zooniverse. By interacting with the Zooniverse, you: * Warrant that your contribution contains only data that you have the right to make available to the CSA for all the purposes specified above, is not defamatory, and does not infringe any law; and * Indemnify the CSA against all legal fees, damages and other expenses that may be incurred by the CSA as a result of your breach of the above warranty; and * Waive any moral rights in your contribution for the purposes specified above. This license does not apply to data about you, covered in the Privacy Policy. ''' privacyPolicy: ''' ## Privacy Policy In addition to the contributions you make towards the scientific goals of the Zooniverse, we collect additional data about you to support and improve the operation of the project. We also conduct experiments on the design of the website that we evaluate based on your reactions and behavior. This Privacy Policy describes what data we collect, how we use it and how we protect it. We respect the privacy of every individual who participates in the Zooniverse. We operate in accordance with the United Kingdom Data Protection Act 1998 and the Freedom of Information Act 2000, as well as with United States regulations regarding protection of human subjects in research. **Data we collect** _Identifying information_: If you register with the Zooniverse, we ask you to create a username and supply your e-mail address. Your e-mail address is not visible to other users, but others will see your username in various contexts. Notably, your username is associated with any classifications or other contributions you make, e.g., on Talk pages. You may optionally provide your real name to be included when we publically thank participants, e.g., in presentations, publications or discoveries. _Usage information_: We also monitor how people use our website, and aggregate general statistics about users and traffic patterns as well as data about how users respond to various site features. This includes, among other things, recording: * When you log in. * Pages you request. * Classifications you make. * Other contributions, such as posts on Talk pages. If you register and log in, the logs associate these activities with your username. Otherwise, they are associated with your IP address. In order to collect this data, we may use software that collects statistics from IP data. This software can determine what times of day people access our site, which country they access the websites from, how long they visit for, what browser they are using, etc. **What we do with the information we gather** Usage information is collected to help us improve our website in particular for the following reasons: * Internal record keeping. * We may periodically send email promoting new research-related projects or other information relating to our research. Information about these contacts is given below. We will not use your contact information for commercial purposes. * We may use the information to customize the website. * We may use the information to conduct experiments regarding the use of various site features. **What is shared with third parties** We will never release e-mail addresses to third parties without your express permission. We will also never share data we collect about you unless (a) it cannot be associated with you or your username, and (b) it is necessary to accomplish our research goals. Specifically, we may share your anonymized data with research study participants, other researchers, or in scholarly work describing our research. For example, we might use one of your classifications as an illustration in a paper, show some of your classifications to another user to see if they agree or disagree, or publish statistics about user interaction. Contributions you make to the Talk pages are widely available to others. Aside from the above, information is held as confidentially as is practical within our secured database. **How we use cookies** In some areas of our site, a cookie may be placed on your computer. A cookie is a small file that resides on your computer's hard drive that allows us to improve the quality of your visit to our websites by responding to you as an individual. We use traffic log cookies to identify which pages are being used and improve our website. We only use this information for statistical analysis purposes, they are not shared with other sites and are not used for advertisements. You can choose to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. However, if you choose to decline cookies from the Zooniverse then functionality, including your ability to log-in and participate, will be impaired. Acceptance of cookies is implied if you continue to access our website without adjusting your browser settings. **Where we store your data** We use Amazon Web Services so we can quickly and reliably serve our website to an unpredictable number of people. This means that your data will be stored in multiple locations, including the United States of America (USA). Amazon is a participant in the Safe Harbor program developed by the USA Department of Commerce and the European Union (EU). Amazon has certified that it adheres to the Safe Harbor Privacy Principles agreed upon by the USA and the EU. **Security measures** Members of the research teams are made aware of our privacy policy and practices by reviewing this statement upon joining the team. We follow industry best practices to secure user data, and access to the database and logs are limited to members of the research group and system administrative staff. **Removing your data** Due to the way in which we archive data, it is generally not possible to completely remove your personal data from our systems. However, if you have specific concerns, please contact us and we will see what we can do. **When we will contact you** If you do not register, we will never contact you. If you do register, we will contact you by e-mail in the following circumstances: * Occasionally, we will send e-mail messages to you highlighting a particular aspect of our research, announcing new features, explaining changes to the system, or inviting you to special events. * We may also use your information to contact you for the purpose of research into our site's operation. We may contact you by email. We may ask for additional information at that time. Providing additional information is entirely optional and will in no way affect your service in the site. * We may contact you with a newsletter about the progress of the project. You are unlikely to receive more than two messages per month. The Zooniverse email newsletter service is provided by JISCmail, which is operated by the United Kingdom Science and Technology Facilities Council. JISCmail does not sell or otherwise transfer any personal data to commercial companies or other organisations. Please review the full JISCmail privacy policy. You can 'opt out' of the newsletter at any time by visiting the Zooniverse [unsubscribe](https://www.zooniverse.org/unsubscribe) page. **Further information and requests** The Data Controller is the Department of Physics, University of Oxford. For a copy of the information we hold on you please contact the project team at the address below: PI:NAME:<NAME>END_PI PI:NAME:<NAME>END_PI Oxford Astrophysics PI:NAME:<NAME>END_PI Building Keble Road Oxford, OX1 3RH United Kingdom ''' counterpart.registerTranslations 'es', privacy: title: 'Zooniverse User Agreement and Privacy Policy' userAgreement: ''' ## User Agreement **Summary** The Zooniverse is a suite of citizen science projects operated by the Citizen Science Alliance (CSA), which support scientific research by involving members of the public - you - in the processes of analyzing and discussing data. Data from these projects is used to study online community design and theory, interface design, and other topics. This document describes what will happen to your contributions if you choose to contribute and what data we collect, how we use it and how we protect it. **What you agree to if you contribute to the Zooniverse** Projects involving the public are needed to enable researchers to cope with the otherwise unmanageable flood of data. The web provides a means of reaching a large audience willing to devote their free time to projects that can add to our knowledge of the world and the Universe. The major goal for this project is for the analyzed data to be available to the researchers for use, modification and redistribution in order to further scientific research. Therefore, if you contribute to the Zooniverse, you grant the CSA and its collaborators, permission to use your contributions however we like to further this goal, trusting us to do the right thing with your data. However, you give us this permission non-exclusively, meaning that you yourself still own your contribution. We ask you to grant us these broad permissions, because they allow us to change the legal details by which we keep the data available; this is important because the legal environment can change and we need to be able to respond without obtaining permission from every single contributor. Finally, you must not contribute data to the Zooniverse that you do not own. For example, do not copy information from published journal articles. If people do this, it can cause major legal headaches for us. **What you may do with Zooniverse data** You retain ownership of any contribution you make to the Zooniverse, and any recorded interaction with the dataset associated with the Zooniverse. You may use, distribute or modify your individual contribution in any way you like. However, you do not possess ownership of the dataset itself. This license does not apply to data about you, covered in the Privacy Policy. **Legal details** By submitting your contribution to the Zooniverse, you agree to grant the CSA a perpetual, royalty-free, non-exclusive, sub-licensable license to: use, reproduce, modify, adapt, publish, translate, create derivative works from, distribute, and exercise all copyright and publicity rights with respect to your contribution worldwide and/or to incorporate your contribution in other works in any media now known or later developed for the full term of any rights that may exist in your contribution. If you do not want to grant to the CSA the rights set out above, you cannot interact with the Zooniverse. By interacting with the Zooniverse, you: * Warrant that your contribution contains only data that you have the right to make available to the CSA for all the purposes specified above, is not defamatory, and does not infringe any law; and * Indemnify the CSA against all legal fees, damages and other expenses that may be incurred by the CSA as a result of your breach of the above warranty; and * Waive any moral rights in your contribution for the purposes specified above. This license does not apply to data about you, covered in the Privacy Policy. ''' privacyPolicy: ''' ## Privacy Policy In addition to the contributions you make towards the scientific goals of the Zooniverse, we collect additional data about you to support and improve the operation of the project. We also conduct experiments on the design of the website that we evaluate based on your reactions and behavior. This Privacy Policy describes what data we collect, how we use it and how we protect it. We respect the privacy of every individual who participates in the Zooniverse. We operate in accordance with the United Kingdom Data Protection Act 1998 and the Freedom of Information Act 2000, as well as with United States regulations regarding protection of human subjects in research. **Data we collect** _Identifying information_: If you register with the Zooniverse, we ask you to create a username and supply your e-mail address. Your e-mail address is not visible to other users, but others will see your username in various contexts. Notably, your username is associated with any classifications or other contributions you make, e.g., on Talk pages. You may optionally provide your real name to be included when we publically thank participants, e.g., in presentations, publications or discoveries. _Usage information_: We also monitor how people use our website, and aggregate general statistics about users and traffic patterns as well as data about how users respond to various site features. This includes, among other things, recording: * When you log in. * Pages you request. * Classifications you make. * Other contributions, such as posts on Talk pages. If you register and log in, the logs associate these activities with your username. Otherwise, they are associated with your IP address. In order to collect this data, we may use software that collects statistics from IP data. This software can determine what times of day people access our site, which country they access the websites from, how long they visit for, what browser they are using, etc. **What we do with the information we gather** Usage information is collected to help us improve our website in particular for the following reasons: * Internal record keeping. * We may periodically send email promoting new research-related projects or other information relating to our research. Information about these contacts is given below. We will not use your contact information for commercial purposes. * We may use the information to customize the website. * We may use the information to conduct experiments regarding the use of various site features. **What is shared with third parties** We will never release e-mail addresses to third parties without your express permission. We will also never share data we collect about you unless (a) it cannot be associated with you or your username, and (b) it is necessary to accomplish our research goals. Specifically, we may share your anonymized data with research study participants, other researchers, or in scholarly work describing our research. For example, we might use one of your classifications as an illustration in a paper, show some of your classifications to another user to see if they agree or disagree, or publish statistics about user interaction. Contributions you make to the Talk pages are widely available to others. Aside from the above, information is held as confidentially as is practical within our secured database. **How we use cookies** In some areas of our site, a cookie may be placed on your computer. A cookie is a small file that resides on your computer's hard drive that allows us to improve the quality of your visit to our websites by responding to you as an individual. We use traffic log cookies to identify which pages are being used and improve our website. We only use this information for statistical analysis purposes, they are not shared with other sites and are not used for advertisements. You can choose to accept or decline cookies. Most web browsers automatically accept cookies, but you can usually modify your browser setting to decline cookies if you prefer. However, if you choose to decline cookies from the Zooniverse then functionality, including your ability to log-in and participate, will be impaired. Acceptance of cookies is implied if you continue to access our website without adjusting your browser settings. **Where we store your data** We use Amazon Web Services so we can quickly and reliably serve our website to an unpredictable number of people. This means that your data will be stored in multiple locations, including the United States of America (USA). Amazon is a participant in the Safe Harbor program developed by the USA Department of Commerce and the European Union (EU). Amazon has certified that it adheres to the Safe Harbor Privacy Principles agreed upon by the USA and the EU. **Security measures** Members of the research teams are made aware of our privacy policy and practices by reviewing this statement upon joining the team. We follow industry best practices to secure user data, and access to the database and logs are limited to members of the research group and system administrative staff. **Removing your data** Due to the way in which we archive data, it is generally not possible to completely remove your personal data from our systems. However, if you have specific concerns, please contact us and we will see what we can do. **When we will contact you** If you do not register, we will never contact you. If you do register, we will contact you by e-mail in the following circumstances: * Occasionally, we will send e-mail messages to you highlighting a particular aspect of our research, announcing new features, explaining changes to the system, or inviting you to special events. * We may also use your information to contact you for the purpose of research into our site's operation. We may contact you by email. We may ask for additional information at that time. Providing additional information is entirely optional and will in no way affect your service in the site. * We may contact you with a newsletter about the progress of the project. You are unlikely to receive more than two messages per month. The Zooniverse email newsletter service is provided by JISCmail, which is operated by the United Kingdom Science and Technology Facilities Council. JISCmail does not sell or otherwise transfer any personal data to commercial companies or other organisations. Please review the full JISCmail privacy policy. You can 'opt out' of the newsletter at any time by visiting the Zooniverse [unsubscribe](https://www.zooniverse.org/unsubscribe) page. **Further information and requests** The Data Controller is the Department of Physics, University of Oxford. For a copy of the information we hold on you please contact the project team at the address below: Professor PI:NAME:<NAME>END_PI Oxford Astrophysics Denys Wilkinson Building Keble Road Oxford, OX1 3RH United Kingdom ''' module.exports = React.createClass displayName: 'PrivacyPage' componentDidMount: -> counterpart.onLocaleChange @handleLocaleChange componentWillUnmount: -> counterpart.offLocaleChange @handleLocaleChange handleLocaleChange: -> @forceUpdate() render: -> <div className="content-container"> <Translate component="h1" content="privacy.title" /> <div className="columns-container"> <Markdown className="column">{counterpart 'privacy.userAgreement'}</Markdown> <Markdown className="column">{counterpart 'privacy.privacyPolicy'}</Markdown> </div> </div>
[ { "context": " # Integration based on token and events. e.g. weibo/firim\n # These integration requests are made b", "end": 3470, "score": 0.6625989675521851, "start": 3467, "tag": "USERNAME", "value": "ibo" }, { "context": "\n events.forEach (event) ->\n taskKey = \"...
src/worker.coffee
jianliaoim/talk-node-sdk
4
{EventEmitter} = require 'events' Promise = require 'bluebird' logger = require 'graceful-logger' {CronJob} = require 'cron' _util = require 'util' class Worker extends EventEmitter constructor: (options = {}) -> @tasks = {} @fetchTasksPromise = @fetchTasks() @bindEvents() @options = interval: 300000 # 5 minutes concurrency: 2 maxErrorTimes: 10 taskInterval: 1000 # Sleep between each task _util._extend @options, options {addTasks, removeTasks} = @options @addTasks = addTasks if typeof addTasks is 'function' @removeTasks = removeTasks if typeof removeTasks is 'function' fetchTasks: -> retryTimes = 0 retryMaxTimes = 3 retryInterval = 100 talk = require './talk' self = this _fetchTasks = -> talk.call 'integration.batchread' .catch (err) -> retryTimes += 1 retryDuration = retryInterval * 2 ** retryTimes if retryTimes > retryMaxTimes throw new Error('could not fetch the integration list from server') Promise.delay retryDuration .then _fetchTasks _fetchTasks() .then (integrations = []) -> integrations.forEach (integration) -> self.emit 'integration.create', integration bindEvents: -> self = this @on 'integration.create', (integration) -> self.addTasks integration @on 'integration.update', (integration) -> self.removeTasks integration self.addTasks integration @on 'integration.remove', (integration) -> self.removeTasks integration run: -> return if @isStopped return @runCron() if @options.cron {interval} = @options self = this @fetchTasksPromise .then -> self.runOnce() .timeout interval # Kill the current task loop when execute time greater than interval .catch (err) -> logger.warn err.stack .then -> Promise.delay interval .then -> self.run() ###* * Execute the tasks by cron-like schedule * @return {[type]} [description] ### runCron: -> {cron} = @options @cronJob = new CronJob cronTime: cron onTick: @runOnce start: true runOnce: => self = this {runner, concurrency, maxErrorTimes, taskInterval} = @options {tasks} = this talk = require './talk' Promise.map Object.keys(tasks), (key) -> task = tasks[key] unless task and typeof(runner) is 'function' delete tasks[key] return false Promise.resolve() .then -> runner task .then -> task.errorTimes = 0 .catch (err) -> # Handle error integration logger.warn err.stack task.errorTimes = (task.errorTimes or 0) + 1 return unless task.errorTimes >= maxErrorTimes {integrations} = task _sendIntegrationError = (ikey) -> integration = integrations[ikey] talk.call 'integration.error', _id: integration._id errorInfo: err.message .then -> self.emit 'integration.remove', integration .catch (err) -> logger.warn err.stack Object.keys(integrations).forEach _sendIntegrationError .delay taskInterval , concurrency: concurrency stop: -> @isStopped = true @cronJob?.stop() # The default handler for convert integrations to task addTasks: (integration) -> {token, events, url} = integration {tasks} = this # Integration based on token and events. e.g. weibo/firim # These integration requests are made by a pair of token and event if token and events?.length events.forEach (event) -> taskKey = "#{token}_#{event}" tasks[taskKey] or= event: event token: token integrations: {} tasks[taskKey].integrations[integration._id] = integration # Integration based on open url such as rss feed # These integration make request with a stable url else if url taskKey = url.trim() tasks[taskKey] or= url: taskKey integrations: {} tasks[taskKey].integrations[integration._id] = integration removeTasks: (integration) -> {_id} = integration return unless _id {tasks} = this Object.keys(tasks).forEach (taskKey) -> task = tasks[taskKey] delete task.integrations[_id] delete tasks[taskKey] unless Object.keys(task.integrations).length # Watch service events watch: (service) -> self = this service.on 'integration.create', (integration) -> self.emit 'integration.create', integration service.on 'integration.update', (integration) -> self.emit 'integration.update', integration service.on 'integration.remove', (integration) -> self.emit 'integration.remove', integration this worker = (options) -> new Worker options module.exports = worker
23231
{EventEmitter} = require 'events' Promise = require 'bluebird' logger = require 'graceful-logger' {CronJob} = require 'cron' _util = require 'util' class Worker extends EventEmitter constructor: (options = {}) -> @tasks = {} @fetchTasksPromise = @fetchTasks() @bindEvents() @options = interval: 300000 # 5 minutes concurrency: 2 maxErrorTimes: 10 taskInterval: 1000 # Sleep between each task _util._extend @options, options {addTasks, removeTasks} = @options @addTasks = addTasks if typeof addTasks is 'function' @removeTasks = removeTasks if typeof removeTasks is 'function' fetchTasks: -> retryTimes = 0 retryMaxTimes = 3 retryInterval = 100 talk = require './talk' self = this _fetchTasks = -> talk.call 'integration.batchread' .catch (err) -> retryTimes += 1 retryDuration = retryInterval * 2 ** retryTimes if retryTimes > retryMaxTimes throw new Error('could not fetch the integration list from server') Promise.delay retryDuration .then _fetchTasks _fetchTasks() .then (integrations = []) -> integrations.forEach (integration) -> self.emit 'integration.create', integration bindEvents: -> self = this @on 'integration.create', (integration) -> self.addTasks integration @on 'integration.update', (integration) -> self.removeTasks integration self.addTasks integration @on 'integration.remove', (integration) -> self.removeTasks integration run: -> return if @isStopped return @runCron() if @options.cron {interval} = @options self = this @fetchTasksPromise .then -> self.runOnce() .timeout interval # Kill the current task loop when execute time greater than interval .catch (err) -> logger.warn err.stack .then -> Promise.delay interval .then -> self.run() ###* * Execute the tasks by cron-like schedule * @return {[type]} [description] ### runCron: -> {cron} = @options @cronJob = new CronJob cronTime: cron onTick: @runOnce start: true runOnce: => self = this {runner, concurrency, maxErrorTimes, taskInterval} = @options {tasks} = this talk = require './talk' Promise.map Object.keys(tasks), (key) -> task = tasks[key] unless task and typeof(runner) is 'function' delete tasks[key] return false Promise.resolve() .then -> runner task .then -> task.errorTimes = 0 .catch (err) -> # Handle error integration logger.warn err.stack task.errorTimes = (task.errorTimes or 0) + 1 return unless task.errorTimes >= maxErrorTimes {integrations} = task _sendIntegrationError = (ikey) -> integration = integrations[ikey] talk.call 'integration.error', _id: integration._id errorInfo: err.message .then -> self.emit 'integration.remove', integration .catch (err) -> logger.warn err.stack Object.keys(integrations).forEach _sendIntegrationError .delay taskInterval , concurrency: concurrency stop: -> @isStopped = true @cronJob?.stop() # The default handler for convert integrations to task addTasks: (integration) -> {token, events, url} = integration {tasks} = this # Integration based on token and events. e.g. weibo/firim # These integration requests are made by a pair of token and event if token and events?.length events.forEach (event) -> taskKey = <KEY>token<KEY>}_#{event}" tasks[taskKey] or= event: event token: token integrations: {} tasks[taskKey].integrations[integration._id] = integration # Integration based on open url such as rss feed # These integration make request with a stable url else if url taskKey = url.trim() tasks[taskKey] or= url: taskKey integrations: {} tasks[taskKey].integrations[integration._id] = integration removeTasks: (integration) -> {_id} = integration return unless _id {tasks} = this Object.keys(tasks).forEach (taskKey) -> task = tasks[taskKey] delete task.integrations[_id] delete tasks[taskKey] unless Object.keys(task.integrations).length # Watch service events watch: (service) -> self = this service.on 'integration.create', (integration) -> self.emit 'integration.create', integration service.on 'integration.update', (integration) -> self.emit 'integration.update', integration service.on 'integration.remove', (integration) -> self.emit 'integration.remove', integration this worker = (options) -> new Worker options module.exports = worker
true
{EventEmitter} = require 'events' Promise = require 'bluebird' logger = require 'graceful-logger' {CronJob} = require 'cron' _util = require 'util' class Worker extends EventEmitter constructor: (options = {}) -> @tasks = {} @fetchTasksPromise = @fetchTasks() @bindEvents() @options = interval: 300000 # 5 minutes concurrency: 2 maxErrorTimes: 10 taskInterval: 1000 # Sleep between each task _util._extend @options, options {addTasks, removeTasks} = @options @addTasks = addTasks if typeof addTasks is 'function' @removeTasks = removeTasks if typeof removeTasks is 'function' fetchTasks: -> retryTimes = 0 retryMaxTimes = 3 retryInterval = 100 talk = require './talk' self = this _fetchTasks = -> talk.call 'integration.batchread' .catch (err) -> retryTimes += 1 retryDuration = retryInterval * 2 ** retryTimes if retryTimes > retryMaxTimes throw new Error('could not fetch the integration list from server') Promise.delay retryDuration .then _fetchTasks _fetchTasks() .then (integrations = []) -> integrations.forEach (integration) -> self.emit 'integration.create', integration bindEvents: -> self = this @on 'integration.create', (integration) -> self.addTasks integration @on 'integration.update', (integration) -> self.removeTasks integration self.addTasks integration @on 'integration.remove', (integration) -> self.removeTasks integration run: -> return if @isStopped return @runCron() if @options.cron {interval} = @options self = this @fetchTasksPromise .then -> self.runOnce() .timeout interval # Kill the current task loop when execute time greater than interval .catch (err) -> logger.warn err.stack .then -> Promise.delay interval .then -> self.run() ###* * Execute the tasks by cron-like schedule * @return {[type]} [description] ### runCron: -> {cron} = @options @cronJob = new CronJob cronTime: cron onTick: @runOnce start: true runOnce: => self = this {runner, concurrency, maxErrorTimes, taskInterval} = @options {tasks} = this talk = require './talk' Promise.map Object.keys(tasks), (key) -> task = tasks[key] unless task and typeof(runner) is 'function' delete tasks[key] return false Promise.resolve() .then -> runner task .then -> task.errorTimes = 0 .catch (err) -> # Handle error integration logger.warn err.stack task.errorTimes = (task.errorTimes or 0) + 1 return unless task.errorTimes >= maxErrorTimes {integrations} = task _sendIntegrationError = (ikey) -> integration = integrations[ikey] talk.call 'integration.error', _id: integration._id errorInfo: err.message .then -> self.emit 'integration.remove', integration .catch (err) -> logger.warn err.stack Object.keys(integrations).forEach _sendIntegrationError .delay taskInterval , concurrency: concurrency stop: -> @isStopped = true @cronJob?.stop() # The default handler for convert integrations to task addTasks: (integration) -> {token, events, url} = integration {tasks} = this # Integration based on token and events. e.g. weibo/firim # These integration requests are made by a pair of token and event if token and events?.length events.forEach (event) -> taskKey = PI:KEY:<KEY>END_PItokenPI:KEY:<KEY>END_PI}_#{event}" tasks[taskKey] or= event: event token: token integrations: {} tasks[taskKey].integrations[integration._id] = integration # Integration based on open url such as rss feed # These integration make request with a stable url else if url taskKey = url.trim() tasks[taskKey] or= url: taskKey integrations: {} tasks[taskKey].integrations[integration._id] = integration removeTasks: (integration) -> {_id} = integration return unless _id {tasks} = this Object.keys(tasks).forEach (taskKey) -> task = tasks[taskKey] delete task.integrations[_id] delete tasks[taskKey] unless Object.keys(task.integrations).length # Watch service events watch: (service) -> self = this service.on 'integration.create', (integration) -> self.emit 'integration.create', integration service.on 'integration.update', (integration) -> self.emit 'integration.update', integration service.on 'integration.remove', (integration) -> self.emit 'integration.remove', integration this worker = (options) -> new Worker options module.exports = worker
[ { "context": "#\n# Based on implementation by Neil Bartlett\n# https://github.com/neilbartlett/color-temperatu", "end": 44, "score": 0.999902069568634, "start": 31, "tag": "NAME", "value": "Neil Bartlett" }, { "context": "lementation by Neil Bartlett\n# https://github.com/neilbartlet...
node_modules/chroma-js/src/converter/out/rgb2temperature.coffee
Dozacode/ResumeChain
15
# # Based on implementation by Neil Bartlett # https://github.com/neilbartlett/color-temperature # # @requires utils temperature2rgb rgb2temperature = () -> [r,g,b] = unpack arguments minTemp = 1000 maxTemp = 40000 eps = 0.4 while maxTemp - minTemp > eps temp = (maxTemp + minTemp) * 0.5 rgb = temperature2rgb temp if (rgb[2] / rgb[0]) >= (b / r) maxTemp = temp else minTemp = temp round temp
3462
# # Based on implementation by <NAME> # https://github.com/neilbartlett/color-temperature # # @requires utils temperature2rgb rgb2temperature = () -> [r,g,b] = unpack arguments minTemp = 1000 maxTemp = 40000 eps = 0.4 while maxTemp - minTemp > eps temp = (maxTemp + minTemp) * 0.5 rgb = temperature2rgb temp if (rgb[2] / rgb[0]) >= (b / r) maxTemp = temp else minTemp = temp round temp
true
# # Based on implementation by PI:NAME:<NAME>END_PI # https://github.com/neilbartlett/color-temperature # # @requires utils temperature2rgb rgb2temperature = () -> [r,g,b] = unpack arguments minTemp = 1000 maxTemp = 40000 eps = 0.4 while maxTemp - minTemp > eps temp = (maxTemp + minTemp) * 0.5 rgb = temperature2rgb temp if (rgb[2] / rgb[0]) >= (b / r) maxTemp = temp else minTemp = temp round temp
[ { "context": " 'must be at least 3 characters'\n password: 'must be present'\n\n assert.calledWith(form.username.$setValidit", "end": 655, "score": 0.9992018342018127, "start": 640, "tag": "PASSWORD", "value": "must be present" }, { "context": " 'must be at least 3 characters...
h/static/scripts/test/form-respond-test.coffee
noscripter/h
2
{module, inject} = angular.mock describe 'form-respond', -> $scope = null formRespond = null form = null before -> angular.module('h', []) .service('formRespond', require('../form-respond')) beforeEach module('h') beforeEach inject (_$rootScope_, _formRespond_) -> $scope = _$rootScope_.$new() formRespond = _formRespond_ form = $setValidity: sinon.spy() username: {$setValidity: sinon.spy()} password: {$setValidity: sinon.spy()} it 'sets the "response" error key for each field with errors', -> formRespond form, username: 'must be at least 3 characters' password: 'must be present' assert.calledWith(form.username.$setValidity, 'response', false) assert.calledWith(form.password.$setValidity, 'response', false) it 'adds an error message to each input controller', -> formRespond form, username: 'must be at least 3 characters' password: 'must be present' assert.equal(form.username.responseErrorMessage, 'must be at least 3 characters') assert.equal(form.password.responseErrorMessage, 'must be present') it 'sets the "response" error key if the form has a top-level error', -> formRespond form, {'': 'Explosions!'} assert.calledWith(form.$setValidity, 'response', false) it 'adds an error message if the form has a top-level error', -> formRespond form, {'': 'Explosions!'} assert.equal(form.responseErrorMessage, 'Explosions!') it 'sets the "response" error key if the form has a failure reason', -> formRespond form, null, 'fail' assert.calledWith(form.$setValidity, 'response', false) it 'adds an reason message as the response error', -> formRespond form, null, 'fail' assert.equal(form.responseErrorMessage, 'fail')
132162
{module, inject} = angular.mock describe 'form-respond', -> $scope = null formRespond = null form = null before -> angular.module('h', []) .service('formRespond', require('../form-respond')) beforeEach module('h') beforeEach inject (_$rootScope_, _formRespond_) -> $scope = _$rootScope_.$new() formRespond = _formRespond_ form = $setValidity: sinon.spy() username: {$setValidity: sinon.spy()} password: {$setValidity: sinon.spy()} it 'sets the "response" error key for each field with errors', -> formRespond form, username: 'must be at least 3 characters' password: '<PASSWORD>' assert.calledWith(form.username.$setValidity, 'response', false) assert.calledWith(form.password.$setValidity, 'response', false) it 'adds an error message to each input controller', -> formRespond form, username: 'must be at least 3 characters' password: '<PASSWORD>' assert.equal(form.username.responseErrorMessage, 'must be at least 3 characters') assert.equal(form.password.responseErrorMessage, 'must be present') it 'sets the "response" error key if the form has a top-level error', -> formRespond form, {'': 'Explosions!'} assert.calledWith(form.$setValidity, 'response', false) it 'adds an error message if the form has a top-level error', -> formRespond form, {'': 'Explosions!'} assert.equal(form.responseErrorMessage, 'Explosions!') it 'sets the "response" error key if the form has a failure reason', -> formRespond form, null, 'fail' assert.calledWith(form.$setValidity, 'response', false) it 'adds an reason message as the response error', -> formRespond form, null, 'fail' assert.equal(form.responseErrorMessage, 'fail')
true
{module, inject} = angular.mock describe 'form-respond', -> $scope = null formRespond = null form = null before -> angular.module('h', []) .service('formRespond', require('../form-respond')) beforeEach module('h') beforeEach inject (_$rootScope_, _formRespond_) -> $scope = _$rootScope_.$new() formRespond = _formRespond_ form = $setValidity: sinon.spy() username: {$setValidity: sinon.spy()} password: {$setValidity: sinon.spy()} it 'sets the "response" error key for each field with errors', -> formRespond form, username: 'must be at least 3 characters' password: 'PI:PASSWORD:<PASSWORD>END_PI' assert.calledWith(form.username.$setValidity, 'response', false) assert.calledWith(form.password.$setValidity, 'response', false) it 'adds an error message to each input controller', -> formRespond form, username: 'must be at least 3 characters' password: 'PI:PASSWORD:<PASSWORD>END_PI' assert.equal(form.username.responseErrorMessage, 'must be at least 3 characters') assert.equal(form.password.responseErrorMessage, 'must be present') it 'sets the "response" error key if the form has a top-level error', -> formRespond form, {'': 'Explosions!'} assert.calledWith(form.$setValidity, 'response', false) it 'adds an error message if the form has a top-level error', -> formRespond form, {'': 'Explosions!'} assert.equal(form.responseErrorMessage, 'Explosions!') it 'sets the "response" error key if the form has a failure reason', -> formRespond form, null, 'fail' assert.calledWith(form.$setValidity, 'response', false) it 'adds an reason message as the response error', -> formRespond form, null, 'fail' assert.equal(form.responseErrorMessage, 'fail')
[ { "context": "#####################\n# Title: HomeView\n# Author: kevin@wintr.us @ WINTR\n#########################################", "end": 101, "score": 0.9999076128005981, "start": 87, "tag": "EMAIL", "value": "kevin@wintr.us" }, { "context": "####\n# Title: HomeView\n# Author: ...
source/javascripts/views/HomeView.coffee
WikiEducationFoundation/WikiEduWizard
1
######################################################### # Title: HomeView # Author: kevin@wintr.us @ WINTR ######################################################### # APP application = require( '../app' ) # SUPER VIEW CLASS View = require('../views/supers/View') #TEMPLATES HomeTemplate = require('../templates/HomeTemplate.hbs') #SUBVIEWS StepView = require('../views/StepView') StepModel = require('../models/StepModel') StepNavView = require('../views/StepNavView') TimelineView = require('../views/TimelineView') #INPUTS WizardStepInputs = require('../data/WizardStepInputs') module.exports = class HomeView extends View #-------------------------------------------------------- # SETUP #-------------------------------------------------------- className: 'home-view' template: HomeTemplate stepData: intro: application.WizardConfig.intro_steps pathways: application.WizardConfig.pathways outro: application.WizardConfig.outro_steps pathwayIds: -> return _.keys(@stepData.pathways) stepViews: [] allStepViews: intro: [] pathway: [] outro: [] selectedPathways: [] #-------------------------------------------------------- # INIT #-------------------------------------------------------- initialize: -> @StepNav = new StepNavView() @currentStep = 0 @stepsRendered = false events: 'click .exit-edit' : 'exitEditClickHandler' subscriptions: 'step:next' : 'nextHandler' 'step:prev' : 'prevHandler' 'step:goto' : 'gotoHandler' 'step:gotoId' : 'gotoIdHandler' 'step:edit' : 'editHandler' 'tips:hide' : 'hideAllTips' 'edit:exit' : 'onEditExit' render: -> @$el.html( @template( @getRenderData())) unless @stepsRendered @afterRender() return @ afterRender: -> @$stepsContainer = @$el.find('.steps') @$innerContainer = @$el.find('.content') @renderIntroSteps() @renderSteps() @StepNav.stepViews = @stepViews @StepNav.totalSteps = @stepViews.length @$innerContainer.append(@StepNav.el) if @stepViews.length > 0 @showCurrentStep() setTimeout(=> @timelineView = new TimelineView() ,1000) return @ renderIntroSteps: -> stepNumber = 0 _.each(@stepData.intro,(step, index) => newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) if index is 0 newview.isFirstStep = true @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") @stepViews.push(newview) @allStepViews.intro.push(newview) stepNumber++ ) return @ renderSteps: -> @allStepViews.pathway = [] stepNumber = @stepViews.length _.each(@selectedPathways, (pid, pindex) => _.each(@stepData.pathways[pid],(step, index) => if @selectedPathways.length > 1 if step.id is 'grading' || step.id is 'overview' || step.type is 'grading' || step.type is 'overview' if pindex < @selectedPathways.length - 1 return newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") newview.$el.addClass("step-pathway step-pathway--#{pid}") @stepViews.push(newview) @allStepViews.pathway.push(newview) stepNumber++ ) ) return @ renderOutroSteps: -> @allStepViews.outro = [] stepNumber = @stepViews.length _.each(@stepData.outro,(step, index) => newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) if index is @stepData.outro.length - 1 newview.isLastStep = true @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") @stepViews.push(newview) @allStepViews.outro.push(newview) stepNumber++ ) return @ recreatePathway: -> clone = @stepViews @stepViews = [clone[0], clone[1]] _.each(@allStepViews.pathway, (step) -> step.remove() ) _.each(@allStepViews.outro, (step) -> step.remove() ) @renderSteps() @renderOutroSteps() @StepNav.stepViews = @stepViews @StepNav.totalSteps = @stepViews.length @$innerContainer.append(@StepNav.el) getRenderData: -> return { content: "This is special content" } #-------------------------------------------------------- # CUSTOM FUNCTIONS #-------------------------------------------------------- advanceStep: -> @currentStep+=1 if @currentStep is @stepViews.length @currentStep = 0 @hideAllSteps() @showCurrentStep() decrementStep: -> @currentStep-=1 if @currentStep < 0 @currentStep = @stepViews.length - 1 @hideAllSteps() @showCurrentStep() updateStep: (index) -> @currentStep = index @hideAllSteps() @showCurrentStep() updateStepById: (id) -> _.each(@stepViews,(stepView) => if stepView.stepId() is id @updateStep(_.indexOf(@stepViews,stepView)) return ) showCurrentStep: -> @stepViews[@currentStep].show() Backbone.Mediator.publish('step:update', @currentStep) return @ updateSelectedPathway: (action, pathwayId) -> if action is 'add' if pathwayId is 'researchwrite' @selectedPathways = [pathwayId] else @selectedPathways.push(pathwayId) else if action is 'remove' if pathwayId is 'researchwrite' @selectedPathways = [] else removeIndex = _.indexOf(@selectedPathway, pathwayId) @selectedPathways.splice(removeIndex) @recreatePathway() return @ currentStepView: -> return @stepViews[@currentStep] hideAllSteps: -> _.each(@stepViews,(stepView) => stepView.hide() ) hideAllTips: (e) -> _.each(@stepViews,(stepView) => stepView.tipVisible = false ) $('body').addClass('tip-open') $('.step-info-tip').removeClass('visible') $('.custom-input-wrapper').removeClass('selected') #-------------------------------------------------------- # EVENT HANDLERS #-------------------------------------------------------- nextHandler: -> @advanceStep() @hideAllTips() prevHandler: -> @decrementStep() @hideAllTips() editHandler: (id) -> if id is 'assignment_selection' x = confirm('Are you sure you want to start the process over with a new assignment type?') if !x return else $('body').addClass('edit-mode') _.each(@stepViews, (view, index) => if view.model.id == id @updateStep(index) ) onEditExit: -> $('body').removeClass('edit-mode') exitEditClickHandler: (e) -> e.preventDefault() Backbone.Mediator.publish('edit:exit') gotoHandler: (index) -> @updateStep(index) @hideAllTips() gotoIdHandler: (id) -> @updateStepById(id) @hideAllTips() getSelectedIds: -> selectedIds = [] _.each(WizardStepInputs, (steps) => _.each(steps, (step) => if step.selected is true if step.id selectedIds.push step.id ) ) return selectedIds
187592
######################################################### # Title: HomeView # Author: <EMAIL> @ WINTR ######################################################### # APP application = require( '../app' ) # SUPER VIEW CLASS View = require('../views/supers/View') #TEMPLATES HomeTemplate = require('../templates/HomeTemplate.hbs') #SUBVIEWS StepView = require('../views/StepView') StepModel = require('../models/StepModel') StepNavView = require('../views/StepNavView') TimelineView = require('../views/TimelineView') #INPUTS WizardStepInputs = require('../data/WizardStepInputs') module.exports = class HomeView extends View #-------------------------------------------------------- # SETUP #-------------------------------------------------------- className: 'home-view' template: HomeTemplate stepData: intro: application.WizardConfig.intro_steps pathways: application.WizardConfig.pathways outro: application.WizardConfig.outro_steps pathwayIds: -> return _.keys(@stepData.pathways) stepViews: [] allStepViews: intro: [] pathway: [] outro: [] selectedPathways: [] #-------------------------------------------------------- # INIT #-------------------------------------------------------- initialize: -> @StepNav = new StepNavView() @currentStep = 0 @stepsRendered = false events: 'click .exit-edit' : 'exitEditClickHandler' subscriptions: 'step:next' : 'nextHandler' 'step:prev' : 'prevHandler' 'step:goto' : 'gotoHandler' 'step:gotoId' : 'gotoIdHandler' 'step:edit' : 'editHandler' 'tips:hide' : 'hideAllTips' 'edit:exit' : 'onEditExit' render: -> @$el.html( @template( @getRenderData())) unless @stepsRendered @afterRender() return @ afterRender: -> @$stepsContainer = @$el.find('.steps') @$innerContainer = @$el.find('.content') @renderIntroSteps() @renderSteps() @StepNav.stepViews = @stepViews @StepNav.totalSteps = @stepViews.length @$innerContainer.append(@StepNav.el) if @stepViews.length > 0 @showCurrentStep() setTimeout(=> @timelineView = new TimelineView() ,1000) return @ renderIntroSteps: -> stepNumber = 0 _.each(@stepData.intro,(step, index) => newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) if index is 0 newview.isFirstStep = true @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") @stepViews.push(newview) @allStepViews.intro.push(newview) stepNumber++ ) return @ renderSteps: -> @allStepViews.pathway = [] stepNumber = @stepViews.length _.each(@selectedPathways, (pid, pindex) => _.each(@stepData.pathways[pid],(step, index) => if @selectedPathways.length > 1 if step.id is 'grading' || step.id is 'overview' || step.type is 'grading' || step.type is 'overview' if pindex < @selectedPathways.length - 1 return newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") newview.$el.addClass("step-pathway step-pathway--#{pid}") @stepViews.push(newview) @allStepViews.pathway.push(newview) stepNumber++ ) ) return @ renderOutroSteps: -> @allStepViews.outro = [] stepNumber = @stepViews.length _.each(@stepData.outro,(step, index) => newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) if index is @stepData.outro.length - 1 newview.isLastStep = true @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") @stepViews.push(newview) @allStepViews.outro.push(newview) stepNumber++ ) return @ recreatePathway: -> clone = @stepViews @stepViews = [clone[0], clone[1]] _.each(@allStepViews.pathway, (step) -> step.remove() ) _.each(@allStepViews.outro, (step) -> step.remove() ) @renderSteps() @renderOutroSteps() @StepNav.stepViews = @stepViews @StepNav.totalSteps = @stepViews.length @$innerContainer.append(@StepNav.el) getRenderData: -> return { content: "This is special content" } #-------------------------------------------------------- # CUSTOM FUNCTIONS #-------------------------------------------------------- advanceStep: -> @currentStep+=1 if @currentStep is @stepViews.length @currentStep = 0 @hideAllSteps() @showCurrentStep() decrementStep: -> @currentStep-=1 if @currentStep < 0 @currentStep = @stepViews.length - 1 @hideAllSteps() @showCurrentStep() updateStep: (index) -> @currentStep = index @hideAllSteps() @showCurrentStep() updateStepById: (id) -> _.each(@stepViews,(stepView) => if stepView.stepId() is id @updateStep(_.indexOf(@stepViews,stepView)) return ) showCurrentStep: -> @stepViews[@currentStep].show() Backbone.Mediator.publish('step:update', @currentStep) return @ updateSelectedPathway: (action, pathwayId) -> if action is 'add' if pathwayId is 'researchwrite' @selectedPathways = [pathwayId] else @selectedPathways.push(pathwayId) else if action is 'remove' if pathwayId is 'researchwrite' @selectedPathways = [] else removeIndex = _.indexOf(@selectedPathway, pathwayId) @selectedPathways.splice(removeIndex) @recreatePathway() return @ currentStepView: -> return @stepViews[@currentStep] hideAllSteps: -> _.each(@stepViews,(stepView) => stepView.hide() ) hideAllTips: (e) -> _.each(@stepViews,(stepView) => stepView.tipVisible = false ) $('body').addClass('tip-open') $('.step-info-tip').removeClass('visible') $('.custom-input-wrapper').removeClass('selected') #-------------------------------------------------------- # EVENT HANDLERS #-------------------------------------------------------- nextHandler: -> @advanceStep() @hideAllTips() prevHandler: -> @decrementStep() @hideAllTips() editHandler: (id) -> if id is 'assignment_selection' x = confirm('Are you sure you want to start the process over with a new assignment type?') if !x return else $('body').addClass('edit-mode') _.each(@stepViews, (view, index) => if view.model.id == id @updateStep(index) ) onEditExit: -> $('body').removeClass('edit-mode') exitEditClickHandler: (e) -> e.preventDefault() Backbone.Mediator.publish('edit:exit') gotoHandler: (index) -> @updateStep(index) @hideAllTips() gotoIdHandler: (id) -> @updateStepById(id) @hideAllTips() getSelectedIds: -> selectedIds = [] _.each(WizardStepInputs, (steps) => _.each(steps, (step) => if step.selected is true if step.id selectedIds.push step.id ) ) return selectedIds
true
######################################################### # Title: HomeView # Author: PI:EMAIL:<EMAIL>END_PI @ WINTR ######################################################### # APP application = require( '../app' ) # SUPER VIEW CLASS View = require('../views/supers/View') #TEMPLATES HomeTemplate = require('../templates/HomeTemplate.hbs') #SUBVIEWS StepView = require('../views/StepView') StepModel = require('../models/StepModel') StepNavView = require('../views/StepNavView') TimelineView = require('../views/TimelineView') #INPUTS WizardStepInputs = require('../data/WizardStepInputs') module.exports = class HomeView extends View #-------------------------------------------------------- # SETUP #-------------------------------------------------------- className: 'home-view' template: HomeTemplate stepData: intro: application.WizardConfig.intro_steps pathways: application.WizardConfig.pathways outro: application.WizardConfig.outro_steps pathwayIds: -> return _.keys(@stepData.pathways) stepViews: [] allStepViews: intro: [] pathway: [] outro: [] selectedPathways: [] #-------------------------------------------------------- # INIT #-------------------------------------------------------- initialize: -> @StepNav = new StepNavView() @currentStep = 0 @stepsRendered = false events: 'click .exit-edit' : 'exitEditClickHandler' subscriptions: 'step:next' : 'nextHandler' 'step:prev' : 'prevHandler' 'step:goto' : 'gotoHandler' 'step:gotoId' : 'gotoIdHandler' 'step:edit' : 'editHandler' 'tips:hide' : 'hideAllTips' 'edit:exit' : 'onEditExit' render: -> @$el.html( @template( @getRenderData())) unless @stepsRendered @afterRender() return @ afterRender: -> @$stepsContainer = @$el.find('.steps') @$innerContainer = @$el.find('.content') @renderIntroSteps() @renderSteps() @StepNav.stepViews = @stepViews @StepNav.totalSteps = @stepViews.length @$innerContainer.append(@StepNav.el) if @stepViews.length > 0 @showCurrentStep() setTimeout(=> @timelineView = new TimelineView() ,1000) return @ renderIntroSteps: -> stepNumber = 0 _.each(@stepData.intro,(step, index) => newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) if index is 0 newview.isFirstStep = true @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") @stepViews.push(newview) @allStepViews.intro.push(newview) stepNumber++ ) return @ renderSteps: -> @allStepViews.pathway = [] stepNumber = @stepViews.length _.each(@selectedPathways, (pid, pindex) => _.each(@stepData.pathways[pid],(step, index) => if @selectedPathways.length > 1 if step.id is 'grading' || step.id is 'overview' || step.type is 'grading' || step.type is 'overview' if pindex < @selectedPathways.length - 1 return newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") newview.$el.addClass("step-pathway step-pathway--#{pid}") @stepViews.push(newview) @allStepViews.pathway.push(newview) stepNumber++ ) ) return @ renderOutroSteps: -> @allStepViews.outro = [] stepNumber = @stepViews.length _.each(@stepData.outro,(step, index) => newmodel = new StepModel() _.map(step,(value, key, list) -> newmodel.set(key,value) ) newview = new StepView( model: newmodel ) newview.model.set('stepNumber', stepNumber + 1) newview.model.set('stepIndex', stepNumber ) if index is @stepData.outro.length - 1 newview.isLastStep = true @$stepsContainer.append(newview.render().hide().el) newview.$el.addClass("step--#{step.id}") @stepViews.push(newview) @allStepViews.outro.push(newview) stepNumber++ ) return @ recreatePathway: -> clone = @stepViews @stepViews = [clone[0], clone[1]] _.each(@allStepViews.pathway, (step) -> step.remove() ) _.each(@allStepViews.outro, (step) -> step.remove() ) @renderSteps() @renderOutroSteps() @StepNav.stepViews = @stepViews @StepNav.totalSteps = @stepViews.length @$innerContainer.append(@StepNav.el) getRenderData: -> return { content: "This is special content" } #-------------------------------------------------------- # CUSTOM FUNCTIONS #-------------------------------------------------------- advanceStep: -> @currentStep+=1 if @currentStep is @stepViews.length @currentStep = 0 @hideAllSteps() @showCurrentStep() decrementStep: -> @currentStep-=1 if @currentStep < 0 @currentStep = @stepViews.length - 1 @hideAllSteps() @showCurrentStep() updateStep: (index) -> @currentStep = index @hideAllSteps() @showCurrentStep() updateStepById: (id) -> _.each(@stepViews,(stepView) => if stepView.stepId() is id @updateStep(_.indexOf(@stepViews,stepView)) return ) showCurrentStep: -> @stepViews[@currentStep].show() Backbone.Mediator.publish('step:update', @currentStep) return @ updateSelectedPathway: (action, pathwayId) -> if action is 'add' if pathwayId is 'researchwrite' @selectedPathways = [pathwayId] else @selectedPathways.push(pathwayId) else if action is 'remove' if pathwayId is 'researchwrite' @selectedPathways = [] else removeIndex = _.indexOf(@selectedPathway, pathwayId) @selectedPathways.splice(removeIndex) @recreatePathway() return @ currentStepView: -> return @stepViews[@currentStep] hideAllSteps: -> _.each(@stepViews,(stepView) => stepView.hide() ) hideAllTips: (e) -> _.each(@stepViews,(stepView) => stepView.tipVisible = false ) $('body').addClass('tip-open') $('.step-info-tip').removeClass('visible') $('.custom-input-wrapper').removeClass('selected') #-------------------------------------------------------- # EVENT HANDLERS #-------------------------------------------------------- nextHandler: -> @advanceStep() @hideAllTips() prevHandler: -> @decrementStep() @hideAllTips() editHandler: (id) -> if id is 'assignment_selection' x = confirm('Are you sure you want to start the process over with a new assignment type?') if !x return else $('body').addClass('edit-mode') _.each(@stepViews, (view, index) => if view.model.id == id @updateStep(index) ) onEditExit: -> $('body').removeClass('edit-mode') exitEditClickHandler: (e) -> e.preventDefault() Backbone.Mediator.publish('edit:exit') gotoHandler: (index) -> @updateStep(index) @hideAllTips() gotoIdHandler: (id) -> @updateStepById(id) @hideAllTips() getSelectedIds: -> selectedIds = [] _.each(WizardStepInputs, (steps) => _.each(steps, (step) => if step.selected is true if step.id selectedIds.push step.id ) ) return selectedIds
[ { "context": "###\n@Author: Kristinita\n@Date: 2017-01-30 13:33:35\n@Last Modified time:", "end": 23, "score": 0.9997961521148682, "start": 13, "tag": "NAME", "value": "Kristinita" }, { "context": "it.ly/2Iq1nGs ;\n\tReplace eval: https://github.com/eslint/eslint/issues/7861#issuec...
content/coffee/personal/Kristinita/gcse.coffee
Kristinita/KristinitaPelicanCI
0
### @Author: Kristinita @Date: 2017-01-30 13:33:35 @Last Modified time: 2017-01-30 13:39:59 ### ############################### # Google Custom Search Engine # ############################### # Custom Search Engine: # https://www.google.com/cse/ # [WARNING]: New search engine, because in old error “X-Frame-Options”: # http://stackoverflow.com/a/32696709/5951529 # [NOTE] “enableHistory = true” enables history management. ### [DEPRECATED] Old form. < gcse: search enableHistory = true > < /gcse:search> < gcse: searchbox enableHistory = trueautoCompleteMaxCompletions = 10 > < /gcse:searchbox> < gcse: searchresults > < /gcse:searchresults> ### do -> cx = '013024336414733191742:sps98skj394' gcse = document.createElement('script') gcse.type = 'text/javascript' gcse.async = true gcse.src = 'https://cse.google.com/cse.js?cx=' + cx s = document.getElementsByTagName('script')[0] ### Add autofocus for Google Custom Search Engine Form: http://bit.ly/2Iq1nGs ; Replace eval: https://github.com/eslint/eslint/issues/7861#issuecomment-270670327 ### # 1000 delay work not always, I increase delay setTimeout (-> document.getElementById('gsc-i-id1').focus() return ), 1500 s.parentNode.insertBefore gcse, s return
120455
### @Author: <NAME> @Date: 2017-01-30 13:33:35 @Last Modified time: 2017-01-30 13:39:59 ### ############################### # Google Custom Search Engine # ############################### # Custom Search Engine: # https://www.google.com/cse/ # [WARNING]: New search engine, because in old error “X-Frame-Options”: # http://stackoverflow.com/a/32696709/5951529 # [NOTE] “enableHistory = true” enables history management. ### [DEPRECATED] Old form. < gcse: search enableHistory = true > < /gcse:search> < gcse: searchbox enableHistory = trueautoCompleteMaxCompletions = 10 > < /gcse:searchbox> < gcse: searchresults > < /gcse:searchresults> ### do -> cx = '013024336414733191742:sps98skj394' gcse = document.createElement('script') gcse.type = 'text/javascript' gcse.async = true gcse.src = 'https://cse.google.com/cse.js?cx=' + cx s = document.getElementsByTagName('script')[0] ### Add autofocus for Google Custom Search Engine Form: http://bit.ly/2Iq1nGs ; Replace eval: https://github.com/eslint/eslint/issues/7861#issuecomment-270670327 ### # 1000 delay work not always, I increase delay setTimeout (-> document.getElementById('gsc-i-id1').focus() return ), 1500 s.parentNode.insertBefore gcse, s return
true
### @Author: PI:NAME:<NAME>END_PI @Date: 2017-01-30 13:33:35 @Last Modified time: 2017-01-30 13:39:59 ### ############################### # Google Custom Search Engine # ############################### # Custom Search Engine: # https://www.google.com/cse/ # [WARNING]: New search engine, because in old error “X-Frame-Options”: # http://stackoverflow.com/a/32696709/5951529 # [NOTE] “enableHistory = true” enables history management. ### [DEPRECATED] Old form. < gcse: search enableHistory = true > < /gcse:search> < gcse: searchbox enableHistory = trueautoCompleteMaxCompletions = 10 > < /gcse:searchbox> < gcse: searchresults > < /gcse:searchresults> ### do -> cx = '013024336414733191742:sps98skj394' gcse = document.createElement('script') gcse.type = 'text/javascript' gcse.async = true gcse.src = 'https://cse.google.com/cse.js?cx=' + cx s = document.getElementsByTagName('script')[0] ### Add autofocus for Google Custom Search Engine Form: http://bit.ly/2Iq1nGs ; Replace eval: https://github.com/eslint/eslint/issues/7861#issuecomment-270670327 ### # 1000 delay work not always, I increase delay setTimeout (-> document.getElementById('gsc-i-id1').focus() return ), 1500 s.parentNode.insertBefore gcse, s return
[ { "context": "ser'+_.uniqueId()+'@example.com'\n password: 'password'\n anonymous: false\n }, options)\n user ", "end": 1550, "score": 0.9995297193527222, "start": 1542, "tag": "PASSWORD", "value": "password" }, { "context": "get('email') or user.get('name')\n pa...
spec/server/utils.coffee
mohancm/codecombat
1
async = require 'async' utils = require '../../server/lib/utils' co = require 'co' Promise = require 'bluebird' User = require '../../server/models/User' Level = require '../../server/models/Level' Achievement = require '../../server/models/Achievement' Campaign = require '../../server/models/Campaign' Course = require '../../server/models/Course' Prepaid = require '../../server/models/Prepaid' Classroom = require '../../server/models/Classroom' CourseInstance = require '../../server/models/CourseInstance' moment = require 'moment' Classroom = require '../../server/models/Classroom' TrialRequest = require '../../server/models/TrialRequest' campaignSchema = require '../../app/schemas/models/campaign.schema' campaignLevelProperties = _.keys(campaignSchema.properties.levels.additionalProperties.properties) campaignAdjacentCampaignProperties = _.keys(campaignSchema.properties.adjacentCampaigns.additionalProperties.properties) module.exports = mw = getURL: (path) -> 'http://localhost:3001' + path clearModels: Promise.promisify (models, done) -> funcs = [] for model in models wrapped = (m) -> (callback) -> m.remove {}, (err) -> callback(err, true) funcs.push(wrapped(model)) async.parallel funcs, done initUser: (options, done) -> if _.isFunction(options) done = options options = {} options = _.extend({ permissions: [] name: 'Name Nameyname '+_.uniqueId() email: 'user'+_.uniqueId()+'@example.com' password: 'password' anonymous: false }, options) user = new User(options) promise = user.save() return promise loginUser: Promise.promisify (user, options={}, done) -> if _.isFunction(options) done = options options = {} form = { username: user.get('email') or user.get('name') password: 'password' } (options.request or request).post mw.getURL('/auth/login'), { form: form }, (err, res) -> expect(err).toBe(null) expect(res.statusCode).toBe(200) mw.lastLogin = user done(err, user) initAdmin: (options) -> if _.isFunction(options) done = options options = {} options = _.extend({permissions: ['admin']}, options) return @initUser(options) initArtisan: (options) -> if _.isFunction(options) done = options options = {} options = _.extend({permissions: ['artisan']}, options) return @initUser(options) becomeAnonymous: Promise.promisify (done) -> request.post mw.getURL('/auth/logout'), -> request.get mw.getURL('/auth/whoami'), {json: true}, (err, res) -> User.findById(res.body._id).exec(done) logout: Promise.promisify (done) -> request.post mw.getURL('/auth/logout'), done wrap: (gen) -> fn = co.wrap(gen) return (done) -> fn.apply(@, [done]).catch (err) -> done.fail(err) makeLevel: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Level ') permissions: [{target: mw.lastLogin.id, access: 'owner'}] }, data) request.post { uri: getURL('/db/level'), json: data }, (err, res) -> return done(err) if err Level.findById(res.body._id).exec done makeAchievement: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Achievement ') }, data) if sources.related and not data.related related = sources.related data.related = (related.get('original') or related._id).valueOf() request.post { uri: getURL('/db/achievement'), json: data }, (err, res) -> return done(err) if err Achievement.findById(res.body._id).exec done makeCampaign: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Campaign ') }, data) if not data.levels data.levels = {} for level in sources?.levels or [] data.levels[level.get('original').valueOf()] = _.pick level.toObject(), campaignLevelProperties if not data.adjacentCampaigns data.adjacentCampaigns = {} for campaign in sources?.adjacentCampaigns or [] data.adjacentCampaigns[campaign.id] = _.pick campaign.toObject(), campaignAdjacentCampaignProperties request.post { uri: getURL('/db/campaign'), json: data }, (err, res) -> return done(err) if err Campaign.findById(res.body._id).exec done makeCourse: (data={}, sources={}) -> if sources.campaign and not data.campaignID data.campaignID = sources.campaign._id data.releasePhase ||= 'released' course = new Course(data) return course.save() makePrepaid: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { type: 'course' maxRedeemers: 9001 endDate: moment().add(1, 'month').toISOString() startDate: new Date().toISOString() }, data) request.post { uri: getURL('/db/prepaid'), json: data }, (err, res) -> return done(err) if err expect(res.statusCode).toBe(201) Prepaid.findById(res.body._id).exec done makeClassroom: (data={}, sources={}) -> co -> data = _.extend({}, { name: _.uniqueId('Classroom ') }, data) [res, body] = yield request.postAsync { uri: getURL('/db/classroom'), json: data } expect(res.statusCode).toBe(201) classroom = yield Classroom.findById(res.body._id) if sources.members classroom.set('members', _.map(sources.members, '_id')) yield classroom.save() return classroom makeCourseInstance: (data={}, sources={}) -> co -> if sources.course and not data.courseID data.courseID = sources.course.id if sources.classroom and not data.classroomID data.classroomID = sources.classroom.id [res, body] = yield request.postAsync({ uri: getURL('/db/course_instance'), json: data }) expect(res.statusCode).toBe(200) courseInstance = yield CourseInstance.findById(res.body._id) if sources.members userIDs = _.map(sources.members, 'id') [res, body] = yield request.postAsync({ url: getURL("/db/course_instance/#{courseInstance.id}/members") json: { userIDs: userIDs } }) expect(res.statusCode).toBe(200) courseInstance = yield CourseInstance.findById(res.body._id) return courseInstance makeTrialRequest: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { type: 'course' properties: {} }, data) request.post { uri: getURL('/db/trial.request'), json: data }, (err, res) -> return done(err) if err expect(res.statusCode).toBe(201) TrialRequest.findById(res.body._id).exec done
158862
async = require 'async' utils = require '../../server/lib/utils' co = require 'co' Promise = require 'bluebird' User = require '../../server/models/User' Level = require '../../server/models/Level' Achievement = require '../../server/models/Achievement' Campaign = require '../../server/models/Campaign' Course = require '../../server/models/Course' Prepaid = require '../../server/models/Prepaid' Classroom = require '../../server/models/Classroom' CourseInstance = require '../../server/models/CourseInstance' moment = require 'moment' Classroom = require '../../server/models/Classroom' TrialRequest = require '../../server/models/TrialRequest' campaignSchema = require '../../app/schemas/models/campaign.schema' campaignLevelProperties = _.keys(campaignSchema.properties.levels.additionalProperties.properties) campaignAdjacentCampaignProperties = _.keys(campaignSchema.properties.adjacentCampaigns.additionalProperties.properties) module.exports = mw = getURL: (path) -> 'http://localhost:3001' + path clearModels: Promise.promisify (models, done) -> funcs = [] for model in models wrapped = (m) -> (callback) -> m.remove {}, (err) -> callback(err, true) funcs.push(wrapped(model)) async.parallel funcs, done initUser: (options, done) -> if _.isFunction(options) done = options options = {} options = _.extend({ permissions: [] name: 'Name Nameyname '+_.uniqueId() email: 'user'+_.uniqueId()+'@example.com' password: '<PASSWORD>' anonymous: false }, options) user = new User(options) promise = user.save() return promise loginUser: Promise.promisify (user, options={}, done) -> if _.isFunction(options) done = options options = {} form = { username: user.get('email') or user.get('name') password: '<PASSWORD>' } (options.request or request).post mw.getURL('/auth/login'), { form: form }, (err, res) -> expect(err).toBe(null) expect(res.statusCode).toBe(200) mw.lastLogin = user done(err, user) initAdmin: (options) -> if _.isFunction(options) done = options options = {} options = _.extend({permissions: ['admin']}, options) return @initUser(options) initArtisan: (options) -> if _.isFunction(options) done = options options = {} options = _.extend({permissions: ['artisan']}, options) return @initUser(options) becomeAnonymous: Promise.promisify (done) -> request.post mw.getURL('/auth/logout'), -> request.get mw.getURL('/auth/whoami'), {json: true}, (err, res) -> User.findById(res.body._id).exec(done) logout: Promise.promisify (done) -> request.post mw.getURL('/auth/logout'), done wrap: (gen) -> fn = co.wrap(gen) return (done) -> fn.apply(@, [done]).catch (err) -> done.fail(err) makeLevel: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Level ') permissions: [{target: mw.lastLogin.id, access: 'owner'}] }, data) request.post { uri: getURL('/db/level'), json: data }, (err, res) -> return done(err) if err Level.findById(res.body._id).exec done makeAchievement: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Achievement ') }, data) if sources.related and not data.related related = sources.related data.related = (related.get('original') or related._id).valueOf() request.post { uri: getURL('/db/achievement'), json: data }, (err, res) -> return done(err) if err Achievement.findById(res.body._id).exec done makeCampaign: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Campaign ') }, data) if not data.levels data.levels = {} for level in sources?.levels or [] data.levels[level.get('original').valueOf()] = _.pick level.toObject(), campaignLevelProperties if not data.adjacentCampaigns data.adjacentCampaigns = {} for campaign in sources?.adjacentCampaigns or [] data.adjacentCampaigns[campaign.id] = _.pick campaign.toObject(), campaignAdjacentCampaignProperties request.post { uri: getURL('/db/campaign'), json: data }, (err, res) -> return done(err) if err Campaign.findById(res.body._id).exec done makeCourse: (data={}, sources={}) -> if sources.campaign and not data.campaignID data.campaignID = sources.campaign._id data.releasePhase ||= 'released' course = new Course(data) return course.save() makePrepaid: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { type: 'course' maxRedeemers: 9001 endDate: moment().add(1, 'month').toISOString() startDate: new Date().toISOString() }, data) request.post { uri: getURL('/db/prepaid'), json: data }, (err, res) -> return done(err) if err expect(res.statusCode).toBe(201) Prepaid.findById(res.body._id).exec done makeClassroom: (data={}, sources={}) -> co -> data = _.extend({}, { name: _.uniqueId('Classroom ') }, data) [res, body] = yield request.postAsync { uri: getURL('/db/classroom'), json: data } expect(res.statusCode).toBe(201) classroom = yield Classroom.findById(res.body._id) if sources.members classroom.set('members', _.map(sources.members, '_id')) yield classroom.save() return classroom makeCourseInstance: (data={}, sources={}) -> co -> if sources.course and not data.courseID data.courseID = sources.course.id if sources.classroom and not data.classroomID data.classroomID = sources.classroom.id [res, body] = yield request.postAsync({ uri: getURL('/db/course_instance'), json: data }) expect(res.statusCode).toBe(200) courseInstance = yield CourseInstance.findById(res.body._id) if sources.members userIDs = _.map(sources.members, 'id') [res, body] = yield request.postAsync({ url: getURL("/db/course_instance/#{courseInstance.id}/members") json: { userIDs: userIDs } }) expect(res.statusCode).toBe(200) courseInstance = yield CourseInstance.findById(res.body._id) return courseInstance makeTrialRequest: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { type: 'course' properties: {} }, data) request.post { uri: getURL('/db/trial.request'), json: data }, (err, res) -> return done(err) if err expect(res.statusCode).toBe(201) TrialRequest.findById(res.body._id).exec done
true
async = require 'async' utils = require '../../server/lib/utils' co = require 'co' Promise = require 'bluebird' User = require '../../server/models/User' Level = require '../../server/models/Level' Achievement = require '../../server/models/Achievement' Campaign = require '../../server/models/Campaign' Course = require '../../server/models/Course' Prepaid = require '../../server/models/Prepaid' Classroom = require '../../server/models/Classroom' CourseInstance = require '../../server/models/CourseInstance' moment = require 'moment' Classroom = require '../../server/models/Classroom' TrialRequest = require '../../server/models/TrialRequest' campaignSchema = require '../../app/schemas/models/campaign.schema' campaignLevelProperties = _.keys(campaignSchema.properties.levels.additionalProperties.properties) campaignAdjacentCampaignProperties = _.keys(campaignSchema.properties.adjacentCampaigns.additionalProperties.properties) module.exports = mw = getURL: (path) -> 'http://localhost:3001' + path clearModels: Promise.promisify (models, done) -> funcs = [] for model in models wrapped = (m) -> (callback) -> m.remove {}, (err) -> callback(err, true) funcs.push(wrapped(model)) async.parallel funcs, done initUser: (options, done) -> if _.isFunction(options) done = options options = {} options = _.extend({ permissions: [] name: 'Name Nameyname '+_.uniqueId() email: 'user'+_.uniqueId()+'@example.com' password: 'PI:PASSWORD:<PASSWORD>END_PI' anonymous: false }, options) user = new User(options) promise = user.save() return promise loginUser: Promise.promisify (user, options={}, done) -> if _.isFunction(options) done = options options = {} form = { username: user.get('email') or user.get('name') password: 'PI:PASSWORD:<PASSWORD>END_PI' } (options.request or request).post mw.getURL('/auth/login'), { form: form }, (err, res) -> expect(err).toBe(null) expect(res.statusCode).toBe(200) mw.lastLogin = user done(err, user) initAdmin: (options) -> if _.isFunction(options) done = options options = {} options = _.extend({permissions: ['admin']}, options) return @initUser(options) initArtisan: (options) -> if _.isFunction(options) done = options options = {} options = _.extend({permissions: ['artisan']}, options) return @initUser(options) becomeAnonymous: Promise.promisify (done) -> request.post mw.getURL('/auth/logout'), -> request.get mw.getURL('/auth/whoami'), {json: true}, (err, res) -> User.findById(res.body._id).exec(done) logout: Promise.promisify (done) -> request.post mw.getURL('/auth/logout'), done wrap: (gen) -> fn = co.wrap(gen) return (done) -> fn.apply(@, [done]).catch (err) -> done.fail(err) makeLevel: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Level ') permissions: [{target: mw.lastLogin.id, access: 'owner'}] }, data) request.post { uri: getURL('/db/level'), json: data }, (err, res) -> return done(err) if err Level.findById(res.body._id).exec done makeAchievement: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Achievement ') }, data) if sources.related and not data.related related = sources.related data.related = (related.get('original') or related._id).valueOf() request.post { uri: getURL('/db/achievement'), json: data }, (err, res) -> return done(err) if err Achievement.findById(res.body._id).exec done makeCampaign: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { name: _.uniqueId('Campaign ') }, data) if not data.levels data.levels = {} for level in sources?.levels or [] data.levels[level.get('original').valueOf()] = _.pick level.toObject(), campaignLevelProperties if not data.adjacentCampaigns data.adjacentCampaigns = {} for campaign in sources?.adjacentCampaigns or [] data.adjacentCampaigns[campaign.id] = _.pick campaign.toObject(), campaignAdjacentCampaignProperties request.post { uri: getURL('/db/campaign'), json: data }, (err, res) -> return done(err) if err Campaign.findById(res.body._id).exec done makeCourse: (data={}, sources={}) -> if sources.campaign and not data.campaignID data.campaignID = sources.campaign._id data.releasePhase ||= 'released' course = new Course(data) return course.save() makePrepaid: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { type: 'course' maxRedeemers: 9001 endDate: moment().add(1, 'month').toISOString() startDate: new Date().toISOString() }, data) request.post { uri: getURL('/db/prepaid'), json: data }, (err, res) -> return done(err) if err expect(res.statusCode).toBe(201) Prepaid.findById(res.body._id).exec done makeClassroom: (data={}, sources={}) -> co -> data = _.extend({}, { name: _.uniqueId('Classroom ') }, data) [res, body] = yield request.postAsync { uri: getURL('/db/classroom'), json: data } expect(res.statusCode).toBe(201) classroom = yield Classroom.findById(res.body._id) if sources.members classroom.set('members', _.map(sources.members, '_id')) yield classroom.save() return classroom makeCourseInstance: (data={}, sources={}) -> co -> if sources.course and not data.courseID data.courseID = sources.course.id if sources.classroom and not data.classroomID data.classroomID = sources.classroom.id [res, body] = yield request.postAsync({ uri: getURL('/db/course_instance'), json: data }) expect(res.statusCode).toBe(200) courseInstance = yield CourseInstance.findById(res.body._id) if sources.members userIDs = _.map(sources.members, 'id') [res, body] = yield request.postAsync({ url: getURL("/db/course_instance/#{courseInstance.id}/members") json: { userIDs: userIDs } }) expect(res.statusCode).toBe(200) courseInstance = yield CourseInstance.findById(res.body._id) return courseInstance makeTrialRequest: Promise.promisify (data, sources, done) -> args = Array.from(arguments) [done, [data, sources]] = [args.pop(), args] data = _.extend({}, { type: 'course' properties: {} }, data) request.post { uri: getURL('/db/trial.request'), json: data }, (err, res) -> return done(err) if err expect(res.statusCode).toBe(201) TrialRequest.findById(res.body._id).exec done
[ { "context": "Each ->\n co =>\n yield @room.user.say 'alice', '@hubot whois'\n yield delayer()\n\n # r", "end": 416, "score": 0.9394735097885132, "start": 411, "tag": "NAME", "value": "alice" }, { "context": "event\n @room.messages.should.eql [\n ['a...
test/scripts/test_whois.coffee
NandanSharma/AIDetails
0
helper = new Helper('../scripts/whois.js') # test ping script describe 'scripts/whois.js', -> beforeEach -> # creating room with 'httpd: false' will auto tear-down @room = helper.createRoom(httpd: false, name: global.DEFAULT_ROOM) @robot = @room.robot _.set @robot, 'brain.data.users', users # Test context 'user: who is', -> beforeEach -> co => yield @room.user.say 'alice', '@hubot whois' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois'] ['hubot', '`whois <name/alias/ID>`'] ] # Test context 'user: who is alice', -> beforeEach -> co => yield @room.user.say 'alice', '@hubot whois alice' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois alice'] ['hubot', '```\nname: alice\nid: ID0000001\nemail_address: alice@email.com\n```'] ] # Test context 'user: who is 001', -> beforeEach -> co => yield @room.user.say 'alice', '@hubot whois 001' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois 001'] ['hubot', '```\nname: alice\nid: ID0000001\nemail_address: alice@email.com\n```'] ]
57981
helper = new Helper('../scripts/whois.js') # test ping script describe 'scripts/whois.js', -> beforeEach -> # creating room with 'httpd: false' will auto tear-down @room = helper.createRoom(httpd: false, name: global.DEFAULT_ROOM) @robot = @room.robot _.set @robot, 'brain.data.users', users # Test context 'user: who is', -> beforeEach -> co => yield @room.user.say '<NAME>', '@hubot whois' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois'] ['hubot', '`whois <name/alias/ID>`'] ] # Test context 'user: who is <NAME>', -> beforeEach -> co => yield @room.user.say '<NAME>', '@hubot whois alice' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois alice'] ['hubot', '```\nname: <NAME>\nid: ID0000001\nemail_address: <EMAIL>\n```'] ] # Test context 'user: who is 001', -> beforeEach -> co => yield @room.user.say '<NAME>', '@hubot whois 001' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois 001'] ['hubot', '```\nname: <NAME>\nid: ID0000001\nemail_address: <EMAIL>\n```'] ]
true
helper = new Helper('../scripts/whois.js') # test ping script describe 'scripts/whois.js', -> beforeEach -> # creating room with 'httpd: false' will auto tear-down @room = helper.createRoom(httpd: false, name: global.DEFAULT_ROOM) @robot = @room.robot _.set @robot, 'brain.data.users', users # Test context 'user: who is', -> beforeEach -> co => yield @room.user.say 'PI:NAME:<NAME>END_PI', '@hubot whois' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois'] ['hubot', '`whois <name/alias/ID>`'] ] # Test context 'user: who is PI:NAME:<NAME>END_PI', -> beforeEach -> co => yield @room.user.say 'PI:NAME:<NAME>END_PI', '@hubot whois alice' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois alice'] ['hubot', '```\nname: PI:NAME:<NAME>END_PI\nid: ID0000001\nemail_address: PI:EMAIL:<EMAIL>END_PI\n```'] ] # Test context 'user: who is 001', -> beforeEach -> co => yield @room.user.say 'PI:NAME:<NAME>END_PI', '@hubot whois 001' yield delayer() # response it 'hubot: <details>', -> # allow time for message to get through and handled # emit the 'serialize' event @room.messages.should.eql [ ['alice', '@hubot whois 001'] ['hubot', '```\nname: PI:NAME:<NAME>END_PI\nid: ID0000001\nemail_address: PI:EMAIL:<EMAIL>END_PI\n```'] ]
[ { "context": "er, strategy } = {}\n\n beforeEach ->\n token = 't0k3n'\n provider = _.clone providers.oauthtest, true", "end": 616, "score": 0.9958196878433228, "start": 611, "tag": "PASSWORD", "value": "t0k3n" } ]
test/unit/strategies/oauth/resourceOwnerAuthorization.coffee
Zacaria/connect
0
# Test dependencies _ = require 'lodash' chai = require 'chai' sinon = require 'sinon' sinonChai = require 'sinon-chai' expect = chai.expect proxyquire = require('proxyquire').noCallThru() # Assertions chai.use sinonChai chai.should() # Code under test providers = require '../../../../providers' User = proxyquire('../../../../models/User', { '../boot/redis': { getClient: () => {} } }) OAuthStrategy = proxyquire('../../../../protocols/OAuth', { '../models/User': User }) describe 'OAuthStrategy resourceOwnerAuthorization', -> { token, provider, strategy } = {} beforeEach -> token = 't0k3n' provider = _.clone providers.oauthtest, true client = {} verifier = () -> strategy = new OAuthStrategy provider, client, verifier strategy.redirect = sinon.spy() strategy.resourceOwnerAuthorization(token) it 'should redirect', -> url = provider.endpoints.authorization.url strategy.redirect.should.have.been.calledWith sinon.match(url) it 'should include oauth_token', -> strategy.redirect.should.have.been.calledWith sinon.match( 'oauth_token=' + token )
11385
# Test dependencies _ = require 'lodash' chai = require 'chai' sinon = require 'sinon' sinonChai = require 'sinon-chai' expect = chai.expect proxyquire = require('proxyquire').noCallThru() # Assertions chai.use sinonChai chai.should() # Code under test providers = require '../../../../providers' User = proxyquire('../../../../models/User', { '../boot/redis': { getClient: () => {} } }) OAuthStrategy = proxyquire('../../../../protocols/OAuth', { '../models/User': User }) describe 'OAuthStrategy resourceOwnerAuthorization', -> { token, provider, strategy } = {} beforeEach -> token = '<PASSWORD>' provider = _.clone providers.oauthtest, true client = {} verifier = () -> strategy = new OAuthStrategy provider, client, verifier strategy.redirect = sinon.spy() strategy.resourceOwnerAuthorization(token) it 'should redirect', -> url = provider.endpoints.authorization.url strategy.redirect.should.have.been.calledWith sinon.match(url) it 'should include oauth_token', -> strategy.redirect.should.have.been.calledWith sinon.match( 'oauth_token=' + token )
true
# Test dependencies _ = require 'lodash' chai = require 'chai' sinon = require 'sinon' sinonChai = require 'sinon-chai' expect = chai.expect proxyquire = require('proxyquire').noCallThru() # Assertions chai.use sinonChai chai.should() # Code under test providers = require '../../../../providers' User = proxyquire('../../../../models/User', { '../boot/redis': { getClient: () => {} } }) OAuthStrategy = proxyquire('../../../../protocols/OAuth', { '../models/User': User }) describe 'OAuthStrategy resourceOwnerAuthorization', -> { token, provider, strategy } = {} beforeEach -> token = 'PI:PASSWORD:<PASSWORD>END_PI' provider = _.clone providers.oauthtest, true client = {} verifier = () -> strategy = new OAuthStrategy provider, client, verifier strategy.redirect = sinon.spy() strategy.resourceOwnerAuthorization(token) it 'should redirect', -> url = provider.endpoints.authorization.url strategy.redirect.should.have.been.calledWith sinon.match(url) it 'should include oauth_token', -> strategy.redirect.should.have.been.calledWith sinon.match( 'oauth_token=' + token )
[ { "context": "omentous-nav'\n #adding hours option in update -Ryan\n if @curView == @minutesView\n navFormat =", "end": 3419, "score": 0.6593993902206421, "start": 3415, "tag": "NAME", "value": "Ryan" } ]
src/momentous.coffee
thom801/momentous
3
class Momentous constructor: (placeholder, options, controller) -> @placeholder = $ placeholder.html dropdownTemplate @events = $ this @options = options @timeFormat = @options.timeFormat # 12 or 24 @minuteGranularity = @options.minuteGranularity or 15 # 1, 5, 10, 15, 20, 30 @dateFormat = @options.dateFormat or 'MM-DD-YYYY' @minutesView = @placeholder.find '.minutes-view' @hoursView = @placeholder.find '.hours-view' @hoursViewPeriod = @placeholder.find '.hours-view-period' @daysView = @placeholder.find '.days-view' @monthsView = @placeholder.find '.months-view' @yearsView = @placeholder.find '.years-view' @curView = @placeholder.find '.days-view' @input = @placeholder.find '.momentous-input' @calButton = @placeholder.find '.momentous-cal-button' @dropdown = @placeholder.find '.momentous-dropdown' @viewButton = @dropdown.find '.view-button' @dateRangeMode = options.dateRangeMode or false if @dateRangeMode @controller = controller @placeholder.addClass 'momentous-container' @input.on 'click', @toggle @calButton.on 'click', @toggle @dropdown.find('.dir-button').on 'click', @directionClickHandler @viewButton.on 'click', @viewClickHandler init: => # defaults @curDate = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @viewDate = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @today = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @weekStart = 1 # Monday @granularity = 'days' # minutes, hours, days, weeks, months, or years if @options.date then @curDate = moment(@options.date, @dateFormat) if @options.weekStart in [0,1] then @weekStart = @options.weekStart if @options.granularity then @granularity = @options.granularity #if @options.language then moment.lang @options.language if @dateRangeMode and this is @controller.start if @granularity == 'hours' || @granularity == 'minutes' @curDate.minutes(0) if @dateRangeMode and this is @controller.end if @granularity == 'days' @curDate.add(1, 'weeks') if @granularity == 'hours' || @granularity == 'minutes' @curDate.add(3, 'hours').minutes(0) @curView.show() # days of week header daysHeader = @daysView.find '.dow-row' weekStart = moment().day(@weekStart) for dow in [0..6] curDay = moment(weekStart).add(dow, 'days') dayName = curDay.format('ddd').substring(0,2) daysHeader.append "<th class='dow'>#{dayName}</th>" if @granularity == 'minutes' then @showDays() if @granularity == 'hours' then @showDays() if @granularity == 'days' then @showDays() if @granularity == 'weeks' @setDate moment(@curDate).day(1) @showDays() # If @today is sunday and weekstart is monday, make sure we init on the right week. if @today.day() is 0 and @weekStart is 1 @curDate.subtract 1, 'weeks' if @granularity == 'months' @setDate moment(@curDate).date(1) @showMonths() if @granularity == 'years' @showYears() @update() update: => @input.attr 'value', @curDate.format @dateFormat nav = @dropdown.find '.momentous-nav' #adding hours option in update -Ryan if @curView == @minutesView navFormat = 'MMM YYYY, h:mm a' @showMinutes() if @curView == @hoursViewPeriod navFormat = 'MMM YYYY, h:mm a' @showHours() if @curView == @hoursView navFormat = 'MMM YYYY, HH:mm' @showHours() if @curView == @daysView navFormat = 'MMM YYYY' @showDays() if @curView == @monthsView navFormat = 'YYYY' @showMonths() if @curView == @yearsView @showYears() ######################################################################### showMinutes: => @curView.hide() if @timeFormat == 12 @dateFormat = @options.dateFormat or 'MM-DD-YYYY, h:mm a' @viewButton.text @viewDate.format 'MMM Do, h:00 a' else @dateFormat = @options.dateFormat or 'MM-DD-YYYY, HH:mm' @viewButton.text @viewDate.format 'MMM Do, HH:00' @minutesView.show() @curView = @minutesView # minutes buttons minutesContainer = @minutesView.find 'ul' minutesHTML = '' curMinute = moment(@viewDate).minute(0) for minute in [0..59] if @timeFormat == 12 selectedHour = moment(@viewDate).format 'h' else selectedHour = moment(@viewDate).format 'HH' minutesContainer = @minutesView.find 'ul' minuteNum = curMinute.format ':mm' # trueMinute = parseInt @today.format 'mm' curMinuteDate = curMinute.format @dateFormat classes = '' disabled = false minuteGran = [1, 5, 10, 15, 20, 30] for i of minuteGran if minuteGran[i] == @minuteGranularity if minute % @minuteGranularity == 0 if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:mm') endDate = @controller.end.date().format('MM-DD-YYYY, HH:mm') calendarDate = moment curMinute calendarDate = calendarDate.format 'MM-DD-YYYY, HH:mm' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if minute is 0 if !@dateRangeMode classes += ' active' minutesHTML += "<li class='#{classes}' data-date='#{curMinuteDate}' data-isdisabled='#{disabled}'>#{selectedHour}#{minuteNum}</li>" else minutesHTML += "<li class='#{classes}' data-date='#{curMinuteDate}' data-isdisabled='#{disabled}'>#{selectedHour}#{minuteNum}</li>" curMinute.add 1, 'minutes' minutesContainer.html minutesHTML minutesContainer.find('li').on 'click', @minuteClickHandler ######################################################################### showHours: => @curView.hide() # 12 hour view with AM/PM if @timeFormat == 12 @dateFormat = @options.dateFormat or 'MM-DD-YYYY, h:mm a' @hoursViewPeriod.show() @curView = @hoursViewPeriod @viewButton.text @viewDate.format 'MMM Do' # hours buttons hoursContainer = @hoursViewPeriod.find 'ul' hoursHTML = '' curHour = moment(@viewDate).hour(0).minute(0) for hour in [0..23] hourNum = curHour.format 'h a' trueHour = parseInt @today.format 'H' curHourDate = curHour.format @dateFormat classes = '' disabled = false if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:00') endDate = @controller.end.date().format('MM-DD-YYYY, HH:00') calendarDate = moment curHour calendarDate = calendarDate.format 'MM-DD-YYYY, HH:00' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if hour is trueHour if !@dateRangeMode classes += ' active' hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'><span>#{hourNum}</span></li>" else hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'><span>#{hourNum}</span></li>" curHour.add 1, 'hours' hoursContainer.html hoursHTML hoursContainer.find('li').on 'click', @hourClickHandler # 24 hour view else @dateFormat = @options.dateFormat or 'MM-DD-YYYY, HH:00' @hoursView.show() @curView = @hoursView @viewButton.text @viewDate.format 'MMM Do' # hours buttons hoursContainer = @hoursView.find 'ul' hoursHTML = '' curHour = moment(@viewDate).hour(0).minute(0) for hour in [0..23] hourNum = curHour.format 'HH' trueHour = parseInt @today.format 'H' curHourDate = curHour.format @dateFormat classes = '' disabled = false if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:00') endDate = @controller.end.date().format('MM-DD-YYYY, HH:00') calendarDate = moment curHour calendarDate = calendarDate.format 'MM-DD-YYYY, HH:00' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if hour is trueHour if !@dateRangeMode classes += ' active' hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'>#{hourNum}:00</li>" else hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'>#{hourNum}:00</li>" curHour.add 1, 'hours' hoursContainer.html hoursHTML hoursContainer.find('li').on 'click', @hourClickHandler showDays: => @curView.hide() @daysView.show() @curView = @daysView @viewButton.text @viewDate.format 'MMM YYYY' month = @viewDate.month() monthStart = moment(@viewDate).date(0) monthWeekStart = monthStart.day(@weekStart) daysContainer = @daysView.find('tbody') calHTML = "" [0..5].map (week) => weekStart = moment(monthWeekStart).add(week * 7, 'days') daysHTML = "" weekClasses = "" if @granularity == 'weeks' weekClasses = 'week' [0..6].map (dow) => curDay = moment weekStart.day(@weekStart + dow).format(@dateFormat), @dateFormat curDayDate = curDay.format @dateFormat classes = 'day' if curDay.month() < month then classes += ' lastMonth' if curDay.month() > month then classes += ' nextMonth' if curDay.format(@dateFormat) == @curDate.format(@dateFormat) && !@dateRangeMode classes += ' active' weekClasses += ' active' if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY') endDate = @controller.end.date().format('MM-DD-YYYY') calendarDate = moment curDay calendarDate = calendarDate.format 'MM-DD-YYYY' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY') classes += ' disabled' disabled = true daysHTML += "<td class='#{classes}' data-date='#{curDayDate}' data-isdisabled='#{disabled}'>#{curDay.date()}</td>" weekHTML = "<tr class='#{weekClasses}'>#{daysHTML}</tr>" calHTML += weekHTML daysContainer.html calHTML if @granularity == 'weeks' @dropdown.find('.week').on 'click', @weekClickHandler else @dropdown.find('.day').on 'click', @dayClickHandler showMonths: => @curView.hide() @monthsView.show() @curView = @monthsView @viewButton.text @viewDate.format 'YYYY' # months buttons monthsContainer = @monthsView.find 'ul' monthsHTML = '' curMonth = moment(@viewDate).dayOfYear(1) for month in [0..11] monthName = curMonth.format 'MMM' monthNum = curMonth.format 'M' if curMonth.month() == @curDate.month() and curMonth.year() == @curDate.year() monthsHTML += "<li class='active' data-date='#{monthNum}'>#{monthName}</li>" else monthsHTML += "<li class='' data-date='#{monthNum}'>#{monthName}</li>" curMonth.add 1, 'months' monthsContainer.html monthsHTML monthsContainer.find('li').on 'click', @monthClickHandler showYears: => @curView.hide() @yearsView.show() @curView = @yearsView viewRange = @viewDate.year() + ' - ' + (@viewDate.year() + 11) @viewButton.text viewRange # years buttons yearsContainer = @yearsView.find 'ul' yearsHTML = '' curYear = moment(@viewDate) for year in [0..11] yearNum = curYear.format 'YYYY' if curYear.year() == @curDate.year() yearsHTML += "<li class='active' data-date='#{yearNum}'>#{yearNum}</li>" else yearsHTML += "<li class='' data-date='#{yearNum}'>#{yearNum}</li>" curYear.add 1, 'years' yearsContainer.html yearsHTML yearsContainer.find('li').on 'click', @yearClickHandler minuteClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' isDisabled = target.data 'isdisabled' if isDisabled == true console.log("This date is not selectable") else @setDate target.data 'date' @hide() hourClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' newDate = target.data 'date' isDisabled = target.data 'isdisabled' if @granularity == 'hours' @setDate moment(newDate, @dateFormat) @hide() else if @dateRangeMode if isDisabled == true console.log("This date is not selectable") else @setViewDate moment(newDate, @dateFormat).minutes(0) @showMinutes() else @setViewDate moment(newDate, @dateFormat) @showMinutes() dayClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' isDisabled = target.data 'isdisabled' if @granularity == 'days' @setDate moment(newDate, @dateFormat) @hide() else if @dateRangeMode if isDisabled == true console.log("This date is not selectable") else @setViewDate moment(newDate, @dateFormat).minutes(0) @showHours() else @setViewDate moment(newDate, @dateFormat) @showHours() weekClickHandler: (event) => target = $ event.currentTarget @setDate target.find('td:first').data 'date' @hide() monthClickHandler: (event) => target = $ event.currentTarget monthNum = target.data 'date' newDate = moment(@curDate).month(monthNum - 1).year(@viewDate.year()) if @granularity == 'months' @setDate newDate.date(1) @hide() else @setViewDate newDate.day(1) @showDays() yearClickHandler: (event) => target = $ event.currentTarget yearNum = target.data 'date' newDate = moment(@curDate).year(yearNum) if @granularity == 'years' @setDate newDate.date(1) @hide() else @setViewDate newDate.day(1) @showMonths() viewClickHandler: (event) => if @curView == @minutesView @showHours() @update() else if @curView == @hoursViewPeriod @showDays() @update() else if @curView == @hoursView @showDays() @update() else if @curView == @daysView @showMonths() @update() else if @curView == @monthsView @showYears() @update() directionClickHandler: (event) => target = $ event.currentTarget if @curView == @minutesView span = 'hours' amount = 1 if @curView == @hoursViewPeriod span = 'days' amount = 1 if @curView == @hoursView span = 'days' amount = 1 if @curView == @daysView span = 'months' amount = 1 if @curView == @monthsView span = 'years' amount = 1 if @curView == @yearsView span = 'years' amount = 12 if target.hasClass 'prev' @setViewDate moment(@viewDate).subtract(amount, span) if target.hasClass 'next' @setViewDate moment(@viewDate).add(amount, span) setDate: (date) => @curDate = moment date, @dateFormat @update() @events.trigger 'dateChange' setViewDate: (date) => @viewDate = moment date @curDate = @viewDate @update() show: => @events.trigger 'showDropdown' @visible = true @update() @dropdown.stop().css({display: 'block'}).animate({ opacity: 1 }, 200) hide: => @events.trigger 'hideDropdown' @viewDate = @curDate @visible = false @dropdown.stop().css({ display: 'none' opacity: 0 }) toggle: => if @visible then @hide() else @show() date: => moment @curDate getDate: => moment @curDate jsDate: => @curDate.toDate() class DateRangeController constructor: (placeholder, options) -> placeholder.html '<div class="momentous-start-date"></div><div class="momentous-end-date"></div>' startDatePlaceholder = $ '.momentous-start-date' endDatePlaceholder = $ '.momentous-end-date' @start = new Momentous startDatePlaceholder, options, this @end = new Momentous endDatePlaceholder, options, this @start.init() @end.init() @start.events.on 'dateChange', @startDateChangeHandler @end.events.on 'dateChange', @endDateChangeHandler @start.events.on 'showDropdown', @startShowHandler @end.events.on 'showDropdown', @endShowHandler startShowHandler: (event) => @end.hide() endShowHandler: (event) => @start.hide() startDateChangeHandler: (event) => startDate = @start.date() endDate = @end.date() diff = if @granularity == 'days' then endDate.diff startDate, 'days' else endDate.diff startDate, 'hours' if diff <= 0 if @granularity == 'days' @end.setDate moment(startDate).add(1, 'weeks') if @granularity == 'hours' @end.setDate moment(startDate).add(1, 'hours') if @granularity == 'minutes' @end.setDate moment(startDate).add(1, 'minutes') @end.show() endDateChangeHandler: (event) => startDate = @start.date() endDate = @end.date() diff = if @granularity == 'days' then endDate.diff startDate, 'days' else endDate.diff startDate, 'hours' if diff <= 0 if @granularity == 'days' @start.setDate moment(endDate).subtract(1, 'weeks') if @granularity == 'hours' @start.setDate moment(endDate).subtract(1, 'hours') if @granularity == 'minutes' @start.setDate moment(endDate).subtract(1, 'minutes') window.Momentous = (placeholder, options={}) -> if options.dateRangeMode is true momentous = new DateRangeController placeholder, options else momentous = new Momentous placeholder, options momentous.init() return momentous dropdownTemplate = """ <div class="input-append"> <input class='momentous-input' type='text' value='' readonly> <button class="btn momentous-cal-button" type="button"><i class="icon-calendar"></i></button> </div> <div class='momentous-dropdown popover bottom'> <div class="arrow"></div> <div class="momentous-nav"> <span class="dir-button prev"><i class="icon-chevron-left"></i></span> <span class="view-button"></span> <span class="dir-button next"><i class="icon-chevron-right"></i></span> </div> <div class="days-view" style="display: none;"> <table class="table-condensed"> <thead> <tr class="dow-row"></tr> </thead> <tbody></tbody> </table> </div> <div class="minutes-view" style="display: none;"><ul></ul></div> <div class="hours-view-period" style="display: none;"><ul></ul></div> <div class="hours-view" style="display: none;"><ul></ul></div> <div class="months-view" style="display: none;"><ul></ul></div> <div class="years-view" style="display: none;"><ul></ul></div> </div> """ log = (s) -> console.log s
192956
class Momentous constructor: (placeholder, options, controller) -> @placeholder = $ placeholder.html dropdownTemplate @events = $ this @options = options @timeFormat = @options.timeFormat # 12 or 24 @minuteGranularity = @options.minuteGranularity or 15 # 1, 5, 10, 15, 20, 30 @dateFormat = @options.dateFormat or 'MM-DD-YYYY' @minutesView = @placeholder.find '.minutes-view' @hoursView = @placeholder.find '.hours-view' @hoursViewPeriod = @placeholder.find '.hours-view-period' @daysView = @placeholder.find '.days-view' @monthsView = @placeholder.find '.months-view' @yearsView = @placeholder.find '.years-view' @curView = @placeholder.find '.days-view' @input = @placeholder.find '.momentous-input' @calButton = @placeholder.find '.momentous-cal-button' @dropdown = @placeholder.find '.momentous-dropdown' @viewButton = @dropdown.find '.view-button' @dateRangeMode = options.dateRangeMode or false if @dateRangeMode @controller = controller @placeholder.addClass 'momentous-container' @input.on 'click', @toggle @calButton.on 'click', @toggle @dropdown.find('.dir-button').on 'click', @directionClickHandler @viewButton.on 'click', @viewClickHandler init: => # defaults @curDate = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @viewDate = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @today = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @weekStart = 1 # Monday @granularity = 'days' # minutes, hours, days, weeks, months, or years if @options.date then @curDate = moment(@options.date, @dateFormat) if @options.weekStart in [0,1] then @weekStart = @options.weekStart if @options.granularity then @granularity = @options.granularity #if @options.language then moment.lang @options.language if @dateRangeMode and this is @controller.start if @granularity == 'hours' || @granularity == 'minutes' @curDate.minutes(0) if @dateRangeMode and this is @controller.end if @granularity == 'days' @curDate.add(1, 'weeks') if @granularity == 'hours' || @granularity == 'minutes' @curDate.add(3, 'hours').minutes(0) @curView.show() # days of week header daysHeader = @daysView.find '.dow-row' weekStart = moment().day(@weekStart) for dow in [0..6] curDay = moment(weekStart).add(dow, 'days') dayName = curDay.format('ddd').substring(0,2) daysHeader.append "<th class='dow'>#{dayName}</th>" if @granularity == 'minutes' then @showDays() if @granularity == 'hours' then @showDays() if @granularity == 'days' then @showDays() if @granularity == 'weeks' @setDate moment(@curDate).day(1) @showDays() # If @today is sunday and weekstart is monday, make sure we init on the right week. if @today.day() is 0 and @weekStart is 1 @curDate.subtract 1, 'weeks' if @granularity == 'months' @setDate moment(@curDate).date(1) @showMonths() if @granularity == 'years' @showYears() @update() update: => @input.attr 'value', @curDate.format @dateFormat nav = @dropdown.find '.momentous-nav' #adding hours option in update -<NAME> if @curView == @minutesView navFormat = 'MMM YYYY, h:mm a' @showMinutes() if @curView == @hoursViewPeriod navFormat = 'MMM YYYY, h:mm a' @showHours() if @curView == @hoursView navFormat = 'MMM YYYY, HH:mm' @showHours() if @curView == @daysView navFormat = 'MMM YYYY' @showDays() if @curView == @monthsView navFormat = 'YYYY' @showMonths() if @curView == @yearsView @showYears() ######################################################################### showMinutes: => @curView.hide() if @timeFormat == 12 @dateFormat = @options.dateFormat or 'MM-DD-YYYY, h:mm a' @viewButton.text @viewDate.format 'MMM Do, h:00 a' else @dateFormat = @options.dateFormat or 'MM-DD-YYYY, HH:mm' @viewButton.text @viewDate.format 'MMM Do, HH:00' @minutesView.show() @curView = @minutesView # minutes buttons minutesContainer = @minutesView.find 'ul' minutesHTML = '' curMinute = moment(@viewDate).minute(0) for minute in [0..59] if @timeFormat == 12 selectedHour = moment(@viewDate).format 'h' else selectedHour = moment(@viewDate).format 'HH' minutesContainer = @minutesView.find 'ul' minuteNum = curMinute.format ':mm' # trueMinute = parseInt @today.format 'mm' curMinuteDate = curMinute.format @dateFormat classes = '' disabled = false minuteGran = [1, 5, 10, 15, 20, 30] for i of minuteGran if minuteGran[i] == @minuteGranularity if minute % @minuteGranularity == 0 if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:mm') endDate = @controller.end.date().format('MM-DD-YYYY, HH:mm') calendarDate = moment curMinute calendarDate = calendarDate.format 'MM-DD-YYYY, HH:mm' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if minute is 0 if !@dateRangeMode classes += ' active' minutesHTML += "<li class='#{classes}' data-date='#{curMinuteDate}' data-isdisabled='#{disabled}'>#{selectedHour}#{minuteNum}</li>" else minutesHTML += "<li class='#{classes}' data-date='#{curMinuteDate}' data-isdisabled='#{disabled}'>#{selectedHour}#{minuteNum}</li>" curMinute.add 1, 'minutes' minutesContainer.html minutesHTML minutesContainer.find('li').on 'click', @minuteClickHandler ######################################################################### showHours: => @curView.hide() # 12 hour view with AM/PM if @timeFormat == 12 @dateFormat = @options.dateFormat or 'MM-DD-YYYY, h:mm a' @hoursViewPeriod.show() @curView = @hoursViewPeriod @viewButton.text @viewDate.format 'MMM Do' # hours buttons hoursContainer = @hoursViewPeriod.find 'ul' hoursHTML = '' curHour = moment(@viewDate).hour(0).minute(0) for hour in [0..23] hourNum = curHour.format 'h a' trueHour = parseInt @today.format 'H' curHourDate = curHour.format @dateFormat classes = '' disabled = false if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:00') endDate = @controller.end.date().format('MM-DD-YYYY, HH:00') calendarDate = moment curHour calendarDate = calendarDate.format 'MM-DD-YYYY, HH:00' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if hour is trueHour if !@dateRangeMode classes += ' active' hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'><span>#{hourNum}</span></li>" else hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'><span>#{hourNum}</span></li>" curHour.add 1, 'hours' hoursContainer.html hoursHTML hoursContainer.find('li').on 'click', @hourClickHandler # 24 hour view else @dateFormat = @options.dateFormat or 'MM-DD-YYYY, HH:00' @hoursView.show() @curView = @hoursView @viewButton.text @viewDate.format 'MMM Do' # hours buttons hoursContainer = @hoursView.find 'ul' hoursHTML = '' curHour = moment(@viewDate).hour(0).minute(0) for hour in [0..23] hourNum = curHour.format 'HH' trueHour = parseInt @today.format 'H' curHourDate = curHour.format @dateFormat classes = '' disabled = false if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:00') endDate = @controller.end.date().format('MM-DD-YYYY, HH:00') calendarDate = moment curHour calendarDate = calendarDate.format 'MM-DD-YYYY, HH:00' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if hour is trueHour if !@dateRangeMode classes += ' active' hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'>#{hourNum}:00</li>" else hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'>#{hourNum}:00</li>" curHour.add 1, 'hours' hoursContainer.html hoursHTML hoursContainer.find('li').on 'click', @hourClickHandler showDays: => @curView.hide() @daysView.show() @curView = @daysView @viewButton.text @viewDate.format 'MMM YYYY' month = @viewDate.month() monthStart = moment(@viewDate).date(0) monthWeekStart = monthStart.day(@weekStart) daysContainer = @daysView.find('tbody') calHTML = "" [0..5].map (week) => weekStart = moment(monthWeekStart).add(week * 7, 'days') daysHTML = "" weekClasses = "" if @granularity == 'weeks' weekClasses = 'week' [0..6].map (dow) => curDay = moment weekStart.day(@weekStart + dow).format(@dateFormat), @dateFormat curDayDate = curDay.format @dateFormat classes = 'day' if curDay.month() < month then classes += ' lastMonth' if curDay.month() > month then classes += ' nextMonth' if curDay.format(@dateFormat) == @curDate.format(@dateFormat) && !@dateRangeMode classes += ' active' weekClasses += ' active' if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY') endDate = @controller.end.date().format('MM-DD-YYYY') calendarDate = moment curDay calendarDate = calendarDate.format 'MM-DD-YYYY' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY') classes += ' disabled' disabled = true daysHTML += "<td class='#{classes}' data-date='#{curDayDate}' data-isdisabled='#{disabled}'>#{curDay.date()}</td>" weekHTML = "<tr class='#{weekClasses}'>#{daysHTML}</tr>" calHTML += weekHTML daysContainer.html calHTML if @granularity == 'weeks' @dropdown.find('.week').on 'click', @weekClickHandler else @dropdown.find('.day').on 'click', @dayClickHandler showMonths: => @curView.hide() @monthsView.show() @curView = @monthsView @viewButton.text @viewDate.format 'YYYY' # months buttons monthsContainer = @monthsView.find 'ul' monthsHTML = '' curMonth = moment(@viewDate).dayOfYear(1) for month in [0..11] monthName = curMonth.format 'MMM' monthNum = curMonth.format 'M' if curMonth.month() == @curDate.month() and curMonth.year() == @curDate.year() monthsHTML += "<li class='active' data-date='#{monthNum}'>#{monthName}</li>" else monthsHTML += "<li class='' data-date='#{monthNum}'>#{monthName}</li>" curMonth.add 1, 'months' monthsContainer.html monthsHTML monthsContainer.find('li').on 'click', @monthClickHandler showYears: => @curView.hide() @yearsView.show() @curView = @yearsView viewRange = @viewDate.year() + ' - ' + (@viewDate.year() + 11) @viewButton.text viewRange # years buttons yearsContainer = @yearsView.find 'ul' yearsHTML = '' curYear = moment(@viewDate) for year in [0..11] yearNum = curYear.format 'YYYY' if curYear.year() == @curDate.year() yearsHTML += "<li class='active' data-date='#{yearNum}'>#{yearNum}</li>" else yearsHTML += "<li class='' data-date='#{yearNum}'>#{yearNum}</li>" curYear.add 1, 'years' yearsContainer.html yearsHTML yearsContainer.find('li').on 'click', @yearClickHandler minuteClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' isDisabled = target.data 'isdisabled' if isDisabled == true console.log("This date is not selectable") else @setDate target.data 'date' @hide() hourClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' newDate = target.data 'date' isDisabled = target.data 'isdisabled' if @granularity == 'hours' @setDate moment(newDate, @dateFormat) @hide() else if @dateRangeMode if isDisabled == true console.log("This date is not selectable") else @setViewDate moment(newDate, @dateFormat).minutes(0) @showMinutes() else @setViewDate moment(newDate, @dateFormat) @showMinutes() dayClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' isDisabled = target.data 'isdisabled' if @granularity == 'days' @setDate moment(newDate, @dateFormat) @hide() else if @dateRangeMode if isDisabled == true console.log("This date is not selectable") else @setViewDate moment(newDate, @dateFormat).minutes(0) @showHours() else @setViewDate moment(newDate, @dateFormat) @showHours() weekClickHandler: (event) => target = $ event.currentTarget @setDate target.find('td:first').data 'date' @hide() monthClickHandler: (event) => target = $ event.currentTarget monthNum = target.data 'date' newDate = moment(@curDate).month(monthNum - 1).year(@viewDate.year()) if @granularity == 'months' @setDate newDate.date(1) @hide() else @setViewDate newDate.day(1) @showDays() yearClickHandler: (event) => target = $ event.currentTarget yearNum = target.data 'date' newDate = moment(@curDate).year(yearNum) if @granularity == 'years' @setDate newDate.date(1) @hide() else @setViewDate newDate.day(1) @showMonths() viewClickHandler: (event) => if @curView == @minutesView @showHours() @update() else if @curView == @hoursViewPeriod @showDays() @update() else if @curView == @hoursView @showDays() @update() else if @curView == @daysView @showMonths() @update() else if @curView == @monthsView @showYears() @update() directionClickHandler: (event) => target = $ event.currentTarget if @curView == @minutesView span = 'hours' amount = 1 if @curView == @hoursViewPeriod span = 'days' amount = 1 if @curView == @hoursView span = 'days' amount = 1 if @curView == @daysView span = 'months' amount = 1 if @curView == @monthsView span = 'years' amount = 1 if @curView == @yearsView span = 'years' amount = 12 if target.hasClass 'prev' @setViewDate moment(@viewDate).subtract(amount, span) if target.hasClass 'next' @setViewDate moment(@viewDate).add(amount, span) setDate: (date) => @curDate = moment date, @dateFormat @update() @events.trigger 'dateChange' setViewDate: (date) => @viewDate = moment date @curDate = @viewDate @update() show: => @events.trigger 'showDropdown' @visible = true @update() @dropdown.stop().css({display: 'block'}).animate({ opacity: 1 }, 200) hide: => @events.trigger 'hideDropdown' @viewDate = @curDate @visible = false @dropdown.stop().css({ display: 'none' opacity: 0 }) toggle: => if @visible then @hide() else @show() date: => moment @curDate getDate: => moment @curDate jsDate: => @curDate.toDate() class DateRangeController constructor: (placeholder, options) -> placeholder.html '<div class="momentous-start-date"></div><div class="momentous-end-date"></div>' startDatePlaceholder = $ '.momentous-start-date' endDatePlaceholder = $ '.momentous-end-date' @start = new Momentous startDatePlaceholder, options, this @end = new Momentous endDatePlaceholder, options, this @start.init() @end.init() @start.events.on 'dateChange', @startDateChangeHandler @end.events.on 'dateChange', @endDateChangeHandler @start.events.on 'showDropdown', @startShowHandler @end.events.on 'showDropdown', @endShowHandler startShowHandler: (event) => @end.hide() endShowHandler: (event) => @start.hide() startDateChangeHandler: (event) => startDate = @start.date() endDate = @end.date() diff = if @granularity == 'days' then endDate.diff startDate, 'days' else endDate.diff startDate, 'hours' if diff <= 0 if @granularity == 'days' @end.setDate moment(startDate).add(1, 'weeks') if @granularity == 'hours' @end.setDate moment(startDate).add(1, 'hours') if @granularity == 'minutes' @end.setDate moment(startDate).add(1, 'minutes') @end.show() endDateChangeHandler: (event) => startDate = @start.date() endDate = @end.date() diff = if @granularity == 'days' then endDate.diff startDate, 'days' else endDate.diff startDate, 'hours' if diff <= 0 if @granularity == 'days' @start.setDate moment(endDate).subtract(1, 'weeks') if @granularity == 'hours' @start.setDate moment(endDate).subtract(1, 'hours') if @granularity == 'minutes' @start.setDate moment(endDate).subtract(1, 'minutes') window.Momentous = (placeholder, options={}) -> if options.dateRangeMode is true momentous = new DateRangeController placeholder, options else momentous = new Momentous placeholder, options momentous.init() return momentous dropdownTemplate = """ <div class="input-append"> <input class='momentous-input' type='text' value='' readonly> <button class="btn momentous-cal-button" type="button"><i class="icon-calendar"></i></button> </div> <div class='momentous-dropdown popover bottom'> <div class="arrow"></div> <div class="momentous-nav"> <span class="dir-button prev"><i class="icon-chevron-left"></i></span> <span class="view-button"></span> <span class="dir-button next"><i class="icon-chevron-right"></i></span> </div> <div class="days-view" style="display: none;"> <table class="table-condensed"> <thead> <tr class="dow-row"></tr> </thead> <tbody></tbody> </table> </div> <div class="minutes-view" style="display: none;"><ul></ul></div> <div class="hours-view-period" style="display: none;"><ul></ul></div> <div class="hours-view" style="display: none;"><ul></ul></div> <div class="months-view" style="display: none;"><ul></ul></div> <div class="years-view" style="display: none;"><ul></ul></div> </div> """ log = (s) -> console.log s
true
class Momentous constructor: (placeholder, options, controller) -> @placeholder = $ placeholder.html dropdownTemplate @events = $ this @options = options @timeFormat = @options.timeFormat # 12 or 24 @minuteGranularity = @options.minuteGranularity or 15 # 1, 5, 10, 15, 20, 30 @dateFormat = @options.dateFormat or 'MM-DD-YYYY' @minutesView = @placeholder.find '.minutes-view' @hoursView = @placeholder.find '.hours-view' @hoursViewPeriod = @placeholder.find '.hours-view-period' @daysView = @placeholder.find '.days-view' @monthsView = @placeholder.find '.months-view' @yearsView = @placeholder.find '.years-view' @curView = @placeholder.find '.days-view' @input = @placeholder.find '.momentous-input' @calButton = @placeholder.find '.momentous-cal-button' @dropdown = @placeholder.find '.momentous-dropdown' @viewButton = @dropdown.find '.view-button' @dateRangeMode = options.dateRangeMode or false if @dateRangeMode @controller = controller @placeholder.addClass 'momentous-container' @input.on 'click', @toggle @calButton.on 'click', @toggle @dropdown.find('.dir-button').on 'click', @directionClickHandler @viewButton.on 'click', @viewClickHandler init: => # defaults @curDate = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @viewDate = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @today = moment(moment().format('MM-DD-YYYY, HH:mm'), 'MM-DD-YYYY, HH:mm') @weekStart = 1 # Monday @granularity = 'days' # minutes, hours, days, weeks, months, or years if @options.date then @curDate = moment(@options.date, @dateFormat) if @options.weekStart in [0,1] then @weekStart = @options.weekStart if @options.granularity then @granularity = @options.granularity #if @options.language then moment.lang @options.language if @dateRangeMode and this is @controller.start if @granularity == 'hours' || @granularity == 'minutes' @curDate.minutes(0) if @dateRangeMode and this is @controller.end if @granularity == 'days' @curDate.add(1, 'weeks') if @granularity == 'hours' || @granularity == 'minutes' @curDate.add(3, 'hours').minutes(0) @curView.show() # days of week header daysHeader = @daysView.find '.dow-row' weekStart = moment().day(@weekStart) for dow in [0..6] curDay = moment(weekStart).add(dow, 'days') dayName = curDay.format('ddd').substring(0,2) daysHeader.append "<th class='dow'>#{dayName}</th>" if @granularity == 'minutes' then @showDays() if @granularity == 'hours' then @showDays() if @granularity == 'days' then @showDays() if @granularity == 'weeks' @setDate moment(@curDate).day(1) @showDays() # If @today is sunday and weekstart is monday, make sure we init on the right week. if @today.day() is 0 and @weekStart is 1 @curDate.subtract 1, 'weeks' if @granularity == 'months' @setDate moment(@curDate).date(1) @showMonths() if @granularity == 'years' @showYears() @update() update: => @input.attr 'value', @curDate.format @dateFormat nav = @dropdown.find '.momentous-nav' #adding hours option in update -PI:NAME:<NAME>END_PI if @curView == @minutesView navFormat = 'MMM YYYY, h:mm a' @showMinutes() if @curView == @hoursViewPeriod navFormat = 'MMM YYYY, h:mm a' @showHours() if @curView == @hoursView navFormat = 'MMM YYYY, HH:mm' @showHours() if @curView == @daysView navFormat = 'MMM YYYY' @showDays() if @curView == @monthsView navFormat = 'YYYY' @showMonths() if @curView == @yearsView @showYears() ######################################################################### showMinutes: => @curView.hide() if @timeFormat == 12 @dateFormat = @options.dateFormat or 'MM-DD-YYYY, h:mm a' @viewButton.text @viewDate.format 'MMM Do, h:00 a' else @dateFormat = @options.dateFormat or 'MM-DD-YYYY, HH:mm' @viewButton.text @viewDate.format 'MMM Do, HH:00' @minutesView.show() @curView = @minutesView # minutes buttons minutesContainer = @minutesView.find 'ul' minutesHTML = '' curMinute = moment(@viewDate).minute(0) for minute in [0..59] if @timeFormat == 12 selectedHour = moment(@viewDate).format 'h' else selectedHour = moment(@viewDate).format 'HH' minutesContainer = @minutesView.find 'ul' minuteNum = curMinute.format ':mm' # trueMinute = parseInt @today.format 'mm' curMinuteDate = curMinute.format @dateFormat classes = '' disabled = false minuteGran = [1, 5, 10, 15, 20, 30] for i of minuteGran if minuteGran[i] == @minuteGranularity if minute % @minuteGranularity == 0 if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:mm') endDate = @controller.end.date().format('MM-DD-YYYY, HH:mm') calendarDate = moment curMinute calendarDate = calendarDate.format 'MM-DD-YYYY, HH:mm' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if minute is 0 if !@dateRangeMode classes += ' active' minutesHTML += "<li class='#{classes}' data-date='#{curMinuteDate}' data-isdisabled='#{disabled}'>#{selectedHour}#{minuteNum}</li>" else minutesHTML += "<li class='#{classes}' data-date='#{curMinuteDate}' data-isdisabled='#{disabled}'>#{selectedHour}#{minuteNum}</li>" curMinute.add 1, 'minutes' minutesContainer.html minutesHTML minutesContainer.find('li').on 'click', @minuteClickHandler ######################################################################### showHours: => @curView.hide() # 12 hour view with AM/PM if @timeFormat == 12 @dateFormat = @options.dateFormat or 'MM-DD-YYYY, h:mm a' @hoursViewPeriod.show() @curView = @hoursViewPeriod @viewButton.text @viewDate.format 'MMM Do' # hours buttons hoursContainer = @hoursViewPeriod.find 'ul' hoursHTML = '' curHour = moment(@viewDate).hour(0).minute(0) for hour in [0..23] hourNum = curHour.format 'h a' trueHour = parseInt @today.format 'H' curHourDate = curHour.format @dateFormat classes = '' disabled = false if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:00') endDate = @controller.end.date().format('MM-DD-YYYY, HH:00') calendarDate = moment curHour calendarDate = calendarDate.format 'MM-DD-YYYY, HH:00' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if hour is trueHour if !@dateRangeMode classes += ' active' hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'><span>#{hourNum}</span></li>" else hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'><span>#{hourNum}</span></li>" curHour.add 1, 'hours' hoursContainer.html hoursHTML hoursContainer.find('li').on 'click', @hourClickHandler # 24 hour view else @dateFormat = @options.dateFormat or 'MM-DD-YYYY, HH:00' @hoursView.show() @curView = @hoursView @viewButton.text @viewDate.format 'MMM Do' # hours buttons hoursContainer = @hoursView.find 'ul' hoursHTML = '' curHour = moment(@viewDate).hour(0).minute(0) for hour in [0..23] hourNum = curHour.format 'HH' trueHour = parseInt @today.format 'H' curHourDate = curHour.format @dateFormat classes = '' disabled = false if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY, HH:00') endDate = @controller.end.date().format('MM-DD-YYYY, HH:00') calendarDate = moment curHour calendarDate = calendarDate.format 'MM-DD-YYYY, HH:00' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY, HH:00') classes += ' disabled' disabled = true if hour is trueHour if !@dateRangeMode classes += ' active' hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'>#{hourNum}:00</li>" else hoursHTML += "<li class='#{classes}' data-date='#{curHourDate}' data-isdisabled='#{disabled}'>#{hourNum}:00</li>" curHour.add 1, 'hours' hoursContainer.html hoursHTML hoursContainer.find('li').on 'click', @hourClickHandler showDays: => @curView.hide() @daysView.show() @curView = @daysView @viewButton.text @viewDate.format 'MMM YYYY' month = @viewDate.month() monthStart = moment(@viewDate).date(0) monthWeekStart = monthStart.day(@weekStart) daysContainer = @daysView.find('tbody') calHTML = "" [0..5].map (week) => weekStart = moment(monthWeekStart).add(week * 7, 'days') daysHTML = "" weekClasses = "" if @granularity == 'weeks' weekClasses = 'week' [0..6].map (dow) => curDay = moment weekStart.day(@weekStart + dow).format(@dateFormat), @dateFormat curDayDate = curDay.format @dateFormat classes = 'day' if curDay.month() < month then classes += ' lastMonth' if curDay.month() > month then classes += ' nextMonth' if curDay.format(@dateFormat) == @curDate.format(@dateFormat) && !@dateRangeMode classes += ' active' weekClasses += ' active' if @dateRangeMode startDate = @controller.start.date().format('MM-DD-YYYY') endDate = @controller.end.date().format('MM-DD-YYYY') calendarDate = moment curDay calendarDate = calendarDate.format 'MM-DD-YYYY' # Apply class to start date if startDate == calendarDate classes += ' startDate' # Apply class to end date if endDate == calendarDate && endDate > startDate classes += ' endDate' # # Apply class to days within date range if calendarDate > startDate and calendarDate < endDate classes += ' inDateRange' if calendarDate < startDate && this is @controller.end || calendarDate < @today.format('MM-DD-YYYY') classes += ' disabled' disabled = true daysHTML += "<td class='#{classes}' data-date='#{curDayDate}' data-isdisabled='#{disabled}'>#{curDay.date()}</td>" weekHTML = "<tr class='#{weekClasses}'>#{daysHTML}</tr>" calHTML += weekHTML daysContainer.html calHTML if @granularity == 'weeks' @dropdown.find('.week').on 'click', @weekClickHandler else @dropdown.find('.day').on 'click', @dayClickHandler showMonths: => @curView.hide() @monthsView.show() @curView = @monthsView @viewButton.text @viewDate.format 'YYYY' # months buttons monthsContainer = @monthsView.find 'ul' monthsHTML = '' curMonth = moment(@viewDate).dayOfYear(1) for month in [0..11] monthName = curMonth.format 'MMM' monthNum = curMonth.format 'M' if curMonth.month() == @curDate.month() and curMonth.year() == @curDate.year() monthsHTML += "<li class='active' data-date='#{monthNum}'>#{monthName}</li>" else monthsHTML += "<li class='' data-date='#{monthNum}'>#{monthName}</li>" curMonth.add 1, 'months' monthsContainer.html monthsHTML monthsContainer.find('li').on 'click', @monthClickHandler showYears: => @curView.hide() @yearsView.show() @curView = @yearsView viewRange = @viewDate.year() + ' - ' + (@viewDate.year() + 11) @viewButton.text viewRange # years buttons yearsContainer = @yearsView.find 'ul' yearsHTML = '' curYear = moment(@viewDate) for year in [0..11] yearNum = curYear.format 'YYYY' if curYear.year() == @curDate.year() yearsHTML += "<li class='active' data-date='#{yearNum}'>#{yearNum}</li>" else yearsHTML += "<li class='' data-date='#{yearNum}'>#{yearNum}</li>" curYear.add 1, 'years' yearsContainer.html yearsHTML yearsContainer.find('li').on 'click', @yearClickHandler minuteClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' isDisabled = target.data 'isdisabled' if isDisabled == true console.log("This date is not selectable") else @setDate target.data 'date' @hide() hourClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' newDate = target.data 'date' isDisabled = target.data 'isdisabled' if @granularity == 'hours' @setDate moment(newDate, @dateFormat) @hide() else if @dateRangeMode if isDisabled == true console.log("This date is not selectable") else @setViewDate moment(newDate, @dateFormat).minutes(0) @showMinutes() else @setViewDate moment(newDate, @dateFormat) @showMinutes() dayClickHandler: (event) => target = $ event.currentTarget newDate = target.data 'date' isDisabled = target.data 'isdisabled' if @granularity == 'days' @setDate moment(newDate, @dateFormat) @hide() else if @dateRangeMode if isDisabled == true console.log("This date is not selectable") else @setViewDate moment(newDate, @dateFormat).minutes(0) @showHours() else @setViewDate moment(newDate, @dateFormat) @showHours() weekClickHandler: (event) => target = $ event.currentTarget @setDate target.find('td:first').data 'date' @hide() monthClickHandler: (event) => target = $ event.currentTarget monthNum = target.data 'date' newDate = moment(@curDate).month(monthNum - 1).year(@viewDate.year()) if @granularity == 'months' @setDate newDate.date(1) @hide() else @setViewDate newDate.day(1) @showDays() yearClickHandler: (event) => target = $ event.currentTarget yearNum = target.data 'date' newDate = moment(@curDate).year(yearNum) if @granularity == 'years' @setDate newDate.date(1) @hide() else @setViewDate newDate.day(1) @showMonths() viewClickHandler: (event) => if @curView == @minutesView @showHours() @update() else if @curView == @hoursViewPeriod @showDays() @update() else if @curView == @hoursView @showDays() @update() else if @curView == @daysView @showMonths() @update() else if @curView == @monthsView @showYears() @update() directionClickHandler: (event) => target = $ event.currentTarget if @curView == @minutesView span = 'hours' amount = 1 if @curView == @hoursViewPeriod span = 'days' amount = 1 if @curView == @hoursView span = 'days' amount = 1 if @curView == @daysView span = 'months' amount = 1 if @curView == @monthsView span = 'years' amount = 1 if @curView == @yearsView span = 'years' amount = 12 if target.hasClass 'prev' @setViewDate moment(@viewDate).subtract(amount, span) if target.hasClass 'next' @setViewDate moment(@viewDate).add(amount, span) setDate: (date) => @curDate = moment date, @dateFormat @update() @events.trigger 'dateChange' setViewDate: (date) => @viewDate = moment date @curDate = @viewDate @update() show: => @events.trigger 'showDropdown' @visible = true @update() @dropdown.stop().css({display: 'block'}).animate({ opacity: 1 }, 200) hide: => @events.trigger 'hideDropdown' @viewDate = @curDate @visible = false @dropdown.stop().css({ display: 'none' opacity: 0 }) toggle: => if @visible then @hide() else @show() date: => moment @curDate getDate: => moment @curDate jsDate: => @curDate.toDate() class DateRangeController constructor: (placeholder, options) -> placeholder.html '<div class="momentous-start-date"></div><div class="momentous-end-date"></div>' startDatePlaceholder = $ '.momentous-start-date' endDatePlaceholder = $ '.momentous-end-date' @start = new Momentous startDatePlaceholder, options, this @end = new Momentous endDatePlaceholder, options, this @start.init() @end.init() @start.events.on 'dateChange', @startDateChangeHandler @end.events.on 'dateChange', @endDateChangeHandler @start.events.on 'showDropdown', @startShowHandler @end.events.on 'showDropdown', @endShowHandler startShowHandler: (event) => @end.hide() endShowHandler: (event) => @start.hide() startDateChangeHandler: (event) => startDate = @start.date() endDate = @end.date() diff = if @granularity == 'days' then endDate.diff startDate, 'days' else endDate.diff startDate, 'hours' if diff <= 0 if @granularity == 'days' @end.setDate moment(startDate).add(1, 'weeks') if @granularity == 'hours' @end.setDate moment(startDate).add(1, 'hours') if @granularity == 'minutes' @end.setDate moment(startDate).add(1, 'minutes') @end.show() endDateChangeHandler: (event) => startDate = @start.date() endDate = @end.date() diff = if @granularity == 'days' then endDate.diff startDate, 'days' else endDate.diff startDate, 'hours' if diff <= 0 if @granularity == 'days' @start.setDate moment(endDate).subtract(1, 'weeks') if @granularity == 'hours' @start.setDate moment(endDate).subtract(1, 'hours') if @granularity == 'minutes' @start.setDate moment(endDate).subtract(1, 'minutes') window.Momentous = (placeholder, options={}) -> if options.dateRangeMode is true momentous = new DateRangeController placeholder, options else momentous = new Momentous placeholder, options momentous.init() return momentous dropdownTemplate = """ <div class="input-append"> <input class='momentous-input' type='text' value='' readonly> <button class="btn momentous-cal-button" type="button"><i class="icon-calendar"></i></button> </div> <div class='momentous-dropdown popover bottom'> <div class="arrow"></div> <div class="momentous-nav"> <span class="dir-button prev"><i class="icon-chevron-left"></i></span> <span class="view-button"></span> <span class="dir-button next"><i class="icon-chevron-right"></i></span> </div> <div class="days-view" style="display: none;"> <table class="table-condensed"> <thead> <tr class="dow-row"></tr> </thead> <tbody></tbody> </table> </div> <div class="minutes-view" style="display: none;"><ul></ul></div> <div class="hours-view-period" style="display: none;"><ul></ul></div> <div class="hours-view" style="display: none;"><ul></ul></div> <div class="months-view" style="display: none;"><ul></ul></div> <div class="years-view" style="display: none;"><ul></ul></div> </div> """ log = (s) -> console.log s
[ { "context": "uld insert every other character', ->\n text = \"cat\"\n delta = new Delta(3, 6, [new RetainOp(0, 1),", "end": 2122, "score": 0.6260939836502075, "start": 2119, "tag": "NAME", "value": "cat" }, { "context": "should delete the last character', ->\n text = \"cat\...
tests/applyDeltaToText.coffee
tandem/tandem-core
2
# Copyright (c) 2012, Salesforce.com, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. Redistributions in binary # form must reproduce the above copyright notice, this list of conditions and # the following disclaimer in the documentation and/or other materials provided # with the distribution. Neither the name of Salesforce.com nor the names of # its contributors may be used to endorse or promote products derived from this # software without specific prior written permission. assert = require('chai').assert Tandem = require('../index') Delta = Tandem.Delta InsertOp = Tandem.InsertOp RetainOp = Tandem.RetainOp testApplyDeltaToText = (delta, text, expected) -> computed = delta.applyToText(text) error = "Incorrect application. Got: " + computed + ", expected: " + expected assert.equal(computed, expected, error) describe('applyDeltaToText', -> it('should append a character', -> text = "cat" delta = new Delta(3, 4, [new RetainOp(0, 3), new InsertOp("s")], 1) expected = "cats" testApplyDeltaToText(delta, text, expected) ) it('should prepend a character', -> text = "cat" delta = new Delta(3, 4, [new InsertOp("a"), new RetainOp(0, 3)], 1) expected = "acat" testApplyDeltaToText(delta, text, expected) ) it('should insert a character into the middle of the document', -> text = "cat" delta = new Delta(3, 4, [new RetainOp(0, 2), new InsertOp("n"), new RetainOp(2, 3)], 1) expected = "cant" testApplyDeltaToText(delta, text, expected) ) it('should prepend and append characters', -> text = "cat" delta = new Delta(3, 7, [new InsertOp("b"), new InsertOp("a"), new InsertOp("t"), new RetainOp(0, 3), new InsertOp("s")], 1) expected = "batcats" testApplyDeltaToText(delta, text, expected) ) it('should insert every other character', -> text = "cat" delta = new Delta(3, 6, [new RetainOp(0, 1), new InsertOp("h"), new RetainOp(1, 2), new InsertOp("n"), new RetainOp(2, 3), new InsertOp("s")], 1) expected = "chants" testApplyDeltaToText(delta, text, expected) ) it('should delete the last character', -> text = "cat" delta = new Delta(3, 2, [new RetainOp(0, 2)], 1) expected = "ca" testApplyDeltaToText(delta, text, expected) ) it('should delete the first character', -> text = "cat" delta = new Delta(3, 2, [new RetainOp(1, 3)], 1) expected = "at" testApplyDeltaToText(delta, text, expected) ) it('should delete the entire string', -> text = "cat" delta = new Delta(3, 0, [], 1) expected = "" testApplyDeltaToText(delta, text, expected) ) it('should delete every other character', -> text = "hello" delta = new Delta(5, 2, [new RetainOp(1, 2), new RetainOp(3,4)], 1) expected = "el" testApplyDeltaToText(delta, text, expected) ) it('should insert to beginning, delete from end', -> text = "cat" delta = new Delta(3, 3, [new InsertOp("a"), new RetainOp(0, 2)], 1) expected = "aca" testApplyDeltaToText(delta, text, expected) ) it('should replace text with new text', -> text = "cat" delta = new Delta(3, 3, [new InsertOp("d"), new InsertOp("o"), new InsertOp("g")], 1) expected = "dog" testApplyDeltaToText(delta, text, expected) ) it('should pass this fuzzer test we once failed', -> deltaA = new Delta(3, 17, [new InsertOp("evumzsdinkbgcp"), new RetainOp(0, 3)]) deltaB = new Delta(3, 33, [new InsertOp("rjieumfrlrukvmmeylxxwtc"), new RetainOp(1, 2), new InsertOp("mklxowze"), new RetainOp(2, 3)]) deltaBPrime = deltaB.transform(deltaA, true) deltaAPrime = deltaA.transform(deltaB, false) deltaAFinal = deltaA.compose(deltaBPrime) deltaBFinal = deltaB.compose(deltaAPrime) xA = deltaAFinal.applyToText("abc") xB = deltaBFinal.applyToText("abc") if (xA != xB) console.info "DeltaA:", deltaA console.info "DeltaB:", deltaB console.info "deltaAPrime:", deltaAPrime console.info "deltaBPrime:", deltaBPrime console.info "deltaAFinal:", deltaAFinal console.info "deltaBFinal:", deltaBFinal assert(false, "Documents diverged. xA is: " + xA + "xB is: " + xB) x = xA ) )
113788
# Copyright (c) 2012, Salesforce.com, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. Redistributions in binary # form must reproduce the above copyright notice, this list of conditions and # the following disclaimer in the documentation and/or other materials provided # with the distribution. Neither the name of Salesforce.com nor the names of # its contributors may be used to endorse or promote products derived from this # software without specific prior written permission. assert = require('chai').assert Tandem = require('../index') Delta = Tandem.Delta InsertOp = Tandem.InsertOp RetainOp = Tandem.RetainOp testApplyDeltaToText = (delta, text, expected) -> computed = delta.applyToText(text) error = "Incorrect application. Got: " + computed + ", expected: " + expected assert.equal(computed, expected, error) describe('applyDeltaToText', -> it('should append a character', -> text = "cat" delta = new Delta(3, 4, [new RetainOp(0, 3), new InsertOp("s")], 1) expected = "cats" testApplyDeltaToText(delta, text, expected) ) it('should prepend a character', -> text = "cat" delta = new Delta(3, 4, [new InsertOp("a"), new RetainOp(0, 3)], 1) expected = "acat" testApplyDeltaToText(delta, text, expected) ) it('should insert a character into the middle of the document', -> text = "cat" delta = new Delta(3, 4, [new RetainOp(0, 2), new InsertOp("n"), new RetainOp(2, 3)], 1) expected = "cant" testApplyDeltaToText(delta, text, expected) ) it('should prepend and append characters', -> text = "cat" delta = new Delta(3, 7, [new InsertOp("b"), new InsertOp("a"), new InsertOp("t"), new RetainOp(0, 3), new InsertOp("s")], 1) expected = "batcats" testApplyDeltaToText(delta, text, expected) ) it('should insert every other character', -> text = "<NAME>" delta = new Delta(3, 6, [new RetainOp(0, 1), new InsertOp("h"), new RetainOp(1, 2), new InsertOp("n"), new RetainOp(2, 3), new InsertOp("s")], 1) expected = "chants" testApplyDeltaToText(delta, text, expected) ) it('should delete the last character', -> text = "<NAME>" delta = new Delta(3, 2, [new RetainOp(0, 2)], 1) expected = "ca" testApplyDeltaToText(delta, text, expected) ) it('should delete the first character', -> text = "<NAME>" delta = new Delta(3, 2, [new RetainOp(1, 3)], 1) expected = "at" testApplyDeltaToText(delta, text, expected) ) it('should delete the entire string', -> text = "<NAME>" delta = new Delta(3, 0, [], 1) expected = "" testApplyDeltaToText(delta, text, expected) ) it('should delete every other character', -> text = "hello" delta = new Delta(5, 2, [new RetainOp(1, 2), new RetainOp(3,4)], 1) expected = "el" testApplyDeltaToText(delta, text, expected) ) it('should insert to beginning, delete from end', -> text = "<NAME>" delta = new Delta(3, 3, [new InsertOp("a"), new RetainOp(0, 2)], 1) expected = "aca" testApplyDeltaToText(delta, text, expected) ) it('should replace text with new text', -> text = "<NAME>" delta = new Delta(3, 3, [new InsertOp("d"), new InsertOp("o"), new InsertOp("g")], 1) expected = "dog" testApplyDeltaToText(delta, text, expected) ) it('should pass this fuzzer test we once failed', -> deltaA = new Delta(3, 17, [new InsertOp("evumzsdinkbgcp"), new RetainOp(0, 3)]) deltaB = new Delta(3, 33, [new InsertOp("rjieumfrlrukvmmeylxxwtc"), new RetainOp(1, 2), new InsertOp("mklxowze"), new RetainOp(2, 3)]) deltaBPrime = deltaB.transform(deltaA, true) deltaAPrime = deltaA.transform(deltaB, false) deltaAFinal = deltaA.compose(deltaBPrime) deltaBFinal = deltaB.compose(deltaAPrime) xA = deltaAFinal.applyToText("abc") xB = deltaBFinal.applyToText("abc") if (xA != xB) console.info "DeltaA:", deltaA console.info "DeltaB:", deltaB console.info "deltaAPrime:", deltaAPrime console.info "deltaBPrime:", deltaBPrime console.info "deltaAFinal:", deltaAFinal console.info "deltaBFinal:", deltaBFinal assert(false, "Documents diverged. xA is: " + xA + "xB is: " + xB) x = xA ) )
true
# Copyright (c) 2012, Salesforce.com, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. Redistributions in binary # form must reproduce the above copyright notice, this list of conditions and # the following disclaimer in the documentation and/or other materials provided # with the distribution. Neither the name of Salesforce.com nor the names of # its contributors may be used to endorse or promote products derived from this # software without specific prior written permission. assert = require('chai').assert Tandem = require('../index') Delta = Tandem.Delta InsertOp = Tandem.InsertOp RetainOp = Tandem.RetainOp testApplyDeltaToText = (delta, text, expected) -> computed = delta.applyToText(text) error = "Incorrect application. Got: " + computed + ", expected: " + expected assert.equal(computed, expected, error) describe('applyDeltaToText', -> it('should append a character', -> text = "cat" delta = new Delta(3, 4, [new RetainOp(0, 3), new InsertOp("s")], 1) expected = "cats" testApplyDeltaToText(delta, text, expected) ) it('should prepend a character', -> text = "cat" delta = new Delta(3, 4, [new InsertOp("a"), new RetainOp(0, 3)], 1) expected = "acat" testApplyDeltaToText(delta, text, expected) ) it('should insert a character into the middle of the document', -> text = "cat" delta = new Delta(3, 4, [new RetainOp(0, 2), new InsertOp("n"), new RetainOp(2, 3)], 1) expected = "cant" testApplyDeltaToText(delta, text, expected) ) it('should prepend and append characters', -> text = "cat" delta = new Delta(3, 7, [new InsertOp("b"), new InsertOp("a"), new InsertOp("t"), new RetainOp(0, 3), new InsertOp("s")], 1) expected = "batcats" testApplyDeltaToText(delta, text, expected) ) it('should insert every other character', -> text = "PI:NAME:<NAME>END_PI" delta = new Delta(3, 6, [new RetainOp(0, 1), new InsertOp("h"), new RetainOp(1, 2), new InsertOp("n"), new RetainOp(2, 3), new InsertOp("s")], 1) expected = "chants" testApplyDeltaToText(delta, text, expected) ) it('should delete the last character', -> text = "PI:NAME:<NAME>END_PI" delta = new Delta(3, 2, [new RetainOp(0, 2)], 1) expected = "ca" testApplyDeltaToText(delta, text, expected) ) it('should delete the first character', -> text = "PI:NAME:<NAME>END_PI" delta = new Delta(3, 2, [new RetainOp(1, 3)], 1) expected = "at" testApplyDeltaToText(delta, text, expected) ) it('should delete the entire string', -> text = "PI:NAME:<NAME>END_PI" delta = new Delta(3, 0, [], 1) expected = "" testApplyDeltaToText(delta, text, expected) ) it('should delete every other character', -> text = "hello" delta = new Delta(5, 2, [new RetainOp(1, 2), new RetainOp(3,4)], 1) expected = "el" testApplyDeltaToText(delta, text, expected) ) it('should insert to beginning, delete from end', -> text = "PI:NAME:<NAME>END_PI" delta = new Delta(3, 3, [new InsertOp("a"), new RetainOp(0, 2)], 1) expected = "aca" testApplyDeltaToText(delta, text, expected) ) it('should replace text with new text', -> text = "PI:NAME:<NAME>END_PI" delta = new Delta(3, 3, [new InsertOp("d"), new InsertOp("o"), new InsertOp("g")], 1) expected = "dog" testApplyDeltaToText(delta, text, expected) ) it('should pass this fuzzer test we once failed', -> deltaA = new Delta(3, 17, [new InsertOp("evumzsdinkbgcp"), new RetainOp(0, 3)]) deltaB = new Delta(3, 33, [new InsertOp("rjieumfrlrukvmmeylxxwtc"), new RetainOp(1, 2), new InsertOp("mklxowze"), new RetainOp(2, 3)]) deltaBPrime = deltaB.transform(deltaA, true) deltaAPrime = deltaA.transform(deltaB, false) deltaAFinal = deltaA.compose(deltaBPrime) deltaBFinal = deltaB.compose(deltaAPrime) xA = deltaAFinal.applyToText("abc") xB = deltaBFinal.applyToText("abc") if (xA != xB) console.info "DeltaA:", deltaA console.info "DeltaB:", deltaB console.info "deltaAPrime:", deltaAPrime console.info "deltaBPrime:", deltaBPrime console.info "deltaAFinal:", deltaAFinal console.info "deltaBFinal:", deltaBFinal assert(false, "Documents diverged. xA is: " + xA + "xB is: " + xB) x = xA ) )
[ { "context": "###*\n *\n * 进度条\n * @author vfasky <vfasky@gmail.com>\n###\n'use strict'\n\n{Component, ", "end": 32, "score": 0.9996593594551086, "start": 26, "tag": "USERNAME", "value": "vfasky" }, { "context": "###*\n *\n * 进度条\n * @author vfasky <vfasky@gmail.com>\n###\n'use stric...
src/coffee/progressBar.coffee
vfasky/mcore-weui
0
###* * * 进度条 * @author vfasky <vfasky@gmail.com> ### 'use strict' {Component, Template, util} = require 'mcore' class ProgressBar extends Component init: -> @render require('../tpl/progressBar.html') watch: -> @on 'change:value', (value)-> @set 'progress', value if util.isNumber value Template.components['progress-bar'] = ProgressBar module.exports = ProgressBar
107879
###* * * 进度条 * @author vfasky <<EMAIL>> ### 'use strict' {Component, Template, util} = require 'mcore' class ProgressBar extends Component init: -> @render require('../tpl/progressBar.html') watch: -> @on 'change:value', (value)-> @set 'progress', value if util.isNumber value Template.components['progress-bar'] = ProgressBar module.exports = ProgressBar
true
###* * * 进度条 * @author vfasky <PI:EMAIL:<EMAIL>END_PI> ### 'use strict' {Component, Template, util} = require 'mcore' class ProgressBar extends Component init: -> @render require('../tpl/progressBar.html') watch: -> @on 'change:value', (value)-> @set 'progress', value if util.isNumber value Template.components['progress-bar'] = ProgressBar module.exports = ProgressBar
[ { "context": "PLOY_URL\n2. UDEPLOY_USER_ID\n3. UDEPLOY_PASSWORD\n4. AUTHREALM\n\nDependencies:\n1. request\n###\n\nudeploy_url = proc", "end": 1465, "score": 0.7773334980010986, "start": 1456, "tag": "USERNAME", "value": "AUTHREALM" }, { "context": "ffee (error,stdout,stderr) ->\n\t\...
scripts/udeploy/scripts-hipchat/udeploy.coffee
akash1233/OnBot_Demo
4
#------------------------------------------------------------------------------- # Copyright 2018 Cognizant Technology Solutions # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. #------------------------------------------------------------------------------- ### Coffee script used for: Creating user,components,resourses,applications. Viewing user,components,resourses,applications. Set of bot commands: 1. create security token 2. view user <user-name> 3. delete user <user-name> 4. create user <user-name> 5. create component <component-name> 6. delete resource <resource-name> 7. create resource <resource-name> 8. view environment of application <application-name> 9. view components of application <application-name> 10. view application <application-name> 11. view component <component-name> 12. list applications 13. list resources 14. list components Env to set: 1. UDEPLOY_URL 2. UDEPLOY_USER_ID 3. UDEPLOY_PASSWORD 4. AUTHREALM Dependencies: 1. request ### udeploy_url = process.env.UDEPLOY_URL udeploy_user_id = process.env.UDEPLOY_USER_ID udeploy_password = process.env.UDEPLOY_PASSWORD botname = process.env.HUBOT_NAME || '' pod_ip = process.env.MY_POD_IP || '' get_all_component = require('./get_all_component.js'); get_all_resources = require('./get_all_resources.js'); get_all_application = require('./get_all_application.js'); get_specific_component = require('./get_specific_component.js'); get_specific_application = require('./get_specific_application.js'); get_component_specific_application = require('./get_component_specific_application.js'); get_environment_specific_application = require('./get_environment_specific_application.js'); create_resource = require('./create_resource.js'); delete_resource = require('./delete_resource.js'); create_component = require('./create_component.js'); create_user = require('./create_user.js'); delete_user = require('./delete_user.js'); info_user = require('./info_user.js'); create_token = require('./create_token.js'); app_deploy = require('./app_deploy.js'); request=require('request') readjson = require './readjson.js' index = require('./index') uniqueId = (length=8) -> id = "" id += Math.random().toString(36).substr(2) while id.length < length id.substr 0, length generate_id = require('./mongoConnt') module.exports = (robot) -> robot.respond /help/i, (msg) -> dt = 'create security token\nview user <user-name>\ndelete user <user-name>\ncreate user <user-name>\ncreate component <component-name>\ndelete resource <resource-name>\ncreate resource <resource-name>\nview environment of application <application-name>\nview components of application <application-name>\nview application <application-name>\nview component <component-name>\nlist applications\nlist resources\nlist components' msg.send dt msg.send 'deploy <app_name> process <process_name> env <environment_name> version <version_number> component <component_name>\n *deploy HelloWorldAppln process HelloWorldApplnProcess env Dev version 3.0 component HelloWorld*\nstart watching *It\'ll notify you if any application/component/resource is created by anybody* '; setTimeout (->index.passData dt),1000 #list components robot.respond /list components/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponentslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponentslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycomponentslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponentslist.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponentslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_component.get_all_component udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponentslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_component.get_all_component udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list components was rejected'; #list resources robot.respond /list resources/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployresourceslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployresourceslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployresourceslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployresourceslist.admin, data); msg.send 'Your request is waiting for approval by '+stdout.udeployresourceslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_resources.get_all_resources udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployresourceslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approve' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_resources.get_all_resources udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list resources was rejected'; #list applications robot.respond /list applications/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployapllicationslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployapllicationslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployapllicationslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployapllicationslist.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployapllicationslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_application.get_all_application udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployapllicationslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_application.get_all_application udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list applications was rejected'; #view component robot.respond /view component (.*)/i, (msg) -> component_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponent.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponent.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycomponent',component_name:component_name,message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponent.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponent.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_specific_component.get_specific_component component_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponent', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_specific_component.get_specific_component data_http.component_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view component was rejected'; #view application robot.respond /view application (.*)/i, (msg) -> application_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployapplication.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployapplication',application_name:application_name,message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_specific_application.get_specific_application application_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_specific_application.get_specific_application data_http.application_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view application was rejected'; #view components of application robot.respond /view components of application (.*)/i, (msg) -> componentapplication = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponentapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponentapplication.admin,podIp:process.env.MY_POD_IP,componentapplication:componentapplication,callback_id: 'udeploycomponentapplication',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponentapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponentapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_component_specific_application.get_component_specific_application componentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponentapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_component_specific_application.get_component_specific_application data_http.componentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view components of application was rejected'; #view environment of application robot.respond /view environment of application (.*)/i, (msg) -> environmentapplication = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployenvironmentapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployenvironmentapplication.admin,podIp:process.env.MY_POD_IP,environmentapplication:environmentapplication,callback_id: 'udeployenvironmentapplication',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployenvironmentapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployenvironmentapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_environment_specific_application.get_environment_specific_application environmentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployenvironmentapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_environment_specific_application.get_environment_specific_application data_http.environmentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view environment of application was rejected'; #create resource robot.respond /create resource (.*)/i, (msg) -> resource = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreateresource.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreateresource.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreateresource',message:msg.message.text,resource:resource} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreateresource.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreateresource.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_resource.create_resource resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy resource created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreateresource', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_resource.create_resource data_http.resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create resource '+data_http.resource; actionmsg = 'u-Deploy resource created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request to create u-Deploy resource was rejected'; #delete resource robot.respond /delete resource (.*)/i, (msg) -> resource = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploydeleteresource.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploydeleteresource.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploydeleteresource',message:msg.message.text,resource:resource,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploydeleteresource.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploydeleteresource.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else delete_resource.delete_resource resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0] actionmsg = 'u-Deploy resource deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploydeleteresource', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); delete_resource.delete_resource data_http.resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'delete resource '+data_http.resource; actionmsg = 'u-Deploy resource deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for deleting u-Deploy resource was rejected'; #create component robot.respond /create component (.*)/i, (msg) -> component = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreaterecomponent.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreaterecomponent.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreaterecomponent',message:msg.message.text,component:component,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreaterecomponent.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreaterecomponent.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_component.create_component component, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy component(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreaterecomponent', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_component.create_component data_http.component, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create component '+data_http.component; actionmsg = 'u-Deploy component(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for creating u-Deploy component was rejected'; #create user robot.respond /create user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> unique_password = uniqueId(5); if stdout.udeploycreatereuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreatereuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreatereuser',message:msg.message.text,user_name:user_name,tckid:tckid,unique_password:unique_password} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreatereuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreatereuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_user.create_user user_name, unique_password, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 actionmsg = 'u-Deploy user(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreatereuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_user.create_user data_http.user_name, data_http.unique_password, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create user '+data_http.user_name actionmsg = 'u-Deploy user(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request to create u-Deploy user was rejected'; #delete user robot.respond /delete user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploydeletereuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploydeletereuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploydeletereuser',message:msg.message.text,user_name:user_name,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploydeletereuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploydeletereuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else delete_user.delete_user user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0] actionmsg = 'u-Deploy user(s) deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploydeletereuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); delete_user.delete_user data_http.user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'delete user '+data_http.user_name; actionmsg = 'u-Deploy user(s) deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for deleting u-Deploy user was rejected'; #view user robot.respond /view user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployshowreuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployshowreuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployshowreuser',message:msg.message.text,user_name:user_name} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployshowreuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployshowreuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else info_user.info_user user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployshowreuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); info_user.info_user data_http.user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view user was rejected'; #create security token robot.respond /create security token/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreatetoken.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreatetoken.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreatetoken',message:msg.message.text,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreatetoken.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreatetoken.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else unique_password = uniqueId(5); create_token.create_token udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy token(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreatetoken', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_token.create_token udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create security token'; actionmsg = 'u-Deploy token(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for creating u-Deploy security token was rejected'; #deploy robot.respond /deploy (.*) process (.*) env (.*) version (.*) component (.*)/i, (msg) -> #deploy HelloWorldAppln process HelloWorldApplnProcess env Dev version 3.0 component HelloWorld #deploy <app_name> process <process_name> env <environment_name> version <version_number> component <component_name> app_name = msg.match[1]; app_process = msg.match[2]; env = msg.match[3]; version = msg.match[4]; component = msg.match[5]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployappdeploy.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployappdeploy.admin,podIp:pod_ip,callback_id: 'udeployappdeploy',message:msg.message.text,tckid:tckid,app_name:app_name,app_process:app_process,env:env,version:version,component:component} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployappdeploy.admin, data); msg.send 'Your request is waiting for approval by '+stdout.udeployappdeploy.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else msg.reply 'Your process is in progress. Once it\'s done you\'ll be notified.'; app_deploy.app_deploy udeploy_url, udeploy_user_id, udeploy_password, app_name, app_process, env, version, component, (error, stdout, stderr) -> if error == "null" msg.reply stdout; else msg.reply error; robot.router.post '/udeployappdeploy', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); app_deploy.app_deploy udeploy_url, udeploy_user_id, udeploy_password, data_http.app_name, data_http.app_process, data_http.env, data_http.version, data_http.component, (error, stdout, stderr) -> if error == "null" setTimeout (->index.passData stdout),1000 message = 'deploy '+data_http.app_name+'process '+data_http.app_process+'env '+data_http.env+'version '+data_http.version+'component '+data_http.component; actionmsg = 'u-Deploy application deployed'; statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; robot.messageRoom data_http.userid, stdout; else setTimeout (->index.passData error),1000 robot.messageRoom data_http.userid, error; else robot.messageRoom data_http.userid, 'You are not authorized.';
57885
#------------------------------------------------------------------------------- # Copyright 2018 Cognizant Technology Solutions # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. #------------------------------------------------------------------------------- ### Coffee script used for: Creating user,components,resourses,applications. Viewing user,components,resourses,applications. Set of bot commands: 1. create security token 2. view user <user-name> 3. delete user <user-name> 4. create user <user-name> 5. create component <component-name> 6. delete resource <resource-name> 7. create resource <resource-name> 8. view environment of application <application-name> 9. view components of application <application-name> 10. view application <application-name> 11. view component <component-name> 12. list applications 13. list resources 14. list components Env to set: 1. UDEPLOY_URL 2. UDEPLOY_USER_ID 3. UDEPLOY_PASSWORD 4. AUTHREALM Dependencies: 1. request ### udeploy_url = process.env.UDEPLOY_URL udeploy_user_id = process.env.UDEPLOY_USER_ID udeploy_password = process.env.UDEPLOY_PASSWORD botname = process.env.HUBOT_NAME || '' pod_ip = process.env.MY_POD_IP || '' get_all_component = require('./get_all_component.js'); get_all_resources = require('./get_all_resources.js'); get_all_application = require('./get_all_application.js'); get_specific_component = require('./get_specific_component.js'); get_specific_application = require('./get_specific_application.js'); get_component_specific_application = require('./get_component_specific_application.js'); get_environment_specific_application = require('./get_environment_specific_application.js'); create_resource = require('./create_resource.js'); delete_resource = require('./delete_resource.js'); create_component = require('./create_component.js'); create_user = require('./create_user.js'); delete_user = require('./delete_user.js'); info_user = require('./info_user.js'); create_token = require('./create_token.js'); app_deploy = require('./app_deploy.js'); request=require('request') readjson = require './readjson.js' index = require('./index') uniqueId = (length=8) -> id = "" id += Math.random().toString(36).substr(2) while id.length < length id.substr 0, length generate_id = require('./mongoConnt') module.exports = (robot) -> robot.respond /help/i, (msg) -> dt = 'create security token\nview user <user-name>\ndelete user <user-name>\ncreate user <user-name>\ncreate component <component-name>\ndelete resource <resource-name>\ncreate resource <resource-name>\nview environment of application <application-name>\nview components of application <application-name>\nview application <application-name>\nview component <component-name>\nlist applications\nlist resources\nlist components' msg.send dt msg.send 'deploy <app_name> process <process_name> env <environment_name> version <version_number> component <component_name>\n *deploy HelloWorldAppln process HelloWorldApplnProcess env Dev version 3.0 component HelloWorld*\nstart watching *It\'ll notify you if any application/component/resource is created by anybody* '; setTimeout (->index.passData dt),1000 #list components robot.respond /list components/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponentslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponentslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycomponentslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponentslist.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponentslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_component.get_all_component udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponentslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_component.get_all_component udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list components was rejected'; #list resources robot.respond /list resources/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployresourceslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployresourceslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployresourceslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployresourceslist.admin, data); msg.send 'Your request is waiting for approval by '+stdout.udeployresourceslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_resources.get_all_resources udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployresourceslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approve' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_resources.get_all_resources udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list resources was rejected'; #list applications robot.respond /list applications/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployapllicationslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployapllicationslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployapllicationslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployapllicationslist.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployapllicationslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_application.get_all_application udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployapllicationslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_application.get_all_application udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list applications was rejected'; #view component robot.respond /view component (.*)/i, (msg) -> component_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponent.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponent.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycomponent',component_name:component_name,message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponent.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponent.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_specific_component.get_specific_component component_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponent', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_specific_component.get_specific_component data_http.component_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view component was rejected'; #view application robot.respond /view application (.*)/i, (msg) -> application_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployapplication.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployapplication',application_name:application_name,message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_specific_application.get_specific_application application_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_specific_application.get_specific_application data_http.application_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view application was rejected'; #view components of application robot.respond /view components of application (.*)/i, (msg) -> componentapplication = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponentapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponentapplication.admin,podIp:process.env.MY_POD_IP,componentapplication:componentapplication,callback_id: 'udeploycomponentapplication',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponentapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponentapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_component_specific_application.get_component_specific_application componentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponentapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_component_specific_application.get_component_specific_application data_http.componentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view components of application was rejected'; #view environment of application robot.respond /view environment of application (.*)/i, (msg) -> environmentapplication = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployenvironmentapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployenvironmentapplication.admin,podIp:process.env.MY_POD_IP,environmentapplication:environmentapplication,callback_id: 'udeployenvironmentapplication',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployenvironmentapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployenvironmentapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_environment_specific_application.get_environment_specific_application environmentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployenvironmentapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_environment_specific_application.get_environment_specific_application data_http.environmentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view environment of application was rejected'; #create resource robot.respond /create resource (.*)/i, (msg) -> resource = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreateresource.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreateresource.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreateresource',message:msg.message.text,resource:resource} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreateresource.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreateresource.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_resource.create_resource resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy resource created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreateresource', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_resource.create_resource data_http.resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create resource '+data_http.resource; actionmsg = 'u-Deploy resource created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request to create u-Deploy resource was rejected'; #delete resource robot.respond /delete resource (.*)/i, (msg) -> resource = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploydeleteresource.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploydeleteresource.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploydeleteresource',message:msg.message.text,resource:resource,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploydeleteresource.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploydeleteresource.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else delete_resource.delete_resource resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0] actionmsg = 'u-Deploy resource deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploydeleteresource', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); delete_resource.delete_resource data_http.resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'delete resource '+data_http.resource; actionmsg = 'u-Deploy resource deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for deleting u-Deploy resource was rejected'; #create component robot.respond /create component (.*)/i, (msg) -> component = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreaterecomponent.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreaterecomponent.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreaterecomponent',message:msg.message.text,component:component,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreaterecomponent.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreaterecomponent.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_component.create_component component, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy component(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreaterecomponent', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_component.create_component data_http.component, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create component '+data_http.component; actionmsg = 'u-Deploy component(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for creating u-Deploy component was rejected'; #create user robot.respond /create user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> unique_password = <PASSWORD>); if stdout.udeploycreatereuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreatereuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreatereuser',message:msg.message.text,user_name:user_name,tckid:tckid,unique_password:<PASSWORD>} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreatereuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreatereuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_user.create_user user_name, unique_password, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 actionmsg = 'u-Deploy user(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreatereuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_user.create_user data_http.user_name, data_http.unique_password, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create user '+data_http.user_name actionmsg = 'u-Deploy user(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request to create u-Deploy user was rejected'; #delete user robot.respond /delete user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploydeletereuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploydeletereuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploydeletereuser',message:msg.message.text,user_name:user_name,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploydeletereuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploydeletereuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else delete_user.delete_user user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0] actionmsg = 'u-Deploy user(s) deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploydeletereuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); delete_user.delete_user data_http.user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'delete user '+data_http.user_name; actionmsg = 'u-Deploy user(s) deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for deleting u-Deploy user was rejected'; #view user robot.respond /view user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployshowreuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployshowreuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployshowreuser',message:msg.message.text,user_name:user_name} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployshowreuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployshowreuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else info_user.info_user user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployshowreuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); info_user.info_user data_http.user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view user was rejected'; #create security token robot.respond /create security token/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreatetoken.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreatetoken.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreatetoken',message:msg.message.text,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreatetoken.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreatetoken.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else unique_password = <PASSWORD>(<PASSWORD>); create_token.create_token udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy token(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreatetoken', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_token.create_token udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create security token'; actionmsg = 'u-Deploy token(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for creating u-Deploy security token was rejected'; #deploy robot.respond /deploy (.*) process (.*) env (.*) version (.*) component (.*)/i, (msg) -> #deploy HelloWorldAppln process HelloWorldApplnProcess env Dev version 3.0 component HelloWorld #deploy <app_name> process <process_name> env <environment_name> version <version_number> component <component_name> app_name = msg.match[1]; app_process = msg.match[2]; env = msg.match[3]; version = msg.match[4]; component = msg.match[5]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployappdeploy.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployappdeploy.admin,podIp:pod_ip,callback_id: 'udeployappdeploy',message:msg.message.text,tckid:tckid,app_name:app_name,app_process:app_process,env:env,version:version,component:component} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployappdeploy.admin, data); msg.send 'Your request is waiting for approval by '+stdout.udeployappdeploy.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else msg.reply 'Your process is in progress. Once it\'s done you\'ll be notified.'; app_deploy.app_deploy udeploy_url, udeploy_user_id, udeploy_password, app_name, app_process, env, version, component, (error, stdout, stderr) -> if error == "null" msg.reply stdout; else msg.reply error; robot.router.post '/udeployappdeploy', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); app_deploy.app_deploy udeploy_url, udeploy_user_id, udeploy_password, data_http.app_name, data_http.app_process, data_http.env, data_http.version, data_http.component, (error, stdout, stderr) -> if error == "null" setTimeout (->index.passData stdout),1000 message = 'deploy '+data_http.app_name+'process '+data_http.app_process+'env '+data_http.env+'version '+data_http.version+'component '+data_http.component; actionmsg = 'u-Deploy application deployed'; statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; robot.messageRoom data_http.userid, stdout; else setTimeout (->index.passData error),1000 robot.messageRoom data_http.userid, error; else robot.messageRoom data_http.userid, 'You are not authorized.';
true
#------------------------------------------------------------------------------- # Copyright 2018 Cognizant Technology Solutions # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. #------------------------------------------------------------------------------- ### Coffee script used for: Creating user,components,resourses,applications. Viewing user,components,resourses,applications. Set of bot commands: 1. create security token 2. view user <user-name> 3. delete user <user-name> 4. create user <user-name> 5. create component <component-name> 6. delete resource <resource-name> 7. create resource <resource-name> 8. view environment of application <application-name> 9. view components of application <application-name> 10. view application <application-name> 11. view component <component-name> 12. list applications 13. list resources 14. list components Env to set: 1. UDEPLOY_URL 2. UDEPLOY_USER_ID 3. UDEPLOY_PASSWORD 4. AUTHREALM Dependencies: 1. request ### udeploy_url = process.env.UDEPLOY_URL udeploy_user_id = process.env.UDEPLOY_USER_ID udeploy_password = process.env.UDEPLOY_PASSWORD botname = process.env.HUBOT_NAME || '' pod_ip = process.env.MY_POD_IP || '' get_all_component = require('./get_all_component.js'); get_all_resources = require('./get_all_resources.js'); get_all_application = require('./get_all_application.js'); get_specific_component = require('./get_specific_component.js'); get_specific_application = require('./get_specific_application.js'); get_component_specific_application = require('./get_component_specific_application.js'); get_environment_specific_application = require('./get_environment_specific_application.js'); create_resource = require('./create_resource.js'); delete_resource = require('./delete_resource.js'); create_component = require('./create_component.js'); create_user = require('./create_user.js'); delete_user = require('./delete_user.js'); info_user = require('./info_user.js'); create_token = require('./create_token.js'); app_deploy = require('./app_deploy.js'); request=require('request') readjson = require './readjson.js' index = require('./index') uniqueId = (length=8) -> id = "" id += Math.random().toString(36).substr(2) while id.length < length id.substr 0, length generate_id = require('./mongoConnt') module.exports = (robot) -> robot.respond /help/i, (msg) -> dt = 'create security token\nview user <user-name>\ndelete user <user-name>\ncreate user <user-name>\ncreate component <component-name>\ndelete resource <resource-name>\ncreate resource <resource-name>\nview environment of application <application-name>\nview components of application <application-name>\nview application <application-name>\nview component <component-name>\nlist applications\nlist resources\nlist components' msg.send dt msg.send 'deploy <app_name> process <process_name> env <environment_name> version <version_number> component <component_name>\n *deploy HelloWorldAppln process HelloWorldApplnProcess env Dev version 3.0 component HelloWorld*\nstart watching *It\'ll notify you if any application/component/resource is created by anybody* '; setTimeout (->index.passData dt),1000 #list components robot.respond /list components/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponentslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponentslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycomponentslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponentslist.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponentslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_component.get_all_component udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponentslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_component.get_all_component udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list components was rejected'; #list resources robot.respond /list resources/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployresourceslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployresourceslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployresourceslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployresourceslist.admin, data); msg.send 'Your request is waiting for approval by '+stdout.udeployresourceslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_resources.get_all_resources udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployresourceslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approve' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_resources.get_all_resources udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list resources was rejected'; #list applications robot.respond /list applications/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployapllicationslist.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployapllicationslist.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployapllicationslist',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployapllicationslist.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployapllicationslist.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_all_application.get_all_application udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployapllicationslist', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_all_application.get_all_application udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for list applications was rejected'; #view component robot.respond /view component (.*)/i, (msg) -> component_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponent.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponent.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycomponent',component_name:component_name,message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponent.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponent.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_specific_component.get_specific_component component_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponent', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_specific_component.get_specific_component data_http.component_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view component was rejected'; #view application robot.respond /view application (.*)/i, (msg) -> application_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployapplication.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployapplication',application_name:application_name,message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_specific_application.get_specific_application application_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_specific_application.get_specific_application data_http.application_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view application was rejected'; #view components of application robot.respond /view components of application (.*)/i, (msg) -> componentapplication = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycomponentapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycomponentapplication.admin,podIp:process.env.MY_POD_IP,componentapplication:componentapplication,callback_id: 'udeploycomponentapplication',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycomponentapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycomponentapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_component_specific_application.get_component_specific_application componentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycomponentapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_component_specific_application.get_component_specific_application data_http.componentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view components of application was rejected'; #view environment of application robot.respond /view environment of application (.*)/i, (msg) -> environmentapplication = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployenvironmentapplication.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id console.log(tckid); payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployenvironmentapplication.admin,podIp:process.env.MY_POD_IP,environmentapplication:environmentapplication,callback_id: 'udeployenvironmentapplication',message:msg.message.text} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployenvironmentapplication.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployenvironmentapplication.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else get_environment_specific_application.get_environment_specific_application environmentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployenvironmentapplication', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); get_environment_specific_application.get_environment_specific_application data_http.environmentapplication, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view environment of application was rejected'; #create resource robot.respond /create resource (.*)/i, (msg) -> resource = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreateresource.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreateresource.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreateresource',message:msg.message.text,resource:resource} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreateresource.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreateresource.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_resource.create_resource resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy resource created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreateresource', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_resource.create_resource data_http.resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create resource '+data_http.resource; actionmsg = 'u-Deploy resource created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request to create u-Deploy resource was rejected'; #delete resource robot.respond /delete resource (.*)/i, (msg) -> resource = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploydeleteresource.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploydeleteresource.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploydeleteresource',message:msg.message.text,resource:resource,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploydeleteresource.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploydeleteresource.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else delete_resource.delete_resource resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0] actionmsg = 'u-Deploy resource deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploydeleteresource', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); delete_resource.delete_resource data_http.resource, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'delete resource '+data_http.resource; actionmsg = 'u-Deploy resource deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for deleting u-Deploy resource was rejected'; #create component robot.respond /create component (.*)/i, (msg) -> component = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreaterecomponent.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreaterecomponent.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreaterecomponent',message:msg.message.text,component:component,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreaterecomponent.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreaterecomponent.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_component.create_component component, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy component(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreaterecomponent', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_component.create_component data_http.component, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create component '+data_http.component; actionmsg = 'u-Deploy component(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for creating u-Deploy component was rejected'; #create user robot.respond /create user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> unique_password = PI:PASSWORD:<PASSWORD>END_PI); if stdout.udeploycreatereuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreatereuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreatereuser',message:msg.message.text,user_name:user_name,tckid:tckid,unique_password:PI:PASSWORD:<PASSWORD>END_PI} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreatereuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreatereuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else create_user.create_user user_name, unique_password, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 actionmsg = 'u-Deploy user(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreatereuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_user.create_user data_http.user_name, data_http.unique_password, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create user '+data_http.user_name actionmsg = 'u-Deploy user(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request to create u-Deploy user was rejected'; #delete user robot.respond /delete user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploydeletereuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploydeletereuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploydeletereuser',message:msg.message.text,user_name:user_name,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploydeletereuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploydeletereuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else delete_user.delete_user user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0] actionmsg = 'u-Deploy user(s) deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploydeletereuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); delete_user.delete_user data_http.user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'delete user '+data_http.user_name; actionmsg = 'u-Deploy user(s) deleted' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for deleting u-Deploy user was rejected'; #view user robot.respond /view user (.*)/i, (msg) -> user_name = msg.match[1]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployshowreuser.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployshowreuser.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeployshowreuser',message:msg.message.text,user_name:user_name} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployshowreuser.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeployshowreuser.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else info_user.info_user user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeployshowreuser', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); info_user.info_user data_http.user_name, udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 else robot.messageRoom data_http.userid, error setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for view user was rejected'; #create security token robot.respond /create security token/i, (msg) -> readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeploycreatetoken.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeploycreatetoken.admin,podIp:process.env.MY_POD_IP,callback_id: 'udeploycreatetoken',message:msg.message.text,tckid:tckid} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeploycreatetoken.admin, data); msg.send 'Your request is waiting for approval from '+stdout.udeploycreatetoken.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else unique_password = PI:PASSWORD:<PASSWORD>END_PI(PI:PASSWORD:<PASSWORD>END_PI); create_token.create_token udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" msg.send stdout; setTimeout (->index.passData stdout),1000 message = msg.match[0]; actionmsg = 'u-Deploy token(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else msg.send error; setTimeout (->index.passData error),1000 robot.router.post '/udeploycreatetoken', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); create_token.create_token udeploy_url, udeploy_user_id, udeploy_password, (error, stdout, stderr) -> if error == "null" robot.messageRoom data_http.userid, stdout; setTimeout (->index.passData stdout),1000 message = 'create security token'; actionmsg = 'u-Deploy token(s) created' statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; else robot.messageRoom data_http.userid, error; setTimeout (->index.passData error),1000 else robot.messageRoom data_http.userid, 'Your request for creating u-Deploy security token was rejected'; #deploy robot.respond /deploy (.*) process (.*) env (.*) version (.*) component (.*)/i, (msg) -> #deploy HelloWorldAppln process HelloWorldApplnProcess env Dev version 3.0 component HelloWorld #deploy <app_name> process <process_name> env <environment_name> version <version_number> component <component_name> app_name = msg.match[1]; app_process = msg.match[2]; env = msg.match[3]; version = msg.match[4]; component = msg.match[5]; readjson.readworkflow_coffee (error,stdout,stderr) -> if stdout.udeployappdeploy.workflowflag == true generate_id.getNextSequence (err,id) -> tckid=id payload={botname:process.env.HUBOT_NAME,username:msg.message.user.name,userid:msg.message.user.reply_to,approver:stdout.udeployappdeploy.admin,podIp:pod_ip,callback_id: 'udeployappdeploy',message:msg.message.text,tckid:tckid,app_name:app_name,app_process:app_process,env:env,version:version,component:component} data='Ticket Id : '+tckid+'\n Raised By: '+msg.message.user.name+'\n Command: '+msg.match[0]; robot.messageRoom(stdout.udeployappdeploy.admin, data); msg.send 'Your request is waiting for approval by '+stdout.udeployappdeploy.admin dataToInsert = {ticketid: tckid, payload: payload, "status":"","approvedby":""} generate_id.add_in_mongo dataToInsert else msg.reply 'Your process is in progress. Once it\'s done you\'ll be notified.'; app_deploy.app_deploy udeploy_url, udeploy_user_id, udeploy_password, app_name, app_process, env, version, component, (error, stdout, stderr) -> if error == "null" msg.reply stdout; else msg.reply error; robot.router.post '/udeployappdeploy', (request, response) -> data_http = if request.body.payload? then JSON.parse request.body.payload else request.body if data_http.action == 'Approved' robot.messageRoom data_http.userid, 'Your request is approved by '.concat(data_http.approver); app_deploy.app_deploy udeploy_url, udeploy_user_id, udeploy_password, data_http.app_name, data_http.app_process, data_http.env, data_http.version, data_http.component, (error, stdout, stderr) -> if error == "null" setTimeout (->index.passData stdout),1000 message = 'deploy '+data_http.app_name+'process '+data_http.app_process+'env '+data_http.env+'version '+data_http.version+'component '+data_http.component; actionmsg = 'u-Deploy application deployed'; statusmsg = 'Success'; index.wallData botname, message, actionmsg, statusmsg; robot.messageRoom data_http.userid, stdout; else setTimeout (->index.passData error),1000 robot.messageRoom data_http.userid, error; else robot.messageRoom data_http.userid, 'You are not authorized.';
[ { "context": "oud API client_id for this to work\n#\n# Author:\n# Joe Fleming (@w33ble)\n\nmodule.exports = (robot) ->\n robot.he", "end": 381, "score": 0.9998542666435242, "start": 370, "tag": "NAME", "value": "Joe Fleming" }, { "context": "nt_id for this to work\n#\n# Author:\n#...
src/scripts/soundcloud-info.coffee
contolini/hubot-scripts
1,450
# Description # Show sound information when Soundcloud URLs are seen. # # Dependencies: # None # # Configuration: # HUBOT_SOUNDCLOUD_CLIENTID: API client_id for SoundCloud # # Commands: # None # # Notes: # For text-based adapters like IRC. # Set the environment var HUBOT_SOUNDCLOUD_CLIENTID to your SoundCloud API client_id for this to work # # Author: # Joe Fleming (@w33ble) module.exports = (robot) -> robot.hear /(https?:\/\/(www\.)?soundcloud\.com\/)([\d\w\-\/]+)/i, (msg) -> fetchUrl msg, msg.match[0] fetchUrl = (msg, url) -> if not process.env.HUBOT_SOUNDCLOUD_CLIENTID return msg.reply "HUBOT_SOUNDCLOUD_CLIENTID must be defined, see http://developers.soundcloud.com/ to get one" msg.http("http://api.soundcloud.com/resolve.json?client_id=#{process.env.HUBOT_SOUNDCLOUD_CLIENTID}&url=#{url}") .query({ alt: 'json' }).get() (err, res, body) -> if res.statusCode is 302 data = JSON.parse(body) showInfo msg, data.location else if res.statusCode is 401 msg.reply "SoundCloud Error: API sent #{res.statusCode}, check your HUBOT_SOUNDCLOUD_CLIENTID setting" else msg.reply "SoundCloud Error: API resolve returned #{res.statusCode}" showInfo = (msg, url) -> msg.http(url) .query({ alt: 'json' }).get() (err, res, body) -> if res.statusCode is 200 data = JSON.parse(body) if data.kind in ['playlist', 'track'] tracks = if data.track_count? then "#{data.track_count} tracks, " else '' msg.send "SoundCloud #{data.kind}: #{data.user.username} - #{data.title} (#{tracks}#{getDuration(data.duration)})" else msg.reply "SoundCloud Error: API lookup returned #{res.statusCode}" getDuration = (time) -> time = time / 1000 h = time / 60 / 60 hours = Math.floor h m = (h - hours) * 60 mins = Math.floor m secs = Math.round Math.floor((m - mins) * 60) if hours > 0 return "#{hours}h#{mins}m#{secs}s" return "#{mins}m#{secs}s"
102873
# Description # Show sound information when Soundcloud URLs are seen. # # Dependencies: # None # # Configuration: # HUBOT_SOUNDCLOUD_CLIENTID: API client_id for SoundCloud # # Commands: # None # # Notes: # For text-based adapters like IRC. # Set the environment var HUBOT_SOUNDCLOUD_CLIENTID to your SoundCloud API client_id for this to work # # Author: # <NAME> (@w33ble) module.exports = (robot) -> robot.hear /(https?:\/\/(www\.)?soundcloud\.com\/)([\d\w\-\/]+)/i, (msg) -> fetchUrl msg, msg.match[0] fetchUrl = (msg, url) -> if not process.env.HUBOT_SOUNDCLOUD_CLIENTID return msg.reply "HUBOT_SOUNDCLOUD_CLIENTID must be defined, see http://developers.soundcloud.com/ to get one" msg.http("http://api.soundcloud.com/resolve.json?client_id=#{process.env.HUBOT_SOUNDCLOUD_CLIENTID}&url=#{url}") .query({ alt: 'json' }).get() (err, res, body) -> if res.statusCode is 302 data = JSON.parse(body) showInfo msg, data.location else if res.statusCode is 401 msg.reply "SoundCloud Error: API sent #{res.statusCode}, check your HUBOT_SOUNDCLOUD_CLIENTID setting" else msg.reply "SoundCloud Error: API resolve returned #{res.statusCode}" showInfo = (msg, url) -> msg.http(url) .query({ alt: 'json' }).get() (err, res, body) -> if res.statusCode is 200 data = JSON.parse(body) if data.kind in ['playlist', 'track'] tracks = if data.track_count? then "#{data.track_count} tracks, " else '' msg.send "SoundCloud #{data.kind}: #{data.user.username} - #{data.title} (#{tracks}#{getDuration(data.duration)})" else msg.reply "SoundCloud Error: API lookup returned #{res.statusCode}" getDuration = (time) -> time = time / 1000 h = time / 60 / 60 hours = Math.floor h m = (h - hours) * 60 mins = Math.floor m secs = Math.round Math.floor((m - mins) * 60) if hours > 0 return "#{hours}h#{mins}m#{secs}s" return "#{mins}m#{secs}s"
true
# Description # Show sound information when Soundcloud URLs are seen. # # Dependencies: # None # # Configuration: # HUBOT_SOUNDCLOUD_CLIENTID: API client_id for SoundCloud # # Commands: # None # # Notes: # For text-based adapters like IRC. # Set the environment var HUBOT_SOUNDCLOUD_CLIENTID to your SoundCloud API client_id for this to work # # Author: # PI:NAME:<NAME>END_PI (@w33ble) module.exports = (robot) -> robot.hear /(https?:\/\/(www\.)?soundcloud\.com\/)([\d\w\-\/]+)/i, (msg) -> fetchUrl msg, msg.match[0] fetchUrl = (msg, url) -> if not process.env.HUBOT_SOUNDCLOUD_CLIENTID return msg.reply "HUBOT_SOUNDCLOUD_CLIENTID must be defined, see http://developers.soundcloud.com/ to get one" msg.http("http://api.soundcloud.com/resolve.json?client_id=#{process.env.HUBOT_SOUNDCLOUD_CLIENTID}&url=#{url}") .query({ alt: 'json' }).get() (err, res, body) -> if res.statusCode is 302 data = JSON.parse(body) showInfo msg, data.location else if res.statusCode is 401 msg.reply "SoundCloud Error: API sent #{res.statusCode}, check your HUBOT_SOUNDCLOUD_CLIENTID setting" else msg.reply "SoundCloud Error: API resolve returned #{res.statusCode}" showInfo = (msg, url) -> msg.http(url) .query({ alt: 'json' }).get() (err, res, body) -> if res.statusCode is 200 data = JSON.parse(body) if data.kind in ['playlist', 'track'] tracks = if data.track_count? then "#{data.track_count} tracks, " else '' msg.send "SoundCloud #{data.kind}: #{data.user.username} - #{data.title} (#{tracks}#{getDuration(data.duration)})" else msg.reply "SoundCloud Error: API lookup returned #{res.statusCode}" getDuration = (time) -> time = time / 1000 h = time / 60 / 60 hours = Math.floor h m = (h - hours) * 60 mins = Math.floor m secs = Math.round Math.floor((m - mins) * 60) if hours > 0 return "#{hours}h#{mins}m#{secs}s" return "#{mins}m#{secs}s"
[ { "context": "# @author mrdoob / http://mrdoob.com/\n# @author aladjev.andrew@gma", "end": 16, "score": 0.9996793270111084, "start": 10, "tag": "USERNAME", "value": "mrdoob" }, { "context": "# @author mrdoob / http://mrdoob.com/\n# @author aladjev.andrew@gmail.com\n\n#= require new_s...
source/javascripts/new_src/loaders/image.coffee
andrew-aladev/three.js
0
# @author mrdoob / http://mrdoob.com/ # @author aladjev.andrew@gmail.com #= require new_src/loaders/loader class ImageLoader extends THREE.Loader load: (url, callback) -> image = new Image() image.onload = => callback image @onLoadComplete() image.crossOrigin = @crossOrigin image.src = path @onLoadStart() namespace "THREE", (exports) -> exports.ImageLoader = ImageLoader
54750
# @author mrdoob / http://mrdoob.com/ # @author <EMAIL> #= require new_src/loaders/loader class ImageLoader extends THREE.Loader load: (url, callback) -> image = new Image() image.onload = => callback image @onLoadComplete() image.crossOrigin = @crossOrigin image.src = path @onLoadStart() namespace "THREE", (exports) -> exports.ImageLoader = ImageLoader
true
# @author mrdoob / http://mrdoob.com/ # @author PI:EMAIL:<EMAIL>END_PI #= require new_src/loaders/loader class ImageLoader extends THREE.Loader load: (url, callback) -> image = new Image() image.onload = => callback image @onLoadComplete() image.crossOrigin = @crossOrigin image.src = path @onLoadStart() namespace "THREE", (exports) -> exports.ImageLoader = ImageLoader
[ { "context": "uire 'bluebird'\nYAML = require 'yamljs'\n\nidKey = 'id'\n\nmodule.exports =\n\n savedData: {}\n\n loadFixtur", "end": 150, "score": 0.9964660406112671, "start": 148, "tag": "KEY", "value": "id" } ]
src/fixtures-loader.coffee
louie007/loopback-component-fixturing
0
_ = require 'lodash' faker = require 'faker' fs = require 'fs' path = require 'path' Promise = require 'bluebird' YAML = require 'yamljs' idKey = 'id' module.exports = savedData: {} loadFixtures: (models, fixturesPath) -> # Get all yml files fixturePath = path.join process.cwd(), fixturesPath fixtureFolderContents = fs.readdirSync fixturePath fixtures = fixtureFolderContents.filter (fileName) -> fileName.match /\.yml$/ loadingFixturesPromises = [] # For each yml file _.each fixtures, (fixture) => fixtureData = YAML.load(fixturePath + fixture) loadingFixturesPromises.push @loadYamlFixture models, fixtureData Promise.all loadingFixturesPromises purgeDatabase: (models) -> purgeModelPromises = [] _.forEach models, (model) => if model.settings.base != 'Model' purgeModelPromises.push @purgeModel(model) Promise.all purgeModelPromises purgeModel: (model) -> new Promise (resolve, reject) -> model.destroyAll (err) -> reject err if err resolve() getRandomMatchingObject: (pattern) -> regex = new RegExp pattern objects = _.filter @savedData, (value, key) -> not _.isEmpty(key.match(regex)) return _.sample objects replaceReferenceInObjects: (object) -> new Promise (resolve, reject) => objIdRegex = new RegExp(/^@[^@]{1}[\w\d\s@,]+$/g) objIdArrayRegex = new RegExp(/^\[(@[^@]{1}[\w\d\s@,]+)\]$/g) objectRegex = new RegExp(/^@@[\w\d\s@,]+$/g) objArrayRegex = new RegExp(/^\[(@@[\w\d\s@,]+)\]$/g) _.each object, (value, key) => valueStr = value.toString() if valueStr != null && valueStr.match(objIdArrayRegex) vstr = valueStr.substring(1, valueStr.length - 1) refArray = vstr.split(',') referencedObjectArray = [] i = 0 while i < refArray.length ref = refArray[i] i++ identifier = ref.trim().substring(1) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject?[idKey] referencedObjectArray.push(referencedObject[idKey]) else reject '[ERROR] Please provide object for @' + identifier return object[key] = referencedObjectArray else if valueStr != null && valueStr.match(objIdRegex) identifier = value.substring(1) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject?[idKey] object[key] = referencedObject[idKey] else reject '[ERROR] Please provide object for @' + identifier else if valueStr != null && valueStr.match(objArrayRegex) vstr = valueStr.substring(1, valueStr.length - 1) refArray = vstr.split(',') referencedObjectArray = [] i = 0 while i < refArray.length ref = refArray[i] i++ identifier = ref.trim().substring(2) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject != null referencedObjectArray.push(referencedObject) else reject '[ERROR] Please provide object for @@' + identifier return object[key] = referencedObjectArray else if valueStr != null && valueStr.match(objectRegex) identifier = value.substring(2) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject != null object[key] = referencedObject else reject '[ERROR] Please provide object for @@' + identifier resolve object executeGenerators: (data) -> expandedData = {} _.each data, (object, identifier) -> # Try to identify "identifer{m..n}" pattern regex = /(\w+)\{(\d+)..(\d+)\}$/ match = identifier.match(regex) # If pattern detected if match?.length is 4 identifier = match[1] min = parseInt match[2] max = parseInt match[3] # Duplicate object ... for i in [min..max] expandedData[identifier + i] = _.clone object # ... and replace {@} occurences _.each object, (value, key) -> if typeof value is 'string' newValue = value.replace '{@}', i.toString() else newValue = value expandedData[identifier + i][key] = newValue else expandedData[identifier] = object return expandedData executeFaker: (data) -> _.each data, (object, identifier) -> _.each object, (value, key) -> try data[identifier][key] = faker.fake value catch e data[identifier][key] = value return data executeFunctions: (data) -> _.each data, (object, identifier) -> _.each object, (value, key) -> try fn = eval value data[identifier][key] = fn catch e return data applyHelpers: (data) -> # Repeat "identifier{a..b}" expandedData = @executeGenerators data # Execute faker {{name.lastname}} etc expandedData = @executeFaker expandedData # Exec function expandedData = @executeFunctions expandedData return expandedData loadYamlFixture: (models, fixtureData) -> fixtureData = _.map fixtureData, (data, index) -> fixtures: data name: index Promise.each fixtureData, (modelData) => modelData.fixtures = @applyHelpers modelData.fixtures modelFixtures = _.map modelData.fixtures, (data, index) -> object: data identifier: index Promise.each modelFixtures, (fixture) => @replaceReferenceInObjects fixture.object .then (object) -> models[modelData.name].create object .then (savedObject) => @savedData[fixture.identifier] = savedObject console.log "[#{modelData.name}] - #{fixture.identifier} " + "imported (id : #{savedObject?[idKey]})"
145626
_ = require 'lodash' faker = require 'faker' fs = require 'fs' path = require 'path' Promise = require 'bluebird' YAML = require 'yamljs' idKey = '<KEY>' module.exports = savedData: {} loadFixtures: (models, fixturesPath) -> # Get all yml files fixturePath = path.join process.cwd(), fixturesPath fixtureFolderContents = fs.readdirSync fixturePath fixtures = fixtureFolderContents.filter (fileName) -> fileName.match /\.yml$/ loadingFixturesPromises = [] # For each yml file _.each fixtures, (fixture) => fixtureData = YAML.load(fixturePath + fixture) loadingFixturesPromises.push @loadYamlFixture models, fixtureData Promise.all loadingFixturesPromises purgeDatabase: (models) -> purgeModelPromises = [] _.forEach models, (model) => if model.settings.base != 'Model' purgeModelPromises.push @purgeModel(model) Promise.all purgeModelPromises purgeModel: (model) -> new Promise (resolve, reject) -> model.destroyAll (err) -> reject err if err resolve() getRandomMatchingObject: (pattern) -> regex = new RegExp pattern objects = _.filter @savedData, (value, key) -> not _.isEmpty(key.match(regex)) return _.sample objects replaceReferenceInObjects: (object) -> new Promise (resolve, reject) => objIdRegex = new RegExp(/^@[^@]{1}[\w\d\s@,]+$/g) objIdArrayRegex = new RegExp(/^\[(@[^@]{1}[\w\d\s@,]+)\]$/g) objectRegex = new RegExp(/^@@[\w\d\s@,]+$/g) objArrayRegex = new RegExp(/^\[(@@[\w\d\s@,]+)\]$/g) _.each object, (value, key) => valueStr = value.toString() if valueStr != null && valueStr.match(objIdArrayRegex) vstr = valueStr.substring(1, valueStr.length - 1) refArray = vstr.split(',') referencedObjectArray = [] i = 0 while i < refArray.length ref = refArray[i] i++ identifier = ref.trim().substring(1) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject?[idKey] referencedObjectArray.push(referencedObject[idKey]) else reject '[ERROR] Please provide object for @' + identifier return object[key] = referencedObjectArray else if valueStr != null && valueStr.match(objIdRegex) identifier = value.substring(1) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject?[idKey] object[key] = referencedObject[idKey] else reject '[ERROR] Please provide object for @' + identifier else if valueStr != null && valueStr.match(objArrayRegex) vstr = valueStr.substring(1, valueStr.length - 1) refArray = vstr.split(',') referencedObjectArray = [] i = 0 while i < refArray.length ref = refArray[i] i++ identifier = ref.trim().substring(2) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject != null referencedObjectArray.push(referencedObject) else reject '[ERROR] Please provide object for @@' + identifier return object[key] = referencedObjectArray else if valueStr != null && valueStr.match(objectRegex) identifier = value.substring(2) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject != null object[key] = referencedObject else reject '[ERROR] Please provide object for @@' + identifier resolve object executeGenerators: (data) -> expandedData = {} _.each data, (object, identifier) -> # Try to identify "identifer{m..n}" pattern regex = /(\w+)\{(\d+)..(\d+)\}$/ match = identifier.match(regex) # If pattern detected if match?.length is 4 identifier = match[1] min = parseInt match[2] max = parseInt match[3] # Duplicate object ... for i in [min..max] expandedData[identifier + i] = _.clone object # ... and replace {@} occurences _.each object, (value, key) -> if typeof value is 'string' newValue = value.replace '{@}', i.toString() else newValue = value expandedData[identifier + i][key] = newValue else expandedData[identifier] = object return expandedData executeFaker: (data) -> _.each data, (object, identifier) -> _.each object, (value, key) -> try data[identifier][key] = faker.fake value catch e data[identifier][key] = value return data executeFunctions: (data) -> _.each data, (object, identifier) -> _.each object, (value, key) -> try fn = eval value data[identifier][key] = fn catch e return data applyHelpers: (data) -> # Repeat "identifier{a..b}" expandedData = @executeGenerators data # Execute faker {{name.lastname}} etc expandedData = @executeFaker expandedData # Exec function expandedData = @executeFunctions expandedData return expandedData loadYamlFixture: (models, fixtureData) -> fixtureData = _.map fixtureData, (data, index) -> fixtures: data name: index Promise.each fixtureData, (modelData) => modelData.fixtures = @applyHelpers modelData.fixtures modelFixtures = _.map modelData.fixtures, (data, index) -> object: data identifier: index Promise.each modelFixtures, (fixture) => @replaceReferenceInObjects fixture.object .then (object) -> models[modelData.name].create object .then (savedObject) => @savedData[fixture.identifier] = savedObject console.log "[#{modelData.name}] - #{fixture.identifier} " + "imported (id : #{savedObject?[idKey]})"
true
_ = require 'lodash' faker = require 'faker' fs = require 'fs' path = require 'path' Promise = require 'bluebird' YAML = require 'yamljs' idKey = 'PI:KEY:<KEY>END_PI' module.exports = savedData: {} loadFixtures: (models, fixturesPath) -> # Get all yml files fixturePath = path.join process.cwd(), fixturesPath fixtureFolderContents = fs.readdirSync fixturePath fixtures = fixtureFolderContents.filter (fileName) -> fileName.match /\.yml$/ loadingFixturesPromises = [] # For each yml file _.each fixtures, (fixture) => fixtureData = YAML.load(fixturePath + fixture) loadingFixturesPromises.push @loadYamlFixture models, fixtureData Promise.all loadingFixturesPromises purgeDatabase: (models) -> purgeModelPromises = [] _.forEach models, (model) => if model.settings.base != 'Model' purgeModelPromises.push @purgeModel(model) Promise.all purgeModelPromises purgeModel: (model) -> new Promise (resolve, reject) -> model.destroyAll (err) -> reject err if err resolve() getRandomMatchingObject: (pattern) -> regex = new RegExp pattern objects = _.filter @savedData, (value, key) -> not _.isEmpty(key.match(regex)) return _.sample objects replaceReferenceInObjects: (object) -> new Promise (resolve, reject) => objIdRegex = new RegExp(/^@[^@]{1}[\w\d\s@,]+$/g) objIdArrayRegex = new RegExp(/^\[(@[^@]{1}[\w\d\s@,]+)\]$/g) objectRegex = new RegExp(/^@@[\w\d\s@,]+$/g) objArrayRegex = new RegExp(/^\[(@@[\w\d\s@,]+)\]$/g) _.each object, (value, key) => valueStr = value.toString() if valueStr != null && valueStr.match(objIdArrayRegex) vstr = valueStr.substring(1, valueStr.length - 1) refArray = vstr.split(',') referencedObjectArray = [] i = 0 while i < refArray.length ref = refArray[i] i++ identifier = ref.trim().substring(1) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject?[idKey] referencedObjectArray.push(referencedObject[idKey]) else reject '[ERROR] Please provide object for @' + identifier return object[key] = referencedObjectArray else if valueStr != null && valueStr.match(objIdRegex) identifier = value.substring(1) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject?[idKey] object[key] = referencedObject[idKey] else reject '[ERROR] Please provide object for @' + identifier else if valueStr != null && valueStr.match(objArrayRegex) vstr = valueStr.substring(1, valueStr.length - 1) refArray = vstr.split(',') referencedObjectArray = [] i = 0 while i < refArray.length ref = refArray[i] i++ identifier = ref.trim().substring(2) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject != null referencedObjectArray.push(referencedObject) else reject '[ERROR] Please provide object for @@' + identifier return object[key] = referencedObjectArray else if valueStr != null && valueStr.match(objectRegex) identifier = value.substring(2) referencedObject = @getRandomMatchingObject "^"+identifier+"$" if referencedObject != null object[key] = referencedObject else reject '[ERROR] Please provide object for @@' + identifier resolve object executeGenerators: (data) -> expandedData = {} _.each data, (object, identifier) -> # Try to identify "identifer{m..n}" pattern regex = /(\w+)\{(\d+)..(\d+)\}$/ match = identifier.match(regex) # If pattern detected if match?.length is 4 identifier = match[1] min = parseInt match[2] max = parseInt match[3] # Duplicate object ... for i in [min..max] expandedData[identifier + i] = _.clone object # ... and replace {@} occurences _.each object, (value, key) -> if typeof value is 'string' newValue = value.replace '{@}', i.toString() else newValue = value expandedData[identifier + i][key] = newValue else expandedData[identifier] = object return expandedData executeFaker: (data) -> _.each data, (object, identifier) -> _.each object, (value, key) -> try data[identifier][key] = faker.fake value catch e data[identifier][key] = value return data executeFunctions: (data) -> _.each data, (object, identifier) -> _.each object, (value, key) -> try fn = eval value data[identifier][key] = fn catch e return data applyHelpers: (data) -> # Repeat "identifier{a..b}" expandedData = @executeGenerators data # Execute faker {{name.lastname}} etc expandedData = @executeFaker expandedData # Exec function expandedData = @executeFunctions expandedData return expandedData loadYamlFixture: (models, fixtureData) -> fixtureData = _.map fixtureData, (data, index) -> fixtures: data name: index Promise.each fixtureData, (modelData) => modelData.fixtures = @applyHelpers modelData.fixtures modelFixtures = _.map modelData.fixtures, (data, index) -> object: data identifier: index Promise.each modelFixtures, (fixture) => @replaceReferenceInObjects fixture.object .then (object) -> models[modelData.name].create object .then (savedObject) => @savedData[fixture.identifier] = savedObject console.log "[#{modelData.name}] - #{fixture.identifier} " + "imported (id : #{savedObject?[idKey]})"
[ { "context": "der: ->\r\n patients = [\r\n ['301', '王大锤', '男']\r\n ['302', '张本煜', '男']\r\n ", "end": 2185, "score": 0.9998329877853394, "start": 2182, "tag": "NAME", "value": "王大锤" }, { "context": " ['301', '王大锤', '男']\r\n ['302', '...
src/base/coffee/zd-patient-list-page.coffee
ben7th/zdmockup
0
@TijianSelectPage = React.createClass render: -> <div className='gh-page'> <div className='ui container'> <h2 className='ui header topbar'> <TopbarBack href='index.html' /> <span>体检</span> </h2> <div className='select'> <div className="ui cards three"> <a className="card" href='zd-patient-list.html'> <div className="content"> <div className='yunwen' /> <div className="ui header"><span>患者队列</span></div> </div> </a> <a className="card" href='tijian-paiban.html'> <div className="content"> <div className='yunwen' /> <div className="ui header"><span>我的排班</span></div> </div> </a> </div> </div> </div> </div> @ZDPatientListPage = React.createClass render: -> <div className='zd-patient-list-page'> <div className='ui container'> <ZDPatientListPage.Dates /> <ZDPatientListPage.List /> </div> </div> statics: Dates: React.createClass render: -> dates = [ ['12-08,星期二,上午', '8/10'] ['12-08,星期二,下午', '14/20'] ['12-09,星期三,上午', '2/10'] ['12-09,星期三,下午', '1/20'] ] <div className='dates'> <h2 className='ui header topbar'> <TopbarBack href='tijian.html' /> 就诊日期 </h2> <div className='dlist'> { for date, idx in dates klass = new ClassName { 'ditem': true 'active': idx == 0 } <a key={idx} className={klass} href='javascript:;'> <span>{date[0]}</span> <span className='persons-number'> <span>{date[1]}</span> <i className='icon chevron right' /> </span> </a> } </div> </div> List: React.createClass render: -> patients = [ ['301', '王大锤', '男'] ['302', '张本煜', '男'] ['303', '小爱', '女'] ['304', '孔连顺', '女'] ['305', '刘循子墨', '男'] ['306', '易小星', '男'] ['307', '至尊玉', '男'] ['308', '葛布', '女'] ] <div className='list'> <h2 className='ui header topbar'>患者队列</h2> <div className='plist'> { for patient, idx in patients klass = new ClassName { 'pitem': true } <a key={idx} className={klass} href='zd-patient-info.html'> <span className='ui label'>{patient[0]}</span> <span> - </span> <span>{patient[1]}</span> <span> - </span> <span>{patient[2]}</span> <span className='tail'> <i className='icon chevron right' /> </span> </a> } </div> </div>
216304
@TijianSelectPage = React.createClass render: -> <div className='gh-page'> <div className='ui container'> <h2 className='ui header topbar'> <TopbarBack href='index.html' /> <span>体检</span> </h2> <div className='select'> <div className="ui cards three"> <a className="card" href='zd-patient-list.html'> <div className="content"> <div className='yunwen' /> <div className="ui header"><span>患者队列</span></div> </div> </a> <a className="card" href='tijian-paiban.html'> <div className="content"> <div className='yunwen' /> <div className="ui header"><span>我的排班</span></div> </div> </a> </div> </div> </div> </div> @ZDPatientListPage = React.createClass render: -> <div className='zd-patient-list-page'> <div className='ui container'> <ZDPatientListPage.Dates /> <ZDPatientListPage.List /> </div> </div> statics: Dates: React.createClass render: -> dates = [ ['12-08,星期二,上午', '8/10'] ['12-08,星期二,下午', '14/20'] ['12-09,星期三,上午', '2/10'] ['12-09,星期三,下午', '1/20'] ] <div className='dates'> <h2 className='ui header topbar'> <TopbarBack href='tijian.html' /> 就诊日期 </h2> <div className='dlist'> { for date, idx in dates klass = new ClassName { 'ditem': true 'active': idx == 0 } <a key={idx} className={klass} href='javascript:;'> <span>{date[0]}</span> <span className='persons-number'> <span>{date[1]}</span> <i className='icon chevron right' /> </span> </a> } </div> </div> List: React.createClass render: -> patients = [ ['301', '<NAME>', '男'] ['302', '<NAME>', '男'] ['303', '小爱', '女'] ['304', '孔连顺', '女'] ['305', '<NAME>', '男'] ['306', '<NAME>', '男'] ['307', '<NAME>', '男'] ['308', '<NAME>', '女'] ] <div className='list'> <h2 className='ui header topbar'>患者队列</h2> <div className='plist'> { for patient, idx in patients klass = new ClassName { 'pitem': true } <a key={idx} className={klass} href='zd-patient-info.html'> <span className='ui label'>{patient[0]}</span> <span> - </span> <span>{patient[1]}</span> <span> - </span> <span>{patient[2]}</span> <span className='tail'> <i className='icon chevron right' /> </span> </a> } </div> </div>
true
@TijianSelectPage = React.createClass render: -> <div className='gh-page'> <div className='ui container'> <h2 className='ui header topbar'> <TopbarBack href='index.html' /> <span>体检</span> </h2> <div className='select'> <div className="ui cards three"> <a className="card" href='zd-patient-list.html'> <div className="content"> <div className='yunwen' /> <div className="ui header"><span>患者队列</span></div> </div> </a> <a className="card" href='tijian-paiban.html'> <div className="content"> <div className='yunwen' /> <div className="ui header"><span>我的排班</span></div> </div> </a> </div> </div> </div> </div> @ZDPatientListPage = React.createClass render: -> <div className='zd-patient-list-page'> <div className='ui container'> <ZDPatientListPage.Dates /> <ZDPatientListPage.List /> </div> </div> statics: Dates: React.createClass render: -> dates = [ ['12-08,星期二,上午', '8/10'] ['12-08,星期二,下午', '14/20'] ['12-09,星期三,上午', '2/10'] ['12-09,星期三,下午', '1/20'] ] <div className='dates'> <h2 className='ui header topbar'> <TopbarBack href='tijian.html' /> 就诊日期 </h2> <div className='dlist'> { for date, idx in dates klass = new ClassName { 'ditem': true 'active': idx == 0 } <a key={idx} className={klass} href='javascript:;'> <span>{date[0]}</span> <span className='persons-number'> <span>{date[1]}</span> <i className='icon chevron right' /> </span> </a> } </div> </div> List: React.createClass render: -> patients = [ ['301', 'PI:NAME:<NAME>END_PI', '男'] ['302', 'PI:NAME:<NAME>END_PI', '男'] ['303', '小爱', '女'] ['304', '孔连顺', '女'] ['305', 'PI:NAME:<NAME>END_PI', '男'] ['306', 'PI:NAME:<NAME>END_PI', '男'] ['307', 'PI:NAME:<NAME>END_PI', '男'] ['308', 'PI:NAME:<NAME>END_PI', '女'] ] <div className='list'> <h2 className='ui header topbar'>患者队列</h2> <div className='plist'> { for patient, idx in patients klass = new ClassName { 'pitem': true } <a key={idx} className={klass} href='zd-patient-info.html'> <span className='ui label'>{patient[0]}</span> <span> - </span> <span>{patient[1]}</span> <span> - </span> <span>{patient[2]}</span> <span className='tail'> <i className='icon chevron right' /> </span> </a> } </div> </div>
[ { "context": "\":\n colors:\n macro: \"#96b5b4\"\n token: \"#8fa1b3\"\n \"atom-terminal-panel\": {}\n build:\n panelVi", "end": 258, "score": 0.8230383992195129, "start": 250, "tag": "KEY", "value": "\"#8fa1b3" }, { "context": " \"*racertmp*\"\n ]\n proje...
atom/config.cson
9999years/dotfiles-1
16
"*": "atom-beautify": _analyticsUserId: "d37d4d49-4d1b-41ef-8126-cd6a27f1ea80" "atom-ctags": extraTagFiles: "tags" "atom-ide-ui": "atom-ide-diagnostics-ui": {} "atom-language-rust": colors: macro: "#96b5b4" token: "#8fa1b3" "atom-terminal-panel": {} build: panelVisibility: "Show on Error" saveOnBuild: true scrollOnError: true "build-cargo": backtraceType: "Compact" extCommands: cargoCheck: true cargoClippy: true openDocs: true "cargo-test-runner": {} core: closeEmptyWindows: false disabledPackages: [ "tidy-markdown" "clojure-eval-in-repl" "r-exec" "scala-worksheet" "atom-live-grammar-reload" "symbols-view" "nrepl" "open-terminal-here" "cargo-test-runner" "sbt" "wrap-guide" "linter-write-good" "typewriter" "docblockr" "rust-api-docs-helper" "tokamak" "language-rust" "linter" "atom-language-rust" "language-scala" "rustsym" ] ignoredNames: [ ".git" ".hg" ".svn" ".DS_Store" "Thumbs.db" ".gradle" ".idea" ".iml" ".ipr" ".iws" ".sublime-workspace" ".pioenvs" ".piolibdeps" ".clang_complete" ".gcc-flags.json" "*racertmp*" ] projectHome: "/Users/eliza/Code" telemetryConsent: "limited" themes: [ "one-dark-ui" "fairygloss" ] titleBar: "custom" docblockr: align_tags: "shallow" auto_add_method_tag: true deep_indent: true editor: backUpBeforeSaving: true fontFamily: "Iosevka" invisibles: {} showIndentGuide: true showInvisibles: true softWrap: true softWrapAtPreferredLineLength: true tabLength: 4 zoomFontWhenCtrlScrolling: true "exception-reporting": userId: "255e7065-c317-52d7-dd5b-8b9a82ef3345" "gist-it": {} "git-plus": general: _analyticsUserId: "3987b4b2-c9a8-4200-b06f-5d9bcca4a6b8" "haskell-ghc-mod": ghcModPath: "/Users/eliza/.cabal/bin/ghc-mod" "ide-haskell": {} latex: enableShellEscape: true engine: "xelatex" opener: "preview" texPath: "/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/" latexer: {} linter: {} "linter-chktex": executablePath: "/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/chktex" "linter-rust": cargoCommand: "check" cargoPath: "/Users/eliza/.cargo/bin/cargo" jobsNumber: 4 rustcBuildTest: true rustcPath: "/Users/eliza/.cargo/bin/rustc" "linter-scalac": scalacExecutablePath: "/usr/local/bin/scalac" "linter-ui-default": panelHeight: 69 showPanel: true "linter-write-good": {} "markdown-preview": {} "markdown-preview-katex": {} "markdown-preview-opener": {} "markdown-preview-plus": {} "markdown-writer": {} "merge-conflicts": {} metrics: userId: "a7630cb430c5986364488e28ca0c77d2b0210374" minimap: useHardwareAcceleration: false "one-dark-ui": tabSizing: "Even" "open-terminal-here": {} "platformio-ide": showHomeScreen: false "platformio-ide-terminal": ansiColors: normal: black: "#657280" blue: "#8fa1b2" cyan: "#96b5b4" green: "#98be8d" magenta: "#b48fa8" red: "#c16069" white: "#c0c5ce" yellow: "#ebca8b" zBright: brightBlack: "#657280" brightBlue: "#8fa1b2" brightCyan: "#96b5b4" brightGreen: "#98be8d" brightMagenta: "#b48fa8" brightRed: "#c16069" brightYellow: "#ebca8b" core: {} iconColors: blue: "#8fa1b2" cyan: "#98be8d" green: "#98be8d" magenta: "#b48fa8" orange: "#f69d5c" red: "#c16069" yellow: "#ebca8b" style: fontFamily: "Pragmata Pro" toggles: autoClose: true "project-quick-open": {} racer: cargoHome: "/Users/eliza/.cargo/" rustSrcPath: "/usr/local/src/rust/src" "spell-check": {} "symbols-tree-view": autoHide: true tablr: {} tabs: enableVcsColoring: true tabScrolling: true usePreviewTabs: true "terminal-panel": {} tokamak: binaryDetection: false cargoHomePath: "/Users/eliza/.cargo/" rustcBinPath: "/Users/eliza/.cargo/bin/rustc" toolBinPath: "/Users/eliza/.cargo/bin/rustup" "tokamak-terminal": ansiColors: normal: black: "#657280" blue: "#8fa1b2" cyan: "#96b5b4" green: "#98be8d" magenta: "#b48fa8" red: "#c16069" white: "#c0c5ce" yellow: "#ebca8b" zBright: brightBlack: "#657280" brightBlue: "#8fa1b2" brightCyan: "#96b5b4" brightGreen: "#98be8d" brightMagenta: "#b48fa8" brightRed: "#c16069" brightYellow: "#ebca8b" iconColors: blue: "#8fa1b2" cyan: "#98be8d" green: "#98be8d" magenta: "#b48fa8" orange: "#f69d5c" red: "#c16069" yellow: "#ebca8b" style: fontFamily: "Pragmata Pro" toggles: autoClose: true "tool-bar": iconSize: "12px" visible: true "travis-ci-status": personalAccessToken: "96bfb2300560e726f0c2c9f19b482ec30eee5d6a" useTravisCiPro: true "tree-view": hideIgnoredNames: true hideVcsIgnoredFiles: true typewriter: scopes: "text.md,source.gfm,text.html,mediawiki,text.tex.latex,text.tex.latex.beamer" wakatime: apikey: "Saved in your ~/.wakatime.cfg file" ignore: [ "^/var/" "^/tmp/" "^/private/" "COMMIT_EDITMSG$" "PULLREQ_EDITMSG$" "MERGE_MSG$" ] "wakatime-hidden": lastInit: 1485436107 welcome: showOnStartup: false ".asm.source.x86_64": editor: tabLength: 4 ".cabal.source": editor: preferredLineLength: 120 ".diff.source": editor: preferredLineLength: 120 ".haskell.latex.tex.text": editor: preferredLineLength: 120 ".haskell.source": editor: preferredLineLength: 120 ".ini.source": editor: preferredLineLength: 120 ".json.source": editor: tabLength: 4 ".latex.tex.text": editor: autoIndent: true ".processing.source": editor: tabLength: 2 ".rust.source": editor: autoIndent: true preferredLineLength: 80 ".scala.source": editor: preferredLineLength: 80 tabLength: 2 ".source.yaml": editor: preferredLineLength: 120 tabLength: 2 "source.gfm": editor: softWrap: true "text.latex.tex": editor: softWrap: true
77570
"*": "atom-beautify": _analyticsUserId: "d37d4d49-4d1b-41ef-8126-cd6a27f1ea80" "atom-ctags": extraTagFiles: "tags" "atom-ide-ui": "atom-ide-diagnostics-ui": {} "atom-language-rust": colors: macro: "#96b5b4" token: <KEY>" "atom-terminal-panel": {} build: panelVisibility: "Show on Error" saveOnBuild: true scrollOnError: true "build-cargo": backtraceType: "Compact" extCommands: cargoCheck: true cargoClippy: true openDocs: true "cargo-test-runner": {} core: closeEmptyWindows: false disabledPackages: [ "tidy-markdown" "clojure-eval-in-repl" "r-exec" "scala-worksheet" "atom-live-grammar-reload" "symbols-view" "nrepl" "open-terminal-here" "cargo-test-runner" "sbt" "wrap-guide" "linter-write-good" "typewriter" "docblockr" "rust-api-docs-helper" "tokamak" "language-rust" "linter" "atom-language-rust" "language-scala" "rustsym" ] ignoredNames: [ ".git" ".hg" ".svn" ".DS_Store" "Thumbs.db" ".gradle" ".idea" ".iml" ".ipr" ".iws" ".sublime-workspace" ".pioenvs" ".piolibdeps" ".clang_complete" ".gcc-flags.json" "*racertmp*" ] projectHome: "/Users/eliza/Code" telemetryConsent: "limited" themes: [ "one-dark-ui" "fairygloss" ] titleBar: "custom" docblockr: align_tags: "shallow" auto_add_method_tag: true deep_indent: true editor: backUpBeforeSaving: true fontFamily: "Iosevka" invisibles: {} showIndentGuide: true showInvisibles: true softWrap: true softWrapAtPreferredLineLength: true tabLength: 4 zoomFontWhenCtrlScrolling: true "exception-reporting": userId: "255e7065-c317-52d7-dd5b-8b9a82ef3345" "gist-it": {} "git-plus": general: _analyticsUserId: "3987b4b2-c9a8-4200-b06f-5d9bcca4a6b8" "haskell-ghc-mod": ghcModPath: "/Users/eliza/.cabal/bin/ghc-mod" "ide-haskell": {} latex: enableShellEscape: true engine: "xelatex" opener: "preview" texPath: "/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/" latexer: {} linter: {} "linter-chktex": executablePath: "/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/chktex" "linter-rust": cargoCommand: "check" cargoPath: "/Users/eliza/.cargo/bin/cargo" jobsNumber: 4 rustcBuildTest: true rustcPath: "/Users/eliza/.cargo/bin/rustc" "linter-scalac": scalacExecutablePath: "/usr/local/bin/scalac" "linter-ui-default": panelHeight: 69 showPanel: true "linter-write-good": {} "markdown-preview": {} "markdown-preview-katex": {} "markdown-preview-opener": {} "markdown-preview-plus": {} "markdown-writer": {} "merge-conflicts": {} metrics: userId: "a7630cb430c5986364488e28ca0c77d2b0210374" minimap: useHardwareAcceleration: false "one-dark-ui": tabSizing: "Even" "open-terminal-here": {} "platformio-ide": showHomeScreen: false "platformio-ide-terminal": ansiColors: normal: black: "#657280" blue: "#8fa1b2" cyan: "#96b5b4" green: "#98be8d" magenta: "#b48fa8" red: "#c16069" white: "#c0c5ce" yellow: "#ebca8b" zBright: brightBlack: "#657280" brightBlue: "#8fa1b2" brightCyan: "#96b5b4" brightGreen: "#98be8d" brightMagenta: "#b48fa8" brightRed: "#c16069" brightYellow: "#ebca8b" core: {} iconColors: blue: "#8fa1b2" cyan: "#98be8d" green: "#98be8d" magenta: "#b48fa8" orange: "#f69d5c" red: "#c16069" yellow: "#ebca8b" style: fontFamily: "Pragmata Pro" toggles: autoClose: true "project-quick-open": {} racer: cargoHome: "/Users/eliza/.cargo/" rustSrcPath: "/usr/local/src/rust/src" "spell-check": {} "symbols-tree-view": autoHide: true tablr: {} tabs: enableVcsColoring: true tabScrolling: true usePreviewTabs: true "terminal-panel": {} tokamak: binaryDetection: false cargoHomePath: "/Users/eliza/.cargo/" rustcBinPath: "/Users/eliza/.cargo/bin/rustc" toolBinPath: "/Users/eliza/.cargo/bin/rustup" "tokamak-terminal": ansiColors: normal: black: "#657280" blue: "#8fa1b2" cyan: "#96b5b4" green: "#98be8d" magenta: "#b48fa8" red: "#c16069" white: "#c0c5ce" yellow: "#ebca8b" zBright: brightBlack: "#657280" brightBlue: "#8fa1b2" brightCyan: "#96b5b4" brightGreen: "#98be8d" brightMagenta: "#b48fa8" brightRed: "#c16069" brightYellow: "#ebca8b" iconColors: blue: "#8fa1b2" cyan: "#98be8d" green: "#98be8d" magenta: "#b48fa8" orange: "#f69d5c" red: "#c16069" yellow: "#ebca8b" style: fontFamily: "Pragmata Pro" toggles: autoClose: true "tool-bar": iconSize: "12px" visible: true "travis-ci-status": personalAccessToken: "<KEY>" useTravisCiPro: true "tree-view": hideIgnoredNames: true hideVcsIgnoredFiles: true typewriter: scopes: "text.md,source.gfm,text.html,mediawiki,text.tex.latex,text.tex.latex.beamer" wakatime: apikey: "Saved in your ~/.wakatime.cfg file" ignore: [ "^/var/" "^/tmp/" "^/private/" "COMMIT_EDITMSG$" "PULLREQ_EDITMSG$" "MERGE_MSG$" ] "wakatime-hidden": lastInit: 1485436107 welcome: showOnStartup: false ".asm.source.x86_64": editor: tabLength: 4 ".cabal.source": editor: preferredLineLength: 120 ".diff.source": editor: preferredLineLength: 120 ".haskell.latex.tex.text": editor: preferredLineLength: 120 ".haskell.source": editor: preferredLineLength: 120 ".ini.source": editor: preferredLineLength: 120 ".json.source": editor: tabLength: 4 ".latex.tex.text": editor: autoIndent: true ".processing.source": editor: tabLength: 2 ".rust.source": editor: autoIndent: true preferredLineLength: 80 ".scala.source": editor: preferredLineLength: 80 tabLength: 2 ".source.yaml": editor: preferredLineLength: 120 tabLength: 2 "source.gfm": editor: softWrap: true "text.latex.tex": editor: softWrap: true
true
"*": "atom-beautify": _analyticsUserId: "d37d4d49-4d1b-41ef-8126-cd6a27f1ea80" "atom-ctags": extraTagFiles: "tags" "atom-ide-ui": "atom-ide-diagnostics-ui": {} "atom-language-rust": colors: macro: "#96b5b4" token: PI:KEY:<KEY>END_PI" "atom-terminal-panel": {} build: panelVisibility: "Show on Error" saveOnBuild: true scrollOnError: true "build-cargo": backtraceType: "Compact" extCommands: cargoCheck: true cargoClippy: true openDocs: true "cargo-test-runner": {} core: closeEmptyWindows: false disabledPackages: [ "tidy-markdown" "clojure-eval-in-repl" "r-exec" "scala-worksheet" "atom-live-grammar-reload" "symbols-view" "nrepl" "open-terminal-here" "cargo-test-runner" "sbt" "wrap-guide" "linter-write-good" "typewriter" "docblockr" "rust-api-docs-helper" "tokamak" "language-rust" "linter" "atom-language-rust" "language-scala" "rustsym" ] ignoredNames: [ ".git" ".hg" ".svn" ".DS_Store" "Thumbs.db" ".gradle" ".idea" ".iml" ".ipr" ".iws" ".sublime-workspace" ".pioenvs" ".piolibdeps" ".clang_complete" ".gcc-flags.json" "*racertmp*" ] projectHome: "/Users/eliza/Code" telemetryConsent: "limited" themes: [ "one-dark-ui" "fairygloss" ] titleBar: "custom" docblockr: align_tags: "shallow" auto_add_method_tag: true deep_indent: true editor: backUpBeforeSaving: true fontFamily: "Iosevka" invisibles: {} showIndentGuide: true showInvisibles: true softWrap: true softWrapAtPreferredLineLength: true tabLength: 4 zoomFontWhenCtrlScrolling: true "exception-reporting": userId: "255e7065-c317-52d7-dd5b-8b9a82ef3345" "gist-it": {} "git-plus": general: _analyticsUserId: "3987b4b2-c9a8-4200-b06f-5d9bcca4a6b8" "haskell-ghc-mod": ghcModPath: "/Users/eliza/.cabal/bin/ghc-mod" "ide-haskell": {} latex: enableShellEscape: true engine: "xelatex" opener: "preview" texPath: "/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/" latexer: {} linter: {} "linter-chktex": executablePath: "/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/chktex" "linter-rust": cargoCommand: "check" cargoPath: "/Users/eliza/.cargo/bin/cargo" jobsNumber: 4 rustcBuildTest: true rustcPath: "/Users/eliza/.cargo/bin/rustc" "linter-scalac": scalacExecutablePath: "/usr/local/bin/scalac" "linter-ui-default": panelHeight: 69 showPanel: true "linter-write-good": {} "markdown-preview": {} "markdown-preview-katex": {} "markdown-preview-opener": {} "markdown-preview-plus": {} "markdown-writer": {} "merge-conflicts": {} metrics: userId: "a7630cb430c5986364488e28ca0c77d2b0210374" minimap: useHardwareAcceleration: false "one-dark-ui": tabSizing: "Even" "open-terminal-here": {} "platformio-ide": showHomeScreen: false "platformio-ide-terminal": ansiColors: normal: black: "#657280" blue: "#8fa1b2" cyan: "#96b5b4" green: "#98be8d" magenta: "#b48fa8" red: "#c16069" white: "#c0c5ce" yellow: "#ebca8b" zBright: brightBlack: "#657280" brightBlue: "#8fa1b2" brightCyan: "#96b5b4" brightGreen: "#98be8d" brightMagenta: "#b48fa8" brightRed: "#c16069" brightYellow: "#ebca8b" core: {} iconColors: blue: "#8fa1b2" cyan: "#98be8d" green: "#98be8d" magenta: "#b48fa8" orange: "#f69d5c" red: "#c16069" yellow: "#ebca8b" style: fontFamily: "Pragmata Pro" toggles: autoClose: true "project-quick-open": {} racer: cargoHome: "/Users/eliza/.cargo/" rustSrcPath: "/usr/local/src/rust/src" "spell-check": {} "symbols-tree-view": autoHide: true tablr: {} tabs: enableVcsColoring: true tabScrolling: true usePreviewTabs: true "terminal-panel": {} tokamak: binaryDetection: false cargoHomePath: "/Users/eliza/.cargo/" rustcBinPath: "/Users/eliza/.cargo/bin/rustc" toolBinPath: "/Users/eliza/.cargo/bin/rustup" "tokamak-terminal": ansiColors: normal: black: "#657280" blue: "#8fa1b2" cyan: "#96b5b4" green: "#98be8d" magenta: "#b48fa8" red: "#c16069" white: "#c0c5ce" yellow: "#ebca8b" zBright: brightBlack: "#657280" brightBlue: "#8fa1b2" brightCyan: "#96b5b4" brightGreen: "#98be8d" brightMagenta: "#b48fa8" brightRed: "#c16069" brightYellow: "#ebca8b" iconColors: blue: "#8fa1b2" cyan: "#98be8d" green: "#98be8d" magenta: "#b48fa8" orange: "#f69d5c" red: "#c16069" yellow: "#ebca8b" style: fontFamily: "Pragmata Pro" toggles: autoClose: true "tool-bar": iconSize: "12px" visible: true "travis-ci-status": personalAccessToken: "PI:KEY:<KEY>END_PI" useTravisCiPro: true "tree-view": hideIgnoredNames: true hideVcsIgnoredFiles: true typewriter: scopes: "text.md,source.gfm,text.html,mediawiki,text.tex.latex,text.tex.latex.beamer" wakatime: apikey: "Saved in your ~/.wakatime.cfg file" ignore: [ "^/var/" "^/tmp/" "^/private/" "COMMIT_EDITMSG$" "PULLREQ_EDITMSG$" "MERGE_MSG$" ] "wakatime-hidden": lastInit: 1485436107 welcome: showOnStartup: false ".asm.source.x86_64": editor: tabLength: 4 ".cabal.source": editor: preferredLineLength: 120 ".diff.source": editor: preferredLineLength: 120 ".haskell.latex.tex.text": editor: preferredLineLength: 120 ".haskell.source": editor: preferredLineLength: 120 ".ini.source": editor: preferredLineLength: 120 ".json.source": editor: tabLength: 4 ".latex.tex.text": editor: autoIndent: true ".processing.source": editor: tabLength: 2 ".rust.source": editor: autoIndent: true preferredLineLength: 80 ".scala.source": editor: preferredLineLength: 80 tabLength: 2 ".source.yaml": editor: preferredLineLength: 120 tabLength: 2 "source.gfm": editor: softWrap: true "text.latex.tex": editor: softWrap: true
[ { "context": "art of butterfly\n#\n# butterfly Copyright (C) 2014 Florian Mounier\n# This program is free software: you can redistri", "end": 106, "score": 0.9998855590820312, "start": 91, "tag": "NAME", "value": "Florian Mounier" }, { "context": "forked from term.js\n#\n# Copyrig...
butterfly/coffees/term.coffee
binRick/thc.digital
0
# *-* coding: utf-8 *-* # This file is part of butterfly # # butterfly Copyright (C) 2014 Florian Mounier # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # This has been forked from term.js # # Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) # https://github.com/chjj/term.js # # # which has been forked from jslinux # # Copyright (c) 2011 Fabrice Bellard # http://bellard.org/jslinux/ cancel = (ev) -> ev.preventDefault() if ev.preventDefault ev.stopPropagation() if ev.stopPropagation ev.cancelBubble = true false s = 0 State = normal: s++ escaped: s++ csi: s++ osc: s++ charset: s++ dcs: s++ ignore: s++ class Terminal constructor: (@parent, @out, @ctl=->) -> # Global elements @document = @parent.ownerDocument @body = @document.getElementsByTagName('body')[0] @htmlEscapesEnabled = @body.getAttribute('data-allow-html') is 'yes' @forceWidth = @body.getAttribute( 'data-force-unicode-width') is 'yes' # Main terminal element @body.className = 'terminal focus' @body.style.outline = 'none' @body.setAttribute 'tabindex', 0 @body.setAttribute 'spellcheck', 'false' # Adding one line to compute char size div = @document.createElement('div') div.className = 'line' @body.appendChild(div) @children = [div] @computeCharSize() @cols = Math.floor(@body.clientWidth / @charSize.width) @rows = Math.floor(window.innerHeight / @charSize.height) px = window.innerHeight % @charSize.height @body.style['padding-bottom'] = "#{px}px" @scrollback = 1000000 @buffSize = 100000 @visualBell = 100 @convertEol = false @termName = 'xterm' @cursorBlink = true @cursorState = 0 @stop = false @lastcc = 0 @resetVars() @focus() @startBlink() addEventListener 'keydown', @keyDown.bind(@) addEventListener 'keypress', @keyPress.bind(@) addEventListener 'focus', @focus.bind(@) addEventListener 'blur', @blur.bind(@) addEventListener 'resize', => @resize() # # Horrible Firefox paste workaround if typeof InstallTrigger isnt "undefined" @body.contentEditable = 'true' @initmouse() setTimeout(@resize.bind(@), 100) cloneAttr: (a, char=null) -> bg: a.bg fg: a.fg ch: unless char is null then char else a.ch bold: a.bold underline: a.underline blink: a.blink inverse: a.inverse invisible: a.invisible equalAttr: (a, b) -> # Not testing char (a.bg is b.bg and a.fg is b.fg and a.bold is b.bold and a.underline is b.underline and a.blink is b.blink and a.inverse is b.inverse and a.invisible is b.invisible) putChar: (c) -> if @insertMode @screen[@y + @shift][0].splice(@x, 0, @cloneAttr @curAttr, c) @screen[@y + @shift][0].pop() else @screen[@y + @shift][0][@x] = @cloneAttr @curAttr, c @screen[@y + @shift][1] = true resetVars: -> @x = 0 @y = 0 @cursorHidden = false @state = State.normal @queue = '' @scrollTop = 0 @scrollBottom = @rows - 1 @scrollLock = false # modes @applicationKeypad = false @applicationCursor = false @originMode = false @wraparoundMode = false @normal = null # charset @charset = null @gcharset = null @glevel = 0 @charsets = [null] # stream @defAttr = bg: 256 fg: 257 ch: " " bold: false underline: false blink: false inverse: false invisible: false @curAttr = @cloneAttr @defAttr @params = [] @currentParam = 0 @prefix = "" @screen = [] i = @rows @shift = 0 @screen.push [@blankLine(), true] while i-- @setupStops() @skipNextKey = null computeCharSize: -> testSpan = document.createElement('span') testSpan.textContent = '0123456789' @children[0].appendChild(testSpan) @charSize = width: testSpan.getBoundingClientRect().width / 10 height: @children[0].getBoundingClientRect().height @children[0].removeChild(testSpan) eraseAttr: -> erased = @cloneAttr @defAttr erased.bg = @curAttr.bg erased focus: -> @send('\x1b[I') if @sendFocus @showCursor() @body.classList.add('focus') @body.classList.remove('blur') blur: -> @cursorState = 1 @screen[@y + @shift][1] = true @refresh() @send('\x1b[O') if @sendFocus @body.classList.add('blur') @body.classList.remove('focus') # XTerm mouse events # http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking # To better understand these # the xterm code is very helpful: # Relevant files: # button.c, charproc.c, misc.c # Relevant functions in xterm/button.c: # BtnCode, EmitButtonCode, EditorButton, SendMousePosition initmouse: -> pressed = 32 # mouseup, mousedown, mousewheel # left click: ^[[M 3<^[[M#3< # mousewheel up: ^[[M`3> sendButton = (ev) -> # get the xterm-style button button = getButton(ev) # get mouse coordinates pos = getCoords(ev) return unless pos sendEvent button, pos, ev.type pressed = button # motion example of a left click: # ^[[M 3<^[[M@4<^[[M@5<^[[M@6<^[[M@7<^[[M#7< sendMove = (ev) -> button = pressed pos = getCoords(ev) return unless pos # buttons marked as motions # are incremented by 32 button += 32 sendEvent button, pos, ev.type # encode button and # position to characters encode = (data, ch) => unless @utfMouse return data.push(0) if ch is 255 ch = 127 if ch > 127 data.push ch else return data.push(0) if ch is 2047 if ch < 127 data.push ch else ch = 2047 if ch > 2047 data.push 0xC0 | (ch >> 6) data.push 0x80 | (ch & 0x3F) # send a mouse event: # regular/utf8: ^[[M Cb Cx Cy # urxvt: ^[[ Cb ; Cx ; Cy M # sgr: ^[[ Cb ; Cx ; Cy M/m # vt300: ^[[ 24(1/3/5)~ [ Cx , Cy ] \r # locator: CSI P e ; P b ; P r ; P c ; P p & w sendEvent = (button, pos, type) => if @urxvtMouse pos.x -= 32 pos.y -= 32 pos.x++ pos.y++ @send "\x1b[" + button + ";" + pos.x + ";" + pos.y + "M" return if @sgrMouse pos.x -= 32 pos.y -= 32 button -= 32 @send "\x1b[<" + button + ";" + pos.x + ";" + pos.y + ( if type is "mouseup" then "m" else "M" ) return data = [] encode data, button encode data, pos.x encode data, pos.y @send "\x1b[M" + String.fromCharCode.apply(String, data) getButton = (ev) => # two low bits: # 0 = left # 1 = middle # 2 = right # 3 = release # wheel up/down: # 1, and 2 - with 64 added switch ev.type when "mousedown" button = if ev.button? then +ev.button else ( if ev.which? then ev.which - 1 else null) when "mouseup" button = 3 when "wheel" button = if ev.deltaY < 0 then 64 else 65 # next three bits are the modifiers: # 4 = shift, 8 = meta, 16 = control shift = if ev.shiftKey then 4 else 0 meta = if ev.metaKey then 8 else 0 ctrl = if ev.ctrlKey then 16 else 0 mod = shift | meta | ctrl # no mods if @vt200Mouse # ctrl only mod &= ctrl else unless @normalMouse mod = 0 # increment to SP (32 + (mod << 2)) + button # mouse coordinates measured in cols/rows getCoords = (ev) => x = ev.pageX y = ev.pageY - window.scrollY # convert to cols/rows w = @body.clientWidth h = window.innerHeight x = Math.ceil((x / w) * @cols) y = Math.ceil((y / h) * @rows) # be sure to avoid sending # bad positions to the program x = 0 if x < 0 x = @cols if x > @cols y = 0 if y < 0 y = @rows if y > @rows # xterm sends raw bytes and # starts at 32 (SP) for each. x += 32 y += 32 x: x y: y type: ev.type addEventListener "contextmenu", (ev) => return unless @mouseEvents cancel ev addEventListener "mousedown", (ev) => return unless @mouseEvents # send the button sendButton ev # fix for odd bug sm = sendMove.bind(this) addEventListener "mousemove", sm # x10 compatibility mode can't send button releases unless @x10Mouse addEventListener "mouseup", up = (ev) -> sendButton ev removeEventListener "mousemove", sm removeEventListener "mouseup", up cancel ev cancel ev addEventListener "wheel", (ev) => if @mouseEvents return if @x10Mouse sendButton ev cancel ev linkify: (t) -> # http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links urlPattern = ( /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim) pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim emailAddressPattern = /[\w.]+@[a-zA-Z_-]+?(?:\.[a-zA-Z]{2,6})+/gim (part .replace(urlPattern, '<a href="$&">$&</a>') .replace(pseudoUrlPattern, '$1<a href="http://$2">$2</a>') .replace(emailAddressPattern, '<a href="mailto:$&">$&</a>' ) for part in t.split('&nbsp;')).join('&nbsp;') refresh: (force=false) -> for cursor in @body.querySelectorAll(".cursor") cursor.parentNode.replaceChild( @document.createTextNode(cursor.textContent), cursor) newOut = '' for [line, dirty], j in @screen continue unless dirty or force out = "" if j is @y + @shift and not @cursorHidden x = @x else x = -Infinity attr = @cloneAttr @defAttr skipnext = false for i in [0..@cols - 1] data = line[i] if data.html out += data.html continue if skipnext skipnext = false continue ch = data.ch unless @equalAttr data, attr out += "</span>" unless @equalAttr attr, @defAttr unless @equalAttr data, @defAttr classes = [] styles = [] out += "<span " # bold classes.push "bold" if data.bold # underline classes.push "underline" if data.underline # blink classes.push "blink" if data.blink # inverse classes.push "reverse-video" if data.inverse # invisible classes.push "invisible" if data.invisible if typeof data.fg is 'number' fg = data.fg if data.bold and fg < 8 fg += 8 classes.push "fg-color-" + fg if typeof data.fg is 'string' styles.push "color: " + data.fg if typeof data.bg is 'number' classes.push "bg-color-" + data.bg if typeof data.bg is 'string' styles.push "background-color: " + data.bg out += "class=\"" out += classes.join(" ") out += "\"" if styles.length out += " style=\"" + styles.join("; ") + "\"" out += ">" out += "<span class=\"" + ( if @cursorState then "reverse-video " else "" ) + "cursor\">" if i is x # This is a temporary dirty hack for raw html insertion if ch.length > 1 out += ch else switch ch when "&" out += "&amp;" when "<" out += "&lt;" when ">" out += "&gt;" else if ch == " " out += '<span class="nbsp">\u2007</span>' else if ch <= " " out += "&nbsp;" else if not @forceWidth or ch <= "~" # Ascii chars out += ch else if "\uff00" < ch < "\uffef" skipnext = true out += "<span style=\"display: inline-block; width: #{2 * @charSize.width}px\">#{ch}</span>" else out += "<span style=\"display: inline-block; width: #{@charSize.width}px\">#{ch}</span>" out += "</span>" if i is x attr = data out += "</span>" unless @equalAttr attr, @defAttr out = @linkify(out) unless j is @y + @shift if @children[j] @children[j].innerHTML = out else newOut += "<div class=\"line\">#{out}</div>" @screen[j][1] = false if newOut isnt '' group = @document.createElement('div') group.className = 'group' group.innerHTML = newOut @body.appendChild group @screen = @screen.slice(-@rows) @shift = 0 lines = document.querySelectorAll('.line') if lines.length > @scrollback for line in Array.prototype.slice.call( lines, 0, lines.length - @scrollback) line.remove() for group in document.querySelectorAll('.group:empty') group.remove() lines = document.querySelectorAll('.line') @children = Array.prototype.slice.call( lines, -@rows) @nativeScrollTo() unless @scrollLock _cursorBlink: -> @cursorState ^= 1 cursor = @body.querySelector(".cursor") return unless cursor if cursor.classList.contains("reverse-video") cursor.classList.remove "reverse-video" else cursor.classList.add "reverse-video" showCursor: -> unless @cursorState @cursorState = 1 @screen[@y + @shift][1] = true @refresh() startBlink: -> return unless @cursorBlink @_blinker = => @_cursorBlink() @t_blink = setInterval(@_blinker, 500) refreshBlink: -> return unless @cursorBlink clearInterval @t_blink @t_blink = setInterval(@_blinker, 500) scroll: -> # Use emulated scroll in alternate buffer or when scroll region is defined if @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 # inner scroll @screen.splice @shift + @scrollBottom + 1, 0, [@blankLine(), true] @screen.splice @shift + @scrollTop, 1 for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true else @screen.push [@blankLine(), true] @shift++ unscroll: -> @screen.splice @shift + @scrollTop , 0, [@blankLine(true), true] @screen.splice @shift + @scrollBottom + 1, 1 for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true nativeScrollTo: (scroll=2000000000) -> # ~ Max ff number window.scrollTo 0, scroll scrollDisplay: (disp) -> @nativeScrollTo window.scrollY + disp * @charSize.height nextLine: -> @y++ if @y > @scrollBottom @y-- @scroll() prevLine: -> @y-- if @y < @scrollTop @y++ @unscroll() write: (data) -> i = 0 l = data.length while i < l ch = data.charAt(i) switch @state when State.normal switch ch # '\a' when "\x07" @bell() # '\n', '\v', '\f' when "\n", "\x0b", "\x0c" # @x = 0 if @convertEol @nextLine() # '\r' when "\r" @x = 0 # '\b' when "\b" @x-- if @x > 0 # '\t' when "\t" @x = @nextStop() # shift out when "\x0e" @setgLevel 1 # shift in when "\x0f" @setgLevel 0 # '\e' when "\x1b" @state = State.escaped else # ' ' if ch >= " " ch = @charset[ch] if @charset?[ch] if @x >= @cols @putChar '\u23CE' @x = 0 @nextLine() @putChar ch @x++ if @forceWidth and "\uff00" < ch < "\uffef" if @cols < 2 or @x >= @cols @putChar " " break @putChar " " @x++ when State.escaped switch ch # ESC [ Control Sequence Introducer ( CSI is 0x9b). when "[" @params = [] @currentParam = 0 @state = State.csi # ESC ] Operating System Command ( OSC is 0x9d). when "]" @params = [] @currentParam = 0 @state = State.osc # ESC P Device Control String ( DCS is 0x90). when "P" @params = [] @currentParam = 0 @state = State.dcs # ESC _ Application Program Command ( APC is 0x9f). when "_" @state = State.ignore # ESC ^ Privacy Message ( PM is 0x9e). when "^" @state = State.ignore # ESC c Full Reset (RIS). when "c" @reset() # ESC E Next Line ( NEL is 0x85). when "E" @x = 0 @index() # ESC D Index ( IND is 0x84). when "D" @index() # ESC M Reverse Index ( RI is 0x8d). when "M" @reverseIndex() # ESC % Select default/utf-8 character set. # @ = default, G = utf-8 when "%" @setgLevel 0 @setgCharset 0, Terminal::charsets.US @state = State.normal i++ # ESC (,),*,+,-,. Designate G0-G2 Character Set. # <-- this seems to get all the attention when "(", ")" , "*" , "+" , "-" , "." switch ch when "(" @gcharset = 0 when ")", "-" @gcharset = 1 when "*", "." @gcharset = 2 when "+" @gcharset = 3 @state = State.charset # Designate G3 Character Set (VT300). # A = ISO Latin-1 Supplemental. # Not implemented. when "/" @gcharset = 3 @state = State.charset i-- # ESC n # Invoke the G2 Character Set as GL (LS2). when "n" @setgLevel 2 # ESC o # Invoke the G3 Character Set as GL (LS3). when "o" @setgLevel 3 # ESC | # Invoke the G3 Character Set as GR (LS3R). when "|" @setgLevel 3 # ESC } # Invoke the G2 Character Set as GR (LS2R). when "}" @setgLevel 2 # ESC ~ # Invoke the G1 Character Set as GR (LS1R). when "~" @setgLevel 1 # ESC 7 Save Cursor (DECSC). when "7" @saveCursor() @state = State.normal # ESC 8 Restore Cursor (DECRC). when "8" @restoreCursor() @state = State.normal # ESC # 3 DEC line height/width when "#" @state = State.normal i++ num = data.charAt(i) switch num when "3" # DECDHL break when "4" # DECDHL break when "5" # DECSWL break when "6" # DECDWL break when "8" # DECALN for line in @screen line[1] = true for c in [0..line[0].length] line[0][c] = @cloneAttr @curAttr, "E" @x = @y = 0 # ESC H Tab Set (HTS is 0x88). when "H" @tabSet() # ESC = Application Keypad (DECPAM). when "=" @applicationKeypad = true @state = State.normal # ESC > Normal Keypad (DECPNM). when ">" @applicationKeypad = false @state = State.normal else @state = State.normal console.log "Unknown ESC control:", ch when State.charset switch ch when "0" # DEC Special Character and Line Drawing Set. cs = Terminal::charsets.SCLD when "A" # UK cs = Terminal::charsets.UK when "B" # United States (USASCII). cs = Terminal::charsets.US when "4" # Dutch cs = Terminal::charsets.Dutch # Finnish when "C", "5" cs = Terminal::charsets.Finnish when "R" # French cs = Terminal::charsets.French when "Q" # FrenchCanadian cs = Terminal::charsets.FrenchCanadian when "K" # German cs = Terminal::charsets.German when "Y" # Italian cs = Terminal::charsets.Italian # NorwegianDanish when "E", "6" cs = Terminal::charsets.NorwegianDanish when "Z" # Spanish cs = Terminal::charsets.Spanish # Swedish when "H", "7" cs = Terminal::charsets.Swedish when "=" # Swiss cs = Terminal::charsets.Swiss when "/" # ISOLatin (actually /A) cs = Terminal::charsets.ISOLatin i++ else # Default cs = Terminal::charsets.US @setgCharset @gcharset, cs @gcharset = null @state = State.normal when State.osc # OSC Ps ; Pt ST # OSC Ps ; Pt BEL # Set Text Parameters. if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" @params.push @currentParam switch @params[0] when 0, 1, 2 if @params[1] @title = @params[1] + " - ƸӜƷ butterfly" @handleTitle @title # reset colors @params = [] @currentParam = 0 @state = State.normal else unless @params.length if ch >= "0" and ch <= "9" @currentParam = @currentParam * 10 + ch.charCodeAt(0) - 48 else if ch is ";" @params.push @currentParam @currentParam = "" else @currentParam += ch when State.csi # '?', '>', '!' if ch is "?" or ch is ">" or ch is "!" @prefix = ch break # 0 - 9 if ch >= "0" and ch <= "9" @currentParam = @currentParam * 10 + ch.charCodeAt(0) - 48 break # '$', '"', ' ', '\'' if ch is "$" or ch is "\"" or ch is " " or ch is "'" break @params.push @currentParam @currentParam = 0 # ';' break if ch is ";" @state = State.normal switch ch # CSI Ps A # Cursor Up Ps Times (default = 1) (CUU). when "A" @cursorUp @params # CSI Ps B # Cursor Down Ps Times (default = 1) (CUD). when "B" @cursorDown @params # CSI Ps C # Cursor Forward Ps Times (default = 1) (CUF). when "C" @cursorForward @params # CSI Ps D # Cursor Backward Ps Times (default = 1) (CUB). when "D" @cursorBackward @params # CSI Ps ; Ps H # Cursor Position [row;column] (default = [1,1]) (CUP). when "H" @cursorPos @params # CSI Ps J Erase in Display (ED). when "J" @eraseInDisplay @params # CSI Ps K Erase in Line (EL). when "K" @eraseInLine @params # CSI Pm m Character Attributes (SGR). when "m" @charAttributes @params unless @prefix # CSI Ps n Device Status Report (DSR). when "n" @deviceStatus @params unless @prefix # CSI Ps @ # Insert Ps (Blank) Character(s) (default = 1) (ICH). when "@" @insertChars @params # CSI Ps E # Cursor Next Line Ps Times (default = 1) (CNL). when "E" @cursorNextLine @params # CSI Ps F # Cursor Preceding Line Ps Times (default = 1) (CNL). when "F" @cursorPrecedingLine @params # CSI Ps G # Cursor Character Absolute [column] (default = [row,1]) (CHA). when "G" @cursorCharAbsolute @params # CSI Ps L # Insert Ps Line(s) (default = 1) (IL). when "L" @insertLines @params # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). when "M" @deleteLines @params # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). when "P" @deleteChars @params # CSI Ps X # Erase Ps Character(s) (default = 1) (ECH). when "X" @eraseChars @params # CSI Pm ` Character Position Absolute # [column] (default = [row,1]) (HPA). when "`" @charPosAbsolute @params # 141 61 a * HPR - # Horizontal Position Relative when "a" @HPositionRelative @params # CSI P s c # Send Device Attributes (Primary DA). # CSI > P s c # Send Device Attributes (Secondary DA) when "c" @sendDeviceAttributes @params # CSI Pm d # Line Position Absolute [row] (default = [1,column]) (VPA). when "d" @linePosAbsolute @params # 145 65 e * VPR - Vertical Position Relative when "e" @VPositionRelative @params # CSI Ps ; Ps f # Horizontal and Vertical Position [row;column] (default = # [1,1]) (HVP). when "f" @HVPosition @params # CSI Pm h Set Mode (SM). # CSI ? Pm h - mouse escape codes, cursor escape codes when "h" @setMode @params # CSI Pm l Reset Mode (RM). # CSI ? Pm l when "l" @resetMode @params # CSI Ps ; Ps r # Set Scrolling Region [top;bottom] (default = full size of win- # dow) (DECSTBM). # CSI ? Pm r when "r" @setScrollRegion @params # CSI s # Save cursor (ANSI.SYS). when "s" @saveCursor @params # CSI u # Restore cursor (ANSI.SYS). when "u" @restoreCursor @params # CSI Ps I # Cursor Forward Tabulation Ps tab stops (default = 1) (CHT). when "I" @cursorForwardTab @params # CSI Ps S Scroll up Ps lines (default = 1) (SU). when "S" @scrollUp @params # CSI Ps T Scroll down Ps lines (default = 1) (SD). # CSI Ps ; Ps ; Ps ; Ps ; Ps T # CSI > Ps; Ps T when "T" @scrollDown @params if @params.length < 2 and not @prefix # CSI Ps Z # Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). when "Z" @cursorBackwardTab @params # CSI Ps b Repeat the preceding graphic character Ps times (REP). when "b" @repeatPrecedingCharacter @params # CSI Ps g Tab Clear (TBC). when "g" @tabClear @params # CSI > Ps p Set pointer mode. # CSI ! p Soft terminal reset (DECSTR). # CSI Ps$ p # Request ANSI mode (DECRQM). # CSI ? Ps$ p # Request DEC private mode (DECRQM). # CSI Ps ; Ps " p when "p" if @prefix is '!' @softReset @params else console.error "Unknown CSI code: %s.", ch @prefix = "" when State.dcs if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" switch @prefix # User-Defined Keys (DECUDK). when "" # Disabling this for now as we need a good script # striper to avoid malicious script injection pt = @currentParam unless pt[0] is ';' console.error "Unknown DECUDK: #{pt}" break pt = pt.slice(1) [type, content] = pt.split('|', 2) unless content console.error "No type for inline DECUDK: #{pt}" break switch type when "HTML" unless @htmlEscapesEnabled console.log "HTML escapes are disabled" break attr = @cloneAttr @curAttr attr.html = ( "<div class=\"inline-html\">#{content}</div>") @screen[@y + @shift][0][@x] = attr @screen[@y + @shift][1] = true when "IMAGE" # Prevent injection content = encodeURI content if content.indexOf(';') mime = content.slice(0, content.indexOf(';')) b64 = content.slice(content.indexOf(';') + 1) else mime = 'image' b64 = content attr = @cloneAttr @curAttr attr.html = ( "<img class=\"inline-image\" src=\"data:#{mime};base64,#{ b64}\" />") @screen[@y + @shift][0][@x] = attr @screen[@y + @shift][1] = true when "PROMPT" @send content when "TEXT" l += content.length data = data.slice(0, i + 1) + content + data.slice(i + 1) else console.error "Unknown type #{type} for DECUDK" # Request Status String (DECRQSS). # test: echo -e '\eP$q"p\e\\' when "$q" pt = @currentParam valid = false switch pt # DECSCA when "\"q" pt = "0\"q" # DECSCL when "\"p" pt = "61\"p" # DECSTBM when "r" pt = "" + (@scrollTop + 1) + ";" + (@scrollBottom + 1) + "r" # SGR when "m" pt = "0m" else console.error "Unknown DCS Pt: %s.", pt pt = "" @send "\x1bP" + +valid + "$r" + pt + "\x1b\\" when "+q" pt = @currentParam valid = false @send "\x1bP" + +valid + "+r" + pt + "\x1b\\" else console.error "Unknown DCS prefix: %s.", @prefix @currentParam = 0 @prefix = "" @state = State.normal else unless @currentParam if not @prefix and ch isnt "$" and ch isnt "+" @currentParam = ch else if @prefix.length is 2 @currentParam = ch else @prefix += ch else @currentParam += ch when State.ignore # For PM and APC. if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" @state = State.normal i++ @screen[@y + @shift][1] = true @refresh() writeln: (data) -> @write "#{data}\r\n" keyDown: (ev) -> # Key Resources: # https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent # Don't handle modifiers alone return true if ev.keyCode > 15 and ev.keyCode < 19 # Handle shift insert and ctrl insert # copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] # Alt-z works as an escape to relay the following keys to the browser. # usefull to trigger browser shortcuts, i.e.: Alt+Z F5 to reload # May be redundant with keyPrefix if ev.altKey and ev.keyCode is 90 and not @skipNextKey @skipNextKey = true @body.classList.add('skip') return cancel(ev) if @skipNextKey @skipNextKey = false @body.classList.remove('skip') return true switch ev.keyCode # backspace when 8 key = if ev.altKey then "\x1b" else "" if ev.shiftKey key += "\x08" # ^H break key += "\x7f" # ^? # tab when 9 if ev.shiftKey key = "\x1b[Z" break key = "\t" # return/enter when 13 key = "\r" # escape when 27 key = "\x1b" # left-arrow when 37 if @applicationCursor key = "\x1bOD" # SS3 as ^[O for 7-bit #key = '\x8fD'; // SS3 as 0x8f for 8-bit break key = "\x1b[D" # right-arrow when 39 if @applicationCursor key = "\x1bOC" break key = "\x1b[C" # up-arrow when 38 if @applicationCursor key = "\x1bOA" break if ev.ctrlKey @scrollDisplay -1 return cancel(ev) else key = "\x1b[A" # down-arrow when 40 if @applicationCursor key = "\x1bOB" break if ev.ctrlKey @scrollDisplay 1 return cancel(ev) else key = "\x1b[B" # delete when 46 key = "\x1b[3~" # insert when 45 key = "\x1b[2~" # home when 36 if @applicationKeypad key = "\x1bOH" break key = "\x1bOH" # end when 35 if @applicationKeypad key = "\x1bOF" break key = "\x1bOF" # page up when 33 if ev.shiftKey @scrollDisplay -(@rows - 1) return cancel(ev) else key = "\x1b[5~" # page down when 34 if ev.shiftKey @scrollDisplay @rows - 1 return cancel(ev) else key = "\x1b[6~" # F1 when 112 key = "\x1bOP" # F2 when 113 key = "\x1bOQ" # F3 when 114 key = "\x1bOR" # F4 when 115 key = "\x1bOS" # F5 when 116 key = "\x1b[15~" # F6 when 117 key = "\x1b[17~" # F7 when 118 key = "\x1b[18~" # F8 when 119 key = "\x1b[19~" # F9 when 120 key = "\x1b[20~" # F10 when 121 key = "\x1b[21~" # F11 when 122 key = "\x1b[23~" # F12 when 123 key = "\x1b[24~" # Scroll lock when 145 @scrollLock = ! @scrollLock if @scrollLock @body.classList.add 'locked' else @body.classList.remove 'locked' return cancel(ev) else # a-z and space if ev.ctrlKey if ev.keyCode >= 65 and ev.keyCode <= 90 if ev.keyCode is 67 t = (new Date()).getTime() if (t - @lastcc) < 500 and not @stop id = (setTimeout ->) (clearTimeout id if id not in [ @t_bell, @t_queue, @t_blink]) while id-- @body.classList.add 'stopped' @stop = true else if @stop return true @lastcc = t key = String.fromCharCode(ev.keyCode - 64) else if ev.keyCode is 32 # NUL key = String.fromCharCode(0) else if ev.keyCode >= 51 and ev.keyCode <= 55 # escape, file sep, group sep, record sep, unit sep key = String.fromCharCode(ev.keyCode - 51 + 27) else if ev.keyCode is 56 # delete key = String.fromCharCode(127) else if ev.keyCode is 219 # ^[ - escape key = String.fromCharCode(27) # ^] - group sep else if ev.keyCode is 221 key = String.fromCharCode(29) else if (ev.altKey and 'Mac' not in navigator.platform) or (ev.metaKey and 'Mac' in navigator.platform) if ev.keyCode >= 65 and ev.keyCode <= 90 key = "\x1b" + String.fromCharCode(ev.keyCode + 32) else if ev.keyCode is 192 key = "\x1b`" else if ev.keyCode >= 48 and ev.keyCode <= 57 key = "\x1b" + (ev.keyCode - 48) if ev.keyCode >= 37 and ev.keyCode <= 40 if ev.ctrlKey key = key.slice(0, -1) + "1;5" + key.slice(-1) else if ev.altKey key = key.slice(0, -1) + "1;3" + key.slice(-1) else if ev.shiftKey key = key.slice(0, -1) + "1;4" + key.slice(-1) return true unless key @showCursor() @send(key) cancel ev setgLevel: (g) -> @glevel = g @charset = @charsets[g] setgCharset: (g, charset) -> @charsets[g] = charset @charset = charset if @glevel is g keyPress: (ev) -> if @skipNextKey is false @skipNextKey = null return true # Don't handle modifiers alone return true if ev.keyCode > 15 and ev.keyCode < 19 # Handle shift insert and ctrl insert # copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] cancel ev if ev.charCode key = ev.charCode else unless ev.which? key = ev.keyCode else if ev.which isnt 0 and ev.charCode isnt 0 key = ev.which else return false return false if not key or ev.ctrlKey or ev.altKey or ev.metaKey key = String.fromCharCode(key) @showCursor() @send key false bell: (cls="bell")-> return unless @visualBell @body.classList.add cls @t_bell = setTimeout (=> @body.classList.remove cls ), @visualBell resize: (x=null, y=null) -> oldCols = @cols oldRows = @rows @computeCharSize() @cols = x or Math.floor(@body.clientWidth / @charSize.width) @rows = y or Math.floor(window.innerHeight / @charSize.height) px = window.innerHeight % @charSize.height @body.style['padding-bottom'] = "#{px}px" if (not x and not y) and oldCols == @cols and oldRows == @rows return @ctl 'Resize', @cols, @rows # resize cols if oldCols < @cols # does xterm use the default attr? i = @screen.length while i-- @screen[i][0].push @defAttr while @screen[i][0].length < @cols else if oldCols > @cols i = @screen.length while i-- @screen[i][0].pop() while @screen[i][0].length > @cols @setupStops oldCols # resize rows j = oldRows if j < @rows el = @body while j++ < @rows @screen.push [@blankLine(), true] if @screen.length < @rows if @children.length < @rows line = @document.createElement("div") line.className = 'line' el.appendChild line @children.push line else if j > @rows while j-- > @rows @screen.pop() if @screen.length > @rows if @children.length > @rows el = @children.pop() el?.parentNode.removeChild el # make sure the cursor stays on screen @y = @rows - 1 if @y >= @rows @x = @cols - 1 if @x >= @cols @scrollTop = 0 @scrollBottom = @rows - 1 @refresh(true) # it's a real nightmare trying # to resize the original # screen buffer. just set it # to null for now. @normal = null @reset() if x or y setupStops: (i) -> if i? i = @prevStop(i) unless @tabs[i] else @tabs = {} i = 0 while i < @cols @tabs[i] = true i += 8 prevStop: (x) -> x = @x unless x? while not @tabs[--x] and x > 0 1 if x >= @cols then @cols - 1 else (if x < 0 then 0 else x) nextStop: (x) -> x = @x unless x? while not @tabs[++x] and x < @cols 1 if x >= @cols then @cols - 1 else (if x < 0 then 0 else x) eraseRight: (x, y) -> line = @screen[y + @shift][0] # xterm while x < @cols line[x] = @eraseAttr() x++ @screen[y + @shift][1] = true eraseLeft: (x, y) -> x++ @screen[y + @shift][0][x] = @eraseAttr() while x-- @screen[y + @shift][1] = true eraseLine: (y) -> @eraseRight 0, y blankLine: (cur) -> attr = (if cur then @eraseAttr() else @defAttr) line = [] i = 0 while i < @cols + 1 line[i] = attr i++ line ch: (cur) -> if cur then @eraseAttr() else @defAttr isterm: (term) -> "#{@termName}".indexOf(term) is 0 send: (data) -> @out data handleTitle: (title) -> document.title = title ## ESC ## # ESC D Index (IND is 0x84). index: -> @nextLine() @state = State.normal # ESC M Reverse Index (RI is 0x8d). reverseIndex: -> @prevLine() @state = State.normal # ESC c Full Reset (RIS). reset: -> @resetVars() @refresh(true) # ESC H Tab Set (HTS is 0x88). tabSet: -> @tabs[@x] = true @state = State.normal ## CSI ## # CSI Ps A # Cursor Up Ps Times (default = 1) (CUU). cursorUp: (params) -> param = params[0] param = 1 if param < 1 @y -= param @y = 0 if @y < 0 # CSI Ps B # Cursor Down Ps Times (default = 1) (CUD). cursorDown: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows # CSI Ps C # Cursor Forward Ps Times (default = 1) (CUF). cursorForward: (params) -> param = params[0] param = 1 if param < 1 @x += param @x = @cols - 1 if @x >= @cols # CSI Ps D # Cursor Backward Ps Times (default = 1) (CUB). cursorBackward: (params) -> param = params[0] param = 1 if param < 1 @x -= param @x = 0 if @x < 0 # CSI Ps ; Ps H # Cursor Position [row;column] (default = [1,1]) (CUP). cursorPos: (params) -> row = params[0] - 1 if params.length >= 2 col = params[1] - 1 else col = 0 if row < 0 row = 0 else row = @rows - 1 if row >= @rows if col < 0 col = 0 else col = @cols - 1 if col >= @cols @x = col @y = row # CSI Ps J Erase in Display (ED). # Ps = 0 -> Erase Below (default). # Ps = 1 -> Erase Above. # Ps = 2 -> Erase All. # Ps = 3 -> Erase Saved Lines (xterm). # CSI ? Ps J # Erase in Display (DECSED). # Ps = 0 -> Selective Erase Below (default). # Ps = 1 -> Selective Erase Above. # Ps = 2 -> Selective Erase All. eraseInDisplay: (params) -> switch params[0] when 0 @eraseRight @x, @y j = @y + 1 while j < @rows @eraseLine j j++ when 1 @eraseLeft @x, @y j = @y @eraseLine j while j-- when 2 j = @rows @eraseLine j while j-- # CSI Ps K Erase in Line (EL). # Ps = 0 -> Erase to Right (default). # Ps = 1 -> Erase to Left. # Ps = 2 -> Erase All. # CSI ? Ps K # Erase in Line (DECSEL). # Ps = 0 -> Selective Erase to Right (default). # Ps = 1 -> Selective Erase to Left. # Ps = 2 -> Selective Erase All. eraseInLine: (params) -> switch params[0] when 0 @eraseRight @x, @y when 1 @eraseLeft @x, @y when 2 @eraseLine @y # CSI Pm m Character Attributes (SGR). # Ps = 0 -> Normal (default). # Ps = 1 -> Bold. # Ps = 4 -> Underlined. # Ps = 5 -> Blink (appears as Bold). # Ps = 7 -> Inverse. # Ps = 8 -> Invisible, i.e., hidden (VT300). # Ps = 2 2 -> Normal (neither bold nor faint). # Ps = 2 4 -> Not underline. # Ps = 2 5 -> Steady (not blinking). # Ps = 2 7 -> Positive (not inverse). # Ps = 2 8 -> Visible, i.e., not hidden (VT300). # Ps = 3 0 -> Set foreground color to Black. # Ps = 3 1 -> Set foreground color to Red. # Ps = 3 2 -> Set foreground color to Green. # Ps = 3 3 -> Set foreground color to Yellow. # Ps = 3 4 -> Set foreground color to Blue. # Ps = 3 5 -> Set foreground color to Magenta. # Ps = 3 6 -> Set foreground color to Cyan. # Ps = 3 7 -> Set foreground color to White. # Ps = 3 9 -> Set foreground color to default (original). # Ps = 4 0 -> Set background color to Black. # Ps = 4 1 -> Set background color to Red. # Ps = 4 2 -> Set background color to Green. # Ps = 4 3 -> Set background color to Yellow. # Ps = 4 4 -> Set background color to Blue. # Ps = 4 5 -> Set background color to Magenta. # Ps = 4 6 -> Set background color to Cyan. # Ps = 4 7 -> Set background color to White. # Ps = 4 9 -> Set background color to default (original). # If 16-color support is compiled, the following apply. Assume # that xterm's resources are set so that the ISO color codes are # the first 8 of a set of 16. Then the aixterm colors are the # bright versions of the ISO colors: # Ps = 9 0 -> Set foreground color to Black. # Ps = 9 1 -> Set foreground color to Red. # Ps = 9 2 -> Set foreground color to Green. # Ps = 9 3 -> Set foreground color to Yellow. # Ps = 9 4 -> Set foreground color to Blue. # Ps = 9 5 -> Set foreground color to Magenta. # Ps = 9 6 -> Set foreground color to Cyan. # Ps = 9 7 -> Set foreground color to White. # Ps = 1 0 0 -> Set background color to Black. # Ps = 1 0 1 -> Set background color to Red. # Ps = 1 0 2 -> Set background color to Green. # Ps = 1 0 3 -> Set background color to Yellow. # Ps = 1 0 4 -> Set background color to Blue. # Ps = 1 0 5 -> Set background color to Magenta. # Ps = 1 0 6 -> Set background color to Cyan. # Ps = 1 0 7 -> Set background color to White. # If xterm is compiled with the 16-color support disabled, it # supports the following, from rxvt: # Ps = 1 0 0 -> Set foreground and background color to # default. # If 88- or 256-color support is compiled, the following apply. # Ps = 3 8 ; 5 ; Ps -> Set foreground color to the second # Ps. # Ps = 4 8 ; 5 ; Ps -> Set background color to the second # Ps. charAttributes: (params) -> # Optimize a single SGR0. if params.length is 1 and params[0] is 0 @curAttr = @cloneAttr @defAttr return l = params.length i = 0 while i < l p = params[i] if p >= 30 and p <= 37 # fg color 8 @curAttr.fg = p - 30 else if p >= 40 and p <= 47 # bg color 8 @curAttr.bg = p - 40 else if p >= 90 and p <= 97 # fg color 16 p += 8 @curAttr.fg = p - 90 else if p >= 100 and p <= 107 # bg color 16 p += 8 @curAttr.bg = p - 100 else if p is 0 # default @curAttr = @cloneAttr @defAttr else if p is 1 # bold text @curAttr.bold = true else if p is 4 # underline text @curAttr.underline = true else if p is 5 # blink @curAttr.blink = true else if p is 7 # inverse and positive # test with: echo -e '\e[31m\e[42mhello\e[7mworld\e[27mhi\e[m' @curAttr.inverse = true else if p is 8 # invisible @curAttr.invisible = true else if p is 10 # Primary Font # ignoring else if p is 22 # not bold @curAttr.bold = false else if p is 24 # not underline @curAttr.underline = false else if p is 25 # not blink @curAttr.blink = false else if p is 27 # not inverse @curAttr.inverse = false else if p is 28 # not invisible @curAttr.invisible = false else if p is 39 # reset fg @curAttr.fg = 257 else if p is 49 # reset bg @curAttr.bg = 256 else if p is 38 if params[i + 1] is 2 # fg color 2^24 i += 2 @curAttr.fg = "rgb(#{params[i]}, #{params[i+1]}, #{params[i+2]})" i += 2 else if params[i + 1] is 5 # fg color 256 i += 2 @curAttr.fg = params[i] & 0xff else if p is 48 if params[i + 1] is 2 # bg color 2^24 i += 2 @curAttr.bg = "rgb(#{params[i]}, #{params[i+1]}, #{params[i+2]})" i += 2 else if params[i + 1] is 5 # bg color 256 i += 2 @curAttr.bg = params[i] & 0xff else if p is 100 # reset fg/bg @curAttr.fg = 257 @curAttr.bg = 256 else console.error "Unknown SGR attribute: %d.", p i++ # CSI Ps n Device Status Report (DSR). # Ps = 5 -> Status Report. Result (``OK'') is # CSI 0 n # Ps = 6 -> Report Cursor Position (CPR) [row;column]. # Result is # CSI r ; c R # CSI ? Ps n # Device Status Report (DSR, DEC-specific). # Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI # ? r ; c R (assumes page is zero). # Ps = 1 5 -> Report Printer status as CSI ? 1 0 n (ready). # or CSI ? 1 1 n (not ready). # Ps = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked) # or CSI ? 2 1 n (locked). # Ps = 2 6 -> Report Keyboard status as # CSI ? 2 7 ; 1 ; 0 ; 0 n (North American). # The last two parameters apply to VT400 & up, and denote key- # board ready and LK01 respectively. # Ps = 5 3 -> Report Locator status as # CSI ? 5 3 n Locator available, if compiled-in, or # CSI ? 5 0 n No Locator, if not. deviceStatus: (params) -> unless @prefix switch params[0] when 5 # status report @send "\x1b[0n" when 6 # cursor position @send "\x1b[" + (@y + 1) + ";" + (@x + 1) + "R" else if @prefix is "?" # modern xterm doesnt seem to # respond to any of these except ?6, 6, and 5 if params[0] is 6 # cursor position @send "\x1b[?" + (@y + 1) + ";" + (@x + 1) + "R" ## Additions ## # CSI Ps @ # Insert Ps (Blank) Character(s) (default = 1) (ICH). insertChars: (params) -> param = params[0] param = 1 if param < 1 row = @y j = @x # xterm while param-- and j < @cols @screen[row + @shift][0].splice j++, 0, [@eraseAttr(), true] @screen[row + @shift][0].pop() @screen[row + @shift][1] = true # CSI Ps E # Cursor Next Line Ps Times (default = 1) (CNL). # same as CSI Ps B ? cursorNextLine: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows @x = 0 # CSI Ps F # Cursor Preceding Line Ps Times (default = 1) (CNL). # reuse CSI Ps A ? cursorPrecedingLine: (params) -> param = params[0] param = 1 if param < 1 @y -= param @y = 0 if @y < 0 @x = 0 # CSI Ps G # Cursor Character Absolute [column] (default = [row,1]) (CHA). cursorCharAbsolute: (params) -> param = params[0] param = 1 if param < 1 @x = param - 1 # CSI Ps L # Insert Ps Line(s) (default = 1) (IL). # test: echo -e '\e[44m\e[1L\e[0m' insertLines: (params) -> param = params[0] param = 1 if param < 1 while param-- @screen.splice @y + @shift, 0, [@blankLine(true), true] # blankLine(true) - xterm/linux behavior @screen.splice @scrollBottom + 1 + @shift, 1 for i in [@y + @shift..@screen.length - 1] @screen[i][1] = true # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). deleteLines: (params) -> param = params[0] param = 1 if param < 1 while param-- # test: echo -e '\e[44m\e[1M\e[0m' # blankLine(true) - xterm/linux behavior @screen.splice @scrollBottom + @shift, 0, [@blankLine(true), true] @screen.splice @y + @shift, 1 unless @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 @children[@y + @shift].remove() @children.splice @y + @shift, 1 if @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 for i in [@y + @shift..@screen.length - 1] @screen[i][1] = true # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). deleteChars: (params) -> param = params[0] param = 1 if param < 1 while param-- @screen[@y + @shift][0].splice @x, 1 @screen[@y + @shift][0].push @eraseAttr() @screen[@y + @shift][1] = true # CSI Ps X # Erase Ps Character(s) (default = 1) (ECH). eraseChars: (params) -> param = params[0] param = 1 if param < 1 j = @x # xterm @screen[@y + @shift][0][j++] = @eraseAttr() while param-- and j < @cols @screen[@y + @shift][1] = true # CSI Pm ` Character Position Absolute # [column] (default = [row,1]) (HPA). charPosAbsolute: (params) -> param = params[0] param = 1 if param < 1 @x = param - 1 @x = @cols - 1 if @x >= @cols # 141 61 a * HPR - # Horizontal Position Relative # reuse CSI Ps C ? HPositionRelative: (params) -> param = params[0] param = 1 if param < 1 @x += param @x = @cols - 1 if @x >= @cols # CSI Ps c Send Device Attributes (Primary DA). # Ps = 0 or omitted -> request attributes from terminal. The # response depends on the decTerminalID resource setting. # -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'') # -> CSI ? 1 ; 0 c (``VT101 with No Options'') # -> CSI ? 6 c (``VT102'') # -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'') # The VT100-style response parameters do not mean anything by # themselves. VT220 parameters do, telling the host what fea- # tures the terminal supports: # Ps = 1 -> 132-columns. # Ps = 2 -> Printer. # Ps = 6 -> Selective erase. # Ps = 8 -> User-defined keys. # Ps = 9 -> National replacement character sets. # Ps = 1 5 -> Technical characters. # Ps = 2 2 -> ANSI color, e.g., VT525. # Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode). # CSI > Ps c # Send Device Attributes (Secondary DA). # Ps = 0 or omitted -> request the terminal's identification # code. The response depends on the decTerminalID resource set- # ting. It should apply only to VT220 and up, but xterm extends # this to VT100. # -> CSI > Pp ; Pv ; Pc c # where Pp denotes the terminal type # Pp = 0 -> ``VT100''. # Pp = 1 -> ``VT220''. # and Pv is the firmware version (for xterm, this was originally # the XFree86 patch number, starting with 95). In a DEC termi- # nal, Pc indicates the ROM cartridge registration number and is # always zero. # More information: # xterm/charproc.c - line 2012, for more information. # vim responds with ^[[?0c or ^[[?1c after the terminal's response (?) sendDeviceAttributes: (params) -> return if params[0] > 0 unless @prefix if @isterm("xterm") or @isterm("rxvt-unicode") or @isterm("screen") @send "\x1b[?1;2c" else @send "\x1b[?6c" if @isterm("linux") else if @prefix is ">" # xterm and urxvt # seem to spit this # out around ~370 times (?). if @isterm("xterm") @send "\x1b[>0;276;0c" else if @isterm("rxvt-unicode") @send "\x1b[>85;95;0c" else if @isterm("linux") # not supported by linux console. # linux console echoes parameters. @send params[0] + "c" else @send "\x1b[>83;40003;0c" if @isterm("screen") # CSI Pm d # Line Position Absolute [row] (default = [1,column]) (VPA). linePosAbsolute: (params) -> param = params[0] param = 1 if param < 1 @y = param - 1 @y = @rows - 1 if @y >= @rows # 145 65 e * VPR - Vertical Position Relative # reuse CSI Ps B ? VPositionRelative: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows # CSI Ps ; Ps f # Horizontal and Vertical Position [row;column] (default = # [1,1]) (HVP). HVPosition: (params) -> params[0] = 1 if params[0] < 1 params[1] = 1 if params[1] < 1 @y = params[0] - 1 @y = @rows - 1 if @y >= @rows @x = params[1] - 1 @x = @cols - 1 if @x >= @cols # CSI Pm h Set Mode (SM). # Ps = 2 -> Keyboard Action Mode (AM). # Ps = 4 -> Insert Mode (IRM). # Ps = 1 2 -> Send/receive (SRM). # Ps = 2 0 -> Automatic Newline (LNM). # CSI ? Pm h # DEC Private Mode Set (DECSET). # Ps = 1 -> Application Cursor Keys (DECCKM). # Ps = 2 -> Designate USASCII for character sets G0-G3 # (DECANM), and set VT100 mode. # Ps = 3 -> 132 Column Mode (DECCOLM). # Ps = 4 -> Smooth (Slow) Scroll (DECSCLM). # Ps = 5 -> Reverse Video (DECSCNM). # Ps = 6 -> Origin Mode (DECOM). # Ps = 7 -> Wraparound Mode (DECAWM). # Ps = 8 -> Auto-repeat Keys (DECARM). # Ps = 9 -> Send Mouse X & Y on button press. See the sec- # tion Mouse Tracking. # Ps = 1 0 -> Show toolbar (rxvt). # Ps = 1 2 -> Start Blinking Cursor (att610). # Ps = 1 8 -> Print form feed (DECPFF). # Ps = 1 9 -> Set print extent to full screen (DECPEX). # Ps = 2 5 -> Show Cursor (DECTCEM). # Ps = 3 0 -> Show scrollbar (rxvt). # Ps = 3 5 -> Enable font-shifting functions (rxvt). # Ps = 3 8 -> Enter Tektronix Mode (DECTEK). # Ps = 4 0 -> Allow 80 -> 132 Mode. # Ps = 4 1 -> more(1) fix (see curses resource). # Ps = 4 2 -> Enable Nation Replacement Character sets (DECN- # RCM). # Ps = 4 4 -> Turn On Margin Bell. # Ps = 4 5 -> Reverse-wraparound Mode. # Ps = 4 6 -> Start Logging. This is normally disabled by a # compile-time option. # Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis- # abled by the titeInhibit resource). # Ps = 6 6 -> Application keypad (DECNKM). # Ps = 6 7 -> Backarrow key sends backspace (DECBKM). # Ps = 1 0 0 0 -> Send Mouse X & Y on button press and # release. See the section Mouse Tracking. # Ps = 1 0 0 1 -> Use Hilite Mouse Tracking. # Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking. # Ps = 1 0 0 3 -> Use All Motion Mouse Tracking. # Ps = 1 0 0 4 -> Send FocusIn/FocusOut events. # Ps = 1 0 0 5 -> Enable Extended Mouse Mode. # Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt). # Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). # Ps = 1 0 3 4 -> Interpret "meta" key, sets eighth bit. # (enables the eightBitInput resource). # Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num- # Lock keys. (This enables the numLock resource). # Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This # enables the metaSendsEscape resource). # Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete # key. # Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This # enables the altSendsEscape resource). # Ps = 1 0 4 0 -> Keep selection even if not highlighted. # (This enables the keepSelection resource). # Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables # the selectToClipboard resource). # Ps = 1 0 4 2 -> Enable Urgency window manager hint when # Control-G is received. (This enables the bellIsUrgent # resource). # Ps = 1 0 4 3 -> Enable raising of the window when Control-G # is received. (enables the popOnBell resource). # Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be # disabled by the titeInhibit resource). # Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis- # abled by the titeInhibit resource). # Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate # Screen Buffer, clearing it first. (This may be disabled by # the titeInhibit resource). This combines the effects of the 1 # 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based # applications rather than the 4 7 mode. # Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode. # Ps = 1 0 5 1 -> Set Sun function-key mode. # Ps = 1 0 5 2 -> Set HP function-key mode. # Ps = 1 0 5 3 -> Set SCO function-key mode. # Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6). # Ps = 1 0 6 1 -> Set VT220 keyboard emulation. # Ps = 2 0 0 4 -> Set bracketed paste mode. # Modes: # http://vt100.net/docs/vt220-rm/chapter4.html setMode: (params) -> if typeof params is "object" l = params.length i = 0 while i < l @setMode params[i] i++ return if not @prefix switch params when 4 @insertMode = true when 20 @convertEol = true return if @prefix is "?" switch params when 1 @applicationCursor = true when 2 @setgCharset 0, Terminal::charsets.US @setgCharset 1, Terminal::charsets.US @setgCharset 2, Terminal::charsets.US @setgCharset 3, Terminal::charsets.US # set VT100 mode here when 3 # 132 col mode @savedCols = @cols @resize 132, @rows when 6 @originMode = true when 7 @wraparoundMode = true when 66 @applicationKeypad = true # X10 Mouse # no release, no motion, no wheel, no modifiers. when 9, 1000, 1002, 1003 # any event mouse # any event - sends motion events, # even if there is no button held down. @x10Mouse = params is 9 @vt200Mouse = params is 1000 @normalMouse = params > 1000 @mouseEvents = true @body.style.cursor = 'pointer' when 1004 # send focusin/focusout events # focusin: ^[[I # focusout: ^[[O @sendFocus = true when 1005 # utf8 ext mode mouse @utfMouse = true # for wide terminals # simply encodes large values as utf8 characters when 1006 # sgr ext mode mouse @sgrMouse = true # for wide terminals # does not add 32 to fields # press: ^[[<b;x;yM # release: ^[[<b;x;ym when 1015 # urxvt ext mode mouse @urxvtMouse = true # for wide terminals # numbers for fields # press: ^[[b;x;yM # motion: ^[[b;x;yT when 25 # show cursor @cursorHidden = false # alt screen buffer cursor #@saveCursor(); when 1049, 47, 1047 # alt screen buffer unless @normal normal = screen: @screen x: @x y: @y shift: @shift scrollTop: @scrollTop scrollBottom: @scrollBottom tabs: @tabs @reset() @normal = normal @showCursor() # CSI Pm l Reset Mode (RM). # Ps = 2 -> Keyboard Action Mode (AM). # Ps = 4 -> Replace Mode (IRM). # Ps = 1 2 -> Send/receive (SRM). # Ps = 2 0 -> Normal Linefeed (LNM). # CSI ? Pm l # DEC Private Mode Reset (DECRST). # Ps = 1 -> Normal Cursor Keys (DECCKM). # Ps = 2 -> Designate VT52 mode (DECANM). # Ps = 3 -> 80 Column Mode (DECCOLM). # Ps = 4 -> Jump (Fast) Scroll (DECSCLM). # Ps = 5 -> Normal Video (DECSCNM). # Ps = 6 -> Normal Cursor Mode (DECOM). # Ps = 7 -> No Wraparound Mode (DECAWM). # Ps = 8 -> No Auto-repeat Keys (DECARM). # Ps = 9 -> Don't send Mouse X & Y on button press. # Ps = 1 0 -> Hide toolbar (rxvt). # Ps = 1 2 -> Stop Blinking Cursor (att610). # Ps = 1 8 -> Don't print form feed (DECPFF). # Ps = 1 9 -> Limit print to scrolling region (DECPEX). # Ps = 2 5 -> Hide Cursor (DECTCEM). # Ps = 3 0 -> Don't show scrollbar (rxvt). # Ps = 3 5 -> Disable font-shifting functions (rxvt). # Ps = 4 0 -> Disallow 80 -> 132 Mode. # Ps = 4 1 -> No more(1) fix (see curses resource). # Ps = 4 2 -> Disable Nation Replacement Character sets (DEC- # NRCM). # Ps = 4 4 -> Turn Off Margin Bell. # Ps = 4 5 -> No Reverse-wraparound Mode. # Ps = 4 6 -> Stop Logging. (This is normally disabled by a # compile-time option). # Ps = 4 7 -> Use Normal Screen Buffer. # Ps = 6 6 -> Numeric keypad (DECNKM). # Ps = 6 7 -> Backarrow key sends delete (DECBKM). # Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and # release. See the section Mouse Tracking. # Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking. # Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking. # Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking. # Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events. # Ps = 1 0 0 5 -> Disable Extended Mouse Mode. # Ps = 1 0 1 0 -> Don't scroll to bottom on tty output # (rxvt). # Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt). # Ps = 1 0 3 4 -> Don't interpret "meta" key. (This disables # the eightBitInput resource). # Ps = 1 0 3 5 -> Disable special modifiers for Alt and Num- # Lock keys. (This disables the numLock resource). # Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key. # (This disables the metaSendsEscape resource). # Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad # Delete key. # Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key. # (This disables the altSendsEscape resource). # Ps = 1 0 4 0 -> Do not keep selection when not highlighted. # (This disables the keepSelection resource). # Ps = 1 0 4 1 -> Use the PRIMARY selection. (This disables # the selectToClipboard resource). # Ps = 1 0 4 2 -> Disable Urgency window manager hint when # Control-G is received. (This disables the bellIsUrgent # resource). # Ps = 1 0 4 3 -> Disable raising of the window when Control- # G is received. (This disables the popOnBell resource). # Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen # first if in the Alternate Screen. (This may be disabled by # the titeInhibit resource). # Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be # disabled by the titeInhibit resource). # Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor # as in DECRC. (This may be disabled by the titeInhibit # resource). This combines the effects of the 1 0 4 7 and 1 0 # 4 8 modes. Use this with terminfo-based applications rather # than the 4 7 mode. # Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode. # Ps = 1 0 5 1 -> Reset Sun function-key mode. # Ps = 1 0 5 2 -> Reset HP function-key mode. # Ps = 1 0 5 3 -> Reset SCO function-key mode. # Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6). # Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style. # Ps = 2 0 0 4 -> Reset bracketed paste mode. resetMode: (params) -> if typeof params is "object" l = params.length i = 0 while i < l @resetMode params[i] i++ return if not @prefix switch params when 4 @insertMode = false when 20 @convertEol = false return if @prefix is "?" switch params when 1 @applicationCursor = false when 3 @resize @savedCols, @rows if @cols is 132 and @savedCols delete @savedCols when 6 @originMode = false when 7 @wraparoundMode = false when 66 @applicationKeypad = false when 9, 1000, 1002 , 1003 # any event mouse @x10Mouse = false @vt200Mouse = false @normalMouse = false @mouseEvents = false @body.style.cursor = "" when 1004 # send focusin/focusout events @sendFocus = false when 1005 # utf8 ext mode mouse @utfMouse = false when 1006 # sgr ext mode mouse @sgrMouse = false when 1015 # urxvt ext mode mouse @urxvtMouse = false when 25 # hide cursor @cursorHidden = true when 1049, 47, 1047 # normal screen buffer - clearing it first if @normal @screen = @normal.screen @x = @normal.x @y = @normal.y @shift = @normal.shift @scrollTop = @normal.scrollTop @scrollBottom = @normal.scrollBottom @tabs = @normal.tabs @normal = null @reset() @showCursor() # CSI Ps ; Ps r # Set Scrolling Region [top;bottom] (default = full size of win- # dow) (DECSTBM). # CSI ? Pm r setScrollRegion: (params) -> return if @prefix @scrollTop = (params[0] or 1) - 1 @scrollBottom = (params[1] or @rows) - 1 @x = 0 @y = 0 # CSI s # Save cursor (ANSI.SYS). saveCursor: (params) -> @savedX = @x @savedY = @y # CSI u # Restore cursor (ANSI.SYS). restoreCursor: (params) -> @x = @savedX or 0 @y = @savedY or 0 ## Lesser Used ## # CSI Ps I # Cursor Forward Tabulation Ps tab stops (default = 1) (CHT). cursorForwardTab: (params) -> param = params[0] or 1 @x = @nextStop() while param-- # CSI Ps S Scroll up Ps lines (default = 1) (SU). scrollUp: (params) -> param = params[0] or 1 while param-- @screen.splice @scrollTop, 1 @screen.splice @scrollBottom, 0, [@blankLine(), true] for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true # CSI Ps T Scroll down Ps lines (default = 1) (SD). scrollDown: (params) -> param = params[0] or 1 while param-- @screen.splice @scrollBottom, 1 @screen.splice @scrollTop, 0, [@blankLine(), true] for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true # CSI Ps ; Ps ; Ps ; Ps ; Ps T # Initiate highlight mouse tracking. Parameters are # [func;startx;starty;firstrow;lastrow]. See the section Mouse # Tracking. initMouseTracking: (params) -> # Relevant: DECSET 1001 # CSI > Ps; Ps T # Reset one or more features of the title modes to the default # value. Normally, "reset" disables the feature. It is possi- # ble to disable the ability to reset features by compiling a # different default for the title modes into xterm. # Ps = 0 -> Do not set window/icon labels using hexadecimal. # Ps = 1 -> Do not query window/icon labels using hexadeci- # mal. # Ps = 2 -> Do not set window/icon labels using UTF-8. # Ps = 3 -> Do not query window/icon labels using UTF-8. # (See discussion of "Title Modes"). resetTitleModes: (params) -> # CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). cursorBackwardTab: (params) -> param = params[0] or 1 @x = @prevStop() while param-- # CSI Ps b Repeat the preceding graphic character Ps times (REP). repeatPrecedingCharacter: (params) -> param = params[0] or 1 line = @screen[@y + @shift][0] ch = line[@x - 1] or @defAttr line[@x++] = ch while param-- @screen[@y + @shift][1] = true # CSI Ps g Tab Clear (TBC). # Ps = 0 -> Clear Current Column (default). # Ps = 3 -> Clear All. # Potentially: # Ps = 2 -> Clear Stops on Line. # http://vt100.net/annarbor/aaa-ug/section6.html tabClear: (params) -> param = params[0] if param <= 0 delete @tabs[@x] else @tabs = {} if param is 3 # CSI Pm i Media Copy (MC). # Ps = 0 -> Print screen (default). # Ps = 4 -> Turn off printer controller mode. # Ps = 5 -> Turn on printer controller mode. # CSI ? Pm i # Media Copy (MC, DEC-specific). # Ps = 1 -> Print line containing cursor. # Ps = 4 -> Turn off autoprint mode. # Ps = 5 -> Turn on autoprint mode. # Ps = 1 0 -> Print composed display, ignores DECPEX. # Ps = 1 1 -> Print all pages. mediaCopy: (params) -> # CSI > Ps; Ps m # Set or reset resource-values used by xterm to decide whether # to construct escape sequences holding information about the # modifiers pressed with a given key. The first parameter iden- # tifies the resource to set/reset. The second parameter is the # value to assign to the resource. If the second parameter is # omitted, the resource is reset to its initial value. # Ps = 1 -> modifyCursorKeys. # Ps = 2 -> modifyFunctionKeys. # Ps = 4 -> modifyOtherKeys. # If no parameters are given, all resources are reset to their # initial values. setResources: (params) -> # CSI > Ps n # Disable modifiers which may be enabled via the CSI > Ps; Ps m # sequence. This corresponds to a resource value of "-1", which # cannot be set with the other sequence. The parameter identi- # fies the resource to be disabled: # Ps = 1 -> modifyCursorKeys. # Ps = 2 -> modifyFunctionKeys. # Ps = 4 -> modifyOtherKeys. # If the parameter is omitted, modifyFunctionKeys is disabled. # When modifyFunctionKeys is disabled, xterm uses the modifier # keys to make an extended sequence of functions rather than # adding a parameter to each function key to denote the modi- # fiers. disableModifiers: (params) -> # CSI > Ps p # Set resource value pointerMode. This is used by xterm to # decide whether to hide the pointer cursor as the user types. # Valid values for the parameter: # Ps = 0 -> never hide the pointer. # Ps = 1 -> hide if the mouse tracking mode is not enabled. # Ps = 2 -> always hide the pointer. If no parameter is # given, xterm uses the default, which is 1 . setPointerMode: (params) -> # CSI ! p Soft terminal reset (DECSTR). # http://vt100.net/docs/vt220-rm/table4-10.html softReset: (params) -> @cursorHidden = false @insertMode = false @originMode = false @wraparoundMode = false # autowrap @applicationKeypad = false # ? @applicationCursor = false @scrollTop = 0 @scrollBottom = @rows - 1 @curAttr = @defAttr @x = @y = 0 # ? @charset = null @glevel = 0 # ?? @charsets = [null] # ?? # CSI Ps$ p # Request ANSI mode (DECRQM). For VT300 and up, reply is # CSI Ps; Pm$ y # where Ps is the mode number as in RM, and Pm is the mode # value: # 0 - not recognized # 1 - set # 2 - reset # 3 - permanently set # 4 - permanently reset requestAnsiMode: (params) -> # CSI ? Ps$ p # Request DEC private mode (DECRQM). For VT300 and up, reply is # CSI ? Ps; Pm$ p # where Ps is the mode number as in DECSET, Pm is the mode value # as in the ANSI DECRQM. requestPrivateMode: (params) -> # CSI Ps ; Ps " p # Set conformance level (DECSCL). Valid values for the first # parameter: # Ps = 6 1 -> VT100. # Ps = 6 2 -> VT200. # Ps = 6 3 -> VT300. # Valid values for the second parameter: # Ps = 0 -> 8-bit controls. # Ps = 1 -> 7-bit controls (always set for VT100). # Ps = 2 -> 8-bit controls. setConformanceLevel: (params) -> # CSI Ps q Load LEDs (DECLL). # Ps = 0 -> Clear all LEDS (default). # Ps = 1 -> Light Num Lock. # Ps = 2 -> Light Caps Lock. # Ps = 3 -> Light Scroll Lock. # Ps = 2 1 -> Extinguish Num Lock. # Ps = 2 2 -> Extinguish Caps Lock. # Ps = 2 3 -> Extinguish Scroll Lock. loadLEDs: (params) -> # CSI Ps SP q # Set cursor style (DECSCUSR, VT520). # Ps = 0 -> blinking block. # Ps = 1 -> blinking block (default). # Ps = 2 -> steady block. # Ps = 3 -> blinking underline. # Ps = 4 -> steady underline. setCursorStyle: (params) -> # CSI Ps " q # Select character protection attribute (DECSCA). Valid values # for the parameter: # Ps = 0 -> DECSED and DECSEL can erase (default). # Ps = 1 -> DECSED and DECSEL cannot erase. # Ps = 2 -> DECSED and DECSEL can erase. setCharProtectionAttr: (params) -> # CSI ? Pm r # Restore DEC Private Mode Values. The value of Ps previously # saved is restored. Ps values are the same as for DECSET. restorePrivateValues: (params) -> # CSI Pt; Pl; Pb; Pr; Ps$ r # Change Attributes in Rectangular Area (DECCARA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. # Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. # NOTE: xterm doesn't enable this code by default. setAttrInRectangle: (params) -> t = params[0] l = params[1] b = params[2] r = params[3] attr = params[4] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @cloneAttr attr, line[i].ch i++ t++ # CSI ? Pm s # Save DEC Private Mode Values. Ps values are the same as for # DECSET. savePrivateValues: (params) -> # CSI Ps ; Ps ; Ps t # Window manipulation (from dtterm, as well as extensions). # These controls may be disabled using the allowWindowOps # resource. Valid values for the first (and any additional # parameters) are: # Ps = 1 -> De-iconify window. # Ps = 2 -> Iconify window. # Ps = 3 ; x ; y -> Move window to [x, y]. # Ps = 4 ; height ; width -> Resize the xterm window to # height and width in pixels. # Ps = 5 -> Raise the xterm window to the front of the stack- # ing order. # Ps = 6 -> Lower the xterm window to the bottom of the # stacking order. # Ps = 7 -> Refresh the xterm window. # Ps = 8 ; height ; width -> Resize the text area to # [height;width] in characters. # Ps = 9 ; 0 -> Restore maximized window. # Ps = 9 ; 1 -> Maximize window (i.e., resize to screen # size). # Ps = 1 0 ; 0 -> Undo full-screen mode. # Ps = 1 0 ; 1 -> Change to full-screen. # Ps = 1 1 -> Report xterm window state. If the xterm window # is open (non-iconified), it returns CSI 1 t . If the xterm # window is iconified, it returns CSI 2 t . # Ps = 1 3 -> Report xterm window position. Result is CSI 3 # ; x ; y t # Ps = 1 4 -> Report xterm window in pixels. Result is CSI # 4 ; height ; width t # Ps = 1 8 -> Report the size of the text area in characters. # Result is CSI 8 ; height ; width t # Ps = 1 9 -> Report the size of the screen in characters. # Result is CSI 9 ; height ; width t # Ps = 2 0 -> Report xterm window's icon label. Result is # OSC L label ST # Ps = 2 1 -> Report xterm window's title. Result is OSC l # label ST # Ps = 2 2 ; 0 -> Save xterm icon and window title on # stack. # Ps = 2 2 ; 1 -> Save xterm icon title on stack. # Ps = 2 2 ; 2 -> Save xterm window title on stack. # Ps = 2 3 ; 0 -> Restore xterm icon and window title from # stack. # Ps = 2 3 ; 1 -> Restore xterm icon title from stack. # Ps = 2 3 ; 2 -> Restore xterm window title from stack. # Ps >= 2 4 -> Resize to Ps lines (DECSLPP). manipulateWindow: (params) -> # CSI Pt; Pl; Pb; Pr; Ps$ t # Reverse Attributes in Rectangular Area (DECRARA), VT400 and # up. # Pt; Pl; Pb; Pr denotes the rectangle. # Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. # NOTE: xterm doesn't enable this code by default. reverseAttrInRectangle: (params) -> # CSI > Ps; Ps t # Set one or more features of the title modes. Each parameter # enables a single feature. # Ps = 0 -> Set window/icon labels using hexadecimal. # Ps = 1 -> Query window/icon labels using hexadecimal. # Ps = 2 -> Set window/icon labels using UTF-8. # Ps = 3 -> Query window/icon labels using UTF-8. (See dis- # cussion of "Title Modes") setTitleModeFeature: (params) -> # CSI Ps SP t # Set warning-bell volume (DECSWBV, VT520). # Ps = 0 or 1 -> off. # Ps = 2 , 3 or 4 -> low. # Ps = 5 , 6 , 7 , or 8 -> high. setWarningBellVolume: (params) -> # CSI Ps SP u # Set margin-bell volume (DECSMBV, VT520). # Ps = 1 -> off. # Ps = 2 , 3 or 4 -> low. # Ps = 0 , 5 , 6 , 7 , or 8 -> high. setMarginBellVolume: (params) -> # CSI Pt; Pl; Pb; Pr; Pp; Pt; Pl; Pp$ v # Copy Rectangular Area (DECCRA, VT400 and up). # Pt; Pl; Pb; Pr denotes the rectangle. # Pp denotes the source page. # Pt; Pl denotes the target location. # Pp denotes the target page. # NOTE: xterm doesn't enable this code by default. copyRectangle: (params) -> # CSI Pt ; Pl ; Pb ; Pr ' w # Enable Filter Rectangle (DECEFR), VT420 and up. # Parameters are [top;left;bottom;right]. # Defines the coordinates of a filter rectangle and activates # it. Anytime the locator is detected outside of the filter # rectangle, an outside rectangle event is generated and the # rectangle is disabled. Filter rectangles are always treated # as "one-shot" events. Any parameters that are omitted default # to the current locator position. If all parameters are omit- # ted, any locator motion will be reported. DECELR always can- # cels any prevous rectangle definition. enableFilterRectangle: (params) -> # CSI Ps x Request Terminal Parameters (DECREQTPARM). # if Ps is a "0" (default) or "1", and xterm is emulating VT100, # the control sequence elicits a response of the same form whose # parameters describe the terminal: # Ps -> the given Ps incremented by 2. # Pn = 1 <- no parity. # Pn = 1 <- eight bits. # Pn = 1 <- 2 8 transmit 38.4k baud. # Pn = 1 <- 2 8 receive 38.4k baud. # Pn = 1 <- clock multiplier. # Pn = 0 <- STP flags. requestParameters: (params) -> # CSI Ps x Select Attribute Change Extent (DECSACE). # Ps = 0 -> from start to end position, wrapped. # Ps = 1 -> from start to end position, wrapped. # Ps = 2 -> rectangle (exact). selectChangeExtent: (params) -> # CSI Pc; Pt; Pl; Pb; Pr$ x # Fill Rectangular Area (DECFRA), VT420 and up. # Pc is the character to use. # Pt; Pl; Pb; Pr denotes the rectangle. # NOTE: xterm doesn't enable this code by default. fillRectangle: (params) -> ch = params[0] t = params[1] l = params[2] b = params[3] r = params[4] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @cloneAttr line[i][0], String.fromCharCode(ch) i++ t++ # CSI Ps ; Pu ' z # Enable Locator Reporting (DECELR). # Valid values for the first parameter: # Ps = 0 -> Locator disabled (default). # Ps = 1 -> Locator enabled. # Ps = 2 -> Locator enabled for one report, then disabled. # The second parameter specifies the coordinate unit for locator # reports. # Valid values for the second parameter: # Pu = 0 <- or omitted -> default to character cells. # Pu = 1 <- device physical pixels. # Pu = 2 <- character cells. enableLocatorReporting: (params) -> val = params[0] > 0 # CSI Pt; Pl; Pb; Pr$ z # Erase Rectangular Area (DECERA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. # NOTE: xterm doesn't enable this code by default. eraseRectangle: (params) -> t = params[0] l = params[1] b = params[2] r = params[3] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @eraseAttr() i++ t++ # CSI Pm ' { # Select Locator Events (DECSLE). # Valid values for the first (and any additional parameters) # are: # Ps = 0 -> only respond to explicit host requests (DECRQLP). # (This is default). It also cancels any filter # rectangle. # Ps = 1 -> report button down transitions. # Ps = 2 -> do not report button down transitions. # Ps = 3 -> report button up transitions. # Ps = 4 -> do not report button up transitions. setLocatorEvents: (params) -> # CSI Pt; Pl; Pb; Pr$ { # Selective Erase Rectangular Area (DECSERA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. selectiveEraseRectangle: (params) -> # CSI Ps ' | # Request Locator Position (DECRQLP). # Valid values for the parameter are: # Ps = 0 , 1 or omitted -> transmit a single DECLRP locator # report. # If Locator Reporting has been enabled by a DECELR, xterm will # respond with a DECLRP Locator Report. This report is also # generated on button up and down events if they have been # enabled with a DECSLE, or when the locator is detected outside # of a filter rectangle, if filter rectangles have been enabled # with a DECEFR. # -> CSI Pe ; Pb ; Pr ; Pc ; Pp & w # Parameters are [event;button;row;column;page]. # Valid values for the event: # Pe = 0 -> locator unavailable - no other parameters sent. # Pe = 1 -> request - xterm received a DECRQLP. # Pe = 2 -> left button down. # Pe = 3 -> left button up. # Pe = 4 -> middle button down. # Pe = 5 -> middle button up. # Pe = 6 -> right button down. # Pe = 7 -> right button up. # Pe = 8 -> M4 button down. # Pe = 9 -> M4 button up. # Pe = 1 0 -> locator outside filter rectangle. # ``button'' parameter is a bitmask indicating which buttons are # pressed: # Pb = 0 <- no buttons down. # Pb & 1 <- right button down. # Pb & 2 <- middle button down. # Pb & 4 <- left button down. # Pb & 8 <- M4 button down. # ``row'' and ``column'' parameters are the coordinates of the # locator position in the xterm window, encoded as ASCII deci- # mal. # The ``page'' parameter is not used by xterm, and will be omit- # ted. requestLocatorPosition: (params) -> # CSI P m SP } # Insert P s Column(s) (default = 1) (DECIC), VT420 and up. # NOTE: xterm doesn't enable this code by default. insertColumns: -> param = params[0] l = @rows + @shift while param-- i = @shift while i < l @screen[i][0].splice @x + 1, 0, @eraseAttr() @screen[i][0].pop() i++ @screen[i][1] = true # CSI P m SP ~ # Delete P s Column(s) (default = 1) (DECDC), VT420 and up # NOTE: xterm doesn't enable this code by default. deleteColumns: -> param = params[0] l = @rows + @shift while param-- i = @shift while i < l @screen[i][0].splice @x, 1 @screen[i][0].push @eraseAttr() i++ @screen[i][1] = true # DEC Special Character and Line Drawing Set. # http://vt100.net/docs/vt102-ug/table5-13.html # A lot of curses apps use this if they see TERM=xterm. # testing: echo -e '\e(0a\e(B' # The xterm output sometimes seems to conflict with the # reference above. xterm seems in line with the reference # when running vttest however. # The table below now uses xterm's output from vttest. charsets: SCLD:# (0 "`": "◆" # '◆' a: "▒" # '▒' b: "\t" # '\t' c: "\f" # '\f' d: "\r" # '\r' e: "\n" # '\n' f: "°" # '°' g: "±" # '±' h: "␤" # '\u2424' (NL) i: "\x0b" # '\v' j: "┘" # '┘' k: "┐" # '┐' l: "┌" # '┌' m: "└" # '└' n: "┼" # '┼' o: "⎺" # '⎺' p: "⎻" # '⎻' q: "─" # '─' r: "⎼" # '⎼' s: "⎽" # '⎽' t: "├" # '├' u: "┤" # '┤' v: "┴" # '┴' w: "┬" # '┬' x: "│" # '│' y: "≤" # '≤' z: "≥" # '≥' "{": "π" # 'π' "|": "≠" # '≠' "}": "£" # '£' "~": "·" # '·' UK: null # (A US: null # (B (USASCII) Dutch: null # (4 Finnish: null # (C or (5 French: null # (R FrenchCanadian: null # (Q German: null # (K Italian: null # (Y NorwegianDanish: null # (E or (6 Spanish: null # (Z Swedish: null # (H or (7 Swiss: null # (= ISOLatin: null # /A window.Terminal = Terminal
216317
# *-* coding: utf-8 *-* # This file is part of butterfly # # butterfly Copyright (C) 2014 <NAME> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # This has been forked from term.js # # Copyright (c) 2012-2013, <NAME> (MIT License) # https://github.com/chjj/term.js # # # which has been forked from jslinux # # Copyright (c) 2011 <NAME> # http://bellard.org/jslinux/ cancel = (ev) -> ev.preventDefault() if ev.preventDefault ev.stopPropagation() if ev.stopPropagation ev.cancelBubble = true false s = 0 State = normal: s++ escaped: s++ csi: s++ osc: s++ charset: s++ dcs: s++ ignore: s++ class Terminal constructor: (@parent, @out, @ctl=->) -> # Global elements @document = @parent.ownerDocument @body = @document.getElementsByTagName('body')[0] @htmlEscapesEnabled = @body.getAttribute('data-allow-html') is 'yes' @forceWidth = @body.getAttribute( 'data-force-unicode-width') is 'yes' # Main terminal element @body.className = 'terminal focus' @body.style.outline = 'none' @body.setAttribute 'tabindex', 0 @body.setAttribute 'spellcheck', 'false' # Adding one line to compute char size div = @document.createElement('div') div.className = 'line' @body.appendChild(div) @children = [div] @computeCharSize() @cols = Math.floor(@body.clientWidth / @charSize.width) @rows = Math.floor(window.innerHeight / @charSize.height) px = window.innerHeight % @charSize.height @body.style['padding-bottom'] = "#{px}px" @scrollback = 1000000 @buffSize = 100000 @visualBell = 100 @convertEol = false @termName = 'xterm' @cursorBlink = true @cursorState = 0 @stop = false @lastcc = 0 @resetVars() @focus() @startBlink() addEventListener 'keydown', @keyDown.bind(@) addEventListener 'keypress', @keyPress.bind(@) addEventListener 'focus', @focus.bind(@) addEventListener 'blur', @blur.bind(@) addEventListener 'resize', => @resize() # # Horrible Firefox paste workaround if typeof InstallTrigger isnt "undefined" @body.contentEditable = 'true' @initmouse() setTimeout(@resize.bind(@), 100) cloneAttr: (a, char=null) -> bg: a.bg fg: a.fg ch: unless char is null then char else a.ch bold: a.bold underline: a.underline blink: a.blink inverse: a.inverse invisible: a.invisible equalAttr: (a, b) -> # Not testing char (a.bg is b.bg and a.fg is b.fg and a.bold is b.bold and a.underline is b.underline and a.blink is b.blink and a.inverse is b.inverse and a.invisible is b.invisible) putChar: (c) -> if @insertMode @screen[@y + @shift][0].splice(@x, 0, @cloneAttr @curAttr, c) @screen[@y + @shift][0].pop() else @screen[@y + @shift][0][@x] = @cloneAttr @curAttr, c @screen[@y + @shift][1] = true resetVars: -> @x = 0 @y = 0 @cursorHidden = false @state = State.normal @queue = '' @scrollTop = 0 @scrollBottom = @rows - 1 @scrollLock = false # modes @applicationKeypad = false @applicationCursor = false @originMode = false @wraparoundMode = false @normal = null # charset @charset = null @gcharset = null @glevel = 0 @charsets = [null] # stream @defAttr = bg: 256 fg: 257 ch: " " bold: false underline: false blink: false inverse: false invisible: false @curAttr = @cloneAttr @defAttr @params = [] @currentParam = 0 @prefix = "" @screen = [] i = @rows @shift = 0 @screen.push [@blankLine(), true] while i-- @setupStops() @skipNextKey = null computeCharSize: -> testSpan = document.createElement('span') testSpan.textContent = '0123456789' @children[0].appendChild(testSpan) @charSize = width: testSpan.getBoundingClientRect().width / 10 height: @children[0].getBoundingClientRect().height @children[0].removeChild(testSpan) eraseAttr: -> erased = @cloneAttr @defAttr erased.bg = @curAttr.bg erased focus: -> @send('\x1b[I') if @sendFocus @showCursor() @body.classList.add('focus') @body.classList.remove('blur') blur: -> @cursorState = 1 @screen[@y + @shift][1] = true @refresh() @send('\x1b[O') if @sendFocus @body.classList.add('blur') @body.classList.remove('focus') # XTerm mouse events # http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking # To better understand these # the xterm code is very helpful: # Relevant files: # button.c, charproc.c, misc.c # Relevant functions in xterm/button.c: # BtnCode, EmitButtonCode, EditorButton, SendMousePosition initmouse: -> pressed = 32 # mouseup, mousedown, mousewheel # left click: ^[[M 3<^[[M#3< # mousewheel up: ^[[M`3> sendButton = (ev) -> # get the xterm-style button button = getButton(ev) # get mouse coordinates pos = getCoords(ev) return unless pos sendEvent button, pos, ev.type pressed = button # motion example of a left click: # ^[[M 3<^[[M@4<^[[M@5<^[[M@6<^[[M@7<^[[M#7< sendMove = (ev) -> button = pressed pos = getCoords(ev) return unless pos # buttons marked as motions # are incremented by 32 button += 32 sendEvent button, pos, ev.type # encode button and # position to characters encode = (data, ch) => unless @utfMouse return data.push(0) if ch is 255 ch = 127 if ch > 127 data.push ch else return data.push(0) if ch is 2047 if ch < 127 data.push ch else ch = 2047 if ch > 2047 data.push 0xC0 | (ch >> 6) data.push 0x80 | (ch & 0x3F) # send a mouse event: # regular/utf8: ^[[M Cb Cx Cy # urxvt: ^[[ Cb ; Cx ; Cy M # sgr: ^[[ Cb ; Cx ; Cy M/m # vt300: ^[[ 24(1/3/5)~ [ Cx , Cy ] \r # locator: CSI P e ; P b ; P r ; P c ; P p & w sendEvent = (button, pos, type) => if @urxvtMouse pos.x -= 32 pos.y -= 32 pos.x++ pos.y++ @send "\x1b[" + button + ";" + pos.x + ";" + pos.y + "M" return if @sgrMouse pos.x -= 32 pos.y -= 32 button -= 32 @send "\x1b[<" + button + ";" + pos.x + ";" + pos.y + ( if type is "mouseup" then "m" else "M" ) return data = [] encode data, button encode data, pos.x encode data, pos.y @send "\x1b[M" + String.fromCharCode.apply(String, data) getButton = (ev) => # two low bits: # 0 = left # 1 = middle # 2 = right # 3 = release # wheel up/down: # 1, and 2 - with 64 added switch ev.type when "mousedown" button = if ev.button? then +ev.button else ( if ev.which? then ev.which - 1 else null) when "mouseup" button = 3 when "wheel" button = if ev.deltaY < 0 then 64 else 65 # next three bits are the modifiers: # 4 = shift, 8 = meta, 16 = control shift = if ev.shiftKey then 4 else 0 meta = if ev.metaKey then 8 else 0 ctrl = if ev.ctrlKey then 16 else 0 mod = shift | meta | ctrl # no mods if @vt200Mouse # ctrl only mod &= ctrl else unless @normalMouse mod = 0 # increment to SP (32 + (mod << 2)) + button # mouse coordinates measured in cols/rows getCoords = (ev) => x = ev.pageX y = ev.pageY - window.scrollY # convert to cols/rows w = @body.clientWidth h = window.innerHeight x = Math.ceil((x / w) * @cols) y = Math.ceil((y / h) * @rows) # be sure to avoid sending # bad positions to the program x = 0 if x < 0 x = @cols if x > @cols y = 0 if y < 0 y = @rows if y > @rows # xterm sends raw bytes and # starts at 32 (SP) for each. x += 32 y += 32 x: x y: y type: ev.type addEventListener "contextmenu", (ev) => return unless @mouseEvents cancel ev addEventListener "mousedown", (ev) => return unless @mouseEvents # send the button sendButton ev # fix for odd bug sm = sendMove.bind(this) addEventListener "mousemove", sm # x10 compatibility mode can't send button releases unless @x10Mouse addEventListener "mouseup", up = (ev) -> sendButton ev removeEventListener "mousemove", sm removeEventListener "mouseup", up cancel ev cancel ev addEventListener "wheel", (ev) => if @mouseEvents return if @x10Mouse sendButton ev cancel ev linkify: (t) -> # http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links urlPattern = ( /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim) pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim emailAddressPattern = /[\w.]+@[a-zA-Z_-]+?(?:\.[a-zA-Z]{2,6})+/gim (part .replace(urlPattern, '<a href="$&">$&</a>') .replace(pseudoUrlPattern, '$1<a href="http://$2">$2</a>') .replace(emailAddressPattern, '<a href="mailto:$&">$&</a>' ) for part in t.split('&nbsp;')).join('&nbsp;') refresh: (force=false) -> for cursor in @body.querySelectorAll(".cursor") cursor.parentNode.replaceChild( @document.createTextNode(cursor.textContent), cursor) newOut = '' for [line, dirty], j in @screen continue unless dirty or force out = "" if j is @y + @shift and not @cursorHidden x = @x else x = -Infinity attr = @cloneAttr @defAttr skipnext = false for i in [0..@cols - 1] data = line[i] if data.html out += data.html continue if skipnext skipnext = false continue ch = data.ch unless @equalAttr data, attr out += "</span>" unless @equalAttr attr, @defAttr unless @equalAttr data, @defAttr classes = [] styles = [] out += "<span " # bold classes.push "bold" if data.bold # underline classes.push "underline" if data.underline # blink classes.push "blink" if data.blink # inverse classes.push "reverse-video" if data.inverse # invisible classes.push "invisible" if data.invisible if typeof data.fg is 'number' fg = data.fg if data.bold and fg < 8 fg += 8 classes.push "fg-color-" + fg if typeof data.fg is 'string' styles.push "color: " + data.fg if typeof data.bg is 'number' classes.push "bg-color-" + data.bg if typeof data.bg is 'string' styles.push "background-color: " + data.bg out += "class=\"" out += classes.join(" ") out += "\"" if styles.length out += " style=\"" + styles.join("; ") + "\"" out += ">" out += "<span class=\"" + ( if @cursorState then "reverse-video " else "" ) + "cursor\">" if i is x # This is a temporary dirty hack for raw html insertion if ch.length > 1 out += ch else switch ch when "&" out += "&amp;" when "<" out += "&lt;" when ">" out += "&gt;" else if ch == " " out += '<span class="nbsp">\u2007</span>' else if ch <= " " out += "&nbsp;" else if not @forceWidth or ch <= "~" # Ascii chars out += ch else if "\uff00" < ch < "\uffef" skipnext = true out += "<span style=\"display: inline-block; width: #{2 * @charSize.width}px\">#{ch}</span>" else out += "<span style=\"display: inline-block; width: #{@charSize.width}px\">#{ch}</span>" out += "</span>" if i is x attr = data out += "</span>" unless @equalAttr attr, @defAttr out = @linkify(out) unless j is @y + @shift if @children[j] @children[j].innerHTML = out else newOut += "<div class=\"line\">#{out}</div>" @screen[j][1] = false if newOut isnt '' group = @document.createElement('div') group.className = 'group' group.innerHTML = newOut @body.appendChild group @screen = @screen.slice(-@rows) @shift = 0 lines = document.querySelectorAll('.line') if lines.length > @scrollback for line in Array.prototype.slice.call( lines, 0, lines.length - @scrollback) line.remove() for group in document.querySelectorAll('.group:empty') group.remove() lines = document.querySelectorAll('.line') @children = Array.prototype.slice.call( lines, -@rows) @nativeScrollTo() unless @scrollLock _cursorBlink: -> @cursorState ^= 1 cursor = @body.querySelector(".cursor") return unless cursor if cursor.classList.contains("reverse-video") cursor.classList.remove "reverse-video" else cursor.classList.add "reverse-video" showCursor: -> unless @cursorState @cursorState = 1 @screen[@y + @shift][1] = true @refresh() startBlink: -> return unless @cursorBlink @_blinker = => @_cursorBlink() @t_blink = setInterval(@_blinker, 500) refreshBlink: -> return unless @cursorBlink clearInterval @t_blink @t_blink = setInterval(@_blinker, 500) scroll: -> # Use emulated scroll in alternate buffer or when scroll region is defined if @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 # inner scroll @screen.splice @shift + @scrollBottom + 1, 0, [@blankLine(), true] @screen.splice @shift + @scrollTop, 1 for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true else @screen.push [@blankLine(), true] @shift++ unscroll: -> @screen.splice @shift + @scrollTop , 0, [@blankLine(true), true] @screen.splice @shift + @scrollBottom + 1, 1 for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true nativeScrollTo: (scroll=2000000000) -> # ~ Max ff number window.scrollTo 0, scroll scrollDisplay: (disp) -> @nativeScrollTo window.scrollY + disp * @charSize.height nextLine: -> @y++ if @y > @scrollBottom @y-- @scroll() prevLine: -> @y-- if @y < @scrollTop @y++ @unscroll() write: (data) -> i = 0 l = data.length while i < l ch = data.charAt(i) switch @state when State.normal switch ch # '\a' when "\x07" @bell() # '\n', '\v', '\f' when "\n", "\x0b", "\x0c" # @x = 0 if @convertEol @nextLine() # '\r' when "\r" @x = 0 # '\b' when "\b" @x-- if @x > 0 # '\t' when "\t" @x = @nextStop() # shift out when "\x0e" @setgLevel 1 # shift in when "\x0f" @setgLevel 0 # '\e' when "\x1b" @state = State.escaped else # ' ' if ch >= " " ch = @charset[ch] if @charset?[ch] if @x >= @cols @putChar '\u23CE' @x = 0 @nextLine() @putChar ch @x++ if @forceWidth and "\uff00" < ch < "\uffef" if @cols < 2 or @x >= @cols @putChar " " break @putChar " " @x++ when State.escaped switch ch # ESC [ Control Sequence Introducer ( CSI is 0x9b). when "[" @params = [] @currentParam = 0 @state = State.csi # ESC ] Operating System Command ( OSC is 0x9d). when "]" @params = [] @currentParam = 0 @state = State.osc # ESC P Device Control String ( DCS is 0x90). when "P" @params = [] @currentParam = 0 @state = State.dcs # ESC _ Application Program Command ( APC is 0x9f). when "_" @state = State.ignore # ESC ^ Privacy Message ( PM is 0x9e). when "^" @state = State.ignore # ESC c Full Reset (RIS). when "c" @reset() # ESC E Next Line ( NEL is 0x85). when "E" @x = 0 @index() # ESC D Index ( IND is 0x84). when "D" @index() # ESC M Reverse Index ( RI is 0x8d). when "M" @reverseIndex() # ESC % Select default/utf-8 character set. # @ = default, G = utf-8 when "%" @setgLevel 0 @setgCharset 0, Terminal::charsets.US @state = State.normal i++ # ESC (,),*,+,-,. Designate G0-G2 Character Set. # <-- this seems to get all the attention when "(", ")" , "*" , "+" , "-" , "." switch ch when "(" @gcharset = 0 when ")", "-" @gcharset = 1 when "*", "." @gcharset = 2 when "+" @gcharset = 3 @state = State.charset # Designate G3 Character Set (VT300). # A = ISO Latin-1 Supplemental. # Not implemented. when "/" @gcharset = 3 @state = State.charset i-- # ESC n # Invoke the G2 Character Set as GL (LS2). when "n" @setgLevel 2 # ESC o # Invoke the G3 Character Set as GL (LS3). when "o" @setgLevel 3 # ESC | # Invoke the G3 Character Set as GR (LS3R). when "|" @setgLevel 3 # ESC } # Invoke the G2 Character Set as GR (LS2R). when "}" @setgLevel 2 # ESC ~ # Invoke the G1 Character Set as GR (LS1R). when "~" @setgLevel 1 # ESC 7 Save Cursor (DECSC). when "7" @saveCursor() @state = State.normal # ESC 8 Restore Cursor (DECRC). when "8" @restoreCursor() @state = State.normal # ESC # 3 DEC line height/width when "#" @state = State.normal i++ num = data.charAt(i) switch num when "3" # DECDHL break when "4" # DECDHL break when "5" # DECSWL break when "6" # DECDWL break when "8" # DECALN for line in @screen line[1] = true for c in [0..line[0].length] line[0][c] = @cloneAttr @curAttr, "E" @x = @y = 0 # ESC H Tab Set (HTS is 0x88). when "H" @tabSet() # ESC = Application Keypad (DECPAM). when "=" @applicationKeypad = true @state = State.normal # ESC > Normal Keypad (DECPNM). when ">" @applicationKeypad = false @state = State.normal else @state = State.normal console.log "Unknown ESC control:", ch when State.charset switch ch when "0" # DEC Special Character and Line Drawing Set. cs = Terminal::charsets.SCLD when "A" # UK cs = Terminal::charsets.UK when "B" # United States (USASCII). cs = Terminal::charsets.US when "4" # Dutch cs = Terminal::charsets.Dutch # Finnish when "C", "5" cs = Terminal::charsets.Finnish when "R" # French cs = Terminal::charsets.French when "Q" # FrenchCanadian cs = Terminal::charsets.FrenchCanadian when "K" # German cs = Terminal::charsets.German when "Y" # Italian cs = Terminal::charsets.Italian # NorwegianDanish when "E", "6" cs = Terminal::charsets.NorwegianDanish when "Z" # Spanish cs = Terminal::charsets.Spanish # Swedish when "H", "7" cs = Terminal::charsets.Swedish when "=" # Swiss cs = Terminal::charsets.Swiss when "/" # ISOLatin (actually /A) cs = Terminal::charsets.ISOLatin i++ else # Default cs = Terminal::charsets.US @setgCharset @gcharset, cs @gcharset = null @state = State.normal when State.osc # OSC Ps ; Pt ST # OSC Ps ; Pt BEL # Set Text Parameters. if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" @params.push @currentParam switch @params[0] when 0, 1, 2 if @params[1] @title = @params[1] + " - ƸӜƷ butterfly" @handleTitle @title # reset colors @params = [] @currentParam = 0 @state = State.normal else unless @params.length if ch >= "0" and ch <= "9" @currentParam = @currentParam * 10 + ch.charCodeAt(0) - 48 else if ch is ";" @params.push @currentParam @currentParam = "" else @currentParam += ch when State.csi # '?', '>', '!' if ch is "?" or ch is ">" or ch is "!" @prefix = ch break # 0 - 9 if ch >= "0" and ch <= "9" @currentParam = @currentParam * 10 + ch.charCodeAt(0) - 48 break # '$', '"', ' ', '\'' if ch is "$" or ch is "\"" or ch is " " or ch is "'" break @params.push @currentParam @currentParam = 0 # ';' break if ch is ";" @state = State.normal switch ch # CSI Ps A # Cursor Up Ps Times (default = 1) (CUU). when "A" @cursorUp @params # CSI Ps B # Cursor Down Ps Times (default = 1) (CUD). when "B" @cursorDown @params # CSI Ps C # Cursor Forward Ps Times (default = 1) (CUF). when "C" @cursorForward @params # CSI Ps D # Cursor Backward Ps Times (default = 1) (CUB). when "D" @cursorBackward @params # CSI Ps ; Ps H # Cursor Position [row;column] (default = [1,1]) (CUP). when "H" @cursorPos @params # CSI Ps J Erase in Display (ED). when "J" @eraseInDisplay @params # CSI Ps K Erase in Line (EL). when "K" @eraseInLine @params # CSI Pm m Character Attributes (SGR). when "m" @charAttributes @params unless @prefix # CSI Ps n Device Status Report (DSR). when "n" @deviceStatus @params unless @prefix # CSI Ps @ # Insert Ps (Blank) Character(s) (default = 1) (ICH). when "@" @insertChars @params # CSI Ps E # Cursor Next Line Ps Times (default = 1) (CNL). when "E" @cursorNextLine @params # CSI Ps F # Cursor Preceding Line Ps Times (default = 1) (CNL). when "F" @cursorPrecedingLine @params # CSI Ps G # Cursor Character Absolute [column] (default = [row,1]) (CHA). when "G" @cursorCharAbsolute @params # CSI Ps L # Insert Ps Line(s) (default = 1) (IL). when "L" @insertLines @params # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). when "M" @deleteLines @params # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). when "P" @deleteChars @params # CSI Ps X # Erase Ps Character(s) (default = 1) (ECH). when "X" @eraseChars @params # CSI Pm ` Character Position Absolute # [column] (default = [row,1]) (HPA). when "`" @charPosAbsolute @params # 141 61 a * HPR - # Horizontal Position Relative when "a" @HPositionRelative @params # CSI P s c # Send Device Attributes (Primary DA). # CSI > P s c # Send Device Attributes (Secondary DA) when "c" @sendDeviceAttributes @params # CSI Pm d # Line Position Absolute [row] (default = [1,column]) (VPA). when "d" @linePosAbsolute @params # 145 65 e * VPR - Vertical Position Relative when "e" @VPositionRelative @params # CSI Ps ; Ps f # Horizontal and Vertical Position [row;column] (default = # [1,1]) (HVP). when "f" @HVPosition @params # CSI Pm h Set Mode (SM). # CSI ? Pm h - mouse escape codes, cursor escape codes when "h" @setMode @params # CSI Pm l Reset Mode (RM). # CSI ? Pm l when "l" @resetMode @params # CSI Ps ; Ps r # Set Scrolling Region [top;bottom] (default = full size of win- # dow) (DECSTBM). # CSI ? Pm r when "r" @setScrollRegion @params # CSI s # Save cursor (ANSI.SYS). when "s" @saveCursor @params # CSI u # Restore cursor (ANSI.SYS). when "u" @restoreCursor @params # CSI Ps I # Cursor Forward Tabulation Ps tab stops (default = 1) (CHT). when "I" @cursorForwardTab @params # CSI Ps S Scroll up Ps lines (default = 1) (SU). when "S" @scrollUp @params # CSI Ps T Scroll down Ps lines (default = 1) (SD). # CSI Ps ; Ps ; Ps ; Ps ; Ps T # CSI > Ps; Ps T when "T" @scrollDown @params if @params.length < 2 and not @prefix # CSI Ps Z # Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). when "Z" @cursorBackwardTab @params # CSI Ps b Repeat the preceding graphic character Ps times (REP). when "b" @repeatPrecedingCharacter @params # CSI Ps g Tab Clear (TBC). when "g" @tabClear @params # CSI > Ps p Set pointer mode. # CSI ! p Soft terminal reset (DECSTR). # CSI Ps$ p # Request ANSI mode (DECRQM). # CSI ? Ps$ p # Request DEC private mode (DECRQM). # CSI Ps ; Ps " p when "p" if @prefix is '!' @softReset @params else console.error "Unknown CSI code: %s.", ch @prefix = "" when State.dcs if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" switch @prefix # User-Defined Keys (DECUDK). when "" # Disabling this for now as we need a good script # striper to avoid malicious script injection pt = @currentParam unless pt[0] is ';' console.error "Unknown DECUDK: #{pt}" break pt = pt.slice(1) [type, content] = pt.split('|', 2) unless content console.error "No type for inline DECUDK: #{pt}" break switch type when "HTML" unless @htmlEscapesEnabled console.log "HTML escapes are disabled" break attr = @cloneAttr @curAttr attr.html = ( "<div class=\"inline-html\">#{content}</div>") @screen[@y + @shift][0][@x] = attr @screen[@y + @shift][1] = true when "IMAGE" # Prevent injection content = encodeURI content if content.indexOf(';') mime = content.slice(0, content.indexOf(';')) b64 = content.slice(content.indexOf(';') + 1) else mime = 'image' b64 = content attr = @cloneAttr @curAttr attr.html = ( "<img class=\"inline-image\" src=\"data:#{mime};base64,#{ b64}\" />") @screen[@y + @shift][0][@x] = attr @screen[@y + @shift][1] = true when "PROMPT" @send content when "TEXT" l += content.length data = data.slice(0, i + 1) + content + data.slice(i + 1) else console.error "Unknown type #{type} for DECUDK" # Request Status String (DECRQSS). # test: echo -e '\eP$q"p\e\\' when "$q" pt = @currentParam valid = false switch pt # DECSCA when "\"q" pt = "0\"q" # DECSCL when "\"p" pt = "61\"p" # DECSTBM when "r" pt = "" + (@scrollTop + 1) + ";" + (@scrollBottom + 1) + "r" # SGR when "m" pt = "0m" else console.error "Unknown DCS Pt: %s.", pt pt = "" @send "\x1bP" + +valid + "$r" + pt + "\x1b\\" when "+q" pt = @currentParam valid = false @send "\x1bP" + +valid + "+r" + pt + "\x1b\\" else console.error "Unknown DCS prefix: %s.", @prefix @currentParam = 0 @prefix = "" @state = State.normal else unless @currentParam if not @prefix and ch isnt "$" and ch isnt "+" @currentParam = ch else if @prefix.length is 2 @currentParam = ch else @prefix += ch else @currentParam += ch when State.ignore # For PM and APC. if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" @state = State.normal i++ @screen[@y + @shift][1] = true @refresh() writeln: (data) -> @write "#{data}\r\n" keyDown: (ev) -> # Key Resources: # https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent # Don't handle modifiers alone return true if ev.keyCode > 15 and ev.keyCode < 19 # Handle shift insert and ctrl insert # copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] # Alt-z works as an escape to relay the following keys to the browser. # usefull to trigger browser shortcuts, i.e.: Alt+Z F5 to reload # May be redundant with keyPrefix if ev.altKey and ev.keyCode is 90 and not @skipNextKey @skipNextKey = true @body.classList.add('skip') return cancel(ev) if @skipNextKey @skipNextKey = false @body.classList.remove('skip') return true switch ev.keyCode # backspace when 8 key = if ev.altKey then "\x1b" else "" if ev.shiftKey key += "\x08" # ^H break key += "\x7f" # ^? # tab when 9 if ev.shiftKey key = "\x1b[Z" break key = "\t" # return/enter when 13 key = "\r" # escape when 27 key = "\x1b" # left-arrow when 37 if @applicationCursor key = "\x1bOD" # SS3 as ^[O for 7-bit #key = '\x8fD'; // SS3 as 0x8f for 8-bit break key = "\x1b[D" # right-arrow when 39 if @applicationCursor key = "\x1bOC" break key = "\x1b[C" # up-arrow when 38 if @applicationCursor key = "\x1bOA" break if ev.ctrlKey @scrollDisplay -1 return cancel(ev) else key = "\x1b[A" # down-arrow when 40 if @applicationCursor key = "\x1bOB" break if ev.ctrlKey @scrollDisplay 1 return cancel(ev) else key = "\x1b[B" # delete when 46 key = "\x1b[3~" # insert when 45 key = "\x1b[2~" # home when 36 if @applicationKeypad key = "\x1bOH" break key = "\x1<KEY>OH" # end when 35 if @applicationKeypad key = "\x1bOF" break key = "\x<KEY>" # page up when 33 if ev.shiftKey @scrollDisplay -(@rows - 1) return cancel(ev) else key = "\x1b[5~" # page down when 34 if ev.shiftKey @scrollDisplay @rows - 1 return cancel(ev) else key = "\x1b[6~" # F1 when 112 key = "\x1bOP" # F2 when 113 key = "\<KEY>" # F3 when 114 key = "\<KEY>" # F4 when 115 key = "\x<KEY>" # F5 when 116 key = "\x1<KEY>[15~" # F6 when 117 key = "\x1b[17~" # F7 when 118 key = "\x1b[18~" # F8 when 119 key = "\x1b[19~" # F9 when 120 key = "\x1b[20~" # F10 when 121 key = "\x1b[21~" # F11 when 122 key = "\x1b[23~" # F12 when 123 key = "\x1b[24~" # Scroll lock when 145 @scrollLock = ! @scrollLock if @scrollLock @body.classList.add 'locked' else @body.classList.remove 'locked' return cancel(ev) else # a-z and space if ev.ctrlKey if ev.keyCode >= 65 and ev.keyCode <= 90 if ev.keyCode is 67 t = (new Date()).getTime() if (t - @lastcc) < 500 and not @stop id = (setTimeout ->) (clearTimeout id if id not in [ @t_bell, @t_queue, @t_blink]) while id-- @body.classList.add 'stopped' @stop = true else if @stop return true @lastcc = t key = String.fromCharCode(ev.keyCode - 64) else if ev.keyCode is 32 # NUL key = String.fromCharCode(0) else if ev.keyCode >= 51 and ev.keyCode <= 55 # escape, file sep, group sep, record sep, unit sep key = String.fromCharCode(ev.keyCode - 51 + 27) else if ev.keyCode is 56 # delete key = String.fromCharCode(127) else if ev.keyCode is 219 # ^[ - escape key = String.fromCharCode(27) # ^] - group sep else if ev.keyCode is 221 key = String.fromCharCode(29) else if (ev.altKey and 'Mac' not in navigator.platform) or (ev.metaKey and 'Mac' in navigator.platform) if ev.keyCode >= 65 and ev.keyCode <= 90 key = "\x1b" + String.fromCharCode(ev.keyCode + 32) else if ev.keyCode is 192 key = "\x1b`" else if ev.keyCode >= 48 and ev.keyCode <= 57 key = "\x1b" + (ev.keyCode - 48) if ev.keyCode >= 37 and ev.keyCode <= 40 if ev.ctrlKey key = key.slice(0, -1) + "1;5" + key.slice(-1) else if ev.altKey key = key.slice(0, -1) + "1;<KEY>" + key.slice(-1) else if ev.shiftKey key = key.slice(0, -1) + "1;<KEY>" + key.slice(-1) return true unless key @showCursor() @send(key) cancel ev setgLevel: (g) -> @glevel = g @charset = @charsets[g] setgCharset: (g, charset) -> @charsets[g] = charset @charset = charset if @glevel is g keyPress: (ev) -> if @skipNextKey is false @skipNextKey = null return true # Don't handle modifiers alone return true if ev.keyCode > 15 and ev.keyCode < 19 # Handle shift insert and ctrl insert # copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] cancel ev if ev.charCode key = ev.charCode else unless ev.which? key = ev.keyCode else if ev.which isnt 0 and ev.charCode isnt 0 key = ev.which else return false return false if not key or ev.ctrlKey or ev.altKey or ev.metaKey key = String.fromCharCode(key) @showCursor() @send key false bell: (cls="bell")-> return unless @visualBell @body.classList.add cls @t_bell = setTimeout (=> @body.classList.remove cls ), @visualBell resize: (x=null, y=null) -> oldCols = @cols oldRows = @rows @computeCharSize() @cols = x or Math.floor(@body.clientWidth / @charSize.width) @rows = y or Math.floor(window.innerHeight / @charSize.height) px = window.innerHeight % @charSize.height @body.style['padding-bottom'] = "#{px}px" if (not x and not y) and oldCols == @cols and oldRows == @rows return @ctl 'Resize', @cols, @rows # resize cols if oldCols < @cols # does xterm use the default attr? i = @screen.length while i-- @screen[i][0].push @defAttr while @screen[i][0].length < @cols else if oldCols > @cols i = @screen.length while i-- @screen[i][0].pop() while @screen[i][0].length > @cols @setupStops oldCols # resize rows j = oldRows if j < @rows el = @body while j++ < @rows @screen.push [@blankLine(), true] if @screen.length < @rows if @children.length < @rows line = @document.createElement("div") line.className = 'line' el.appendChild line @children.push line else if j > @rows while j-- > @rows @screen.pop() if @screen.length > @rows if @children.length > @rows el = @children.pop() el?.parentNode.removeChild el # make sure the cursor stays on screen @y = @rows - 1 if @y >= @rows @x = @cols - 1 if @x >= @cols @scrollTop = 0 @scrollBottom = @rows - 1 @refresh(true) # it's a real nightmare trying # to resize the original # screen buffer. just set it # to null for now. @normal = null @reset() if x or y setupStops: (i) -> if i? i = @prevStop(i) unless @tabs[i] else @tabs = {} i = 0 while i < @cols @tabs[i] = true i += 8 prevStop: (x) -> x = @x unless x? while not @tabs[--x] and x > 0 1 if x >= @cols then @cols - 1 else (if x < 0 then 0 else x) nextStop: (x) -> x = @x unless x? while not @tabs[++x] and x < @cols 1 if x >= @cols then @cols - 1 else (if x < 0 then 0 else x) eraseRight: (x, y) -> line = @screen[y + @shift][0] # xterm while x < @cols line[x] = @eraseAttr() x++ @screen[y + @shift][1] = true eraseLeft: (x, y) -> x++ @screen[y + @shift][0][x] = @eraseAttr() while x-- @screen[y + @shift][1] = true eraseLine: (y) -> @eraseRight 0, y blankLine: (cur) -> attr = (if cur then @eraseAttr() else @defAttr) line = [] i = 0 while i < @cols + 1 line[i] = attr i++ line ch: (cur) -> if cur then @eraseAttr() else @defAttr isterm: (term) -> "#{@termName}".indexOf(term) is 0 send: (data) -> @out data handleTitle: (title) -> document.title = title ## ESC ## # ESC D Index (IND is 0x84). index: -> @nextLine() @state = State.normal # ESC M Reverse Index (RI is 0x8d). reverseIndex: -> @prevLine() @state = State.normal # ESC c Full Reset (RIS). reset: -> @resetVars() @refresh(true) # ESC H Tab Set (HTS is 0x88). tabSet: -> @tabs[@x] = true @state = State.normal ## CSI ## # CSI Ps A # Cursor Up Ps Times (default = 1) (CUU). cursorUp: (params) -> param = params[0] param = 1 if param < 1 @y -= param @y = 0 if @y < 0 # CSI Ps B # Cursor Down Ps Times (default = 1) (CUD). cursorDown: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows # CSI Ps C # Cursor Forward Ps Times (default = 1) (CUF). cursorForward: (params) -> param = params[0] param = 1 if param < 1 @x += param @x = @cols - 1 if @x >= @cols # CSI Ps D # Cursor Backward Ps Times (default = 1) (CUB). cursorBackward: (params) -> param = params[0] param = 1 if param < 1 @x -= param @x = 0 if @x < 0 # CSI Ps ; Ps H # Cursor Position [row;column] (default = [1,1]) (CUP). cursorPos: (params) -> row = params[0] - 1 if params.length >= 2 col = params[1] - 1 else col = 0 if row < 0 row = 0 else row = @rows - 1 if row >= @rows if col < 0 col = 0 else col = @cols - 1 if col >= @cols @x = col @y = row # CSI Ps J Erase in Display (ED). # Ps = 0 -> Erase Below (default). # Ps = 1 -> Erase Above. # Ps = 2 -> Erase All. # Ps = 3 -> Erase Saved Lines (xterm). # CSI ? Ps J # Erase in Display (DECSED). # Ps = 0 -> Selective Erase Below (default). # Ps = 1 -> Selective Erase Above. # Ps = 2 -> Selective Erase All. eraseInDisplay: (params) -> switch params[0] when 0 @eraseRight @x, @y j = @y + 1 while j < @rows @eraseLine j j++ when 1 @eraseLeft @x, @y j = @y @eraseLine j while j-- when 2 j = @rows @eraseLine j while j-- # CSI Ps K Erase in Line (EL). # Ps = 0 -> Erase to Right (default). # Ps = 1 -> Erase to Left. # Ps = 2 -> Erase All. # CSI ? Ps K # Erase in Line (DECSEL). # Ps = 0 -> Selective Erase to Right (default). # Ps = 1 -> Selective Erase to Left. # Ps = 2 -> Selective Erase All. eraseInLine: (params) -> switch params[0] when 0 @eraseRight @x, @y when 1 @eraseLeft @x, @y when 2 @eraseLine @y # CSI Pm m Character Attributes (SGR). # Ps = 0 -> Normal (default). # Ps = 1 -> Bold. # Ps = 4 -> Underlined. # Ps = 5 -> Blink (appears as Bold). # Ps = 7 -> Inverse. # Ps = 8 -> Invisible, i.e., hidden (VT300). # Ps = 2 2 -> Normal (neither bold nor faint). # Ps = 2 4 -> Not underline. # Ps = 2 5 -> Steady (not blinking). # Ps = 2 7 -> Positive (not inverse). # Ps = 2 8 -> Visible, i.e., not hidden (VT300). # Ps = 3 0 -> Set foreground color to Black. # Ps = 3 1 -> Set foreground color to Red. # Ps = 3 2 -> Set foreground color to Green. # Ps = 3 3 -> Set foreground color to Yellow. # Ps = 3 4 -> Set foreground color to Blue. # Ps = 3 5 -> Set foreground color to Magenta. # Ps = 3 6 -> Set foreground color to Cyan. # Ps = 3 7 -> Set foreground color to White. # Ps = 3 9 -> Set foreground color to default (original). # Ps = 4 0 -> Set background color to Black. # Ps = 4 1 -> Set background color to Red. # Ps = 4 2 -> Set background color to Green. # Ps = 4 3 -> Set background color to Yellow. # Ps = 4 4 -> Set background color to Blue. # Ps = 4 5 -> Set background color to Magenta. # Ps = 4 6 -> Set background color to Cyan. # Ps = 4 7 -> Set background color to White. # Ps = 4 9 -> Set background color to default (original). # If 16-color support is compiled, the following apply. Assume # that xterm's resources are set so that the ISO color codes are # the first 8 of a set of 16. Then the aixterm colors are the # bright versions of the ISO colors: # Ps = 9 0 -> Set foreground color to Black. # Ps = 9 1 -> Set foreground color to Red. # Ps = 9 2 -> Set foreground color to Green. # Ps = 9 3 -> Set foreground color to Yellow. # Ps = 9 4 -> Set foreground color to Blue. # Ps = 9 5 -> Set foreground color to Magenta. # Ps = 9 6 -> Set foreground color to Cyan. # Ps = 9 7 -> Set foreground color to White. # Ps = 1 0 0 -> Set background color to Black. # Ps = 1 0 1 -> Set background color to Red. # Ps = 1 0 2 -> Set background color to Green. # Ps = 1 0 3 -> Set background color to Yellow. # Ps = 1 0 4 -> Set background color to Blue. # Ps = 1 0 5 -> Set background color to Magenta. # Ps = 1 0 6 -> Set background color to Cyan. # Ps = 1 0 7 -> Set background color to White. # If xterm is compiled with the 16-color support disabled, it # supports the following, from rxvt: # Ps = 1 0 0 -> Set foreground and background color to # default. # If 88- or 256-color support is compiled, the following apply. # Ps = 3 8 ; 5 ; Ps -> Set foreground color to the second # Ps. # Ps = 4 8 ; 5 ; Ps -> Set background color to the second # Ps. charAttributes: (params) -> # Optimize a single SGR0. if params.length is 1 and params[0] is 0 @curAttr = @cloneAttr @defAttr return l = params.length i = 0 while i < l p = params[i] if p >= 30 and p <= 37 # fg color 8 @curAttr.fg = p - 30 else if p >= 40 and p <= 47 # bg color 8 @curAttr.bg = p - 40 else if p >= 90 and p <= 97 # fg color 16 p += 8 @curAttr.fg = p - 90 else if p >= 100 and p <= 107 # bg color 16 p += 8 @curAttr.bg = p - 100 else if p is 0 # default @curAttr = @cloneAttr @defAttr else if p is 1 # bold text @curAttr.bold = true else if p is 4 # underline text @curAttr.underline = true else if p is 5 # blink @curAttr.blink = true else if p is 7 # inverse and positive # test with: echo -e '\e[31m\e[42mhello\e[7mworld\e[27mhi\e[m' @curAttr.inverse = true else if p is 8 # invisible @curAttr.invisible = true else if p is 10 # Primary Font # ignoring else if p is 22 # not bold @curAttr.bold = false else if p is 24 # not underline @curAttr.underline = false else if p is 25 # not blink @curAttr.blink = false else if p is 27 # not inverse @curAttr.inverse = false else if p is 28 # not invisible @curAttr.invisible = false else if p is 39 # reset fg @curAttr.fg = 257 else if p is 49 # reset bg @curAttr.bg = 256 else if p is 38 if params[i + 1] is 2 # fg color 2^24 i += 2 @curAttr.fg = "rgb(#{params[i]}, #{params[i+1]}, #{params[i+2]})" i += 2 else if params[i + 1] is 5 # fg color 256 i += 2 @curAttr.fg = params[i] & 0xff else if p is 48 if params[i + 1] is 2 # bg color 2^24 i += 2 @curAttr.bg = "rgb(#{params[i]}, #{params[i+1]}, #{params[i+2]})" i += 2 else if params[i + 1] is 5 # bg color 256 i += 2 @curAttr.bg = params[i] & 0xff else if p is 100 # reset fg/bg @curAttr.fg = 257 @curAttr.bg = 256 else console.error "Unknown SGR attribute: %d.", p i++ # CSI Ps n Device Status Report (DSR). # Ps = 5 -> Status Report. Result (``OK'') is # CSI 0 n # Ps = 6 -> Report Cursor Position (CPR) [row;column]. # Result is # CSI r ; c R # CSI ? Ps n # Device Status Report (DSR, DEC-specific). # Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI # ? r ; c R (assumes page is zero). # Ps = 1 5 -> Report Printer status as CSI ? 1 0 n (ready). # or CSI ? 1 1 n (not ready). # Ps = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked) # or CSI ? 2 1 n (locked). # Ps = 2 6 -> Report Keyboard status as # CSI ? 2 7 ; 1 ; 0 ; 0 n (North American). # The last two parameters apply to VT400 & up, and denote key- # board ready and LK01 respectively. # Ps = 5 3 -> Report Locator status as # CSI ? 5 3 n Locator available, if compiled-in, or # CSI ? 5 0 n No Locator, if not. deviceStatus: (params) -> unless @prefix switch params[0] when 5 # status report @send "\x1b[0n" when 6 # cursor position @send "\x1b[" + (@y + 1) + ";" + (@x + 1) + "R" else if @prefix is "?" # modern xterm doesnt seem to # respond to any of these except ?6, 6, and 5 if params[0] is 6 # cursor position @send "\x1b[?" + (@y + 1) + ";" + (@x + 1) + "R" ## Additions ## # CSI Ps @ # Insert Ps (Blank) Character(s) (default = 1) (ICH). insertChars: (params) -> param = params[0] param = 1 if param < 1 row = @y j = @x # xterm while param-- and j < @cols @screen[row + @shift][0].splice j++, 0, [@eraseAttr(), true] @screen[row + @shift][0].pop() @screen[row + @shift][1] = true # CSI Ps E # Cursor Next Line Ps Times (default = 1) (CNL). # same as CSI Ps B ? cursorNextLine: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows @x = 0 # CSI Ps F # Cursor Preceding Line Ps Times (default = 1) (CNL). # reuse CSI Ps A ? cursorPrecedingLine: (params) -> param = params[0] param = 1 if param < 1 @y -= param @y = 0 if @y < 0 @x = 0 # CSI Ps G # Cursor Character Absolute [column] (default = [row,1]) (CHA). cursorCharAbsolute: (params) -> param = params[0] param = 1 if param < 1 @x = param - 1 # CSI Ps L # Insert Ps Line(s) (default = 1) (IL). # test: echo -e '\e[44m\e[1L\e[0m' insertLines: (params) -> param = params[0] param = 1 if param < 1 while param-- @screen.splice @y + @shift, 0, [@blankLine(true), true] # blankLine(true) - xterm/linux behavior @screen.splice @scrollBottom + 1 + @shift, 1 for i in [@y + @shift..@screen.length - 1] @screen[i][1] = true # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). deleteLines: (params) -> param = params[0] param = 1 if param < 1 while param-- # test: echo -e '\e[44m\e[1M\e[0m' # blankLine(true) - xterm/linux behavior @screen.splice @scrollBottom + @shift, 0, [@blankLine(true), true] @screen.splice @y + @shift, 1 unless @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 @children[@y + @shift].remove() @children.splice @y + @shift, 1 if @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 for i in [@y + @shift..@screen.length - 1] @screen[i][1] = true # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). deleteChars: (params) -> param = params[0] param = 1 if param < 1 while param-- @screen[@y + @shift][0].splice @x, 1 @screen[@y + @shift][0].push @eraseAttr() @screen[@y + @shift][1] = true # CSI Ps X # Erase Ps Character(s) (default = 1) (ECH). eraseChars: (params) -> param = params[0] param = 1 if param < 1 j = @x # xterm @screen[@y + @shift][0][j++] = @eraseAttr() while param-- and j < @cols @screen[@y + @shift][1] = true # CSI Pm ` Character Position Absolute # [column] (default = [row,1]) (HPA). charPosAbsolute: (params) -> param = params[0] param = 1 if param < 1 @x = param - 1 @x = @cols - 1 if @x >= @cols # 141 61 a * HPR - # Horizontal Position Relative # reuse CSI Ps C ? HPositionRelative: (params) -> param = params[0] param = 1 if param < 1 @x += param @x = @cols - 1 if @x >= @cols # CSI Ps c Send Device Attributes (Primary DA). # Ps = 0 or omitted -> request attributes from terminal. The # response depends on the decTerminalID resource setting. # -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'') # -> CSI ? 1 ; 0 c (``VT101 with No Options'') # -> CSI ? 6 c (``VT102'') # -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'') # The VT100-style response parameters do not mean anything by # themselves. VT220 parameters do, telling the host what fea- # tures the terminal supports: # Ps = 1 -> 132-columns. # Ps = 2 -> Printer. # Ps = 6 -> Selective erase. # Ps = 8 -> User-defined keys. # Ps = 9 -> National replacement character sets. # Ps = 1 5 -> Technical characters. # Ps = 2 2 -> ANSI color, e.g., VT525. # Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode). # CSI > Ps c # Send Device Attributes (Secondary DA). # Ps = 0 or omitted -> request the terminal's identification # code. The response depends on the decTerminalID resource set- # ting. It should apply only to VT220 and up, but xterm extends # this to VT100. # -> CSI > Pp ; Pv ; Pc c # where Pp denotes the terminal type # Pp = 0 -> ``VT100''. # Pp = 1 -> ``VT220''. # and Pv is the firmware version (for xterm, this was originally # the XFree86 patch number, starting with 95). In a DEC termi- # nal, Pc indicates the ROM cartridge registration number and is # always zero. # More information: # xterm/charproc.c - line 2012, for more information. # vim responds with ^[[?0c or ^[[?1c after the terminal's response (?) sendDeviceAttributes: (params) -> return if params[0] > 0 unless @prefix if @isterm("xterm") or @isterm("rxvt-unicode") or @isterm("screen") @send "\x1b[?1;2c" else @send "\x1b[?6c" if @isterm("linux") else if @prefix is ">" # xterm and urxvt # seem to spit this # out around ~370 times (?). if @isterm("xterm") @send "\x1b[>0;276;0c" else if @isterm("rxvt-unicode") @send "\x1b[>85;95;0c" else if @isterm("linux") # not supported by linux console. # linux console echoes parameters. @send params[0] + "c" else @send "\x1b[>83;40003;0c" if @isterm("screen") # CSI Pm d # Line Position Absolute [row] (default = [1,column]) (VPA). linePosAbsolute: (params) -> param = params[0] param = 1 if param < 1 @y = param - 1 @y = @rows - 1 if @y >= @rows # 145 65 e * VPR - Vertical Position Relative # reuse CSI Ps B ? VPositionRelative: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows # CSI Ps ; Ps f # Horizontal and Vertical Position [row;column] (default = # [1,1]) (HVP). HVPosition: (params) -> params[0] = 1 if params[0] < 1 params[1] = 1 if params[1] < 1 @y = params[0] - 1 @y = @rows - 1 if @y >= @rows @x = params[1] - 1 @x = @cols - 1 if @x >= @cols # CSI Pm h Set Mode (SM). # Ps = 2 -> Keyboard Action Mode (AM). # Ps = 4 -> Insert Mode (IRM). # Ps = 1 2 -> Send/receive (SRM). # Ps = 2 0 -> Automatic Newline (LNM). # CSI ? Pm h # DEC Private Mode Set (DECSET). # Ps = 1 -> Application Cursor Keys (DECCKM). # Ps = 2 -> Designate USASCII for character sets G0-G3 # (DECANM), and set VT100 mode. # Ps = 3 -> 132 Column Mode (DECCOLM). # Ps = 4 -> Smooth (Slow) Scroll (DECSCLM). # Ps = 5 -> Reverse Video (DECSCNM). # Ps = 6 -> Origin Mode (DECOM). # Ps = 7 -> Wraparound Mode (DECAWM). # Ps = 8 -> Auto-repeat Keys (DECARM). # Ps = 9 -> Send Mouse X & Y on button press. See the sec- # tion Mouse Tracking. # Ps = 1 0 -> Show toolbar (rxvt). # Ps = 1 2 -> Start Blinking Cursor (att610). # Ps = 1 8 -> Print form feed (DECPFF). # Ps = 1 9 -> Set print extent to full screen (DECPEX). # Ps = 2 5 -> Show Cursor (DECTCEM). # Ps = 3 0 -> Show scrollbar (rxvt). # Ps = 3 5 -> Enable font-shifting functions (rxvt). # Ps = 3 8 -> Enter Tektronix Mode (DECTEK). # Ps = 4 0 -> Allow 80 -> 132 Mode. # Ps = 4 1 -> more(1) fix (see curses resource). # Ps = 4 2 -> Enable Nation Replacement Character sets (DECN- # RCM). # Ps = 4 4 -> Turn On Margin Bell. # Ps = 4 5 -> Reverse-wraparound Mode. # Ps = 4 6 -> Start Logging. This is normally disabled by a # compile-time option. # Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis- # abled by the titeInhibit resource). # Ps = 6 6 -> Application keypad (DECNKM). # Ps = 6 7 -> Backarrow key sends backspace (DECBKM). # Ps = 1 0 0 0 -> Send Mouse X & Y on button press and # release. See the section Mouse Tracking. # Ps = 1 0 0 1 -> Use Hilite Mouse Tracking. # Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking. # Ps = 1 0 0 3 -> Use All Motion Mouse Tracking. # Ps = 1 0 0 4 -> Send FocusIn/FocusOut events. # Ps = 1 0 0 5 -> Enable Extended Mouse Mode. # Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt). # Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). # Ps = 1 0 3 4 -> Interpret "meta" key, sets eighth bit. # (enables the eightBitInput resource). # Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num- # Lock keys. (This enables the numLock resource). # Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This # enables the metaSendsEscape resource). # Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete # key. # Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This # enables the altSendsEscape resource). # Ps = 1 0 4 0 -> Keep selection even if not highlighted. # (This enables the keepSelection resource). # Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables # the selectToClipboard resource). # Ps = 1 0 4 2 -> Enable Urgency window manager hint when # Control-G is received. (This enables the bellIsUrgent # resource). # Ps = 1 0 4 3 -> Enable raising of the window when Control-G # is received. (enables the popOnBell resource). # Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be # disabled by the titeInhibit resource). # Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis- # abled by the titeInhibit resource). # Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate # Screen Buffer, clearing it first. (This may be disabled by # the titeInhibit resource). This combines the effects of the 1 # 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based # applications rather than the 4 7 mode. # Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode. # Ps = 1 0 5 1 -> Set Sun function-key mode. # Ps = 1 0 5 2 -> Set HP function-key mode. # Ps = 1 0 5 3 -> Set SCO function-key mode. # Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6). # Ps = 1 0 6 1 -> Set VT220 keyboard emulation. # Ps = 2 0 0 4 -> Set bracketed paste mode. # Modes: # http://vt100.net/docs/vt220-rm/chapter4.html setMode: (params) -> if typeof params is "object" l = params.length i = 0 while i < l @setMode params[i] i++ return if not @prefix switch params when 4 @insertMode = true when 20 @convertEol = true return if @prefix is "?" switch params when 1 @applicationCursor = true when 2 @setgCharset 0, Terminal::charsets.US @setgCharset 1, Terminal::charsets.US @setgCharset 2, Terminal::charsets.US @setgCharset 3, Terminal::charsets.US # set VT100 mode here when 3 # 132 col mode @savedCols = @cols @resize 132, @rows when 6 @originMode = true when 7 @wraparoundMode = true when 66 @applicationKeypad = true # X10 Mouse # no release, no motion, no wheel, no modifiers. when 9, 1000, 1002, 1003 # any event mouse # any event - sends motion events, # even if there is no button held down. @x10Mouse = params is 9 @vt200Mouse = params is 1000 @normalMouse = params > 1000 @mouseEvents = true @body.style.cursor = 'pointer' when 1004 # send focusin/focusout events # focusin: ^[[I # focusout: ^[[O @sendFocus = true when 1005 # utf8 ext mode mouse @utfMouse = true # for wide terminals # simply encodes large values as utf8 characters when 1006 # sgr ext mode mouse @sgrMouse = true # for wide terminals # does not add 32 to fields # press: ^[[<b;x;yM # release: ^[[<b;x;ym when 1015 # urxvt ext mode mouse @urxvtMouse = true # for wide terminals # numbers for fields # press: ^[[b;x;yM # motion: ^[[b;x;yT when 25 # show cursor @cursorHidden = false # alt screen buffer cursor #@saveCursor(); when 1049, 47, 1047 # alt screen buffer unless @normal normal = screen: @screen x: @x y: @y shift: @shift scrollTop: @scrollTop scrollBottom: @scrollBottom tabs: @tabs @reset() @normal = normal @showCursor() # CSI Pm l Reset Mode (RM). # Ps = 2 -> Keyboard Action Mode (AM). # Ps = 4 -> Replace Mode (IRM). # Ps = 1 2 -> Send/receive (SRM). # Ps = 2 0 -> Normal Linefeed (LNM). # CSI ? Pm l # DEC Private Mode Reset (DECRST). # Ps = 1 -> Normal Cursor Keys (DECCKM). # Ps = 2 -> Designate VT52 mode (DECANM). # Ps = 3 -> 80 Column Mode (DECCOLM). # Ps = 4 -> Jump (Fast) Scroll (DECSCLM). # Ps = 5 -> Normal Video (DECSCNM). # Ps = 6 -> Normal Cursor Mode (DECOM). # Ps = 7 -> No Wraparound Mode (DECAWM). # Ps = 8 -> No Auto-repeat Keys (DECARM). # Ps = 9 -> Don't send Mouse X & Y on button press. # Ps = 1 0 -> Hide toolbar (rxvt). # Ps = 1 2 -> Stop Blinking Cursor (att610). # Ps = 1 8 -> Don't print form feed (DECPFF). # Ps = 1 9 -> Limit print to scrolling region (DECPEX). # Ps = 2 5 -> Hide Cursor (DECTCEM). # Ps = 3 0 -> Don't show scrollbar (rxvt). # Ps = 3 5 -> Disable font-shifting functions (rxvt). # Ps = 4 0 -> Disallow 80 -> 132 Mode. # Ps = 4 1 -> No more(1) fix (see curses resource). # Ps = 4 2 -> Disable Nation Replacement Character sets (DEC- # NRCM). # Ps = 4 4 -> Turn Off Margin Bell. # Ps = 4 5 -> No Reverse-wraparound Mode. # Ps = 4 6 -> Stop Logging. (This is normally disabled by a # compile-time option). # Ps = 4 7 -> Use Normal Screen Buffer. # Ps = 6 6 -> Numeric keypad (DECNKM). # Ps = 6 7 -> Backarrow key sends delete (DECBKM). # Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and # release. See the section Mouse Tracking. # Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking. # Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking. # Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking. # Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events. # Ps = 1 0 0 5 -> Disable Extended Mouse Mode. # Ps = 1 0 1 0 -> Don't scroll to bottom on tty output # (rxvt). # Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt). # Ps = 1 0 3 4 -> Don't interpret "meta" key. (This disables # the eightBitInput resource). # Ps = 1 0 3 5 -> Disable special modifiers for Alt and Num- # Lock keys. (This disables the numLock resource). # Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key. # (This disables the metaSendsEscape resource). # Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad # Delete key. # Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key. # (This disables the altSendsEscape resource). # Ps = 1 0 4 0 -> Do not keep selection when not highlighted. # (This disables the keepSelection resource). # Ps = 1 0 4 1 -> Use the PRIMARY selection. (This disables # the selectToClipboard resource). # Ps = 1 0 4 2 -> Disable Urgency window manager hint when # Control-G is received. (This disables the bellIsUrgent # resource). # Ps = 1 0 4 3 -> Disable raising of the window when Control- # G is received. (This disables the popOnBell resource). # Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen # first if in the Alternate Screen. (This may be disabled by # the titeInhibit resource). # Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be # disabled by the titeInhibit resource). # Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor # as in DECRC. (This may be disabled by the titeInhibit # resource). This combines the effects of the 1 0 4 7 and 1 0 # 4 8 modes. Use this with terminfo-based applications rather # than the 4 7 mode. # Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode. # Ps = 1 0 5 1 -> Reset Sun function-key mode. # Ps = 1 0 5 2 -> Reset HP function-key mode. # Ps = 1 0 5 3 -> Reset SCO function-key mode. # Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6). # Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style. # Ps = 2 0 0 4 -> Reset bracketed paste mode. resetMode: (params) -> if typeof params is "object" l = params.length i = 0 while i < l @resetMode params[i] i++ return if not @prefix switch params when 4 @insertMode = false when 20 @convertEol = false return if @prefix is "?" switch params when 1 @applicationCursor = false when 3 @resize @savedCols, @rows if @cols is 132 and @savedCols delete @savedCols when 6 @originMode = false when 7 @wraparoundMode = false when 66 @applicationKeypad = false when 9, 1000, 1002 , 1003 # any event mouse @x10Mouse = false @vt200Mouse = false @normalMouse = false @mouseEvents = false @body.style.cursor = "" when 1004 # send focusin/focusout events @sendFocus = false when 1005 # utf8 ext mode mouse @utfMouse = false when 1006 # sgr ext mode mouse @sgrMouse = false when 1015 # urxvt ext mode mouse @urxvtMouse = false when 25 # hide cursor @cursorHidden = true when 1049, 47, 1047 # normal screen buffer - clearing it first if @normal @screen = @normal.screen @x = @normal.x @y = @normal.y @shift = @normal.shift @scrollTop = @normal.scrollTop @scrollBottom = @normal.scrollBottom @tabs = @normal.tabs @normal = null @reset() @showCursor() # CSI Ps ; Ps r # Set Scrolling Region [top;bottom] (default = full size of win- # dow) (DECSTBM). # CSI ? Pm r setScrollRegion: (params) -> return if @prefix @scrollTop = (params[0] or 1) - 1 @scrollBottom = (params[1] or @rows) - 1 @x = 0 @y = 0 # CSI s # Save cursor (ANSI.SYS). saveCursor: (params) -> @savedX = @x @savedY = @y # CSI u # Restore cursor (ANSI.SYS). restoreCursor: (params) -> @x = @savedX or 0 @y = @savedY or 0 ## Lesser Used ## # CSI Ps I # Cursor Forward Tabulation Ps tab stops (default = 1) (CHT). cursorForwardTab: (params) -> param = params[0] or 1 @x = @nextStop() while param-- # CSI Ps S Scroll up Ps lines (default = 1) (SU). scrollUp: (params) -> param = params[0] or 1 while param-- @screen.splice @scrollTop, 1 @screen.splice @scrollBottom, 0, [@blankLine(), true] for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true # CSI Ps T Scroll down Ps lines (default = 1) (SD). scrollDown: (params) -> param = params[0] or 1 while param-- @screen.splice @scrollBottom, 1 @screen.splice @scrollTop, 0, [@blankLine(), true] for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true # CSI Ps ; Ps ; Ps ; Ps ; Ps T # Initiate highlight mouse tracking. Parameters are # [func;startx;starty;firstrow;lastrow]. See the section Mouse # Tracking. initMouseTracking: (params) -> # Relevant: DECSET 1001 # CSI > Ps; Ps T # Reset one or more features of the title modes to the default # value. Normally, "reset" disables the feature. It is possi- # ble to disable the ability to reset features by compiling a # different default for the title modes into xterm. # Ps = 0 -> Do not set window/icon labels using hexadecimal. # Ps = 1 -> Do not query window/icon labels using hexadeci- # mal. # Ps = 2 -> Do not set window/icon labels using UTF-8. # Ps = 3 -> Do not query window/icon labels using UTF-8. # (See discussion of "Title Modes"). resetTitleModes: (params) -> # CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). cursorBackwardTab: (params) -> param = params[0] or 1 @x = @prevStop() while param-- # CSI Ps b Repeat the preceding graphic character Ps times (REP). repeatPrecedingCharacter: (params) -> param = params[0] or 1 line = @screen[@y + @shift][0] ch = line[@x - 1] or @defAttr line[@x++] = ch while param-- @screen[@y + @shift][1] = true # CSI Ps g Tab Clear (TBC). # Ps = 0 -> Clear Current Column (default). # Ps = 3 -> Clear All. # Potentially: # Ps = 2 -> Clear Stops on Line. # http://vt100.net/annarbor/aaa-ug/section6.html tabClear: (params) -> param = params[0] if param <= 0 delete @tabs[@x] else @tabs = {} if param is 3 # CSI Pm i Media Copy (MC). # Ps = 0 -> Print screen (default). # Ps = 4 -> Turn off printer controller mode. # Ps = 5 -> Turn on printer controller mode. # CSI ? Pm i # Media Copy (MC, DEC-specific). # Ps = 1 -> Print line containing cursor. # Ps = 4 -> Turn off autoprint mode. # Ps = 5 -> Turn on autoprint mode. # Ps = 1 0 -> Print composed display, ignores DECPEX. # Ps = 1 1 -> Print all pages. mediaCopy: (params) -> # CSI > Ps; Ps m # Set or reset resource-values used by xterm to decide whether # to construct escape sequences holding information about the # modifiers pressed with a given key. The first parameter iden- # tifies the resource to set/reset. The second parameter is the # value to assign to the resource. If the second parameter is # omitted, the resource is reset to its initial value. # Ps = 1 -> modifyCursorKeys. # Ps = 2 -> modifyFunctionKeys. # Ps = 4 -> modifyOtherKeys. # If no parameters are given, all resources are reset to their # initial values. setResources: (params) -> # CSI > Ps n # Disable modifiers which may be enabled via the CSI > Ps; Ps m # sequence. This corresponds to a resource value of "-1", which # cannot be set with the other sequence. The parameter identi- # fies the resource to be disabled: # Ps = 1 -> modifyCursorKeys. # Ps = 2 -> modifyFunctionKeys. # Ps = 4 -> modifyOtherKeys. # If the parameter is omitted, modifyFunctionKeys is disabled. # When modifyFunctionKeys is disabled, xterm uses the modifier # keys to make an extended sequence of functions rather than # adding a parameter to each function key to denote the modi- # fiers. disableModifiers: (params) -> # CSI > Ps p # Set resource value pointerMode. This is used by xterm to # decide whether to hide the pointer cursor as the user types. # Valid values for the parameter: # Ps = 0 -> never hide the pointer. # Ps = 1 -> hide if the mouse tracking mode is not enabled. # Ps = 2 -> always hide the pointer. If no parameter is # given, xterm uses the default, which is 1 . setPointerMode: (params) -> # CSI ! p Soft terminal reset (DECSTR). # http://vt100.net/docs/vt220-rm/table4-10.html softReset: (params) -> @cursorHidden = false @insertMode = false @originMode = false @wraparoundMode = false # autowrap @applicationKeypad = false # ? @applicationCursor = false @scrollTop = 0 @scrollBottom = @rows - 1 @curAttr = @defAttr @x = @y = 0 # ? @charset = null @glevel = 0 # ?? @charsets = [null] # ?? # CSI Ps$ p # Request ANSI mode (DECRQM). For VT300 and up, reply is # CSI Ps; Pm$ y # where Ps is the mode number as in RM, and Pm is the mode # value: # 0 - not recognized # 1 - set # 2 - reset # 3 - permanently set # 4 - permanently reset requestAnsiMode: (params) -> # CSI ? Ps$ p # Request DEC private mode (DECRQM). For VT300 and up, reply is # CSI ? Ps; Pm$ p # where Ps is the mode number as in DECSET, Pm is the mode value # as in the ANSI DECRQM. requestPrivateMode: (params) -> # CSI Ps ; Ps " p # Set conformance level (DECSCL). Valid values for the first # parameter: # Ps = 6 1 -> VT100. # Ps = 6 2 -> VT200. # Ps = 6 3 -> VT300. # Valid values for the second parameter: # Ps = 0 -> 8-bit controls. # Ps = 1 -> 7-bit controls (always set for VT100). # Ps = 2 -> 8-bit controls. setConformanceLevel: (params) -> # CSI Ps q Load LEDs (DECLL). # Ps = 0 -> Clear all LEDS (default). # Ps = 1 -> Light Num Lock. # Ps = 2 -> Light Caps Lock. # Ps = 3 -> Light Scroll Lock. # Ps = 2 1 -> Extinguish Num Lock. # Ps = 2 2 -> Extinguish Caps Lock. # Ps = 2 3 -> Extinguish Scroll Lock. loadLEDs: (params) -> # CSI Ps SP q # Set cursor style (DECSCUSR, VT520). # Ps = 0 -> blinking block. # Ps = 1 -> blinking block (default). # Ps = 2 -> steady block. # Ps = 3 -> blinking underline. # Ps = 4 -> steady underline. setCursorStyle: (params) -> # CSI Ps " q # Select character protection attribute (DECSCA). Valid values # for the parameter: # Ps = 0 -> DECSED and DECSEL can erase (default). # Ps = 1 -> DECSED and DECSEL cannot erase. # Ps = 2 -> DECSED and DECSEL can erase. setCharProtectionAttr: (params) -> # CSI ? Pm r # Restore DEC Private Mode Values. The value of Ps previously # saved is restored. Ps values are the same as for DECSET. restorePrivateValues: (params) -> # CSI Pt; Pl; Pb; Pr; Ps$ r # Change Attributes in Rectangular Area (DECCARA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. # Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. # NOTE: xterm doesn't enable this code by default. setAttrInRectangle: (params) -> t = params[0] l = params[1] b = params[2] r = params[3] attr = params[4] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @cloneAttr attr, line[i].ch i++ t++ # CSI ? Pm s # Save DEC Private Mode Values. Ps values are the same as for # DECSET. savePrivateValues: (params) -> # CSI Ps ; Ps ; Ps t # Window manipulation (from dtterm, as well as extensions). # These controls may be disabled using the allowWindowOps # resource. Valid values for the first (and any additional # parameters) are: # Ps = 1 -> De-iconify window. # Ps = 2 -> Iconify window. # Ps = 3 ; x ; y -> Move window to [x, y]. # Ps = 4 ; height ; width -> Resize the xterm window to # height and width in pixels. # Ps = 5 -> Raise the xterm window to the front of the stack- # ing order. # Ps = 6 -> Lower the xterm window to the bottom of the # stacking order. # Ps = 7 -> Refresh the xterm window. # Ps = 8 ; height ; width -> Resize the text area to # [height;width] in characters. # Ps = 9 ; 0 -> Restore maximized window. # Ps = 9 ; 1 -> Maximize window (i.e., resize to screen # size). # Ps = 1 0 ; 0 -> Undo full-screen mode. # Ps = 1 0 ; 1 -> Change to full-screen. # Ps = 1 1 -> Report xterm window state. If the xterm window # is open (non-iconified), it returns CSI 1 t . If the xterm # window is iconified, it returns CSI 2 t . # Ps = 1 3 -> Report xterm window position. Result is CSI 3 # ; x ; y t # Ps = 1 4 -> Report xterm window in pixels. Result is CSI # 4 ; height ; width t # Ps = 1 8 -> Report the size of the text area in characters. # Result is CSI 8 ; height ; width t # Ps = 1 9 -> Report the size of the screen in characters. # Result is CSI 9 ; height ; width t # Ps = 2 0 -> Report xterm window's icon label. Result is # OSC L label ST # Ps = 2 1 -> Report xterm window's title. Result is OSC l # label ST # Ps = 2 2 ; 0 -> Save xterm icon and window title on # stack. # Ps = 2 2 ; 1 -> Save xterm icon title on stack. # Ps = 2 2 ; 2 -> Save xterm window title on stack. # Ps = 2 3 ; 0 -> Restore xterm icon and window title from # stack. # Ps = 2 3 ; 1 -> Restore xterm icon title from stack. # Ps = 2 3 ; 2 -> Restore xterm window title from stack. # Ps >= 2 4 -> Resize to Ps lines (DECSLPP). manipulateWindow: (params) -> # CSI Pt; Pl; Pb; Pr; Ps$ t # Reverse Attributes in Rectangular Area (DECRARA), VT400 and # up. # Pt; Pl; Pb; Pr denotes the rectangle. # Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. # NOTE: xterm doesn't enable this code by default. reverseAttrInRectangle: (params) -> # CSI > Ps; Ps t # Set one or more features of the title modes. Each parameter # enables a single feature. # Ps = 0 -> Set window/icon labels using hexadecimal. # Ps = 1 -> Query window/icon labels using hexadecimal. # Ps = 2 -> Set window/icon labels using UTF-8. # Ps = 3 -> Query window/icon labels using UTF-8. (See dis- # cussion of "Title Modes") setTitleModeFeature: (params) -> # CSI Ps SP t # Set warning-bell volume (DECSWBV, VT520). # Ps = 0 or 1 -> off. # Ps = 2 , 3 or 4 -> low. # Ps = 5 , 6 , 7 , or 8 -> high. setWarningBellVolume: (params) -> # CSI Ps SP u # Set margin-bell volume (DECSMBV, VT520). # Ps = 1 -> off. # Ps = 2 , 3 or 4 -> low. # Ps = 0 , 5 , 6 , 7 , or 8 -> high. setMarginBellVolume: (params) -> # CSI Pt; Pl; Pb; Pr; Pp; Pt; Pl; Pp$ v # Copy Rectangular Area (DECCRA, VT400 and up). # Pt; Pl; Pb; Pr denotes the rectangle. # Pp denotes the source page. # Pt; Pl denotes the target location. # Pp denotes the target page. # NOTE: xterm doesn't enable this code by default. copyRectangle: (params) -> # CSI Pt ; Pl ; Pb ; Pr ' w # Enable Filter Rectangle (DECEFR), VT420 and up. # Parameters are [top;left;bottom;right]. # Defines the coordinates of a filter rectangle and activates # it. Anytime the locator is detected outside of the filter # rectangle, an outside rectangle event is generated and the # rectangle is disabled. Filter rectangles are always treated # as "one-shot" events. Any parameters that are omitted default # to the current locator position. If all parameters are omit- # ted, any locator motion will be reported. DECELR always can- # cels any prevous rectangle definition. enableFilterRectangle: (params) -> # CSI Ps x Request Terminal Parameters (DECREQTPARM). # if Ps is a "0" (default) or "1", and xterm is emulating VT100, # the control sequence elicits a response of the same form whose # parameters describe the terminal: # Ps -> the given Ps incremented by 2. # Pn = 1 <- no parity. # Pn = 1 <- eight bits. # Pn = 1 <- 2 8 transmit 38.4k baud. # Pn = 1 <- 2 8 receive 38.4k baud. # Pn = 1 <- clock multiplier. # Pn = 0 <- STP flags. requestParameters: (params) -> # CSI Ps x Select Attribute Change Extent (DECSACE). # Ps = 0 -> from start to end position, wrapped. # Ps = 1 -> from start to end position, wrapped. # Ps = 2 -> rectangle (exact). selectChangeExtent: (params) -> # CSI Pc; Pt; Pl; Pb; Pr$ x # Fill Rectangular Area (DECFRA), VT420 and up. # Pc is the character to use. # Pt; Pl; Pb; Pr denotes the rectangle. # NOTE: xterm doesn't enable this code by default. fillRectangle: (params) -> ch = params[0] t = params[1] l = params[2] b = params[3] r = params[4] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @cloneAttr line[i][0], String.fromCharCode(ch) i++ t++ # CSI Ps ; Pu ' z # Enable Locator Reporting (DECELR). # Valid values for the first parameter: # Ps = 0 -> Locator disabled (default). # Ps = 1 -> Locator enabled. # Ps = 2 -> Locator enabled for one report, then disabled. # The second parameter specifies the coordinate unit for locator # reports. # Valid values for the second parameter: # Pu = 0 <- or omitted -> default to character cells. # Pu = 1 <- device physical pixels. # Pu = 2 <- character cells. enableLocatorReporting: (params) -> val = params[0] > 0 # CSI Pt; Pl; Pb; Pr$ z # Erase Rectangular Area (DECERA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. # NOTE: xterm doesn't enable this code by default. eraseRectangle: (params) -> t = params[0] l = params[1] b = params[2] r = params[3] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @eraseAttr() i++ t++ # CSI Pm ' { # Select Locator Events (DECSLE). # Valid values for the first (and any additional parameters) # are: # Ps = 0 -> only respond to explicit host requests (DECRQLP). # (This is default). It also cancels any filter # rectangle. # Ps = 1 -> report button down transitions. # Ps = 2 -> do not report button down transitions. # Ps = 3 -> report button up transitions. # Ps = 4 -> do not report button up transitions. setLocatorEvents: (params) -> # CSI Pt; Pl; Pb; Pr$ { # Selective Erase Rectangular Area (DECSERA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. selectiveEraseRectangle: (params) -> # CSI Ps ' | # Request Locator Position (DECRQLP). # Valid values for the parameter are: # Ps = 0 , 1 or omitted -> transmit a single DECLRP locator # report. # If Locator Reporting has been enabled by a DECELR, xterm will # respond with a DECLRP Locator Report. This report is also # generated on button up and down events if they have been # enabled with a DECSLE, or when the locator is detected outside # of a filter rectangle, if filter rectangles have been enabled # with a DECEFR. # -> CSI Pe ; Pb ; Pr ; Pc ; Pp & w # Parameters are [event;button;row;column;page]. # Valid values for the event: # Pe = 0 -> locator unavailable - no other parameters sent. # Pe = 1 -> request - xterm received a DECRQLP. # Pe = 2 -> left button down. # Pe = 3 -> left button up. # Pe = 4 -> middle button down. # Pe = 5 -> middle button up. # Pe = 6 -> right button down. # Pe = 7 -> right button up. # Pe = 8 -> M4 button down. # Pe = 9 -> M4 button up. # Pe = 1 0 -> locator outside filter rectangle. # ``button'' parameter is a bitmask indicating which buttons are # pressed: # Pb = 0 <- no buttons down. # Pb & 1 <- right button down. # Pb & 2 <- middle button down. # Pb & 4 <- left button down. # Pb & 8 <- M4 button down. # ``row'' and ``column'' parameters are the coordinates of the # locator position in the xterm window, encoded as ASCII deci- # mal. # The ``page'' parameter is not used by xterm, and will be omit- # ted. requestLocatorPosition: (params) -> # CSI P m SP } # Insert P s Column(s) (default = 1) (DECIC), VT420 and up. # NOTE: xterm doesn't enable this code by default. insertColumns: -> param = params[0] l = @rows + @shift while param-- i = @shift while i < l @screen[i][0].splice @x + 1, 0, @eraseAttr() @screen[i][0].pop() i++ @screen[i][1] = true # CSI P m SP ~ # Delete P s Column(s) (default = 1) (DECDC), VT420 and up # NOTE: xterm doesn't enable this code by default. deleteColumns: -> param = params[0] l = @rows + @shift while param-- i = @shift while i < l @screen[i][0].splice @x, 1 @screen[i][0].push @eraseAttr() i++ @screen[i][1] = true # DEC Special Character and Line Drawing Set. # http://vt100.net/docs/vt102-ug/table5-13.html # A lot of curses apps use this if they see TERM=xterm. # testing: echo -e '\e(0a\e(B' # The xterm output sometimes seems to conflict with the # reference above. xterm seems in line with the reference # when running vttest however. # The table below now uses xterm's output from vttest. charsets: SCLD:# (0 "`": "◆" # '◆' a: "▒" # '▒' b: "\t" # '\t' c: "\f" # '\f' d: "\r" # '\r' e: "\n" # '\n' f: "°" # '°' g: "±" # '±' h: "␤" # '\u2424' (NL) i: "\x0b" # '\v' j: "┘" # '┘' k: "┐" # '┐' l: "┌" # '┌' m: "└" # '└' n: "┼" # '┼' o: "⎺" # '⎺' p: "⎻" # '⎻' q: "─" # '─' r: "⎼" # '⎼' s: "⎽" # '⎽' t: "├" # '├' u: "┤" # '┤' v: "┴" # '┴' w: "┬" # '┬' x: "│" # '│' y: "≤" # '≤' z: "≥" # '≥' "{": "π" # 'π' "|": "≠" # '≠' "}": "£" # '£' "~": "·" # '·' UK: null # (A US: null # (B (USASCII) Dutch: null # (4 Finnish: null # (C or (5 French: null # (R FrenchCanadian: null # (Q German: null # (K Italian: null # (Y NorwegianDanish: null # (E or (6 Spanish: null # (Z Swedish: null # (H or (7 Swiss: null # (= ISOLatin: null # /A window.Terminal = Terminal
true
# *-* coding: utf-8 *-* # This file is part of butterfly # # butterfly Copyright (C) 2014 PI:NAME:<NAME>END_PI # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # This has been forked from term.js # # Copyright (c) 2012-2013, PI:NAME:<NAME>END_PI (MIT License) # https://github.com/chjj/term.js # # # which has been forked from jslinux # # Copyright (c) 2011 PI:NAME:<NAME>END_PI # http://bellard.org/jslinux/ cancel = (ev) -> ev.preventDefault() if ev.preventDefault ev.stopPropagation() if ev.stopPropagation ev.cancelBubble = true false s = 0 State = normal: s++ escaped: s++ csi: s++ osc: s++ charset: s++ dcs: s++ ignore: s++ class Terminal constructor: (@parent, @out, @ctl=->) -> # Global elements @document = @parent.ownerDocument @body = @document.getElementsByTagName('body')[0] @htmlEscapesEnabled = @body.getAttribute('data-allow-html') is 'yes' @forceWidth = @body.getAttribute( 'data-force-unicode-width') is 'yes' # Main terminal element @body.className = 'terminal focus' @body.style.outline = 'none' @body.setAttribute 'tabindex', 0 @body.setAttribute 'spellcheck', 'false' # Adding one line to compute char size div = @document.createElement('div') div.className = 'line' @body.appendChild(div) @children = [div] @computeCharSize() @cols = Math.floor(@body.clientWidth / @charSize.width) @rows = Math.floor(window.innerHeight / @charSize.height) px = window.innerHeight % @charSize.height @body.style['padding-bottom'] = "#{px}px" @scrollback = 1000000 @buffSize = 100000 @visualBell = 100 @convertEol = false @termName = 'xterm' @cursorBlink = true @cursorState = 0 @stop = false @lastcc = 0 @resetVars() @focus() @startBlink() addEventListener 'keydown', @keyDown.bind(@) addEventListener 'keypress', @keyPress.bind(@) addEventListener 'focus', @focus.bind(@) addEventListener 'blur', @blur.bind(@) addEventListener 'resize', => @resize() # # Horrible Firefox paste workaround if typeof InstallTrigger isnt "undefined" @body.contentEditable = 'true' @initmouse() setTimeout(@resize.bind(@), 100) cloneAttr: (a, char=null) -> bg: a.bg fg: a.fg ch: unless char is null then char else a.ch bold: a.bold underline: a.underline blink: a.blink inverse: a.inverse invisible: a.invisible equalAttr: (a, b) -> # Not testing char (a.bg is b.bg and a.fg is b.fg and a.bold is b.bold and a.underline is b.underline and a.blink is b.blink and a.inverse is b.inverse and a.invisible is b.invisible) putChar: (c) -> if @insertMode @screen[@y + @shift][0].splice(@x, 0, @cloneAttr @curAttr, c) @screen[@y + @shift][0].pop() else @screen[@y + @shift][0][@x] = @cloneAttr @curAttr, c @screen[@y + @shift][1] = true resetVars: -> @x = 0 @y = 0 @cursorHidden = false @state = State.normal @queue = '' @scrollTop = 0 @scrollBottom = @rows - 1 @scrollLock = false # modes @applicationKeypad = false @applicationCursor = false @originMode = false @wraparoundMode = false @normal = null # charset @charset = null @gcharset = null @glevel = 0 @charsets = [null] # stream @defAttr = bg: 256 fg: 257 ch: " " bold: false underline: false blink: false inverse: false invisible: false @curAttr = @cloneAttr @defAttr @params = [] @currentParam = 0 @prefix = "" @screen = [] i = @rows @shift = 0 @screen.push [@blankLine(), true] while i-- @setupStops() @skipNextKey = null computeCharSize: -> testSpan = document.createElement('span') testSpan.textContent = '0123456789' @children[0].appendChild(testSpan) @charSize = width: testSpan.getBoundingClientRect().width / 10 height: @children[0].getBoundingClientRect().height @children[0].removeChild(testSpan) eraseAttr: -> erased = @cloneAttr @defAttr erased.bg = @curAttr.bg erased focus: -> @send('\x1b[I') if @sendFocus @showCursor() @body.classList.add('focus') @body.classList.remove('blur') blur: -> @cursorState = 1 @screen[@y + @shift][1] = true @refresh() @send('\x1b[O') if @sendFocus @body.classList.add('blur') @body.classList.remove('focus') # XTerm mouse events # http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Mouse%20Tracking # To better understand these # the xterm code is very helpful: # Relevant files: # button.c, charproc.c, misc.c # Relevant functions in xterm/button.c: # BtnCode, EmitButtonCode, EditorButton, SendMousePosition initmouse: -> pressed = 32 # mouseup, mousedown, mousewheel # left click: ^[[M 3<^[[M#3< # mousewheel up: ^[[M`3> sendButton = (ev) -> # get the xterm-style button button = getButton(ev) # get mouse coordinates pos = getCoords(ev) return unless pos sendEvent button, pos, ev.type pressed = button # motion example of a left click: # ^[[M 3<^[[M@4<^[[M@5<^[[M@6<^[[M@7<^[[M#7< sendMove = (ev) -> button = pressed pos = getCoords(ev) return unless pos # buttons marked as motions # are incremented by 32 button += 32 sendEvent button, pos, ev.type # encode button and # position to characters encode = (data, ch) => unless @utfMouse return data.push(0) if ch is 255 ch = 127 if ch > 127 data.push ch else return data.push(0) if ch is 2047 if ch < 127 data.push ch else ch = 2047 if ch > 2047 data.push 0xC0 | (ch >> 6) data.push 0x80 | (ch & 0x3F) # send a mouse event: # regular/utf8: ^[[M Cb Cx Cy # urxvt: ^[[ Cb ; Cx ; Cy M # sgr: ^[[ Cb ; Cx ; Cy M/m # vt300: ^[[ 24(1/3/5)~ [ Cx , Cy ] \r # locator: CSI P e ; P b ; P r ; P c ; P p & w sendEvent = (button, pos, type) => if @urxvtMouse pos.x -= 32 pos.y -= 32 pos.x++ pos.y++ @send "\x1b[" + button + ";" + pos.x + ";" + pos.y + "M" return if @sgrMouse pos.x -= 32 pos.y -= 32 button -= 32 @send "\x1b[<" + button + ";" + pos.x + ";" + pos.y + ( if type is "mouseup" then "m" else "M" ) return data = [] encode data, button encode data, pos.x encode data, pos.y @send "\x1b[M" + String.fromCharCode.apply(String, data) getButton = (ev) => # two low bits: # 0 = left # 1 = middle # 2 = right # 3 = release # wheel up/down: # 1, and 2 - with 64 added switch ev.type when "mousedown" button = if ev.button? then +ev.button else ( if ev.which? then ev.which - 1 else null) when "mouseup" button = 3 when "wheel" button = if ev.deltaY < 0 then 64 else 65 # next three bits are the modifiers: # 4 = shift, 8 = meta, 16 = control shift = if ev.shiftKey then 4 else 0 meta = if ev.metaKey then 8 else 0 ctrl = if ev.ctrlKey then 16 else 0 mod = shift | meta | ctrl # no mods if @vt200Mouse # ctrl only mod &= ctrl else unless @normalMouse mod = 0 # increment to SP (32 + (mod << 2)) + button # mouse coordinates measured in cols/rows getCoords = (ev) => x = ev.pageX y = ev.pageY - window.scrollY # convert to cols/rows w = @body.clientWidth h = window.innerHeight x = Math.ceil((x / w) * @cols) y = Math.ceil((y / h) * @rows) # be sure to avoid sending # bad positions to the program x = 0 if x < 0 x = @cols if x > @cols y = 0 if y < 0 y = @rows if y > @rows # xterm sends raw bytes and # starts at 32 (SP) for each. x += 32 y += 32 x: x y: y type: ev.type addEventListener "contextmenu", (ev) => return unless @mouseEvents cancel ev addEventListener "mousedown", (ev) => return unless @mouseEvents # send the button sendButton ev # fix for odd bug sm = sendMove.bind(this) addEventListener "mousemove", sm # x10 compatibility mode can't send button releases unless @x10Mouse addEventListener "mouseup", up = (ev) -> sendButton ev removeEventListener "mousemove", sm removeEventListener "mouseup", up cancel ev cancel ev addEventListener "wheel", (ev) => if @mouseEvents return if @x10Mouse sendButton ev cancel ev linkify: (t) -> # http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links urlPattern = ( /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim) pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim emailAddressPattern = /[\w.]+@[a-zA-Z_-]+?(?:\.[a-zA-Z]{2,6})+/gim (part .replace(urlPattern, '<a href="$&">$&</a>') .replace(pseudoUrlPattern, '$1<a href="http://$2">$2</a>') .replace(emailAddressPattern, '<a href="mailto:$&">$&</a>' ) for part in t.split('&nbsp;')).join('&nbsp;') refresh: (force=false) -> for cursor in @body.querySelectorAll(".cursor") cursor.parentNode.replaceChild( @document.createTextNode(cursor.textContent), cursor) newOut = '' for [line, dirty], j in @screen continue unless dirty or force out = "" if j is @y + @shift and not @cursorHidden x = @x else x = -Infinity attr = @cloneAttr @defAttr skipnext = false for i in [0..@cols - 1] data = line[i] if data.html out += data.html continue if skipnext skipnext = false continue ch = data.ch unless @equalAttr data, attr out += "</span>" unless @equalAttr attr, @defAttr unless @equalAttr data, @defAttr classes = [] styles = [] out += "<span " # bold classes.push "bold" if data.bold # underline classes.push "underline" if data.underline # blink classes.push "blink" if data.blink # inverse classes.push "reverse-video" if data.inverse # invisible classes.push "invisible" if data.invisible if typeof data.fg is 'number' fg = data.fg if data.bold and fg < 8 fg += 8 classes.push "fg-color-" + fg if typeof data.fg is 'string' styles.push "color: " + data.fg if typeof data.bg is 'number' classes.push "bg-color-" + data.bg if typeof data.bg is 'string' styles.push "background-color: " + data.bg out += "class=\"" out += classes.join(" ") out += "\"" if styles.length out += " style=\"" + styles.join("; ") + "\"" out += ">" out += "<span class=\"" + ( if @cursorState then "reverse-video " else "" ) + "cursor\">" if i is x # This is a temporary dirty hack for raw html insertion if ch.length > 1 out += ch else switch ch when "&" out += "&amp;" when "<" out += "&lt;" when ">" out += "&gt;" else if ch == " " out += '<span class="nbsp">\u2007</span>' else if ch <= " " out += "&nbsp;" else if not @forceWidth or ch <= "~" # Ascii chars out += ch else if "\uff00" < ch < "\uffef" skipnext = true out += "<span style=\"display: inline-block; width: #{2 * @charSize.width}px\">#{ch}</span>" else out += "<span style=\"display: inline-block; width: #{@charSize.width}px\">#{ch}</span>" out += "</span>" if i is x attr = data out += "</span>" unless @equalAttr attr, @defAttr out = @linkify(out) unless j is @y + @shift if @children[j] @children[j].innerHTML = out else newOut += "<div class=\"line\">#{out}</div>" @screen[j][1] = false if newOut isnt '' group = @document.createElement('div') group.className = 'group' group.innerHTML = newOut @body.appendChild group @screen = @screen.slice(-@rows) @shift = 0 lines = document.querySelectorAll('.line') if lines.length > @scrollback for line in Array.prototype.slice.call( lines, 0, lines.length - @scrollback) line.remove() for group in document.querySelectorAll('.group:empty') group.remove() lines = document.querySelectorAll('.line') @children = Array.prototype.slice.call( lines, -@rows) @nativeScrollTo() unless @scrollLock _cursorBlink: -> @cursorState ^= 1 cursor = @body.querySelector(".cursor") return unless cursor if cursor.classList.contains("reverse-video") cursor.classList.remove "reverse-video" else cursor.classList.add "reverse-video" showCursor: -> unless @cursorState @cursorState = 1 @screen[@y + @shift][1] = true @refresh() startBlink: -> return unless @cursorBlink @_blinker = => @_cursorBlink() @t_blink = setInterval(@_blinker, 500) refreshBlink: -> return unless @cursorBlink clearInterval @t_blink @t_blink = setInterval(@_blinker, 500) scroll: -> # Use emulated scroll in alternate buffer or when scroll region is defined if @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 # inner scroll @screen.splice @shift + @scrollBottom + 1, 0, [@blankLine(), true] @screen.splice @shift + @scrollTop, 1 for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true else @screen.push [@blankLine(), true] @shift++ unscroll: -> @screen.splice @shift + @scrollTop , 0, [@blankLine(true), true] @screen.splice @shift + @scrollBottom + 1, 1 for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true nativeScrollTo: (scroll=2000000000) -> # ~ Max ff number window.scrollTo 0, scroll scrollDisplay: (disp) -> @nativeScrollTo window.scrollY + disp * @charSize.height nextLine: -> @y++ if @y > @scrollBottom @y-- @scroll() prevLine: -> @y-- if @y < @scrollTop @y++ @unscroll() write: (data) -> i = 0 l = data.length while i < l ch = data.charAt(i) switch @state when State.normal switch ch # '\a' when "\x07" @bell() # '\n', '\v', '\f' when "\n", "\x0b", "\x0c" # @x = 0 if @convertEol @nextLine() # '\r' when "\r" @x = 0 # '\b' when "\b" @x-- if @x > 0 # '\t' when "\t" @x = @nextStop() # shift out when "\x0e" @setgLevel 1 # shift in when "\x0f" @setgLevel 0 # '\e' when "\x1b" @state = State.escaped else # ' ' if ch >= " " ch = @charset[ch] if @charset?[ch] if @x >= @cols @putChar '\u23CE' @x = 0 @nextLine() @putChar ch @x++ if @forceWidth and "\uff00" < ch < "\uffef" if @cols < 2 or @x >= @cols @putChar " " break @putChar " " @x++ when State.escaped switch ch # ESC [ Control Sequence Introducer ( CSI is 0x9b). when "[" @params = [] @currentParam = 0 @state = State.csi # ESC ] Operating System Command ( OSC is 0x9d). when "]" @params = [] @currentParam = 0 @state = State.osc # ESC P Device Control String ( DCS is 0x90). when "P" @params = [] @currentParam = 0 @state = State.dcs # ESC _ Application Program Command ( APC is 0x9f). when "_" @state = State.ignore # ESC ^ Privacy Message ( PM is 0x9e). when "^" @state = State.ignore # ESC c Full Reset (RIS). when "c" @reset() # ESC E Next Line ( NEL is 0x85). when "E" @x = 0 @index() # ESC D Index ( IND is 0x84). when "D" @index() # ESC M Reverse Index ( RI is 0x8d). when "M" @reverseIndex() # ESC % Select default/utf-8 character set. # @ = default, G = utf-8 when "%" @setgLevel 0 @setgCharset 0, Terminal::charsets.US @state = State.normal i++ # ESC (,),*,+,-,. Designate G0-G2 Character Set. # <-- this seems to get all the attention when "(", ")" , "*" , "+" , "-" , "." switch ch when "(" @gcharset = 0 when ")", "-" @gcharset = 1 when "*", "." @gcharset = 2 when "+" @gcharset = 3 @state = State.charset # Designate G3 Character Set (VT300). # A = ISO Latin-1 Supplemental. # Not implemented. when "/" @gcharset = 3 @state = State.charset i-- # ESC n # Invoke the G2 Character Set as GL (LS2). when "n" @setgLevel 2 # ESC o # Invoke the G3 Character Set as GL (LS3). when "o" @setgLevel 3 # ESC | # Invoke the G3 Character Set as GR (LS3R). when "|" @setgLevel 3 # ESC } # Invoke the G2 Character Set as GR (LS2R). when "}" @setgLevel 2 # ESC ~ # Invoke the G1 Character Set as GR (LS1R). when "~" @setgLevel 1 # ESC 7 Save Cursor (DECSC). when "7" @saveCursor() @state = State.normal # ESC 8 Restore Cursor (DECRC). when "8" @restoreCursor() @state = State.normal # ESC # 3 DEC line height/width when "#" @state = State.normal i++ num = data.charAt(i) switch num when "3" # DECDHL break when "4" # DECDHL break when "5" # DECSWL break when "6" # DECDWL break when "8" # DECALN for line in @screen line[1] = true for c in [0..line[0].length] line[0][c] = @cloneAttr @curAttr, "E" @x = @y = 0 # ESC H Tab Set (HTS is 0x88). when "H" @tabSet() # ESC = Application Keypad (DECPAM). when "=" @applicationKeypad = true @state = State.normal # ESC > Normal Keypad (DECPNM). when ">" @applicationKeypad = false @state = State.normal else @state = State.normal console.log "Unknown ESC control:", ch when State.charset switch ch when "0" # DEC Special Character and Line Drawing Set. cs = Terminal::charsets.SCLD when "A" # UK cs = Terminal::charsets.UK when "B" # United States (USASCII). cs = Terminal::charsets.US when "4" # Dutch cs = Terminal::charsets.Dutch # Finnish when "C", "5" cs = Terminal::charsets.Finnish when "R" # French cs = Terminal::charsets.French when "Q" # FrenchCanadian cs = Terminal::charsets.FrenchCanadian when "K" # German cs = Terminal::charsets.German when "Y" # Italian cs = Terminal::charsets.Italian # NorwegianDanish when "E", "6" cs = Terminal::charsets.NorwegianDanish when "Z" # Spanish cs = Terminal::charsets.Spanish # Swedish when "H", "7" cs = Terminal::charsets.Swedish when "=" # Swiss cs = Terminal::charsets.Swiss when "/" # ISOLatin (actually /A) cs = Terminal::charsets.ISOLatin i++ else # Default cs = Terminal::charsets.US @setgCharset @gcharset, cs @gcharset = null @state = State.normal when State.osc # OSC Ps ; Pt ST # OSC Ps ; Pt BEL # Set Text Parameters. if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" @params.push @currentParam switch @params[0] when 0, 1, 2 if @params[1] @title = @params[1] + " - ƸӜƷ butterfly" @handleTitle @title # reset colors @params = [] @currentParam = 0 @state = State.normal else unless @params.length if ch >= "0" and ch <= "9" @currentParam = @currentParam * 10 + ch.charCodeAt(0) - 48 else if ch is ";" @params.push @currentParam @currentParam = "" else @currentParam += ch when State.csi # '?', '>', '!' if ch is "?" or ch is ">" or ch is "!" @prefix = ch break # 0 - 9 if ch >= "0" and ch <= "9" @currentParam = @currentParam * 10 + ch.charCodeAt(0) - 48 break # '$', '"', ' ', '\'' if ch is "$" or ch is "\"" or ch is " " or ch is "'" break @params.push @currentParam @currentParam = 0 # ';' break if ch is ";" @state = State.normal switch ch # CSI Ps A # Cursor Up Ps Times (default = 1) (CUU). when "A" @cursorUp @params # CSI Ps B # Cursor Down Ps Times (default = 1) (CUD). when "B" @cursorDown @params # CSI Ps C # Cursor Forward Ps Times (default = 1) (CUF). when "C" @cursorForward @params # CSI Ps D # Cursor Backward Ps Times (default = 1) (CUB). when "D" @cursorBackward @params # CSI Ps ; Ps H # Cursor Position [row;column] (default = [1,1]) (CUP). when "H" @cursorPos @params # CSI Ps J Erase in Display (ED). when "J" @eraseInDisplay @params # CSI Ps K Erase in Line (EL). when "K" @eraseInLine @params # CSI Pm m Character Attributes (SGR). when "m" @charAttributes @params unless @prefix # CSI Ps n Device Status Report (DSR). when "n" @deviceStatus @params unless @prefix # CSI Ps @ # Insert Ps (Blank) Character(s) (default = 1) (ICH). when "@" @insertChars @params # CSI Ps E # Cursor Next Line Ps Times (default = 1) (CNL). when "E" @cursorNextLine @params # CSI Ps F # Cursor Preceding Line Ps Times (default = 1) (CNL). when "F" @cursorPrecedingLine @params # CSI Ps G # Cursor Character Absolute [column] (default = [row,1]) (CHA). when "G" @cursorCharAbsolute @params # CSI Ps L # Insert Ps Line(s) (default = 1) (IL). when "L" @insertLines @params # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). when "M" @deleteLines @params # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). when "P" @deleteChars @params # CSI Ps X # Erase Ps Character(s) (default = 1) (ECH). when "X" @eraseChars @params # CSI Pm ` Character Position Absolute # [column] (default = [row,1]) (HPA). when "`" @charPosAbsolute @params # 141 61 a * HPR - # Horizontal Position Relative when "a" @HPositionRelative @params # CSI P s c # Send Device Attributes (Primary DA). # CSI > P s c # Send Device Attributes (Secondary DA) when "c" @sendDeviceAttributes @params # CSI Pm d # Line Position Absolute [row] (default = [1,column]) (VPA). when "d" @linePosAbsolute @params # 145 65 e * VPR - Vertical Position Relative when "e" @VPositionRelative @params # CSI Ps ; Ps f # Horizontal and Vertical Position [row;column] (default = # [1,1]) (HVP). when "f" @HVPosition @params # CSI Pm h Set Mode (SM). # CSI ? Pm h - mouse escape codes, cursor escape codes when "h" @setMode @params # CSI Pm l Reset Mode (RM). # CSI ? Pm l when "l" @resetMode @params # CSI Ps ; Ps r # Set Scrolling Region [top;bottom] (default = full size of win- # dow) (DECSTBM). # CSI ? Pm r when "r" @setScrollRegion @params # CSI s # Save cursor (ANSI.SYS). when "s" @saveCursor @params # CSI u # Restore cursor (ANSI.SYS). when "u" @restoreCursor @params # CSI Ps I # Cursor Forward Tabulation Ps tab stops (default = 1) (CHT). when "I" @cursorForwardTab @params # CSI Ps S Scroll up Ps lines (default = 1) (SU). when "S" @scrollUp @params # CSI Ps T Scroll down Ps lines (default = 1) (SD). # CSI Ps ; Ps ; Ps ; Ps ; Ps T # CSI > Ps; Ps T when "T" @scrollDown @params if @params.length < 2 and not @prefix # CSI Ps Z # Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). when "Z" @cursorBackwardTab @params # CSI Ps b Repeat the preceding graphic character Ps times (REP). when "b" @repeatPrecedingCharacter @params # CSI Ps g Tab Clear (TBC). when "g" @tabClear @params # CSI > Ps p Set pointer mode. # CSI ! p Soft terminal reset (DECSTR). # CSI Ps$ p # Request ANSI mode (DECRQM). # CSI ? Ps$ p # Request DEC private mode (DECRQM). # CSI Ps ; Ps " p when "p" if @prefix is '!' @softReset @params else console.error "Unknown CSI code: %s.", ch @prefix = "" when State.dcs if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" switch @prefix # User-Defined Keys (DECUDK). when "" # Disabling this for now as we need a good script # striper to avoid malicious script injection pt = @currentParam unless pt[0] is ';' console.error "Unknown DECUDK: #{pt}" break pt = pt.slice(1) [type, content] = pt.split('|', 2) unless content console.error "No type for inline DECUDK: #{pt}" break switch type when "HTML" unless @htmlEscapesEnabled console.log "HTML escapes are disabled" break attr = @cloneAttr @curAttr attr.html = ( "<div class=\"inline-html\">#{content}</div>") @screen[@y + @shift][0][@x] = attr @screen[@y + @shift][1] = true when "IMAGE" # Prevent injection content = encodeURI content if content.indexOf(';') mime = content.slice(0, content.indexOf(';')) b64 = content.slice(content.indexOf(';') + 1) else mime = 'image' b64 = content attr = @cloneAttr @curAttr attr.html = ( "<img class=\"inline-image\" src=\"data:#{mime};base64,#{ b64}\" />") @screen[@y + @shift][0][@x] = attr @screen[@y + @shift][1] = true when "PROMPT" @send content when "TEXT" l += content.length data = data.slice(0, i + 1) + content + data.slice(i + 1) else console.error "Unknown type #{type} for DECUDK" # Request Status String (DECRQSS). # test: echo -e '\eP$q"p\e\\' when "$q" pt = @currentParam valid = false switch pt # DECSCA when "\"q" pt = "0\"q" # DECSCL when "\"p" pt = "61\"p" # DECSTBM when "r" pt = "" + (@scrollTop + 1) + ";" + (@scrollBottom + 1) + "r" # SGR when "m" pt = "0m" else console.error "Unknown DCS Pt: %s.", pt pt = "" @send "\x1bP" + +valid + "$r" + pt + "\x1b\\" when "+q" pt = @currentParam valid = false @send "\x1bP" + +valid + "+r" + pt + "\x1b\\" else console.error "Unknown DCS prefix: %s.", @prefix @currentParam = 0 @prefix = "" @state = State.normal else unless @currentParam if not @prefix and ch isnt "$" and ch isnt "+" @currentParam = ch else if @prefix.length is 2 @currentParam = ch else @prefix += ch else @currentParam += ch when State.ignore # For PM and APC. if ch is "\x1b" or ch is "\x07" i++ if ch is "\x1b" @state = State.normal i++ @screen[@y + @shift][1] = true @refresh() writeln: (data) -> @write "#{data}\r\n" keyDown: (ev) -> # Key Resources: # https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent # Don't handle modifiers alone return true if ev.keyCode > 15 and ev.keyCode < 19 # Handle shift insert and ctrl insert # copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] # Alt-z works as an escape to relay the following keys to the browser. # usefull to trigger browser shortcuts, i.e.: Alt+Z F5 to reload # May be redundant with keyPrefix if ev.altKey and ev.keyCode is 90 and not @skipNextKey @skipNextKey = true @body.classList.add('skip') return cancel(ev) if @skipNextKey @skipNextKey = false @body.classList.remove('skip') return true switch ev.keyCode # backspace when 8 key = if ev.altKey then "\x1b" else "" if ev.shiftKey key += "\x08" # ^H break key += "\x7f" # ^? # tab when 9 if ev.shiftKey key = "\x1b[Z" break key = "\t" # return/enter when 13 key = "\r" # escape when 27 key = "\x1b" # left-arrow when 37 if @applicationCursor key = "\x1bOD" # SS3 as ^[O for 7-bit #key = '\x8fD'; // SS3 as 0x8f for 8-bit break key = "\x1b[D" # right-arrow when 39 if @applicationCursor key = "\x1bOC" break key = "\x1b[C" # up-arrow when 38 if @applicationCursor key = "\x1bOA" break if ev.ctrlKey @scrollDisplay -1 return cancel(ev) else key = "\x1b[A" # down-arrow when 40 if @applicationCursor key = "\x1bOB" break if ev.ctrlKey @scrollDisplay 1 return cancel(ev) else key = "\x1b[B" # delete when 46 key = "\x1b[3~" # insert when 45 key = "\x1b[2~" # home when 36 if @applicationKeypad key = "\x1bOH" break key = "\x1PI:KEY:<KEY>END_PIOH" # end when 35 if @applicationKeypad key = "\x1bOF" break key = "\xPI:KEY:<KEY>END_PI" # page up when 33 if ev.shiftKey @scrollDisplay -(@rows - 1) return cancel(ev) else key = "\x1b[5~" # page down when 34 if ev.shiftKey @scrollDisplay @rows - 1 return cancel(ev) else key = "\x1b[6~" # F1 when 112 key = "\x1bOP" # F2 when 113 key = "\PI:KEY:<KEY>END_PI" # F3 when 114 key = "\PI:KEY:<KEY>END_PI" # F4 when 115 key = "\xPI:KEY:<KEY>END_PI" # F5 when 116 key = "\x1PI:KEY:<KEY>END_PI[15~" # F6 when 117 key = "\x1b[17~" # F7 when 118 key = "\x1b[18~" # F8 when 119 key = "\x1b[19~" # F9 when 120 key = "\x1b[20~" # F10 when 121 key = "\x1b[21~" # F11 when 122 key = "\x1b[23~" # F12 when 123 key = "\x1b[24~" # Scroll lock when 145 @scrollLock = ! @scrollLock if @scrollLock @body.classList.add 'locked' else @body.classList.remove 'locked' return cancel(ev) else # a-z and space if ev.ctrlKey if ev.keyCode >= 65 and ev.keyCode <= 90 if ev.keyCode is 67 t = (new Date()).getTime() if (t - @lastcc) < 500 and not @stop id = (setTimeout ->) (clearTimeout id if id not in [ @t_bell, @t_queue, @t_blink]) while id-- @body.classList.add 'stopped' @stop = true else if @stop return true @lastcc = t key = String.fromCharCode(ev.keyCode - 64) else if ev.keyCode is 32 # NUL key = String.fromCharCode(0) else if ev.keyCode >= 51 and ev.keyCode <= 55 # escape, file sep, group sep, record sep, unit sep key = String.fromCharCode(ev.keyCode - 51 + 27) else if ev.keyCode is 56 # delete key = String.fromCharCode(127) else if ev.keyCode is 219 # ^[ - escape key = String.fromCharCode(27) # ^] - group sep else if ev.keyCode is 221 key = String.fromCharCode(29) else if (ev.altKey and 'Mac' not in navigator.platform) or (ev.metaKey and 'Mac' in navigator.platform) if ev.keyCode >= 65 and ev.keyCode <= 90 key = "\x1b" + String.fromCharCode(ev.keyCode + 32) else if ev.keyCode is 192 key = "\x1b`" else if ev.keyCode >= 48 and ev.keyCode <= 57 key = "\x1b" + (ev.keyCode - 48) if ev.keyCode >= 37 and ev.keyCode <= 40 if ev.ctrlKey key = key.slice(0, -1) + "1;5" + key.slice(-1) else if ev.altKey key = key.slice(0, -1) + "1;PI:KEY:<KEY>END_PI" + key.slice(-1) else if ev.shiftKey key = key.slice(0, -1) + "1;PI:KEY:<KEY>END_PI" + key.slice(-1) return true unless key @showCursor() @send(key) cancel ev setgLevel: (g) -> @glevel = g @charset = @charsets[g] setgCharset: (g, charset) -> @charsets[g] = charset @charset = charset if @glevel is g keyPress: (ev) -> if @skipNextKey is false @skipNextKey = null return true # Don't handle modifiers alone return true if ev.keyCode > 15 and ev.keyCode < 19 # Handle shift insert and ctrl insert # copy/paste usefull for typematrix keyboard return true if (ev.shiftKey or ev.ctrlKey) and ev.keyCode is 45 # Let the ctrl+shift+c, ctrl+shift+v go through to handle native copy paste return true if (ev.shiftKey and ev.ctrlKey) and ev.keyCode in [67, 86] cancel ev if ev.charCode key = ev.charCode else unless ev.which? key = ev.keyCode else if ev.which isnt 0 and ev.charCode isnt 0 key = ev.which else return false return false if not key or ev.ctrlKey or ev.altKey or ev.metaKey key = String.fromCharCode(key) @showCursor() @send key false bell: (cls="bell")-> return unless @visualBell @body.classList.add cls @t_bell = setTimeout (=> @body.classList.remove cls ), @visualBell resize: (x=null, y=null) -> oldCols = @cols oldRows = @rows @computeCharSize() @cols = x or Math.floor(@body.clientWidth / @charSize.width) @rows = y or Math.floor(window.innerHeight / @charSize.height) px = window.innerHeight % @charSize.height @body.style['padding-bottom'] = "#{px}px" if (not x and not y) and oldCols == @cols and oldRows == @rows return @ctl 'Resize', @cols, @rows # resize cols if oldCols < @cols # does xterm use the default attr? i = @screen.length while i-- @screen[i][0].push @defAttr while @screen[i][0].length < @cols else if oldCols > @cols i = @screen.length while i-- @screen[i][0].pop() while @screen[i][0].length > @cols @setupStops oldCols # resize rows j = oldRows if j < @rows el = @body while j++ < @rows @screen.push [@blankLine(), true] if @screen.length < @rows if @children.length < @rows line = @document.createElement("div") line.className = 'line' el.appendChild line @children.push line else if j > @rows while j-- > @rows @screen.pop() if @screen.length > @rows if @children.length > @rows el = @children.pop() el?.parentNode.removeChild el # make sure the cursor stays on screen @y = @rows - 1 if @y >= @rows @x = @cols - 1 if @x >= @cols @scrollTop = 0 @scrollBottom = @rows - 1 @refresh(true) # it's a real nightmare trying # to resize the original # screen buffer. just set it # to null for now. @normal = null @reset() if x or y setupStops: (i) -> if i? i = @prevStop(i) unless @tabs[i] else @tabs = {} i = 0 while i < @cols @tabs[i] = true i += 8 prevStop: (x) -> x = @x unless x? while not @tabs[--x] and x > 0 1 if x >= @cols then @cols - 1 else (if x < 0 then 0 else x) nextStop: (x) -> x = @x unless x? while not @tabs[++x] and x < @cols 1 if x >= @cols then @cols - 1 else (if x < 0 then 0 else x) eraseRight: (x, y) -> line = @screen[y + @shift][0] # xterm while x < @cols line[x] = @eraseAttr() x++ @screen[y + @shift][1] = true eraseLeft: (x, y) -> x++ @screen[y + @shift][0][x] = @eraseAttr() while x-- @screen[y + @shift][1] = true eraseLine: (y) -> @eraseRight 0, y blankLine: (cur) -> attr = (if cur then @eraseAttr() else @defAttr) line = [] i = 0 while i < @cols + 1 line[i] = attr i++ line ch: (cur) -> if cur then @eraseAttr() else @defAttr isterm: (term) -> "#{@termName}".indexOf(term) is 0 send: (data) -> @out data handleTitle: (title) -> document.title = title ## ESC ## # ESC D Index (IND is 0x84). index: -> @nextLine() @state = State.normal # ESC M Reverse Index (RI is 0x8d). reverseIndex: -> @prevLine() @state = State.normal # ESC c Full Reset (RIS). reset: -> @resetVars() @refresh(true) # ESC H Tab Set (HTS is 0x88). tabSet: -> @tabs[@x] = true @state = State.normal ## CSI ## # CSI Ps A # Cursor Up Ps Times (default = 1) (CUU). cursorUp: (params) -> param = params[0] param = 1 if param < 1 @y -= param @y = 0 if @y < 0 # CSI Ps B # Cursor Down Ps Times (default = 1) (CUD). cursorDown: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows # CSI Ps C # Cursor Forward Ps Times (default = 1) (CUF). cursorForward: (params) -> param = params[0] param = 1 if param < 1 @x += param @x = @cols - 1 if @x >= @cols # CSI Ps D # Cursor Backward Ps Times (default = 1) (CUB). cursorBackward: (params) -> param = params[0] param = 1 if param < 1 @x -= param @x = 0 if @x < 0 # CSI Ps ; Ps H # Cursor Position [row;column] (default = [1,1]) (CUP). cursorPos: (params) -> row = params[0] - 1 if params.length >= 2 col = params[1] - 1 else col = 0 if row < 0 row = 0 else row = @rows - 1 if row >= @rows if col < 0 col = 0 else col = @cols - 1 if col >= @cols @x = col @y = row # CSI Ps J Erase in Display (ED). # Ps = 0 -> Erase Below (default). # Ps = 1 -> Erase Above. # Ps = 2 -> Erase All. # Ps = 3 -> Erase Saved Lines (xterm). # CSI ? Ps J # Erase in Display (DECSED). # Ps = 0 -> Selective Erase Below (default). # Ps = 1 -> Selective Erase Above. # Ps = 2 -> Selective Erase All. eraseInDisplay: (params) -> switch params[0] when 0 @eraseRight @x, @y j = @y + 1 while j < @rows @eraseLine j j++ when 1 @eraseLeft @x, @y j = @y @eraseLine j while j-- when 2 j = @rows @eraseLine j while j-- # CSI Ps K Erase in Line (EL). # Ps = 0 -> Erase to Right (default). # Ps = 1 -> Erase to Left. # Ps = 2 -> Erase All. # CSI ? Ps K # Erase in Line (DECSEL). # Ps = 0 -> Selective Erase to Right (default). # Ps = 1 -> Selective Erase to Left. # Ps = 2 -> Selective Erase All. eraseInLine: (params) -> switch params[0] when 0 @eraseRight @x, @y when 1 @eraseLeft @x, @y when 2 @eraseLine @y # CSI Pm m Character Attributes (SGR). # Ps = 0 -> Normal (default). # Ps = 1 -> Bold. # Ps = 4 -> Underlined. # Ps = 5 -> Blink (appears as Bold). # Ps = 7 -> Inverse. # Ps = 8 -> Invisible, i.e., hidden (VT300). # Ps = 2 2 -> Normal (neither bold nor faint). # Ps = 2 4 -> Not underline. # Ps = 2 5 -> Steady (not blinking). # Ps = 2 7 -> Positive (not inverse). # Ps = 2 8 -> Visible, i.e., not hidden (VT300). # Ps = 3 0 -> Set foreground color to Black. # Ps = 3 1 -> Set foreground color to Red. # Ps = 3 2 -> Set foreground color to Green. # Ps = 3 3 -> Set foreground color to Yellow. # Ps = 3 4 -> Set foreground color to Blue. # Ps = 3 5 -> Set foreground color to Magenta. # Ps = 3 6 -> Set foreground color to Cyan. # Ps = 3 7 -> Set foreground color to White. # Ps = 3 9 -> Set foreground color to default (original). # Ps = 4 0 -> Set background color to Black. # Ps = 4 1 -> Set background color to Red. # Ps = 4 2 -> Set background color to Green. # Ps = 4 3 -> Set background color to Yellow. # Ps = 4 4 -> Set background color to Blue. # Ps = 4 5 -> Set background color to Magenta. # Ps = 4 6 -> Set background color to Cyan. # Ps = 4 7 -> Set background color to White. # Ps = 4 9 -> Set background color to default (original). # If 16-color support is compiled, the following apply. Assume # that xterm's resources are set so that the ISO color codes are # the first 8 of a set of 16. Then the aixterm colors are the # bright versions of the ISO colors: # Ps = 9 0 -> Set foreground color to Black. # Ps = 9 1 -> Set foreground color to Red. # Ps = 9 2 -> Set foreground color to Green. # Ps = 9 3 -> Set foreground color to Yellow. # Ps = 9 4 -> Set foreground color to Blue. # Ps = 9 5 -> Set foreground color to Magenta. # Ps = 9 6 -> Set foreground color to Cyan. # Ps = 9 7 -> Set foreground color to White. # Ps = 1 0 0 -> Set background color to Black. # Ps = 1 0 1 -> Set background color to Red. # Ps = 1 0 2 -> Set background color to Green. # Ps = 1 0 3 -> Set background color to Yellow. # Ps = 1 0 4 -> Set background color to Blue. # Ps = 1 0 5 -> Set background color to Magenta. # Ps = 1 0 6 -> Set background color to Cyan. # Ps = 1 0 7 -> Set background color to White. # If xterm is compiled with the 16-color support disabled, it # supports the following, from rxvt: # Ps = 1 0 0 -> Set foreground and background color to # default. # If 88- or 256-color support is compiled, the following apply. # Ps = 3 8 ; 5 ; Ps -> Set foreground color to the second # Ps. # Ps = 4 8 ; 5 ; Ps -> Set background color to the second # Ps. charAttributes: (params) -> # Optimize a single SGR0. if params.length is 1 and params[0] is 0 @curAttr = @cloneAttr @defAttr return l = params.length i = 0 while i < l p = params[i] if p >= 30 and p <= 37 # fg color 8 @curAttr.fg = p - 30 else if p >= 40 and p <= 47 # bg color 8 @curAttr.bg = p - 40 else if p >= 90 and p <= 97 # fg color 16 p += 8 @curAttr.fg = p - 90 else if p >= 100 and p <= 107 # bg color 16 p += 8 @curAttr.bg = p - 100 else if p is 0 # default @curAttr = @cloneAttr @defAttr else if p is 1 # bold text @curAttr.bold = true else if p is 4 # underline text @curAttr.underline = true else if p is 5 # blink @curAttr.blink = true else if p is 7 # inverse and positive # test with: echo -e '\e[31m\e[42mhello\e[7mworld\e[27mhi\e[m' @curAttr.inverse = true else if p is 8 # invisible @curAttr.invisible = true else if p is 10 # Primary Font # ignoring else if p is 22 # not bold @curAttr.bold = false else if p is 24 # not underline @curAttr.underline = false else if p is 25 # not blink @curAttr.blink = false else if p is 27 # not inverse @curAttr.inverse = false else if p is 28 # not invisible @curAttr.invisible = false else if p is 39 # reset fg @curAttr.fg = 257 else if p is 49 # reset bg @curAttr.bg = 256 else if p is 38 if params[i + 1] is 2 # fg color 2^24 i += 2 @curAttr.fg = "rgb(#{params[i]}, #{params[i+1]}, #{params[i+2]})" i += 2 else if params[i + 1] is 5 # fg color 256 i += 2 @curAttr.fg = params[i] & 0xff else if p is 48 if params[i + 1] is 2 # bg color 2^24 i += 2 @curAttr.bg = "rgb(#{params[i]}, #{params[i+1]}, #{params[i+2]})" i += 2 else if params[i + 1] is 5 # bg color 256 i += 2 @curAttr.bg = params[i] & 0xff else if p is 100 # reset fg/bg @curAttr.fg = 257 @curAttr.bg = 256 else console.error "Unknown SGR attribute: %d.", p i++ # CSI Ps n Device Status Report (DSR). # Ps = 5 -> Status Report. Result (``OK'') is # CSI 0 n # Ps = 6 -> Report Cursor Position (CPR) [row;column]. # Result is # CSI r ; c R # CSI ? Ps n # Device Status Report (DSR, DEC-specific). # Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI # ? r ; c R (assumes page is zero). # Ps = 1 5 -> Report Printer status as CSI ? 1 0 n (ready). # or CSI ? 1 1 n (not ready). # Ps = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked) # or CSI ? 2 1 n (locked). # Ps = 2 6 -> Report Keyboard status as # CSI ? 2 7 ; 1 ; 0 ; 0 n (North American). # The last two parameters apply to VT400 & up, and denote key- # board ready and LK01 respectively. # Ps = 5 3 -> Report Locator status as # CSI ? 5 3 n Locator available, if compiled-in, or # CSI ? 5 0 n No Locator, if not. deviceStatus: (params) -> unless @prefix switch params[0] when 5 # status report @send "\x1b[0n" when 6 # cursor position @send "\x1b[" + (@y + 1) + ";" + (@x + 1) + "R" else if @prefix is "?" # modern xterm doesnt seem to # respond to any of these except ?6, 6, and 5 if params[0] is 6 # cursor position @send "\x1b[?" + (@y + 1) + ";" + (@x + 1) + "R" ## Additions ## # CSI Ps @ # Insert Ps (Blank) Character(s) (default = 1) (ICH). insertChars: (params) -> param = params[0] param = 1 if param < 1 row = @y j = @x # xterm while param-- and j < @cols @screen[row + @shift][0].splice j++, 0, [@eraseAttr(), true] @screen[row + @shift][0].pop() @screen[row + @shift][1] = true # CSI Ps E # Cursor Next Line Ps Times (default = 1) (CNL). # same as CSI Ps B ? cursorNextLine: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows @x = 0 # CSI Ps F # Cursor Preceding Line Ps Times (default = 1) (CNL). # reuse CSI Ps A ? cursorPrecedingLine: (params) -> param = params[0] param = 1 if param < 1 @y -= param @y = 0 if @y < 0 @x = 0 # CSI Ps G # Cursor Character Absolute [column] (default = [row,1]) (CHA). cursorCharAbsolute: (params) -> param = params[0] param = 1 if param < 1 @x = param - 1 # CSI Ps L # Insert Ps Line(s) (default = 1) (IL). # test: echo -e '\e[44m\e[1L\e[0m' insertLines: (params) -> param = params[0] param = 1 if param < 1 while param-- @screen.splice @y + @shift, 0, [@blankLine(true), true] # blankLine(true) - xterm/linux behavior @screen.splice @scrollBottom + 1 + @shift, 1 for i in [@y + @shift..@screen.length - 1] @screen[i][1] = true # CSI Ps M # Delete Ps Line(s) (default = 1) (DL). deleteLines: (params) -> param = params[0] param = 1 if param < 1 while param-- # test: echo -e '\e[44m\e[1M\e[0m' # blankLine(true) - xterm/linux behavior @screen.splice @scrollBottom + @shift, 0, [@blankLine(true), true] @screen.splice @y + @shift, 1 unless @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 @children[@y + @shift].remove() @children.splice @y + @shift, 1 if @normal or @scrollTop isnt 0 or @scrollBottom isnt @rows - 1 for i in [@y + @shift..@screen.length - 1] @screen[i][1] = true # CSI Ps P # Delete Ps Character(s) (default = 1) (DCH). deleteChars: (params) -> param = params[0] param = 1 if param < 1 while param-- @screen[@y + @shift][0].splice @x, 1 @screen[@y + @shift][0].push @eraseAttr() @screen[@y + @shift][1] = true # CSI Ps X # Erase Ps Character(s) (default = 1) (ECH). eraseChars: (params) -> param = params[0] param = 1 if param < 1 j = @x # xterm @screen[@y + @shift][0][j++] = @eraseAttr() while param-- and j < @cols @screen[@y + @shift][1] = true # CSI Pm ` Character Position Absolute # [column] (default = [row,1]) (HPA). charPosAbsolute: (params) -> param = params[0] param = 1 if param < 1 @x = param - 1 @x = @cols - 1 if @x >= @cols # 141 61 a * HPR - # Horizontal Position Relative # reuse CSI Ps C ? HPositionRelative: (params) -> param = params[0] param = 1 if param < 1 @x += param @x = @cols - 1 if @x >= @cols # CSI Ps c Send Device Attributes (Primary DA). # Ps = 0 or omitted -> request attributes from terminal. The # response depends on the decTerminalID resource setting. # -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'') # -> CSI ? 1 ; 0 c (``VT101 with No Options'') # -> CSI ? 6 c (``VT102'') # -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'') # The VT100-style response parameters do not mean anything by # themselves. VT220 parameters do, telling the host what fea- # tures the terminal supports: # Ps = 1 -> 132-columns. # Ps = 2 -> Printer. # Ps = 6 -> Selective erase. # Ps = 8 -> User-defined keys. # Ps = 9 -> National replacement character sets. # Ps = 1 5 -> Technical characters. # Ps = 2 2 -> ANSI color, e.g., VT525. # Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode). # CSI > Ps c # Send Device Attributes (Secondary DA). # Ps = 0 or omitted -> request the terminal's identification # code. The response depends on the decTerminalID resource set- # ting. It should apply only to VT220 and up, but xterm extends # this to VT100. # -> CSI > Pp ; Pv ; Pc c # where Pp denotes the terminal type # Pp = 0 -> ``VT100''. # Pp = 1 -> ``VT220''. # and Pv is the firmware version (for xterm, this was originally # the XFree86 patch number, starting with 95). In a DEC termi- # nal, Pc indicates the ROM cartridge registration number and is # always zero. # More information: # xterm/charproc.c - line 2012, for more information. # vim responds with ^[[?0c or ^[[?1c after the terminal's response (?) sendDeviceAttributes: (params) -> return if params[0] > 0 unless @prefix if @isterm("xterm") or @isterm("rxvt-unicode") or @isterm("screen") @send "\x1b[?1;2c" else @send "\x1b[?6c" if @isterm("linux") else if @prefix is ">" # xterm and urxvt # seem to spit this # out around ~370 times (?). if @isterm("xterm") @send "\x1b[>0;276;0c" else if @isterm("rxvt-unicode") @send "\x1b[>85;95;0c" else if @isterm("linux") # not supported by linux console. # linux console echoes parameters. @send params[0] + "c" else @send "\x1b[>83;40003;0c" if @isterm("screen") # CSI Pm d # Line Position Absolute [row] (default = [1,column]) (VPA). linePosAbsolute: (params) -> param = params[0] param = 1 if param < 1 @y = param - 1 @y = @rows - 1 if @y >= @rows # 145 65 e * VPR - Vertical Position Relative # reuse CSI Ps B ? VPositionRelative: (params) -> param = params[0] param = 1 if param < 1 @y += param @y = @rows - 1 if @y >= @rows # CSI Ps ; Ps f # Horizontal and Vertical Position [row;column] (default = # [1,1]) (HVP). HVPosition: (params) -> params[0] = 1 if params[0] < 1 params[1] = 1 if params[1] < 1 @y = params[0] - 1 @y = @rows - 1 if @y >= @rows @x = params[1] - 1 @x = @cols - 1 if @x >= @cols # CSI Pm h Set Mode (SM). # Ps = 2 -> Keyboard Action Mode (AM). # Ps = 4 -> Insert Mode (IRM). # Ps = 1 2 -> Send/receive (SRM). # Ps = 2 0 -> Automatic Newline (LNM). # CSI ? Pm h # DEC Private Mode Set (DECSET). # Ps = 1 -> Application Cursor Keys (DECCKM). # Ps = 2 -> Designate USASCII for character sets G0-G3 # (DECANM), and set VT100 mode. # Ps = 3 -> 132 Column Mode (DECCOLM). # Ps = 4 -> Smooth (Slow) Scroll (DECSCLM). # Ps = 5 -> Reverse Video (DECSCNM). # Ps = 6 -> Origin Mode (DECOM). # Ps = 7 -> Wraparound Mode (DECAWM). # Ps = 8 -> Auto-repeat Keys (DECARM). # Ps = 9 -> Send Mouse X & Y on button press. See the sec- # tion Mouse Tracking. # Ps = 1 0 -> Show toolbar (rxvt). # Ps = 1 2 -> Start Blinking Cursor (att610). # Ps = 1 8 -> Print form feed (DECPFF). # Ps = 1 9 -> Set print extent to full screen (DECPEX). # Ps = 2 5 -> Show Cursor (DECTCEM). # Ps = 3 0 -> Show scrollbar (rxvt). # Ps = 3 5 -> Enable font-shifting functions (rxvt). # Ps = 3 8 -> Enter Tektronix Mode (DECTEK). # Ps = 4 0 -> Allow 80 -> 132 Mode. # Ps = 4 1 -> more(1) fix (see curses resource). # Ps = 4 2 -> Enable Nation Replacement Character sets (DECN- # RCM). # Ps = 4 4 -> Turn On Margin Bell. # Ps = 4 5 -> Reverse-wraparound Mode. # Ps = 4 6 -> Start Logging. This is normally disabled by a # compile-time option. # Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis- # abled by the titeInhibit resource). # Ps = 6 6 -> Application keypad (DECNKM). # Ps = 6 7 -> Backarrow key sends backspace (DECBKM). # Ps = 1 0 0 0 -> Send Mouse X & Y on button press and # release. See the section Mouse Tracking. # Ps = 1 0 0 1 -> Use Hilite Mouse Tracking. # Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking. # Ps = 1 0 0 3 -> Use All Motion Mouse Tracking. # Ps = 1 0 0 4 -> Send FocusIn/FocusOut events. # Ps = 1 0 0 5 -> Enable Extended Mouse Mode. # Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt). # Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt). # Ps = 1 0 3 4 -> Interpret "meta" key, sets eighth bit. # (enables the eightBitInput resource). # Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num- # Lock keys. (This enables the numLock resource). # Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This # enables the metaSendsEscape resource). # Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete # key. # Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This # enables the altSendsEscape resource). # Ps = 1 0 4 0 -> Keep selection even if not highlighted. # (This enables the keepSelection resource). # Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables # the selectToClipboard resource). # Ps = 1 0 4 2 -> Enable Urgency window manager hint when # Control-G is received. (This enables the bellIsUrgent # resource). # Ps = 1 0 4 3 -> Enable raising of the window when Control-G # is received. (enables the popOnBell resource). # Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be # disabled by the titeInhibit resource). # Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis- # abled by the titeInhibit resource). # Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate # Screen Buffer, clearing it first. (This may be disabled by # the titeInhibit resource). This combines the effects of the 1 # 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based # applications rather than the 4 7 mode. # Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode. # Ps = 1 0 5 1 -> Set Sun function-key mode. # Ps = 1 0 5 2 -> Set HP function-key mode. # Ps = 1 0 5 3 -> Set SCO function-key mode. # Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6). # Ps = 1 0 6 1 -> Set VT220 keyboard emulation. # Ps = 2 0 0 4 -> Set bracketed paste mode. # Modes: # http://vt100.net/docs/vt220-rm/chapter4.html setMode: (params) -> if typeof params is "object" l = params.length i = 0 while i < l @setMode params[i] i++ return if not @prefix switch params when 4 @insertMode = true when 20 @convertEol = true return if @prefix is "?" switch params when 1 @applicationCursor = true when 2 @setgCharset 0, Terminal::charsets.US @setgCharset 1, Terminal::charsets.US @setgCharset 2, Terminal::charsets.US @setgCharset 3, Terminal::charsets.US # set VT100 mode here when 3 # 132 col mode @savedCols = @cols @resize 132, @rows when 6 @originMode = true when 7 @wraparoundMode = true when 66 @applicationKeypad = true # X10 Mouse # no release, no motion, no wheel, no modifiers. when 9, 1000, 1002, 1003 # any event mouse # any event - sends motion events, # even if there is no button held down. @x10Mouse = params is 9 @vt200Mouse = params is 1000 @normalMouse = params > 1000 @mouseEvents = true @body.style.cursor = 'pointer' when 1004 # send focusin/focusout events # focusin: ^[[I # focusout: ^[[O @sendFocus = true when 1005 # utf8 ext mode mouse @utfMouse = true # for wide terminals # simply encodes large values as utf8 characters when 1006 # sgr ext mode mouse @sgrMouse = true # for wide terminals # does not add 32 to fields # press: ^[[<b;x;yM # release: ^[[<b;x;ym when 1015 # urxvt ext mode mouse @urxvtMouse = true # for wide terminals # numbers for fields # press: ^[[b;x;yM # motion: ^[[b;x;yT when 25 # show cursor @cursorHidden = false # alt screen buffer cursor #@saveCursor(); when 1049, 47, 1047 # alt screen buffer unless @normal normal = screen: @screen x: @x y: @y shift: @shift scrollTop: @scrollTop scrollBottom: @scrollBottom tabs: @tabs @reset() @normal = normal @showCursor() # CSI Pm l Reset Mode (RM). # Ps = 2 -> Keyboard Action Mode (AM). # Ps = 4 -> Replace Mode (IRM). # Ps = 1 2 -> Send/receive (SRM). # Ps = 2 0 -> Normal Linefeed (LNM). # CSI ? Pm l # DEC Private Mode Reset (DECRST). # Ps = 1 -> Normal Cursor Keys (DECCKM). # Ps = 2 -> Designate VT52 mode (DECANM). # Ps = 3 -> 80 Column Mode (DECCOLM). # Ps = 4 -> Jump (Fast) Scroll (DECSCLM). # Ps = 5 -> Normal Video (DECSCNM). # Ps = 6 -> Normal Cursor Mode (DECOM). # Ps = 7 -> No Wraparound Mode (DECAWM). # Ps = 8 -> No Auto-repeat Keys (DECARM). # Ps = 9 -> Don't send Mouse X & Y on button press. # Ps = 1 0 -> Hide toolbar (rxvt). # Ps = 1 2 -> Stop Blinking Cursor (att610). # Ps = 1 8 -> Don't print form feed (DECPFF). # Ps = 1 9 -> Limit print to scrolling region (DECPEX). # Ps = 2 5 -> Hide Cursor (DECTCEM). # Ps = 3 0 -> Don't show scrollbar (rxvt). # Ps = 3 5 -> Disable font-shifting functions (rxvt). # Ps = 4 0 -> Disallow 80 -> 132 Mode. # Ps = 4 1 -> No more(1) fix (see curses resource). # Ps = 4 2 -> Disable Nation Replacement Character sets (DEC- # NRCM). # Ps = 4 4 -> Turn Off Margin Bell. # Ps = 4 5 -> No Reverse-wraparound Mode. # Ps = 4 6 -> Stop Logging. (This is normally disabled by a # compile-time option). # Ps = 4 7 -> Use Normal Screen Buffer. # Ps = 6 6 -> Numeric keypad (DECNKM). # Ps = 6 7 -> Backarrow key sends delete (DECBKM). # Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and # release. See the section Mouse Tracking. # Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking. # Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking. # Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking. # Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events. # Ps = 1 0 0 5 -> Disable Extended Mouse Mode. # Ps = 1 0 1 0 -> Don't scroll to bottom on tty output # (rxvt). # Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt). # Ps = 1 0 3 4 -> Don't interpret "meta" key. (This disables # the eightBitInput resource). # Ps = 1 0 3 5 -> Disable special modifiers for Alt and Num- # Lock keys. (This disables the numLock resource). # Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key. # (This disables the metaSendsEscape resource). # Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad # Delete key. # Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key. # (This disables the altSendsEscape resource). # Ps = 1 0 4 0 -> Do not keep selection when not highlighted. # (This disables the keepSelection resource). # Ps = 1 0 4 1 -> Use the PRIMARY selection. (This disables # the selectToClipboard resource). # Ps = 1 0 4 2 -> Disable Urgency window manager hint when # Control-G is received. (This disables the bellIsUrgent # resource). # Ps = 1 0 4 3 -> Disable raising of the window when Control- # G is received. (This disables the popOnBell resource). # Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen # first if in the Alternate Screen. (This may be disabled by # the titeInhibit resource). # Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be # disabled by the titeInhibit resource). # Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor # as in DECRC. (This may be disabled by the titeInhibit # resource). This combines the effects of the 1 0 4 7 and 1 0 # 4 8 modes. Use this with terminfo-based applications rather # than the 4 7 mode. # Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode. # Ps = 1 0 5 1 -> Reset Sun function-key mode. # Ps = 1 0 5 2 -> Reset HP function-key mode. # Ps = 1 0 5 3 -> Reset SCO function-key mode. # Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6). # Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style. # Ps = 2 0 0 4 -> Reset bracketed paste mode. resetMode: (params) -> if typeof params is "object" l = params.length i = 0 while i < l @resetMode params[i] i++ return if not @prefix switch params when 4 @insertMode = false when 20 @convertEol = false return if @prefix is "?" switch params when 1 @applicationCursor = false when 3 @resize @savedCols, @rows if @cols is 132 and @savedCols delete @savedCols when 6 @originMode = false when 7 @wraparoundMode = false when 66 @applicationKeypad = false when 9, 1000, 1002 , 1003 # any event mouse @x10Mouse = false @vt200Mouse = false @normalMouse = false @mouseEvents = false @body.style.cursor = "" when 1004 # send focusin/focusout events @sendFocus = false when 1005 # utf8 ext mode mouse @utfMouse = false when 1006 # sgr ext mode mouse @sgrMouse = false when 1015 # urxvt ext mode mouse @urxvtMouse = false when 25 # hide cursor @cursorHidden = true when 1049, 47, 1047 # normal screen buffer - clearing it first if @normal @screen = @normal.screen @x = @normal.x @y = @normal.y @shift = @normal.shift @scrollTop = @normal.scrollTop @scrollBottom = @normal.scrollBottom @tabs = @normal.tabs @normal = null @reset() @showCursor() # CSI Ps ; Ps r # Set Scrolling Region [top;bottom] (default = full size of win- # dow) (DECSTBM). # CSI ? Pm r setScrollRegion: (params) -> return if @prefix @scrollTop = (params[0] or 1) - 1 @scrollBottom = (params[1] or @rows) - 1 @x = 0 @y = 0 # CSI s # Save cursor (ANSI.SYS). saveCursor: (params) -> @savedX = @x @savedY = @y # CSI u # Restore cursor (ANSI.SYS). restoreCursor: (params) -> @x = @savedX or 0 @y = @savedY or 0 ## Lesser Used ## # CSI Ps I # Cursor Forward Tabulation Ps tab stops (default = 1) (CHT). cursorForwardTab: (params) -> param = params[0] or 1 @x = @nextStop() while param-- # CSI Ps S Scroll up Ps lines (default = 1) (SU). scrollUp: (params) -> param = params[0] or 1 while param-- @screen.splice @scrollTop, 1 @screen.splice @scrollBottom, 0, [@blankLine(), true] for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true # CSI Ps T Scroll down Ps lines (default = 1) (SD). scrollDown: (params) -> param = params[0] or 1 while param-- @screen.splice @scrollBottom, 1 @screen.splice @scrollTop, 0, [@blankLine(), true] for i in [@scrollTop..@scrollBottom] @screen[i + @shift][1] = true # CSI Ps ; Ps ; Ps ; Ps ; Ps T # Initiate highlight mouse tracking. Parameters are # [func;startx;starty;firstrow;lastrow]. See the section Mouse # Tracking. initMouseTracking: (params) -> # Relevant: DECSET 1001 # CSI > Ps; Ps T # Reset one or more features of the title modes to the default # value. Normally, "reset" disables the feature. It is possi- # ble to disable the ability to reset features by compiling a # different default for the title modes into xterm. # Ps = 0 -> Do not set window/icon labels using hexadecimal. # Ps = 1 -> Do not query window/icon labels using hexadeci- # mal. # Ps = 2 -> Do not set window/icon labels using UTF-8. # Ps = 3 -> Do not query window/icon labels using UTF-8. # (See discussion of "Title Modes"). resetTitleModes: (params) -> # CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT). cursorBackwardTab: (params) -> param = params[0] or 1 @x = @prevStop() while param-- # CSI Ps b Repeat the preceding graphic character Ps times (REP). repeatPrecedingCharacter: (params) -> param = params[0] or 1 line = @screen[@y + @shift][0] ch = line[@x - 1] or @defAttr line[@x++] = ch while param-- @screen[@y + @shift][1] = true # CSI Ps g Tab Clear (TBC). # Ps = 0 -> Clear Current Column (default). # Ps = 3 -> Clear All. # Potentially: # Ps = 2 -> Clear Stops on Line. # http://vt100.net/annarbor/aaa-ug/section6.html tabClear: (params) -> param = params[0] if param <= 0 delete @tabs[@x] else @tabs = {} if param is 3 # CSI Pm i Media Copy (MC). # Ps = 0 -> Print screen (default). # Ps = 4 -> Turn off printer controller mode. # Ps = 5 -> Turn on printer controller mode. # CSI ? Pm i # Media Copy (MC, DEC-specific). # Ps = 1 -> Print line containing cursor. # Ps = 4 -> Turn off autoprint mode. # Ps = 5 -> Turn on autoprint mode. # Ps = 1 0 -> Print composed display, ignores DECPEX. # Ps = 1 1 -> Print all pages. mediaCopy: (params) -> # CSI > Ps; Ps m # Set or reset resource-values used by xterm to decide whether # to construct escape sequences holding information about the # modifiers pressed with a given key. The first parameter iden- # tifies the resource to set/reset. The second parameter is the # value to assign to the resource. If the second parameter is # omitted, the resource is reset to its initial value. # Ps = 1 -> modifyCursorKeys. # Ps = 2 -> modifyFunctionKeys. # Ps = 4 -> modifyOtherKeys. # If no parameters are given, all resources are reset to their # initial values. setResources: (params) -> # CSI > Ps n # Disable modifiers which may be enabled via the CSI > Ps; Ps m # sequence. This corresponds to a resource value of "-1", which # cannot be set with the other sequence. The parameter identi- # fies the resource to be disabled: # Ps = 1 -> modifyCursorKeys. # Ps = 2 -> modifyFunctionKeys. # Ps = 4 -> modifyOtherKeys. # If the parameter is omitted, modifyFunctionKeys is disabled. # When modifyFunctionKeys is disabled, xterm uses the modifier # keys to make an extended sequence of functions rather than # adding a parameter to each function key to denote the modi- # fiers. disableModifiers: (params) -> # CSI > Ps p # Set resource value pointerMode. This is used by xterm to # decide whether to hide the pointer cursor as the user types. # Valid values for the parameter: # Ps = 0 -> never hide the pointer. # Ps = 1 -> hide if the mouse tracking mode is not enabled. # Ps = 2 -> always hide the pointer. If no parameter is # given, xterm uses the default, which is 1 . setPointerMode: (params) -> # CSI ! p Soft terminal reset (DECSTR). # http://vt100.net/docs/vt220-rm/table4-10.html softReset: (params) -> @cursorHidden = false @insertMode = false @originMode = false @wraparoundMode = false # autowrap @applicationKeypad = false # ? @applicationCursor = false @scrollTop = 0 @scrollBottom = @rows - 1 @curAttr = @defAttr @x = @y = 0 # ? @charset = null @glevel = 0 # ?? @charsets = [null] # ?? # CSI Ps$ p # Request ANSI mode (DECRQM). For VT300 and up, reply is # CSI Ps; Pm$ y # where Ps is the mode number as in RM, and Pm is the mode # value: # 0 - not recognized # 1 - set # 2 - reset # 3 - permanently set # 4 - permanently reset requestAnsiMode: (params) -> # CSI ? Ps$ p # Request DEC private mode (DECRQM). For VT300 and up, reply is # CSI ? Ps; Pm$ p # where Ps is the mode number as in DECSET, Pm is the mode value # as in the ANSI DECRQM. requestPrivateMode: (params) -> # CSI Ps ; Ps " p # Set conformance level (DECSCL). Valid values for the first # parameter: # Ps = 6 1 -> VT100. # Ps = 6 2 -> VT200. # Ps = 6 3 -> VT300. # Valid values for the second parameter: # Ps = 0 -> 8-bit controls. # Ps = 1 -> 7-bit controls (always set for VT100). # Ps = 2 -> 8-bit controls. setConformanceLevel: (params) -> # CSI Ps q Load LEDs (DECLL). # Ps = 0 -> Clear all LEDS (default). # Ps = 1 -> Light Num Lock. # Ps = 2 -> Light Caps Lock. # Ps = 3 -> Light Scroll Lock. # Ps = 2 1 -> Extinguish Num Lock. # Ps = 2 2 -> Extinguish Caps Lock. # Ps = 2 3 -> Extinguish Scroll Lock. loadLEDs: (params) -> # CSI Ps SP q # Set cursor style (DECSCUSR, VT520). # Ps = 0 -> blinking block. # Ps = 1 -> blinking block (default). # Ps = 2 -> steady block. # Ps = 3 -> blinking underline. # Ps = 4 -> steady underline. setCursorStyle: (params) -> # CSI Ps " q # Select character protection attribute (DECSCA). Valid values # for the parameter: # Ps = 0 -> DECSED and DECSEL can erase (default). # Ps = 1 -> DECSED and DECSEL cannot erase. # Ps = 2 -> DECSED and DECSEL can erase. setCharProtectionAttr: (params) -> # CSI ? Pm r # Restore DEC Private Mode Values. The value of Ps previously # saved is restored. Ps values are the same as for DECSET. restorePrivateValues: (params) -> # CSI Pt; Pl; Pb; Pr; Ps$ r # Change Attributes in Rectangular Area (DECCARA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. # Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. # NOTE: xterm doesn't enable this code by default. setAttrInRectangle: (params) -> t = params[0] l = params[1] b = params[2] r = params[3] attr = params[4] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @cloneAttr attr, line[i].ch i++ t++ # CSI ? Pm s # Save DEC Private Mode Values. Ps values are the same as for # DECSET. savePrivateValues: (params) -> # CSI Ps ; Ps ; Ps t # Window manipulation (from dtterm, as well as extensions). # These controls may be disabled using the allowWindowOps # resource. Valid values for the first (and any additional # parameters) are: # Ps = 1 -> De-iconify window. # Ps = 2 -> Iconify window. # Ps = 3 ; x ; y -> Move window to [x, y]. # Ps = 4 ; height ; width -> Resize the xterm window to # height and width in pixels. # Ps = 5 -> Raise the xterm window to the front of the stack- # ing order. # Ps = 6 -> Lower the xterm window to the bottom of the # stacking order. # Ps = 7 -> Refresh the xterm window. # Ps = 8 ; height ; width -> Resize the text area to # [height;width] in characters. # Ps = 9 ; 0 -> Restore maximized window. # Ps = 9 ; 1 -> Maximize window (i.e., resize to screen # size). # Ps = 1 0 ; 0 -> Undo full-screen mode. # Ps = 1 0 ; 1 -> Change to full-screen. # Ps = 1 1 -> Report xterm window state. If the xterm window # is open (non-iconified), it returns CSI 1 t . If the xterm # window is iconified, it returns CSI 2 t . # Ps = 1 3 -> Report xterm window position. Result is CSI 3 # ; x ; y t # Ps = 1 4 -> Report xterm window in pixels. Result is CSI # 4 ; height ; width t # Ps = 1 8 -> Report the size of the text area in characters. # Result is CSI 8 ; height ; width t # Ps = 1 9 -> Report the size of the screen in characters. # Result is CSI 9 ; height ; width t # Ps = 2 0 -> Report xterm window's icon label. Result is # OSC L label ST # Ps = 2 1 -> Report xterm window's title. Result is OSC l # label ST # Ps = 2 2 ; 0 -> Save xterm icon and window title on # stack. # Ps = 2 2 ; 1 -> Save xterm icon title on stack. # Ps = 2 2 ; 2 -> Save xterm window title on stack. # Ps = 2 3 ; 0 -> Restore xterm icon and window title from # stack. # Ps = 2 3 ; 1 -> Restore xterm icon title from stack. # Ps = 2 3 ; 2 -> Restore xterm window title from stack. # Ps >= 2 4 -> Resize to Ps lines (DECSLPP). manipulateWindow: (params) -> # CSI Pt; Pl; Pb; Pr; Ps$ t # Reverse Attributes in Rectangular Area (DECRARA), VT400 and # up. # Pt; Pl; Pb; Pr denotes the rectangle. # Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. # NOTE: xterm doesn't enable this code by default. reverseAttrInRectangle: (params) -> # CSI > Ps; Ps t # Set one or more features of the title modes. Each parameter # enables a single feature. # Ps = 0 -> Set window/icon labels using hexadecimal. # Ps = 1 -> Query window/icon labels using hexadecimal. # Ps = 2 -> Set window/icon labels using UTF-8. # Ps = 3 -> Query window/icon labels using UTF-8. (See dis- # cussion of "Title Modes") setTitleModeFeature: (params) -> # CSI Ps SP t # Set warning-bell volume (DECSWBV, VT520). # Ps = 0 or 1 -> off. # Ps = 2 , 3 or 4 -> low. # Ps = 5 , 6 , 7 , or 8 -> high. setWarningBellVolume: (params) -> # CSI Ps SP u # Set margin-bell volume (DECSMBV, VT520). # Ps = 1 -> off. # Ps = 2 , 3 or 4 -> low. # Ps = 0 , 5 , 6 , 7 , or 8 -> high. setMarginBellVolume: (params) -> # CSI Pt; Pl; Pb; Pr; Pp; Pt; Pl; Pp$ v # Copy Rectangular Area (DECCRA, VT400 and up). # Pt; Pl; Pb; Pr denotes the rectangle. # Pp denotes the source page. # Pt; Pl denotes the target location. # Pp denotes the target page. # NOTE: xterm doesn't enable this code by default. copyRectangle: (params) -> # CSI Pt ; Pl ; Pb ; Pr ' w # Enable Filter Rectangle (DECEFR), VT420 and up. # Parameters are [top;left;bottom;right]. # Defines the coordinates of a filter rectangle and activates # it. Anytime the locator is detected outside of the filter # rectangle, an outside rectangle event is generated and the # rectangle is disabled. Filter rectangles are always treated # as "one-shot" events. Any parameters that are omitted default # to the current locator position. If all parameters are omit- # ted, any locator motion will be reported. DECELR always can- # cels any prevous rectangle definition. enableFilterRectangle: (params) -> # CSI Ps x Request Terminal Parameters (DECREQTPARM). # if Ps is a "0" (default) or "1", and xterm is emulating VT100, # the control sequence elicits a response of the same form whose # parameters describe the terminal: # Ps -> the given Ps incremented by 2. # Pn = 1 <- no parity. # Pn = 1 <- eight bits. # Pn = 1 <- 2 8 transmit 38.4k baud. # Pn = 1 <- 2 8 receive 38.4k baud. # Pn = 1 <- clock multiplier. # Pn = 0 <- STP flags. requestParameters: (params) -> # CSI Ps x Select Attribute Change Extent (DECSACE). # Ps = 0 -> from start to end position, wrapped. # Ps = 1 -> from start to end position, wrapped. # Ps = 2 -> rectangle (exact). selectChangeExtent: (params) -> # CSI Pc; Pt; Pl; Pb; Pr$ x # Fill Rectangular Area (DECFRA), VT420 and up. # Pc is the character to use. # Pt; Pl; Pb; Pr denotes the rectangle. # NOTE: xterm doesn't enable this code by default. fillRectangle: (params) -> ch = params[0] t = params[1] l = params[2] b = params[3] r = params[4] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @cloneAttr line[i][0], String.fromCharCode(ch) i++ t++ # CSI Ps ; Pu ' z # Enable Locator Reporting (DECELR). # Valid values for the first parameter: # Ps = 0 -> Locator disabled (default). # Ps = 1 -> Locator enabled. # Ps = 2 -> Locator enabled for one report, then disabled. # The second parameter specifies the coordinate unit for locator # reports. # Valid values for the second parameter: # Pu = 0 <- or omitted -> default to character cells. # Pu = 1 <- device physical pixels. # Pu = 2 <- character cells. enableLocatorReporting: (params) -> val = params[0] > 0 # CSI Pt; Pl; Pb; Pr$ z # Erase Rectangular Area (DECERA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. # NOTE: xterm doesn't enable this code by default. eraseRectangle: (params) -> t = params[0] l = params[1] b = params[2] r = params[3] while t < b + 1 line = @screen[t + @shift][0] @screen[t + @shift][1] = true i = l while i < r line[i] = @eraseAttr() i++ t++ # CSI Pm ' { # Select Locator Events (DECSLE). # Valid values for the first (and any additional parameters) # are: # Ps = 0 -> only respond to explicit host requests (DECRQLP). # (This is default). It also cancels any filter # rectangle. # Ps = 1 -> report button down transitions. # Ps = 2 -> do not report button down transitions. # Ps = 3 -> report button up transitions. # Ps = 4 -> do not report button up transitions. setLocatorEvents: (params) -> # CSI Pt; Pl; Pb; Pr$ { # Selective Erase Rectangular Area (DECSERA), VT400 and up. # Pt; Pl; Pb; Pr denotes the rectangle. selectiveEraseRectangle: (params) -> # CSI Ps ' | # Request Locator Position (DECRQLP). # Valid values for the parameter are: # Ps = 0 , 1 or omitted -> transmit a single DECLRP locator # report. # If Locator Reporting has been enabled by a DECELR, xterm will # respond with a DECLRP Locator Report. This report is also # generated on button up and down events if they have been # enabled with a DECSLE, or when the locator is detected outside # of a filter rectangle, if filter rectangles have been enabled # with a DECEFR. # -> CSI Pe ; Pb ; Pr ; Pc ; Pp & w # Parameters are [event;button;row;column;page]. # Valid values for the event: # Pe = 0 -> locator unavailable - no other parameters sent. # Pe = 1 -> request - xterm received a DECRQLP. # Pe = 2 -> left button down. # Pe = 3 -> left button up. # Pe = 4 -> middle button down. # Pe = 5 -> middle button up. # Pe = 6 -> right button down. # Pe = 7 -> right button up. # Pe = 8 -> M4 button down. # Pe = 9 -> M4 button up. # Pe = 1 0 -> locator outside filter rectangle. # ``button'' parameter is a bitmask indicating which buttons are # pressed: # Pb = 0 <- no buttons down. # Pb & 1 <- right button down. # Pb & 2 <- middle button down. # Pb & 4 <- left button down. # Pb & 8 <- M4 button down. # ``row'' and ``column'' parameters are the coordinates of the # locator position in the xterm window, encoded as ASCII deci- # mal. # The ``page'' parameter is not used by xterm, and will be omit- # ted. requestLocatorPosition: (params) -> # CSI P m SP } # Insert P s Column(s) (default = 1) (DECIC), VT420 and up. # NOTE: xterm doesn't enable this code by default. insertColumns: -> param = params[0] l = @rows + @shift while param-- i = @shift while i < l @screen[i][0].splice @x + 1, 0, @eraseAttr() @screen[i][0].pop() i++ @screen[i][1] = true # CSI P m SP ~ # Delete P s Column(s) (default = 1) (DECDC), VT420 and up # NOTE: xterm doesn't enable this code by default. deleteColumns: -> param = params[0] l = @rows + @shift while param-- i = @shift while i < l @screen[i][0].splice @x, 1 @screen[i][0].push @eraseAttr() i++ @screen[i][1] = true # DEC Special Character and Line Drawing Set. # http://vt100.net/docs/vt102-ug/table5-13.html # A lot of curses apps use this if they see TERM=xterm. # testing: echo -e '\e(0a\e(B' # The xterm output sometimes seems to conflict with the # reference above. xterm seems in line with the reference # when running vttest however. # The table below now uses xterm's output from vttest. charsets: SCLD:# (0 "`": "◆" # '◆' a: "▒" # '▒' b: "\t" # '\t' c: "\f" # '\f' d: "\r" # '\r' e: "\n" # '\n' f: "°" # '°' g: "±" # '±' h: "␤" # '\u2424' (NL) i: "\x0b" # '\v' j: "┘" # '┘' k: "┐" # '┐' l: "┌" # '┌' m: "└" # '└' n: "┼" # '┼' o: "⎺" # '⎺' p: "⎻" # '⎻' q: "─" # '─' r: "⎼" # '⎼' s: "⎽" # '⎽' t: "├" # '├' u: "┤" # '┤' v: "┴" # '┴' w: "┬" # '┬' x: "│" # '│' y: "≤" # '≤' z: "≥" # '≥' "{": "π" # 'π' "|": "≠" # '≠' "}": "£" # '£' "~": "·" # '·' UK: null # (A US: null # (B (USASCII) Dutch: null # (4 Finnish: null # (C or (5 French: null # (R FrenchCanadian: null # (Q German: null # (K Italian: null # (Y NorwegianDanish: null # (E or (6 Spanish: null # (Z Swedish: null # (H or (7 Swiss: null # (= ISOLatin: null # /A window.Terminal = Terminal
[ { "context": "listedEmails).toEqual jasmine.objectContaining [ 'bonnie_2@example.com', 'bonnie_3@example.com', 'bonnie_4@example.com',", "end": 512, "score": 0.9999231100082397, "start": 492, "tag": "EMAIL", "value": "bonnie_2@example.com" }, { "context": "smine.objectContaining [ 'b...
spec/javascripts/admin_views/users_view_spec.js.coffee
projectcypress/bonnie
0
describe 'UsersViews', -> beforeEach -> jasmine.getJSONFixtures().clearCache() users_index = getJSONFixture("ajax/users.json") users = new Thorax.Collections.Users(users_index) users.trigger('reset', users, {}); @view = new Thorax.Views.Users(collection: users) @view.render() it 'initializes', -> listedEmails = @view.$('td.user-email > div:first-of-type').toArray().map (e) -> e.innerText expect(listedEmails).toEqual jasmine.objectContaining [ 'bonnie_2@example.com', 'bonnie_3@example.com', 'bonnie_4@example.com', 'bonnie@example.com' ]
13210
describe 'UsersViews', -> beforeEach -> jasmine.getJSONFixtures().clearCache() users_index = getJSONFixture("ajax/users.json") users = new Thorax.Collections.Users(users_index) users.trigger('reset', users, {}); @view = new Thorax.Views.Users(collection: users) @view.render() it 'initializes', -> listedEmails = @view.$('td.user-email > div:first-of-type').toArray().map (e) -> e.innerText expect(listedEmails).toEqual jasmine.objectContaining [ '<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>' ]
true
describe 'UsersViews', -> beforeEach -> jasmine.getJSONFixtures().clearCache() users_index = getJSONFixture("ajax/users.json") users = new Thorax.Collections.Users(users_index) users.trigger('reset', users, {}); @view = new Thorax.Views.Users(collection: users) @view.render() it 'initializes', -> listedEmails = @view.$('td.user-email > div:first-of-type').toArray().map (e) -> e.innerText expect(listedEmails).toEqual jasmine.objectContaining [ 'PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI', 'PI:EMAIL:<EMAIL>END_PI' ]
[ { "context": "an\", ->\n query = db.products.find({\"id >\" : \"steve\"})\n query.sql.should.equal(\"SELECT * FROM pr", "end": 2042, "score": 0.9883984327316284, "start": 2037, "tag": "NAME", "value": "steve" }, { "context": "an\", ->\n query = db.products.find({\"id <...
test/pg_query_spec.coffee
dmorosinotto/massive-js
1
massive = require("../index") should = require("should") util = require("util") helper = require('./pg_helper') describe "Postgres Queries", -> db = null before (done) -> massive.connect helper.connectionString(), (err,_db) -> db = _db done() describe "initialization", -> it "sets the table name", -> db.products.name.should.equal("products") it "defaults the pk to id", -> db.products.pk.should.equal("id") describe "SELECT queries", -> it "runs a select *", -> query = db.products.find() query.sql.should.equal "SELECT * FROM products" query.params.length.should.equal 0 it "adds columns when specified", -> query = db.products.find ["name"] query.sql.should.equal "SELECT name FROM products" query.params.length.should.equal 0 it "adds columns when specified in criteria", -> query = db.products.find {}, {columns : "name"} query.sql.should.equal "SELECT name FROM products" query.params.length.should.equal 0 it "adds a where when id is a number", -> query = db.products.find {id : 1} query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 1") query.params.length.should.equal 0 it "adds a where as a primary key", -> query = db.products.find(5) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5") query.params.length.should.equal 0 it "adds a LIMIT if specified", -> query = db.products.find(5).limit(1) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT 1") it "adds a LIMIT with SKIP if specified", -> query = db.products.find(5).limit(10,1) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT(10,1)") it "adds an ORDER if specified", -> query = db.products.find(5).order("name") query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nORDER BY name") it "handles greater than", -> query = db.products.find({"id >" : "steve"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" > $1") query.params.length.should.equal 1 it "handles less than", -> query = db.products.find({"id <" : "steve"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" < $1") query.params.length.should.equal 1 it "handles bang equal", -> query = db.products.find({"id !=" : "steve"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" <> $1") query.params.length.should.equal 1 it "handles ineqaulity", -> query = db.products.find({"id <>" : "steve"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" <> $1") query.params.length.should.equal 1 it "handles IN", -> query = db.products.find({id : ["steve","juice","pete"]}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" IN ($1, $2, $3)") query.params.length.should.equal 3 it "handles NOT IN", -> query = db.products.find({"id != ": ["steve","juice","pete"]}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" NOT IN ($1, $2, $3)") query.params.length.should.equal 3 it "handles inline goodness", -> query = db.run("select * from crazytown where id = $1", [1]) query.sql.should.equal("select * from crazytown where id = $1") query.params.length.should.equal 1 describe "destroy", -> it "creates a delete everything", -> query = db.products.destroy() query.sql.should.equal "DELETE FROM products" query.params.length.should.equal 0 it "uses where when specified as an argument", -> query = db.products.destroy({id : 1}) query.sql.should.equal "DELETE FROM products \nWHERE \"id\" = 1" query.params.length.should.equal 0 it "adds a where as a primary key", -> query = db.products.destroy(6) query.sql.should.equal("DELETE FROM products \nWHERE \"id\" = 6") query.params.length.should.equal 0 describe "insert", -> it "creates a basic insert with returning", -> query = db.products.insert({name : "steve", price : 12.00}) query.sql.should.equal "INSERT INTO products (name, price) VALUES\n($1, $2) \nRETURNING *" query.params.length.should.equal 2 it "creates a batch for item arrays", -> items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}] query = db.products.insert(items) query.sql.should.equal "INSERT INTO products (title, price, desc) VALUES\n($1, $2, $3),\n($4, $5, $6) \nRETURNING *" query.params.length.should.equal 6 it "throws an error if no data was supplied", -> (-> db.products.insert().execute()).should.throw describe "updates", -> it "creates a basic update", -> query = db.products.update({name:"pumpkin", price:1000}, 12) query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" = 12") query.params.length.should.equal 2 it "creates a basic update with a string key", -> query = db.products.update({name:"pumpkin", price:1000}, "12") query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" = $3") query.params.length.should.equal 3 it "creates a basic update with multi result", -> query = db.products.update({name:"pumpkin", price:1000}, {"id >": 12}) query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" > 12") query.params.length.should.equal 2 it "updates all rows", -> query = db.products.update({name:"leto", sand: true}) query.sql.should.equal("UPDATE products SET name = $1, sand = $2") query.params.length.should.equal 2 describe "aggregates", -> it "counts with SELECT COUNT", -> query = db.products.count() query.sql.should.equal("SELECT COUNT(1) FROM products") it "counts with SELECT COUNT and a WHERE", -> query = db.products.count({"id > " : 1}) query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1") describe "events", -> it "fires iterator when new events are added", -> query = db.products.find -> query.on "row", (row)-> should.exist(row) describe "iterators on tables and queries", -> it "has an each method", -> query = db.products.find() should.exist query.each it "should iterate", -> query = db.products.find() query.each (err,result) -> should.exist result it "tables should have an each method", -> should.exist db.products.each
182579
massive = require("../index") should = require("should") util = require("util") helper = require('./pg_helper') describe "Postgres Queries", -> db = null before (done) -> massive.connect helper.connectionString(), (err,_db) -> db = _db done() describe "initialization", -> it "sets the table name", -> db.products.name.should.equal("products") it "defaults the pk to id", -> db.products.pk.should.equal("id") describe "SELECT queries", -> it "runs a select *", -> query = db.products.find() query.sql.should.equal "SELECT * FROM products" query.params.length.should.equal 0 it "adds columns when specified", -> query = db.products.find ["name"] query.sql.should.equal "SELECT name FROM products" query.params.length.should.equal 0 it "adds columns when specified in criteria", -> query = db.products.find {}, {columns : "name"} query.sql.should.equal "SELECT name FROM products" query.params.length.should.equal 0 it "adds a where when id is a number", -> query = db.products.find {id : 1} query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 1") query.params.length.should.equal 0 it "adds a where as a primary key", -> query = db.products.find(5) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5") query.params.length.should.equal 0 it "adds a LIMIT if specified", -> query = db.products.find(5).limit(1) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT 1") it "adds a LIMIT with SKIP if specified", -> query = db.products.find(5).limit(10,1) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT(10,1)") it "adds an ORDER if specified", -> query = db.products.find(5).order("name") query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nORDER BY name") it "handles greater than", -> query = db.products.find({"id >" : "<NAME>"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" > $1") query.params.length.should.equal 1 it "handles less than", -> query = db.products.find({"id <" : "<NAME>"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" < $1") query.params.length.should.equal 1 it "handles bang equal", -> query = db.products.find({"id !=" : "<NAME>"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" <> $1") query.params.length.should.equal 1 it "handles ineqaulity", -> query = db.products.find({"id <>" : "<NAME>"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" <> $1") query.params.length.should.equal 1 it "handles IN", -> query = db.products.find({id : ["<NAME>","juice","<NAME>"]}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" IN ($1, $2, $3)") query.params.length.should.equal 3 it "handles NOT IN", -> query = db.products.find({"id != ": ["<NAME>","juice","<NAME>"]}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" NOT IN ($1, $2, $3)") query.params.length.should.equal 3 it "handles inline goodness", -> query = db.run("select * from crazytown where id = $1", [1]) query.sql.should.equal("select * from crazytown where id = $1") query.params.length.should.equal 1 describe "destroy", -> it "creates a delete everything", -> query = db.products.destroy() query.sql.should.equal "DELETE FROM products" query.params.length.should.equal 0 it "uses where when specified as an argument", -> query = db.products.destroy({id : 1}) query.sql.should.equal "DELETE FROM products \nWHERE \"id\" = 1" query.params.length.should.equal 0 it "adds a where as a primary key", -> query = db.products.destroy(6) query.sql.should.equal("DELETE FROM products \nWHERE \"id\" = 6") query.params.length.should.equal 0 describe "insert", -> it "creates a basic insert with returning", -> query = db.products.insert({name : "<NAME>", price : 12.00}) query.sql.should.equal "INSERT INTO products (name, price) VALUES\n($1, $2) \nRETURNING *" query.params.length.should.equal 2 it "creates a batch for item arrays", -> items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}] query = db.products.insert(items) query.sql.should.equal "INSERT INTO products (title, price, desc) VALUES\n($1, $2, $3),\n($4, $5, $6) \nRETURNING *" query.params.length.should.equal 6 it "throws an error if no data was supplied", -> (-> db.products.insert().execute()).should.throw describe "updates", -> it "creates a basic update", -> query = db.products.update({name:"<NAME>kin", price:1000}, 12) query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" = 12") query.params.length.should.equal 2 it "creates a basic update with a string key", -> query = db.products.update({name:"pumpkin", price:1000}, "12") query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" = $3") query.params.length.should.equal 3 it "creates a basic update with multi result", -> query = db.products.update({name:"<NAME>", price:1000}, {"id >": 12}) query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" > 12") query.params.length.should.equal 2 it "updates all rows", -> query = db.products.update({name:"<NAME>", sand: true}) query.sql.should.equal("UPDATE products SET name = $1, sand = $2") query.params.length.should.equal 2 describe "aggregates", -> it "counts with SELECT COUNT", -> query = db.products.count() query.sql.should.equal("SELECT COUNT(1) FROM products") it "counts with SELECT COUNT and a WHERE", -> query = db.products.count({"id > " : 1}) query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1") describe "events", -> it "fires iterator when new events are added", -> query = db.products.find -> query.on "row", (row)-> should.exist(row) describe "iterators on tables and queries", -> it "has an each method", -> query = db.products.find() should.exist query.each it "should iterate", -> query = db.products.find() query.each (err,result) -> should.exist result it "tables should have an each method", -> should.exist db.products.each
true
massive = require("../index") should = require("should") util = require("util") helper = require('./pg_helper') describe "Postgres Queries", -> db = null before (done) -> massive.connect helper.connectionString(), (err,_db) -> db = _db done() describe "initialization", -> it "sets the table name", -> db.products.name.should.equal("products") it "defaults the pk to id", -> db.products.pk.should.equal("id") describe "SELECT queries", -> it "runs a select *", -> query = db.products.find() query.sql.should.equal "SELECT * FROM products" query.params.length.should.equal 0 it "adds columns when specified", -> query = db.products.find ["name"] query.sql.should.equal "SELECT name FROM products" query.params.length.should.equal 0 it "adds columns when specified in criteria", -> query = db.products.find {}, {columns : "name"} query.sql.should.equal "SELECT name FROM products" query.params.length.should.equal 0 it "adds a where when id is a number", -> query = db.products.find {id : 1} query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 1") query.params.length.should.equal 0 it "adds a where as a primary key", -> query = db.products.find(5) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5") query.params.length.should.equal 0 it "adds a LIMIT if specified", -> query = db.products.find(5).limit(1) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT 1") it "adds a LIMIT with SKIP if specified", -> query = db.products.find(5).limit(10,1) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nLIMIT(10,1)") it "adds an ORDER if specified", -> query = db.products.find(5).order("name") query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" = 5 \nORDER BY name") it "handles greater than", -> query = db.products.find({"id >" : "PI:NAME:<NAME>END_PI"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" > $1") query.params.length.should.equal 1 it "handles less than", -> query = db.products.find({"id <" : "PI:NAME:<NAME>END_PI"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" < $1") query.params.length.should.equal 1 it "handles bang equal", -> query = db.products.find({"id !=" : "PI:NAME:<NAME>END_PI"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" <> $1") query.params.length.should.equal 1 it "handles ineqaulity", -> query = db.products.find({"id <>" : "PI:NAME:<NAME>END_PI"}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" <> $1") query.params.length.should.equal 1 it "handles IN", -> query = db.products.find({id : ["PI:NAME:<NAME>END_PI","juice","PI:NAME:<NAME>END_PI"]}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" IN ($1, $2, $3)") query.params.length.should.equal 3 it "handles NOT IN", -> query = db.products.find({"id != ": ["PI:NAME:<NAME>END_PI","juice","PI:NAME:<NAME>END_PI"]}) query.sql.should.equal("SELECT * FROM products \nWHERE \"id\" NOT IN ($1, $2, $3)") query.params.length.should.equal 3 it "handles inline goodness", -> query = db.run("select * from crazytown where id = $1", [1]) query.sql.should.equal("select * from crazytown where id = $1") query.params.length.should.equal 1 describe "destroy", -> it "creates a delete everything", -> query = db.products.destroy() query.sql.should.equal "DELETE FROM products" query.params.length.should.equal 0 it "uses where when specified as an argument", -> query = db.products.destroy({id : 1}) query.sql.should.equal "DELETE FROM products \nWHERE \"id\" = 1" query.params.length.should.equal 0 it "adds a where as a primary key", -> query = db.products.destroy(6) query.sql.should.equal("DELETE FROM products \nWHERE \"id\" = 6") query.params.length.should.equal 0 describe "insert", -> it "creates a basic insert with returning", -> query = db.products.insert({name : "PI:NAME:<NAME>END_PI", price : 12.00}) query.sql.should.equal "INSERT INTO products (name, price) VALUES\n($1, $2) \nRETURNING *" query.params.length.should.equal 2 it "creates a batch for item arrays", -> items = [{title:"stuffy stuff", price: 12.00, desc : "bubble"},{title:"poofy poof", price: 24.00, desc : "glurp"}] query = db.products.insert(items) query.sql.should.equal "INSERT INTO products (title, price, desc) VALUES\n($1, $2, $3),\n($4, $5, $6) \nRETURNING *" query.params.length.should.equal 6 it "throws an error if no data was supplied", -> (-> db.products.insert().execute()).should.throw describe "updates", -> it "creates a basic update", -> query = db.products.update({name:"PI:NAME:<NAME>END_PIkin", price:1000}, 12) query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" = 12") query.params.length.should.equal 2 it "creates a basic update with a string key", -> query = db.products.update({name:"pumpkin", price:1000}, "12") query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" = $3") query.params.length.should.equal 3 it "creates a basic update with multi result", -> query = db.products.update({name:"PI:NAME:<NAME>END_PI", price:1000}, {"id >": 12}) query.sql.should.equal("UPDATE products SET name = $1, price = $2 \nWHERE \"id\" > 12") query.params.length.should.equal 2 it "updates all rows", -> query = db.products.update({name:"PI:NAME:<NAME>END_PI", sand: true}) query.sql.should.equal("UPDATE products SET name = $1, sand = $2") query.params.length.should.equal 2 describe "aggregates", -> it "counts with SELECT COUNT", -> query = db.products.count() query.sql.should.equal("SELECT COUNT(1) FROM products") it "counts with SELECT COUNT and a WHERE", -> query = db.products.count({"id > " : 1}) query.sql.should.equal("SELECT COUNT(1) FROM products \nWHERE \"id\" > 1") describe "events", -> it "fires iterator when new events are added", -> query = db.products.find -> query.on "row", (row)-> should.exist(row) describe "iterators on tables and queries", -> it "has an each method", -> query = db.products.find() should.exist query.each it "should iterate", -> query = db.products.find() query.each (err,result) -> should.exist result it "tables should have an each method", -> should.exist db.products.each
[ { "context": "iguration:\n# HUBOT_WPGTRANSIT_KEY=ABCDEFGHIJKLMNOPXRSTUVWXYZ (Required)\n# HUBOT_WPGTRANSIT_URL=http", "end": 149, "score": 0.5384020805358887, "start": 146, "tag": "KEY", "value": "OPX" }, { "context": "nt bus schedule for specified stop\n#\n# Author:\n# Jordan ...
scripts/wpgtransit.coffee
neufeldtech/hubot-wpgtransit
0
# Description: # Gets Bus Schedule Information via the Winnipeg Transit Open Data api # # Configuration: # HUBOT_WPGTRANSIT_KEY=ABCDEFGHIJKLMNOPXRSTUVWXYZ (Required) # HUBOT_WPGTRANSIT_URL=https://api.winnipegtransit.com/v2/ (Optional) # # Dependencies: # "moment": "^2.15.1" # "moment-timezone": "^0.5.6" # # Notes: # You can get an API key here: https://api.winnipegtransit.com/home/users/new # # Commands: # hubot bus search <query> - Search for a stop number # hubot bus schedule - Display current bus schedule for the last bus stop that you viewed # hubot bus schedule <stop number> - Display current bus schedule for specified stop # # Author: # Jordan Neufeld <myjc.niv@gmail.com> # moment = require('moment-timezone') stopsJSON = require('../data/bus_stops.json') api_url = process.env.WPG_OPENDATA_URL || "https://api.winnipegtransit.com/v2/" api_key = process.env.HUBOT_WPGTRANSIT_KEY module.exports = (robot) -> getSchedule = (msg, cb) -> now = new moment().tz("America/Winnipeg") #futureTime is how far in advance we want to display schedule for futureTime = now.add('1.25','hours').format('HH:mm') robot.logger.debug("#{api_url}stops/#{msg}/schedule.json?end=#{futureTime}&usage=long&max-results-per-route=4&api-key=#{api_key}") httprequest = robot.http("#{api_url}stops/#{msg}/schedule.json?end=#{futureTime}&usage=long&max-results-per-route=4&api-key=#{api_key}") httprequest.get() (err, res, body) -> if err or res.statusCode != 200 cb "An Error occurred: " + body else cb null, body #Retrieve schedule by stop number robot.respond /bus schedules? ?(\d{5}|)$/i, (msg) -> preferredStop = robot.brain.get("preferred_stop_#{msg.message.user.id}") #If user left the stop number field blank, perform some logic if !msg.match[1] #if we find a preferred route in hubot's brain if preferredStop msg.match[1] = preferredStop else #did not find a preferred route and we were not given a stop number msg.send "I couldn't find any bus stop history for you #{msg.message.user.name}, please provide a 5 digit stop number." return getSchedule msg.match[1], (err, body) -> if err msg.send err else #Got successful result; remember this preferred route in hubot's brain robot.brain.set "preferred_stop_#{msg.message.user.id}", msg.match[1] bodyJSON = JSON.parse(body) stopName = bodyJSON['stop-schedule']['stop']['name'] stopNumber = bodyJSON['stop-schedule']['stop']['number'] routeSchedulesArray = bodyJSON['stop-schedule']['route-schedules'] sortedRoutesArray = [] i = 0 while i < routeSchedulesArray.length routeScheduleObj = routeSchedulesArray[i] scheduledStopsArray = routeScheduleObj['scheduled-stops'] s = 0 while s < scheduledStopsArray.length scheduledStop = scheduledStopsArray[s] estimatedArrival = new moment(scheduledStop.times.arrival.estimated) sortedRoutesArray.push({estimatedArrival: estimatedArrival, routeNumber: routeScheduleObj.route.number, routeName: scheduledStop.variant.name}) s++ i++ #Sort the array by date sortedRoutesArray.sort (a, b) -> new Date(a.estimatedArrival) - (new Date(b.estimatedArrival)) scheduleData = "" d = 0 while d < sortedRoutesArray.length scheduleData += "#{sortedRoutesArray[d].estimatedArrival.format('hh:mm')} - [#{sortedRoutesArray[d].routeNumber}] #{sortedRoutesArray[d].routeName}\n" d++ msg.send "```Stop Number #{stopNumber} | #{stopName}\n Time - Route\n#{scheduleData.substring(0,2000)}```" #Search for stop number robot.respond /bus search (.*)/i, (msg) -> searchTerm = msg.match[1].toLowerCase().replace(".","").replace("’","'") resultsData = "" resultsCount = 0 searchLimit = 25 s = 0 while s < stopsJSON.length for key of stopsJSON[s] # `key = key` if stopsJSON[s][key].toLowerCase().replace(".","").indexOf(searchTerm) != -1 and resultsCount < searchLimit resultsData += "Stop Number #{key} | #{stopsJSON[s][key]}\n" resultsCount++ s++ msg.send "```Search Results (limited to 25):\n#{resultsData}```"
124335
# Description: # Gets Bus Schedule Information via the Winnipeg Transit Open Data api # # Configuration: # HUBOT_WPGTRANSIT_KEY=ABCDEFGHIJKLMN<KEY>RSTUVWXYZ (Required) # HUBOT_WPGTRANSIT_URL=https://api.winnipegtransit.com/v2/ (Optional) # # Dependencies: # "moment": "^2.15.1" # "moment-timezone": "^0.5.6" # # Notes: # You can get an API key here: https://api.winnipegtransit.com/home/users/new # # Commands: # hubot bus search <query> - Search for a stop number # hubot bus schedule - Display current bus schedule for the last bus stop that you viewed # hubot bus schedule <stop number> - Display current bus schedule for specified stop # # Author: # <NAME> <<EMAIL>> # moment = require('moment-timezone') stopsJSON = require('../data/bus_stops.json') api_url = process.env.WPG_OPENDATA_URL || "https://api.winnipegtransit.com/v2/" api_key = process.env.HUBOT_WPGTRANSIT_KEY module.exports = (robot) -> getSchedule = (msg, cb) -> now = new moment().tz("America/Winnipeg") #futureTime is how far in advance we want to display schedule for futureTime = now.add('1.25','hours').format('HH:mm') robot.logger.debug("#{api_url}stops/#{msg}/schedule.json?end=#{futureTime}&usage=long&max-results-per-route=4&api-key=#{api_key}") httprequest = robot.http("#{api_url}stops/#{msg}/schedule.json?end=#{futureTime}&usage=long&max-results-per-route=4&api-key=#{api_key}") httprequest.get() (err, res, body) -> if err or res.statusCode != 200 cb "An Error occurred: " + body else cb null, body #Retrieve schedule by stop number robot.respond /bus schedules? ?(\d{5}|)$/i, (msg) -> preferredStop = robot.brain.get("preferred_stop_#{msg.message.user.id}") #If user left the stop number field blank, perform some logic if !msg.match[1] #if we find a preferred route in hubot's brain if preferredStop msg.match[1] = preferredStop else #did not find a preferred route and we were not given a stop number msg.send "I couldn't find any bus stop history for you #{msg.message.user.name}, please provide a 5 digit stop number." return getSchedule msg.match[1], (err, body) -> if err msg.send err else #Got successful result; remember this preferred route in hubot's brain robot.brain.set "preferred_stop_#{msg.message.user.id}", msg.match[1] bodyJSON = JSON.parse(body) stopName = bodyJSON['stop-schedule']['stop']['name'] stopNumber = bodyJSON['stop-schedule']['stop']['number'] routeSchedulesArray = bodyJSON['stop-schedule']['route-schedules'] sortedRoutesArray = [] i = 0 while i < routeSchedulesArray.length routeScheduleObj = routeSchedulesArray[i] scheduledStopsArray = routeScheduleObj['scheduled-stops'] s = 0 while s < scheduledStopsArray.length scheduledStop = scheduledStopsArray[s] estimatedArrival = new moment(scheduledStop.times.arrival.estimated) sortedRoutesArray.push({estimatedArrival: estimatedArrival, routeNumber: routeScheduleObj.route.number, routeName: scheduledStop.variant.name}) s++ i++ #Sort the array by date sortedRoutesArray.sort (a, b) -> new Date(a.estimatedArrival) - (new Date(b.estimatedArrival)) scheduleData = "" d = 0 while d < sortedRoutesArray.length scheduleData += "#{sortedRoutesArray[d].estimatedArrival.format('hh:mm')} - [#{sortedRoutesArray[d].routeNumber}] #{sortedRoutesArray[d].routeName}\n" d++ msg.send "```Stop Number #{stopNumber} | #{stopName}\n Time - Route\n#{scheduleData.substring(0,2000)}```" #Search for stop number robot.respond /bus search (.*)/i, (msg) -> searchTerm = msg.match[1].toLowerCase().replace(".","").replace("’","'") resultsData = "" resultsCount = 0 searchLimit = 25 s = 0 while s < stopsJSON.length for key of stopsJSON[s] # `key = key` if stopsJSON[s][key].toLowerCase().replace(".","").indexOf(searchTerm) != -1 and resultsCount < searchLimit resultsData += "Stop Number #{key} | #{stopsJSON[s][key]}\n" resultsCount++ s++ msg.send "```Search Results (limited to 25):\n#{resultsData}```"
true
# Description: # Gets Bus Schedule Information via the Winnipeg Transit Open Data api # # Configuration: # HUBOT_WPGTRANSIT_KEY=ABCDEFGHIJKLMNPI:KEY:<KEY>END_PIRSTUVWXYZ (Required) # HUBOT_WPGTRANSIT_URL=https://api.winnipegtransit.com/v2/ (Optional) # # Dependencies: # "moment": "^2.15.1" # "moment-timezone": "^0.5.6" # # Notes: # You can get an API key here: https://api.winnipegtransit.com/home/users/new # # Commands: # hubot bus search <query> - Search for a stop number # hubot bus schedule - Display current bus schedule for the last bus stop that you viewed # hubot bus schedule <stop number> - Display current bus schedule for specified stop # # Author: # PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> # moment = require('moment-timezone') stopsJSON = require('../data/bus_stops.json') api_url = process.env.WPG_OPENDATA_URL || "https://api.winnipegtransit.com/v2/" api_key = process.env.HUBOT_WPGTRANSIT_KEY module.exports = (robot) -> getSchedule = (msg, cb) -> now = new moment().tz("America/Winnipeg") #futureTime is how far in advance we want to display schedule for futureTime = now.add('1.25','hours').format('HH:mm') robot.logger.debug("#{api_url}stops/#{msg}/schedule.json?end=#{futureTime}&usage=long&max-results-per-route=4&api-key=#{api_key}") httprequest = robot.http("#{api_url}stops/#{msg}/schedule.json?end=#{futureTime}&usage=long&max-results-per-route=4&api-key=#{api_key}") httprequest.get() (err, res, body) -> if err or res.statusCode != 200 cb "An Error occurred: " + body else cb null, body #Retrieve schedule by stop number robot.respond /bus schedules? ?(\d{5}|)$/i, (msg) -> preferredStop = robot.brain.get("preferred_stop_#{msg.message.user.id}") #If user left the stop number field blank, perform some logic if !msg.match[1] #if we find a preferred route in hubot's brain if preferredStop msg.match[1] = preferredStop else #did not find a preferred route and we were not given a stop number msg.send "I couldn't find any bus stop history for you #{msg.message.user.name}, please provide a 5 digit stop number." return getSchedule msg.match[1], (err, body) -> if err msg.send err else #Got successful result; remember this preferred route in hubot's brain robot.brain.set "preferred_stop_#{msg.message.user.id}", msg.match[1] bodyJSON = JSON.parse(body) stopName = bodyJSON['stop-schedule']['stop']['name'] stopNumber = bodyJSON['stop-schedule']['stop']['number'] routeSchedulesArray = bodyJSON['stop-schedule']['route-schedules'] sortedRoutesArray = [] i = 0 while i < routeSchedulesArray.length routeScheduleObj = routeSchedulesArray[i] scheduledStopsArray = routeScheduleObj['scheduled-stops'] s = 0 while s < scheduledStopsArray.length scheduledStop = scheduledStopsArray[s] estimatedArrival = new moment(scheduledStop.times.arrival.estimated) sortedRoutesArray.push({estimatedArrival: estimatedArrival, routeNumber: routeScheduleObj.route.number, routeName: scheduledStop.variant.name}) s++ i++ #Sort the array by date sortedRoutesArray.sort (a, b) -> new Date(a.estimatedArrival) - (new Date(b.estimatedArrival)) scheduleData = "" d = 0 while d < sortedRoutesArray.length scheduleData += "#{sortedRoutesArray[d].estimatedArrival.format('hh:mm')} - [#{sortedRoutesArray[d].routeNumber}] #{sortedRoutesArray[d].routeName}\n" d++ msg.send "```Stop Number #{stopNumber} | #{stopName}\n Time - Route\n#{scheduleData.substring(0,2000)}```" #Search for stop number robot.respond /bus search (.*)/i, (msg) -> searchTerm = msg.match[1].toLowerCase().replace(".","").replace("’","'") resultsData = "" resultsCount = 0 searchLimit = 25 s = 0 while s < stopsJSON.length for key of stopsJSON[s] # `key = key` if stopsJSON[s][key].toLowerCase().replace(".","").indexOf(searchTerm) != -1 and resultsCount < searchLimit resultsData += "Stop Number #{key} | #{stopsJSON[s][key]}\n" resultsCount++ s++ msg.send "```Search Results (limited to 25):\n#{resultsData}```"
[ { "context": "# Copyright (C) 2013 John Judnich\n# Released under The MIT License - see \"LICENSE\" ", "end": 33, "score": 0.9998749494552612, "start": 21, "tag": "NAME", "value": "John Judnich" } ]
source/DetailMapGenerator.coffee
anandprabhakar0507/Kosmos
46
# Copyright (C) 2013 John Judnich # Released under The MIT License - see "LICENSE" file for details. root = exports ? this class root.DetailMapGenerator constructor: (mapResolution) -> # load shaders @shader = xgl.loadProgram("detailMapGenerator") #@shader.uniforms = xgl.getProgramUniforms(@shader, ["randomSeed"]) @shader.attribs = xgl.getProgramAttribs(@shader, ["aUV"]) # initialize FBO @fbo = gl.createFramebuffer() gl.bindFramebuffer(gl.FRAMEBUFFER, @fbo) @fbo.width = mapResolution @fbo.height = mapResolution console.log("Initialized detail map generator FBO at #{@fbo.width} x #{@fbo.height}") gl.bindFramebuffer(gl.FRAMEBUFFER, null) # create fullscreen quad vertices buff = new Float32Array(6*2) i = 0 for uv in [[0,0], [1,0], [0,1], [1,0], [1,1], [0,1]] buff[i++] = uv[0]; buff[i++] = uv[1] @quadVerts = gl.createBuffer() gl.bindBuffer(gl.ARRAY_BUFFER, @quadVerts); gl.bufferData(gl.ARRAY_BUFFER, buff, gl.STATIC_DRAW) gl.bindBuffer(gl.ARRAY_BUFFER, null) @quadVerts.itemSize = 2 @quadVerts.numItems = buff.length / @quadVerts.itemSize _start: -> gl.disable(gl.DEPTH_TEST) gl.depthMask(false) gl.bindFramebuffer(gl.FRAMEBUFFER, @fbo) gl.viewport(0, 0, @fbo.width, @fbo.height) gl.bindBuffer(gl.ARRAY_BUFFER, @quadVerts) gl.enableVertexAttribArray(@shader.attribs.aUV) _finish: -> gl.disableVertexAttribArray(@shader.attribs.aUV) gl.bindBuffer(gl.ARRAY_BUFFER, null) gl.bindFramebuffer(gl.FRAMEBUFFER, null) gl.useProgram(null) gl.depthMask(true) gl.enable(gl.DEPTH_TEST) generate: -> @_start() # set shader gl.useProgram(@shader) gl.vertexAttribPointer(@shader.attribs.aUV, 2, gl.FLOAT, false, @quadVerts.itemSize*4, 0) # create and attach texture map as render target detailMap = gl.createTexture() gl.bindTexture(gl.TEXTURE_2D, detailMap) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, @fbo.width, @fbo.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null) gl.bindTexture(gl.TEXTURE_2D, null) gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, detailMap, 0) gl.drawArrays(gl.TRIANGLES, 0, @quadVerts.numItems); gl.useProgram(null) @_finish() return detailMap
11304
# Copyright (C) 2013 <NAME> # Released under The MIT License - see "LICENSE" file for details. root = exports ? this class root.DetailMapGenerator constructor: (mapResolution) -> # load shaders @shader = xgl.loadProgram("detailMapGenerator") #@shader.uniforms = xgl.getProgramUniforms(@shader, ["randomSeed"]) @shader.attribs = xgl.getProgramAttribs(@shader, ["aUV"]) # initialize FBO @fbo = gl.createFramebuffer() gl.bindFramebuffer(gl.FRAMEBUFFER, @fbo) @fbo.width = mapResolution @fbo.height = mapResolution console.log("Initialized detail map generator FBO at #{@fbo.width} x #{@fbo.height}") gl.bindFramebuffer(gl.FRAMEBUFFER, null) # create fullscreen quad vertices buff = new Float32Array(6*2) i = 0 for uv in [[0,0], [1,0], [0,1], [1,0], [1,1], [0,1]] buff[i++] = uv[0]; buff[i++] = uv[1] @quadVerts = gl.createBuffer() gl.bindBuffer(gl.ARRAY_BUFFER, @quadVerts); gl.bufferData(gl.ARRAY_BUFFER, buff, gl.STATIC_DRAW) gl.bindBuffer(gl.ARRAY_BUFFER, null) @quadVerts.itemSize = 2 @quadVerts.numItems = buff.length / @quadVerts.itemSize _start: -> gl.disable(gl.DEPTH_TEST) gl.depthMask(false) gl.bindFramebuffer(gl.FRAMEBUFFER, @fbo) gl.viewport(0, 0, @fbo.width, @fbo.height) gl.bindBuffer(gl.ARRAY_BUFFER, @quadVerts) gl.enableVertexAttribArray(@shader.attribs.aUV) _finish: -> gl.disableVertexAttribArray(@shader.attribs.aUV) gl.bindBuffer(gl.ARRAY_BUFFER, null) gl.bindFramebuffer(gl.FRAMEBUFFER, null) gl.useProgram(null) gl.depthMask(true) gl.enable(gl.DEPTH_TEST) generate: -> @_start() # set shader gl.useProgram(@shader) gl.vertexAttribPointer(@shader.attribs.aUV, 2, gl.FLOAT, false, @quadVerts.itemSize*4, 0) # create and attach texture map as render target detailMap = gl.createTexture() gl.bindTexture(gl.TEXTURE_2D, detailMap) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, @fbo.width, @fbo.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null) gl.bindTexture(gl.TEXTURE_2D, null) gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, detailMap, 0) gl.drawArrays(gl.TRIANGLES, 0, @quadVerts.numItems); gl.useProgram(null) @_finish() return detailMap
true
# Copyright (C) 2013 PI:NAME:<NAME>END_PI # Released under The MIT License - see "LICENSE" file for details. root = exports ? this class root.DetailMapGenerator constructor: (mapResolution) -> # load shaders @shader = xgl.loadProgram("detailMapGenerator") #@shader.uniforms = xgl.getProgramUniforms(@shader, ["randomSeed"]) @shader.attribs = xgl.getProgramAttribs(@shader, ["aUV"]) # initialize FBO @fbo = gl.createFramebuffer() gl.bindFramebuffer(gl.FRAMEBUFFER, @fbo) @fbo.width = mapResolution @fbo.height = mapResolution console.log("Initialized detail map generator FBO at #{@fbo.width} x #{@fbo.height}") gl.bindFramebuffer(gl.FRAMEBUFFER, null) # create fullscreen quad vertices buff = new Float32Array(6*2) i = 0 for uv in [[0,0], [1,0], [0,1], [1,0], [1,1], [0,1]] buff[i++] = uv[0]; buff[i++] = uv[1] @quadVerts = gl.createBuffer() gl.bindBuffer(gl.ARRAY_BUFFER, @quadVerts); gl.bufferData(gl.ARRAY_BUFFER, buff, gl.STATIC_DRAW) gl.bindBuffer(gl.ARRAY_BUFFER, null) @quadVerts.itemSize = 2 @quadVerts.numItems = buff.length / @quadVerts.itemSize _start: -> gl.disable(gl.DEPTH_TEST) gl.depthMask(false) gl.bindFramebuffer(gl.FRAMEBUFFER, @fbo) gl.viewport(0, 0, @fbo.width, @fbo.height) gl.bindBuffer(gl.ARRAY_BUFFER, @quadVerts) gl.enableVertexAttribArray(@shader.attribs.aUV) _finish: -> gl.disableVertexAttribArray(@shader.attribs.aUV) gl.bindBuffer(gl.ARRAY_BUFFER, null) gl.bindFramebuffer(gl.FRAMEBUFFER, null) gl.useProgram(null) gl.depthMask(true) gl.enable(gl.DEPTH_TEST) generate: -> @_start() # set shader gl.useProgram(@shader) gl.vertexAttribPointer(@shader.attribs.aUV, 2, gl.FLOAT, false, @quadVerts.itemSize*4, 0) # create and attach texture map as render target detailMap = gl.createTexture() gl.bindTexture(gl.TEXTURE_2D, detailMap) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR) gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, @fbo.width, @fbo.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null) gl.bindTexture(gl.TEXTURE_2D, null) gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, detailMap, 0) gl.drawArrays(gl.TRIANGLES, 0, @quadVerts.numItems); gl.useProgram(null) @_finish() return detailMap
[ { "context": " require('sizeof').sizeof\n obj1 =\n name: 'Daniel'\n age: 18\n assert.equal sizeof(obj1),'34'", "end": 184, "score": 0.9997353553771973, "start": 178, "tag": "NAME", "value": "Daniel" } ]
coffee/test/other.coffee
mick-whats/selfmemo
0
{assert} = require 'chai' _ = require 'lodash' # その他のnpmモジュール describe "sizeof", -> it "オブジェクトのサイズを計ってくれる", -> sizeof = require('sizeof').sizeof obj1 = name: 'Daniel' age: 18 assert.equal sizeof(obj1),'34' assert.equal sizeof(obj1,true),'34B'
81590
{assert} = require 'chai' _ = require 'lodash' # その他のnpmモジュール describe "sizeof", -> it "オブジェクトのサイズを計ってくれる", -> sizeof = require('sizeof').sizeof obj1 = name: '<NAME>' age: 18 assert.equal sizeof(obj1),'34' assert.equal sizeof(obj1,true),'34B'
true
{assert} = require 'chai' _ = require 'lodash' # その他のnpmモジュール describe "sizeof", -> it "オブジェクトのサイズを計ってくれる", -> sizeof = require('sizeof').sizeof obj1 = name: 'PI:NAME:<NAME>END_PI' age: 18 assert.equal sizeof(obj1),'34' assert.equal sizeof(obj1,true),'34B'
[ { "context": "# Copyright 2012 Joshua Carver \n# \n# Licensed under the Apache License, Versio", "end": 30, "score": 0.9998683929443359, "start": 17, "tag": "NAME", "value": "Joshua Carver" } ]
src/coffeescript/charts/line_chart_options.coffee
jcarver989/raphy-charts
5
# Copyright 2012 Joshua Carver # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class LineChartOptions @DEFAULTS: { dot_size: 5 dot_color: "#00aadd" dot_stroke_color: "#fff" dot_stroke_size: 2 line_width: 3 line_color: "#00aadd" smoothing: 0.4 fill_area: true area_color: "#00aadd" area_opacity: 0.2 show_x_labels: true show_y_labels: true label_max : true label_min : true max_x_labels: 10 max_y_labels: 3 font_family: "Helvetica, Arial, sans-serif" x_label_size: 14 y_label_size: 14 label_format: "%m/%d" label_color: "#333" show_grid: false x_padding: 45 y_padding: 40 multi_axis: false scale: "linear" # or "log" y_axis_scale: [] # force y_axis scale eg [0, 100] render: "line" # or "bar" bar_width: 20 } @merge: (from = {}, to = {}) -> opts = {} for option, value of from opts[option] = value for option, value of to when to.hasOwnProperty(option) opts[option] = value return opts constructor: (options) -> opts = {} for option, value of LineChartOptions.DEFAULTS opts[option] = value for option, value of options when options.hasOwnProperty(option) opts[option] = value return opts
10686
# Copyright 2012 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class LineChartOptions @DEFAULTS: { dot_size: 5 dot_color: "#00aadd" dot_stroke_color: "#fff" dot_stroke_size: 2 line_width: 3 line_color: "#00aadd" smoothing: 0.4 fill_area: true area_color: "#00aadd" area_opacity: 0.2 show_x_labels: true show_y_labels: true label_max : true label_min : true max_x_labels: 10 max_y_labels: 3 font_family: "Helvetica, Arial, sans-serif" x_label_size: 14 y_label_size: 14 label_format: "%m/%d" label_color: "#333" show_grid: false x_padding: 45 y_padding: 40 multi_axis: false scale: "linear" # or "log" y_axis_scale: [] # force y_axis scale eg [0, 100] render: "line" # or "bar" bar_width: 20 } @merge: (from = {}, to = {}) -> opts = {} for option, value of from opts[option] = value for option, value of to when to.hasOwnProperty(option) opts[option] = value return opts constructor: (options) -> opts = {} for option, value of LineChartOptions.DEFAULTS opts[option] = value for option, value of options when options.hasOwnProperty(option) opts[option] = value return opts
true
# Copyright 2012 PI:NAME:<NAME>END_PI # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class LineChartOptions @DEFAULTS: { dot_size: 5 dot_color: "#00aadd" dot_stroke_color: "#fff" dot_stroke_size: 2 line_width: 3 line_color: "#00aadd" smoothing: 0.4 fill_area: true area_color: "#00aadd" area_opacity: 0.2 show_x_labels: true show_y_labels: true label_max : true label_min : true max_x_labels: 10 max_y_labels: 3 font_family: "Helvetica, Arial, sans-serif" x_label_size: 14 y_label_size: 14 label_format: "%m/%d" label_color: "#333" show_grid: false x_padding: 45 y_padding: 40 multi_axis: false scale: "linear" # or "log" y_axis_scale: [] # force y_axis scale eg [0, 100] render: "line" # or "bar" bar_width: 20 } @merge: (from = {}, to = {}) -> opts = {} for option, value of from opts[option] = value for option, value of to when to.hasOwnProperty(option) opts[option] = value return opts constructor: (options) -> opts = {} for option, value of LineChartOptions.DEFAULTS opts[option] = value for option, value of options when options.hasOwnProperty(option) opts[option] = value return opts
[ { "context": "###\nCopyright (c) 2013, Alexander Cherniuk <ts33kr@gmail.com>\nAll rights reserved.\n\nRedistri", "end": 42, "score": 0.9998455047607422, "start": 24, "tag": "NAME", "value": "Alexander Cherniuk" }, { "context": "###\nCopyright (c) 2013, Alexander Cherniuk <ts33kr@gmai...
library/membrane/bilateral.coffee
ts33kr/granite
6
### Copyright (c) 2013, Alexander Cherniuk <ts33kr@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### _ = require "lodash" asciify = require "asciify" connect = require "connect" logger = require "winston" assert = require "assert" colors = require "colors" nconf = require "nconf" https = require "https" http = require "http" weak = require "weak" util = require "util" tools = require "../nucleus/toolkit" plumbs = require "../nucleus/plumbs" extendz = require "../nucleus/extends" compose = require "../nucleus/compose" {format} = require "util" {STATUS_CODES} = require "http" {EventEmitter2} = require "eventemitter2" {remote, external} = require "./remote" {Barebones} = require "./skeleton" {DuplexCore} = require "./duplex" # The bilateral is an abstract compound built up on top of `DuplexCore` # commodity that facilitates full duplex, both ways (bilateral) way # of communicating between client and server sites. Original duplex # is oriented for client-to-service communications only, while this # compounds adds the service-to-client communication on top of that. # The component itself is built heavily on top of a code emission # and delivery platform, as implemented by `Screenplay` service. module.exports.Bilateral = class Bilateral extends DuplexCore # This is a marker that indicates to some internal subsystems # that this class has to be considered abstract and therefore # can not be treated as a complete class implementation. This # mainly is used to exclude or account for abstract classes. # Once inherited from, the inheritee is not abstract anymore. @abstract yes # This server side method is called on the context prior to the # context being compiled and flushed down to the client site. The # method is wired in an synchronous way for greater functionality. # This is the place where you would be importing the dependencies. # Pay attention that most implementations side effect the context. prelude: (symbol, context, request, next) -> assert _.isString(symbol), "cannot found symbol" assert _.isObject(context), "located no context" assert _.isObject(request), "located no request" assert _.isFunction(next), "got no next function" identify = try @constructor.identify().underline message = "Executing the bilateral linkage in %s" logger.debug message.yellow, identify.toString() assert _.isObject pseq = @constructor.prototype execution = (arg) => next.call this, undefined execution _.forIn pseq, (value, name, service) => assert qualified = "#{symbol}.#{name}" # full assert setter = try "#{qualified}.%s = (%s)" directives = value?.uplink?.directives or 0 return -1 unless _.isPlainObject directives assert json = try JSON.stringify directives template = format setter, "directives", json context.invokes.push "\r\n#{template}\r\n" uplinks = context.uplinks ?= new Object() uplinks[name] = directives; return this # Obtain an array of service pseudo instances that are currently # active. That means the instances that have a connected sockets # attached to it. It is important to understand that objects are # not the real service instances (as there is only one instance). # These objects are shadows created by creating a new object out # of the service instance, using the later one as the prototype. @remoteSites: (predicate) -> noPredFunc = "missing the predicating function" notAccquired = "cant accquire service instance" resolve = (handler) => handler.of i?.location() predicate ?= (isolation) -> return yes # always assert _.isFunction(predicate or 0), noPredFunc assert instance = i = @accquire(), notAccquired assert kernel = instance.kernel, "got no kernel" assert sserver = kernel.serverSocket, "no HTTP socket" assert ssecure = kernel.secureSocket, "no HTTPS socket" assert contexts = _.map [sserver, ssecure], resolve _.flatten _.map contexts, (context, vector) => intern = "missing a client listing registry" assert _.isObject(context.connected), intern assert clients = _.values context.connected assert clients = _.filter clients, "connected" assert clients = _.unique clients # went once ipcs = _.map clients, (xc) -> weak xc.shadow assert _.all ipcs, (xc) -> try xc.__isolated return _.toArray _.filter ipcs, predicate # Declarate the supplied implementation function as the uplink. # An uplink is an external (remote) function published on socket # channel. This is a client site counterpart of the providers. A # function that is supplied as an implementation is automatocally # externalized and transferred (by the `Screenplay`) to a client. @uplink: (directives, implement) -> invalid = "missing function for the uplink" implement = try _.find arguments, _.isFunction directives = {} unless _.isPlainObject directives assert _.isFunction(implement or false), invalid assert _.isObject type = this # ref for closures e = "Exception happend when processing the uplink" assert p = @prototype; overwrap = (container) -> assert _.isArray c = _.toArray arguments or [] assert _.isArray s = [@__origin, socket: @socket] return overwrap.call(s...)(c...) if @__isolated name = _.findKey p, (x) -> return x is overwrap assert socket = container?.socket or container assert socket._events?, "no container or socket" guarded = type.guarded externalized, socket, e assert run = guarded.run.bind(guarded) or no @createLinkage socket, name, directives, run remoted = _.isObject(implement.remote or null) ext = if remoted then implement else undefined assert externalized = ext or external implement assert overwrap.uplink = directives: directives assert overwrap.remote = externalized.remote assert overwrap.remote.source; overwrap # This is a client site, bilateral bootloader that gets fired # on the client automatically (with `autocall`) and detects all # the uplinks. Once detected, each uplink gets published onto a # socket channel that makes it available for the invocation by # the corresponding server site facilities implemented belows. bilateral: @autocall z: +102, -> assert _.isFunction o = -> try _.head arguments assert _.isFunction i = -> try _.head arguments assert _.isPlainObject @uplinks ?= new Object() assert _.isString(@service), "invalid service data" assert _.isString(@location), "location misconfied" assert _.isString(@nsp), "bilateral nsp malfunction" assert uplinking = "Uplink %s at %s using nsp=%s" _.forIn this, (value, reference, context) => do => return -1 unless _.has @uplinks or {}, reference assert mangled = try "#{@location}/#{reference}" mangled += "/#{nsp}" if _.isString nsp = this.nsp assert try xref = ref = reference.toString().bold assert try xloc = @location.toString().underline logger.info uplinking, xref, xloc, (try nsp.bold) assert value; return this.socket.on mangled, => value.call this, i(arguments)..., (params...) => id = @socket.sacks = (@socket.sacks ?= 0) + 1 ack = type: "ack", name: mangled, ack: "data" assert _.extend ack, ackId: id, args: o(params) assert ack.ackId > 0; @socket.packet ack # This is a complementary part of the bilateral implementation. # It is invoked to produce a server side agent that is aware of # the protocol for calling the specific uplink exported by the # client site. Please refer to `bilateral` method for more info. # This method should not normally be used outside of the class. createLinkage: (socket, name, directives, run) -> assert identify = @constructor.identify() idc = identify = identify.toString().underline assert sid = (try socket.id.bold) or undefined uplinking = "Invoke uplink %s at #{idc} on #{sid}" responded = "Uplink %s at #{idc} responds on #{sid}" noBinder = "the container has got no valid binder" notify = "got incorrect callback for the uplink" assert _.isFunction o = -> try _.head arguments assert _.isFunction i = -> try _.head arguments return (sequence..., callback) => # a complex sig parameters = _.reject arguments, _.isFunction callback = (->) unless _.isFunction callback assert _.isFunction(callback or null), notify assert mangled = try "#{@location()}/#{name}" assert (try binder = socket.binder), noBinder mangled += "/#{nsp}" if nsp = try binder.nsp try logger.debug uplinking.cyan, name.bold socket.emit mangled, o(parameters)..., a = => key = _.findKey socket.acks, (x) -> x is a assert key, "ack"; delete socket.acks[key] logger.debug responded.cyan, name.bold run => callback.apply @, i(arguments)
112204
### Copyright (c) 2013, <NAME> <<EMAIL>> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### _ = require "lodash" asciify = require "asciify" connect = require "connect" logger = require "winston" assert = require "assert" colors = require "colors" nconf = require "nconf" https = require "https" http = require "http" weak = require "weak" util = require "util" tools = require "../nucleus/toolkit" plumbs = require "../nucleus/plumbs" extendz = require "../nucleus/extends" compose = require "../nucleus/compose" {format} = require "util" {STATUS_CODES} = require "http" {EventEmitter2} = require "eventemitter2" {remote, external} = require "./remote" {Barebones} = require "./skeleton" {DuplexCore} = require "./duplex" # The bilateral is an abstract compound built up on top of `DuplexCore` # commodity that facilitates full duplex, both ways (bilateral) way # of communicating between client and server sites. Original duplex # is oriented for client-to-service communications only, while this # compounds adds the service-to-client communication on top of that. # The component itself is built heavily on top of a code emission # and delivery platform, as implemented by `Screenplay` service. module.exports.Bilateral = class Bilateral extends DuplexCore # This is a marker that indicates to some internal subsystems # that this class has to be considered abstract and therefore # can not be treated as a complete class implementation. This # mainly is used to exclude or account for abstract classes. # Once inherited from, the inheritee is not abstract anymore. @abstract yes # This server side method is called on the context prior to the # context being compiled and flushed down to the client site. The # method is wired in an synchronous way for greater functionality. # This is the place where you would be importing the dependencies. # Pay attention that most implementations side effect the context. prelude: (symbol, context, request, next) -> assert _.isString(symbol), "cannot found symbol" assert _.isObject(context), "located no context" assert _.isObject(request), "located no request" assert _.isFunction(next), "got no next function" identify = try @constructor.identify().underline message = "Executing the bilateral linkage in %s" logger.debug message.yellow, identify.toString() assert _.isObject pseq = @constructor.prototype execution = (arg) => next.call this, undefined execution _.forIn pseq, (value, name, service) => assert qualified = "#{symbol}.#{name}" # full assert setter = try "#{qualified}.%s = (%s)" directives = value?.uplink?.directives or 0 return -1 unless _.isPlainObject directives assert json = try JSON.stringify directives template = format setter, "directives", json context.invokes.push "\r\n#{template}\r\n" uplinks = context.uplinks ?= new Object() uplinks[name] = directives; return this # Obtain an array of service pseudo instances that are currently # active. That means the instances that have a connected sockets # attached to it. It is important to understand that objects are # not the real service instances (as there is only one instance). # These objects are shadows created by creating a new object out # of the service instance, using the later one as the prototype. @remoteSites: (predicate) -> noPredFunc = "missing the predicating function" notAccquired = "cant accquire service instance" resolve = (handler) => handler.of i?.location() predicate ?= (isolation) -> return yes # always assert _.isFunction(predicate or 0), noPredFunc assert instance = i = @accquire(), notAccquired assert kernel = instance.kernel, "got no kernel" assert sserver = kernel.serverSocket, "no HTTP socket" assert ssecure = kernel.secureSocket, "no HTTPS socket" assert contexts = _.map [sserver, ssecure], resolve _.flatten _.map contexts, (context, vector) => intern = "missing a client listing registry" assert _.isObject(context.connected), intern assert clients = _.values context.connected assert clients = _.filter clients, "connected" assert clients = _.unique clients # went once ipcs = _.map clients, (xc) -> weak xc.shadow assert _.all ipcs, (xc) -> try xc.__isolated return _.toArray _.filter ipcs, predicate # Declarate the supplied implementation function as the uplink. # An uplink is an external (remote) function published on socket # channel. This is a client site counterpart of the providers. A # function that is supplied as an implementation is automatocally # externalized and transferred (by the `Screenplay`) to a client. @uplink: (directives, implement) -> invalid = "missing function for the uplink" implement = try _.find arguments, _.isFunction directives = {} unless _.isPlainObject directives assert _.isFunction(implement or false), invalid assert _.isObject type = this # ref for closures e = "Exception happend when processing the uplink" assert p = @prototype; overwrap = (container) -> assert _.isArray c = _.toArray arguments or [] assert _.isArray s = [@__origin, socket: @socket] return overwrap.call(s...)(c...) if @__isolated name = _.findKey p, (x) -> return x is overwrap assert socket = container?.socket or container assert socket._events?, "no container or socket" guarded = type.guarded externalized, socket, e assert run = guarded.run.bind(guarded) or no @createLinkage socket, name, directives, run remoted = _.isObject(implement.remote or null) ext = if remoted then implement else undefined assert externalized = ext or external implement assert overwrap.uplink = directives: directives assert overwrap.remote = externalized.remote assert overwrap.remote.source; overwrap # This is a client site, bilateral bootloader that gets fired # on the client automatically (with `autocall`) and detects all # the uplinks. Once detected, each uplink gets published onto a # socket channel that makes it available for the invocation by # the corresponding server site facilities implemented belows. bilateral: @autocall z: +102, -> assert _.isFunction o = -> try _.head arguments assert _.isFunction i = -> try _.head arguments assert _.isPlainObject @uplinks ?= new Object() assert _.isString(@service), "invalid service data" assert _.isString(@location), "location misconfied" assert _.isString(@nsp), "bilateral nsp malfunction" assert uplinking = "Uplink %s at %s using nsp=%s" _.forIn this, (value, reference, context) => do => return -1 unless _.has @uplinks or {}, reference assert mangled = try "#{@location}/#{reference}" mangled += "/#{nsp}" if _.isString nsp = this.nsp assert try xref = ref = reference.toString().bold assert try xloc = @location.toString().underline logger.info uplinking, xref, xloc, (try nsp.bold) assert value; return this.socket.on mangled, => value.call this, i(arguments)..., (params...) => id = @socket.sacks = (@socket.sacks ?= 0) + 1 ack = type: "ack", name: mangled, ack: "data" assert _.extend ack, ackId: id, args: o(params) assert ack.ackId > 0; @socket.packet ack # This is a complementary part of the bilateral implementation. # It is invoked to produce a server side agent that is aware of # the protocol for calling the specific uplink exported by the # client site. Please refer to `bilateral` method for more info. # This method should not normally be used outside of the class. createLinkage: (socket, name, directives, run) -> assert identify = @constructor.identify() idc = identify = identify.toString().underline assert sid = (try socket.id.bold) or undefined uplinking = "Invoke uplink %s at #{idc} on #{sid}" responded = "Uplink %s at #{idc} responds on #{sid}" noBinder = "the container has got no valid binder" notify = "got incorrect callback for the uplink" assert _.isFunction o = -> try _.head arguments assert _.isFunction i = -> try _.head arguments return (sequence..., callback) => # a complex sig parameters = _.reject arguments, _.isFunction callback = (->) unless _.isFunction callback assert _.isFunction(callback or null), notify assert mangled = try "#{@location()}/#{name}" assert (try binder = socket.binder), noBinder mangled += "/#{nsp}" if nsp = try binder.nsp try logger.debug uplinking.cyan, name.bold socket.emit mangled, o(parameters)..., a = => key = _.findKey socket.acks, (x) -> x is a assert key, "ack"; delete socket.acks[key] logger.debug responded.cyan, name.bold run => callback.apply @, i(arguments)
true
### Copyright (c) 2013, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### _ = require "lodash" asciify = require "asciify" connect = require "connect" logger = require "winston" assert = require "assert" colors = require "colors" nconf = require "nconf" https = require "https" http = require "http" weak = require "weak" util = require "util" tools = require "../nucleus/toolkit" plumbs = require "../nucleus/plumbs" extendz = require "../nucleus/extends" compose = require "../nucleus/compose" {format} = require "util" {STATUS_CODES} = require "http" {EventEmitter2} = require "eventemitter2" {remote, external} = require "./remote" {Barebones} = require "./skeleton" {DuplexCore} = require "./duplex" # The bilateral is an abstract compound built up on top of `DuplexCore` # commodity that facilitates full duplex, both ways (bilateral) way # of communicating between client and server sites. Original duplex # is oriented for client-to-service communications only, while this # compounds adds the service-to-client communication on top of that. # The component itself is built heavily on top of a code emission # and delivery platform, as implemented by `Screenplay` service. module.exports.Bilateral = class Bilateral extends DuplexCore # This is a marker that indicates to some internal subsystems # that this class has to be considered abstract and therefore # can not be treated as a complete class implementation. This # mainly is used to exclude or account for abstract classes. # Once inherited from, the inheritee is not abstract anymore. @abstract yes # This server side method is called on the context prior to the # context being compiled and flushed down to the client site. The # method is wired in an synchronous way for greater functionality. # This is the place where you would be importing the dependencies. # Pay attention that most implementations side effect the context. prelude: (symbol, context, request, next) -> assert _.isString(symbol), "cannot found symbol" assert _.isObject(context), "located no context" assert _.isObject(request), "located no request" assert _.isFunction(next), "got no next function" identify = try @constructor.identify().underline message = "Executing the bilateral linkage in %s" logger.debug message.yellow, identify.toString() assert _.isObject pseq = @constructor.prototype execution = (arg) => next.call this, undefined execution _.forIn pseq, (value, name, service) => assert qualified = "#{symbol}.#{name}" # full assert setter = try "#{qualified}.%s = (%s)" directives = value?.uplink?.directives or 0 return -1 unless _.isPlainObject directives assert json = try JSON.stringify directives template = format setter, "directives", json context.invokes.push "\r\n#{template}\r\n" uplinks = context.uplinks ?= new Object() uplinks[name] = directives; return this # Obtain an array of service pseudo instances that are currently # active. That means the instances that have a connected sockets # attached to it. It is important to understand that objects are # not the real service instances (as there is only one instance). # These objects are shadows created by creating a new object out # of the service instance, using the later one as the prototype. @remoteSites: (predicate) -> noPredFunc = "missing the predicating function" notAccquired = "cant accquire service instance" resolve = (handler) => handler.of i?.location() predicate ?= (isolation) -> return yes # always assert _.isFunction(predicate or 0), noPredFunc assert instance = i = @accquire(), notAccquired assert kernel = instance.kernel, "got no kernel" assert sserver = kernel.serverSocket, "no HTTP socket" assert ssecure = kernel.secureSocket, "no HTTPS socket" assert contexts = _.map [sserver, ssecure], resolve _.flatten _.map contexts, (context, vector) => intern = "missing a client listing registry" assert _.isObject(context.connected), intern assert clients = _.values context.connected assert clients = _.filter clients, "connected" assert clients = _.unique clients # went once ipcs = _.map clients, (xc) -> weak xc.shadow assert _.all ipcs, (xc) -> try xc.__isolated return _.toArray _.filter ipcs, predicate # Declarate the supplied implementation function as the uplink. # An uplink is an external (remote) function published on socket # channel. This is a client site counterpart of the providers. A # function that is supplied as an implementation is automatocally # externalized and transferred (by the `Screenplay`) to a client. @uplink: (directives, implement) -> invalid = "missing function for the uplink" implement = try _.find arguments, _.isFunction directives = {} unless _.isPlainObject directives assert _.isFunction(implement or false), invalid assert _.isObject type = this # ref for closures e = "Exception happend when processing the uplink" assert p = @prototype; overwrap = (container) -> assert _.isArray c = _.toArray arguments or [] assert _.isArray s = [@__origin, socket: @socket] return overwrap.call(s...)(c...) if @__isolated name = _.findKey p, (x) -> return x is overwrap assert socket = container?.socket or container assert socket._events?, "no container or socket" guarded = type.guarded externalized, socket, e assert run = guarded.run.bind(guarded) or no @createLinkage socket, name, directives, run remoted = _.isObject(implement.remote or null) ext = if remoted then implement else undefined assert externalized = ext or external implement assert overwrap.uplink = directives: directives assert overwrap.remote = externalized.remote assert overwrap.remote.source; overwrap # This is a client site, bilateral bootloader that gets fired # on the client automatically (with `autocall`) and detects all # the uplinks. Once detected, each uplink gets published onto a # socket channel that makes it available for the invocation by # the corresponding server site facilities implemented belows. bilateral: @autocall z: +102, -> assert _.isFunction o = -> try _.head arguments assert _.isFunction i = -> try _.head arguments assert _.isPlainObject @uplinks ?= new Object() assert _.isString(@service), "invalid service data" assert _.isString(@location), "location misconfied" assert _.isString(@nsp), "bilateral nsp malfunction" assert uplinking = "Uplink %s at %s using nsp=%s" _.forIn this, (value, reference, context) => do => return -1 unless _.has @uplinks or {}, reference assert mangled = try "#{@location}/#{reference}" mangled += "/#{nsp}" if _.isString nsp = this.nsp assert try xref = ref = reference.toString().bold assert try xloc = @location.toString().underline logger.info uplinking, xref, xloc, (try nsp.bold) assert value; return this.socket.on mangled, => value.call this, i(arguments)..., (params...) => id = @socket.sacks = (@socket.sacks ?= 0) + 1 ack = type: "ack", name: mangled, ack: "data" assert _.extend ack, ackId: id, args: o(params) assert ack.ackId > 0; @socket.packet ack # This is a complementary part of the bilateral implementation. # It is invoked to produce a server side agent that is aware of # the protocol for calling the specific uplink exported by the # client site. Please refer to `bilateral` method for more info. # This method should not normally be used outside of the class. createLinkage: (socket, name, directives, run) -> assert identify = @constructor.identify() idc = identify = identify.toString().underline assert sid = (try socket.id.bold) or undefined uplinking = "Invoke uplink %s at #{idc} on #{sid}" responded = "Uplink %s at #{idc} responds on #{sid}" noBinder = "the container has got no valid binder" notify = "got incorrect callback for the uplink" assert _.isFunction o = -> try _.head arguments assert _.isFunction i = -> try _.head arguments return (sequence..., callback) => # a complex sig parameters = _.reject arguments, _.isFunction callback = (->) unless _.isFunction callback assert _.isFunction(callback or null), notify assert mangled = try "#{@location()}/#{name}" assert (try binder = socket.binder), noBinder mangled += "/#{nsp}" if nsp = try binder.nsp try logger.debug uplinking.cyan, name.bold socket.emit mangled, o(parameters)..., a = => key = _.findKey socket.acks, (x) -> x is a assert key, "ack"; delete socket.acks[key] logger.debug responded.cyan, name.bold run => callback.apply @, i(arguments)
[ { "context": " { id: 'NRM_Avon', name: 'Avon' },\n { id: 'NRM_Border", "end": 15877, "score": 0.932566225528717, "start": 15873, "tag": "NAME", "value": "Avon" }, { "context": " { id: 'NRM_Burdekin', name: 'Burdekin'...
climas-ng/climasng/src/coffee/reports/views/app.coffee
DanielBaird/CliMAS-Next-Generation
0
# $ = require 'jquery' # _ = require 'lodash' # Backbone = require 'backbone' # L = require 'leaflet' # MapLayer = require '../models/maplayer' require '../util/shims' # help IE to get up to date # disable the jshint warning about "did you mean to return a # conditional" which crops up all the time in coffeescript compiled # code. ### jshint -W093 ### # disable the jshint warning about "use !== to compare with null" # which coffeescript compiled code sometimes triggers. ### jshint -W041 ### # ------------------------------------------------------------------- debug = (itemToLog, itemLevel)-> levels = ['verydebug', 'debug', 'message', 'warning'] # threshold = 'verydebug' # threshold = 'debug' threshold = 'message' itemLevel = 'debug' unless itemLevel thresholdNum = levels.indexOf threshold messageNum = levels.indexOf itemLevel return if thresholdNum > messageNum if itemToLog + '' == itemToLog # it's a string.. console.log "[#{itemLevel}] #{itemToLog}" else console.log itemToLog # ------------------------------------------------------------------- # ------------------------------------------------------------------- AppView = Backbone.View.extend { # --------------------------------------------------------------- # this view's base element tagName: 'form' className: '' id: 'reportform' # --------------------------------------------------------------- # some settings speciesDataUrl: "#{location.protocol}//#{location.host}/speciesdata" rasterApiUrl: "#{location.protocol}//localhost:10600/api/raster/1/wms_data_url" # --------------------------------------------------------------- # tracking the splitter bar trackSplitter: false trackPeriod: 100 # --------------------------------------------------------------- events: 'change .sectionselector input': 'updateSectionSelection' 'change .regionselect input': 'updateRegionSelection' 'change .regionselect select': 'updateRegionSelection' 'change .yearselect input': 'updateYearSelection' 'click .getreport': 'getReport' # --------------------------------------------------------------- initialize: ()-> debug 'AppView.initialize' # more annoying version of bindAll requires this concat stuff _.bindAll.apply _, [this].concat _.functions(this) # kick off the fetching of stuff @fetchReportSections() @fetchRegions() @fetchYears() # @tick() # --------------------------------------------------------------- render: ()-> debug 'AppView.render' @$el.append AppView.templates.layout {} $('#contentwrap .maincontent').append @$el # --------------------------------------------------------------- # actually go get the report # --------------------------------------------------------------- getReport: ()-> debug 'AppView.getReport' # remove any previous form @$('#reportform').remove() form = [] form.push '<form action="/regionreport" method="get" id="reportform">' # selected year form.push '<input type="hidden" name="year" value="' + @selectedYear + '">' # selected region form.push '<input type="hidden" name="regiontype" value="' + @selectedRegionType + '">' form.push '<input type="hidden" name="region" value="' + @selectedRegion + '">' # selected report sections form.push '<input type="hidden" name="sections" value="' + @selectedSections.join(' ') + '">' form.push '</form>' @$el.append form.join '\n' @$('#reportform').submit() # --------------------------------------------------------------- # deal with report sections # --------------------------------------------------------------- fetchReportSections: ()-> debug 'AppView.fetchReportSections' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @possibleSections = data.sections sectionselect = @$ '.sectionselect' sectionselect.empty().removeClass 'loading' @buildReportSectionList @possibleSections, sectionselect # pretend it took a while to get the data.. setTimeout ()-> fetch.resolve({ sections: [ { id: 'intro' name: 'Introduction' description: 'title, credits, and introductory paragraphs.' presence: 'required' sections: [] },{ id: 'climatereview' name: 'Climate Review' description: 'a description of the region\'s current and projected climate.' presence: 'optional' sections: [ { id: 'temperature' name: 'Temperature' description: 'current and projected temperature.' presence: 'optional' sections: [] },{ id: 'rainfall' name: 'Rainfall' description: 'current and projected precipitation.' presence: 'optional' sections: [] } ] },{ id: 'biodiversity' name: 'Biodiversity Review' description: 'a description of the region\'s current and projected biodiversity.' presence: 'optional' sections: [ { id: 'overall' name: 'Overall' description: 'current and projected biodiversity over all modelled species.' presence: 'optional' sections: [] },{ id: 'mammals' name: 'Mammals' description: 'current and projected biodiversity over mammal species.' presence: 'optional' sections: [] },{ id: 'amphibians' name: 'Amphibians' description: 'current and projected biodiversity over amphibian species.' presence: 'optional' sections: [{ id: 'allamphibians' name: 'All' description: 'current and projected biodiversity over all amphibian species.' presence: 'optional' sections: [] },{ id: 'streamfrogs' name: 'Stream frogs' description: 'current and projected biodiversity over stream frogs.' presence: 'optional' sections: [] } ] },{ id: 'reptiles' name: 'Reptiles' description: 'current and projected biodiversity over reptile species.' presence: 'optional' sections: [{ id: 'allreptiles' name: 'All' description: 'current and projected biodiversity over all reptile species.' presence: 'optional' sections: [] },{ id: 'turtles' name: 'Turtles' description: 'current and projected biodiversity over turtles.' presence: 'optional' sections: [] } ] },{ id: 'birds' name: 'Birds' description: 'current and projected biodiversity over bird species.' presence: 'optional' sections: [] },{ id: 'freshwaterfish' name: 'Freshwater fish' description: 'current and projected biodiversity over freshwater fish species.' presence: 'optional' sections: [] } ] },{ id: 'pests' name: 'Pest Species' description: 'climate suitability and distribution of pest species.' presence: 'optional' sections: [ { id: 'pestplants' name: 'Pest Plants' description: 'summary of projections for selected pest plants.' presence: 'optional' sections: [] } ] },{ id: 'appendixes' name: 'Appendices' description: 'tables and other appendices.' presence: 'required' sections: [ { id: 'observedmammallist' name: 'Mammals Present' description: 'list of mammals currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedamphibianslist' name: 'Amphibians Present' description: 'list of amphibians currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedstreamfrogslist' name: 'Steam Frogs Present' description: 'list of stream frogs currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedreptileslist' name: 'Reptiles Present' description: 'list of reptiles currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedturtleslist' name: 'Turtles Present' description: 'list of turtles currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedbirdslist' name: 'Birds Present' description: 'list of birds currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'science' name: 'Science' description: 'description of the climate and species distribution modelling used to generate the data in the report.' presence: 'required' sections: [] } ] } ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildReportSectionList: (data, wrapper)-> debug 'AppView.buildReportSectionList' $.each data, (index, item)=> # make a row for this item selectorRow = $ AppView.templates.sectionSelector(item) $(wrapper).append selectorRow # if the item has subitems, insert those if item.sections.length > 0 subsections = $ AppView.templates.subsections() @buildReportSectionList item.sections, subsections $(selectorRow).addClass('hassubsections').append(subsections) # --------------------------------------------------------------- updateSectionSelection: (event)-> debug 'AppView.updateSectionSelection' @handleSectionSelection @possibleSections # --------------------------------------------------------------- handleSectionSelection: (sectionList, parent)-> debug 'AppView.handleSectionSelection' $.each sectionList, (index, item)=> # find the selection checkbox.. selector = @$ "#section-#{ item.id }" selectionControl = selector.find 'input' # set the right class on the selector if selectionControl.prop 'checked' selector.removeClass 'unselected' else selector.addClass 'unselected' if item.sections?.length > 0 @handleSectionSelection item.sections, item.id @updateSummary() # --------------------------------------------------------------- # deal with regions # --------------------------------------------------------------- fetchRegions: ()-> debug 'AppView.fetchRegions' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @buildRegionList data # pretend it took a while to get the data.. setTimeout ()-> fetch.resolve({ regiontypes: [ { id: 'nrm' name: 'NRM region' regions: [ { id: 'NRM_ACT', name: 'ACT' }, { id: 'NRM_Adelaide_and_Mount_Lofty_Ranges', name: 'Adelaide and Mount Lofty Ranges' }, { id: 'NRM_Alinytjara_Wilurara', name: 'Alinytjara Wilurara' }, { id: 'NRM_Avon', name: 'Avon' }, { id: 'NRM_Border_Rivers-Gwydir', name: 'Border Rivers-Gwydir' }, { id: 'NRM_Border_Rivers_Maranoa-Balonne', name: 'Border Rivers Maranoa-Balonne' }, { id: 'NRM_Burdekin', name: 'Burdekin' }, { id: 'NRM_Burnett_Mary', name: 'Burnett Mary' }, { id: 'NRM_Cape_York', name: 'Cape York' }, { id: 'NRM_Central_West', name: 'Central West' }, { id: 'NRM_Condamine', name: 'Condamine' }, { id: 'NRM_Cooperative_Management_Area', name: 'Cooperative Management Area' }, { id: 'NRM_Corangamite', name: 'Corangamite' }, { id: 'NRM_Desert_Channels', name: 'Desert Channels' }, { id: 'NRM_East_Gippsland', name: 'East Gippsland' }, { id: 'NRM_Eyre_Peninsula', name: 'Eyre Peninsula' }, { id: 'NRM_Fitzroy', name: 'Fitzroy' }, { id: 'NRM_Glenelg_Hopkins', name: 'Glenelg Hopkins' }, { id: 'NRM_Goulburn_Broken', name: 'Goulburn Broken' }, { id: 'NRM_Hawkesbury-Nepean', name: 'Hawkesbury-Nepean' }, { id: 'NRM_Hunter-Central_Rivers', name: 'Hunter-Central_Rivers' }, { id: 'NRM_Kangaroo_Island', name: 'Kangaroo Island' }, { id: 'NRM_Lachlan', name: 'Lachlan' }, { id: 'NRM_Lower_Murray_Darling', name: 'Lower Murray Darling' }, { id: 'NRM_Mackay_Whitsunday', name: 'Mackay Whitsunday' }, { id: 'NRM_Mallee', name: 'Mallee' }, { id: 'NRM_Murray', name: 'Murray' }, { id: 'NRM_Murrumbidgee', name: 'Murrumbidgee' }, { id: 'NRM_Namoi', name: 'Namoi' }, { id: 'NRM_North', name: 'North' }, { id: 'NRM_North_Central', name: 'North Central' }, { id: 'NRM_North_East', name: 'North East' }, { id: 'NRM_North_West', name: 'North West' }, { id: 'NRM_Northern_Agricultural', name: 'Northern Agricultural' }, { id: 'NRM_Northern_Gulf', name: 'Northern Gulf' }, { id: 'NRM_Northern_Rivers', name: 'Northern Rivers' }, { id: 'NRM_Northern_Territory', name: 'Northern Territory' }, { id: 'NRM_Northern_and_Yorke', name: 'Northern and Yorke' }, { id: 'NRM_Perth', name: 'Perth' }, { id: 'NRM_Port_Phillip_and_Western_Port', name: 'Port Phillip and Western Port' }, { id: 'NRM_Rangelands', name: 'Rangelands' }, { id: 'NRM_South', name: 'South' }, { id: 'NRM_South_Australian_Arid_Lands', name: 'South Australian Arid Lands' }, { id: 'NRM_South_Australian_Murray_Darling_Basin', name: 'South Australian Murray Darling Basin' }, { id: 'NRM_South_Coast', name: 'South Coast' }, { id: 'NRM_South_East', name: 'South East' }, { id: 'NRM_South_East_Queensland', name: 'South East Queensland' }, { id: 'NRM_South_West', name: 'South West' }, { id: 'NRM_South_West_Queensland', name: 'South West Queensland' }, { id: 'NRM_Southern_Gulf', name: 'Southern Gulf' }, { id: 'NRM_Southern_Rivers', name: 'Southern Rivers' }, { id: 'NRM_Sydney_Metro', name: 'Sydney Metro' }, { id: 'NRM_Torres_Strait', name: 'Torres Strait' }, { id: 'NRM_West_Gippsland', name: 'West Gippsland' }, { id: 'NRM_Western', name: 'Western' }, { id: 'NRM_Wet_Tropics', name: 'Wet Tropics' }, { id: 'NRM_Wimmera', name: 'Wimmera' } ] },{ id: 'ibra' name: 'IBRA bioregion' regions: [] },{ id: 'park' name: 'Parks, reserves' regions: [] },{ id: 'state' name: 'State, territory' regions: [ { id: 'State_Australian_Capital_Territory', name: 'ACT' }, { id: 'State_New_South_Wales', name: 'New South Wales' }, { id: 'State_Northern_Territory', name: 'Northern Territory' }, { id: 'State_Queensland', name: 'Queensland' }, { id: 'State_South_Australia', name: 'South Australia' }, { id: 'State_Tasmania', name: 'Tasmania' }, { id: 'State_Victoria', name: 'Victoria' }, { id: 'State_Western_Australia', name: 'Western Australia' } ] } ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildRegionList: (data)-> debug 'AppView.buildRegionList' @regions = data.regiontypes regionselect = @$ '.regionselect' regionselect.empty().removeClass 'loading' $.each @regions, (index, regionType)=> # make a row for this regiontype # first the regions go into a select box regionType.optionList = [ AppView.templates.regionSelector(reg) for reg in regionType.regions ].join "\n" regionTypeRow = $ AppView.templates.regionTypeSelector(regionType) regionselect.append regionTypeRow # --------------------------------------------------------------- updateRegionSelection: (event)-> debug 'AppView.updateRegionSelection' selectedType = @$('[name=regiontype]:checked').val() $.each @regions, (index, regionType)=> # find the selection checkbox.. selector = @$ "#regiontype-#{ regionType.id }" # set the right class on the selector if selectedType == regionType.id selector.addClass 'typeselected' @selectedRegionType = regionType.id @selectedRegion = $(selector.find('select')).val() if @selectedRegion == null selector.removeClass 'regionselected' else selector.addClass 'regionselected' # note the region data for later.. @selectedRegionInfo = _.find regionType.regions, (region)=> region.id == @selectedRegion else selector.removeClass 'typeselected' @updateSummary() # --------------------------------------------------------------- # deal with years # --------------------------------------------------------------- fetchYears: ()-> debug 'AppView.fetchYears' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @buildYearList data # pretend it took a second to get the data.. setTimeout ()-> fetch.resolve({ years: [ '2015' '2025' '2035' '2045' '2055' '2065' '2075' '2085' ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildYearList: (data)-> debug 'AppView.buildYearList' @years = data.years yearselect = @$ '.yearselect' yearselect.empty().removeClass 'loading' $.each @years, (index, year)=> # make a selector for this year yearselect.append AppView.templates.yearSelector({ year: year }) # --------------------------------------------------------------- updateYearSelection: (event)-> debug 'AppView.updateYearSelection' @selectedYear = @$('[name=yearselector]:checked').val() $.each @years, (index, year)=> # find the selection checkbox.. selector = @$ "#year-#{ year }" # set the right class on the selector if @selectedYear == year selector.addClass 'yearselected' else selector.removeClass 'yearselected' @updateSummary() # --------------------------------------------------------------- # update report summary # --------------------------------------------------------------- sectionId: (sectionDom)-> debug 'AppView.sectionId' $(sectionDom).find('input').attr 'value' # --------------------------------------------------------------- sectionName: (sectionDom)-> debug 'AppView.sectionName' @sectionInfo(sectionDom).name # --------------------------------------------------------------- sectionInfo: (sectionDom)-> debug 'AppView.sectionInfo' # get a list of this section's parent ids parentage = $(sectionDom).parents '.sectionselector' parentIds = parentage.map( (i, elem)=> @sectionId elem ).get().reverse() # add this section's own id parentIds.push @sectionId(sectionDom) @selectedSections.push parentIds.join('.') # now walk into the sections hierarchy info = { sections: @possibleSections } parentIds.forEach (id)-> info = _.filter(info.sections, (section)-> section.id == id)[0] # finally we have a pointer to the info for this section return info # --------------------------------------------------------------- subSectionList: (sectionDom)-> debug 'AppView.sectionList' list = [] subsections = $(sectionDom).children('.subsections') subsections.children('.sectionselector').not('.unselected').each (i, elem)=> name = @sectionName(elem) subs = @subSectionList(elem) if subs isnt '' name = name + ' (' + subs + ')' list.push name return list.join ', ' # --------------------------------------------------------------- updateSummary: ()-> debug 'AppView.updateSummary' selectedSections = @$('.sectionselect > .sectionselector').not('.unselected') @selectedSections = [] contentList = [] selectedSections.each (index, section)=> info = @sectionName section subList = @subSectionList section if subList isnt '' info = info + ': ' + subList.toLowerCase() contentList.push info + '.' content = '' if contentList.length > 0 content = '<li>' + contentList.join('</li><li>') + '</li>' summary = { regionName: @selectedRegionInfo?.name year: @selectedYear content: content } @$('.reviewblock').html AppView.templates.reviewBlock(summary) # --------------------------------------------------------------- },{ templates: { # ================================================== # templates here # --------------------------------------------------------------- layout: _.template """ <div class="reviewblock"></div> <div class="formblock"> <h1>Report on</h1> <div class="loading select regionselect">loading available regions..</div> <h1>In the year</h1> <div class="loading select yearselect">loading available years..</div> <h1>Including</h1> <div class="loading select sectionselect">loading available sections..</div> </div> """ # --------------------------------------------------------------- reviewBlock: _.template """ <h1>Selected Report</h1> <p class="coverage">Covers <% if (regionName) { %><%= regionName %><% } else { %><em>(unspecified region)</em><% } %> in <% if (year) { %><%= year %>.<% } else { %><em>(unspecified year)</em>.<% } %> </p> <ul class="contents"><%= content %></ul> <button type="button" class="getreport">download report</button> """ # --------------------------------------------------------------- reviewContentItem: _.template """ <li>item</li> """ # --------------------------------------------------------------- regionTypeSelector: _.template """ <div class="regiontypeselector" id="regiontype-<%= id %>"> <label class="name"><input class="regiontype" name="regiontype" type="radio" value="<%= id %>" /> <%= name %> </label> <div class="regionselectorwrapper"><select class="regionselector"> <option value="" disabled="disabled" selected="selected">select a region&hellip;</option> <%= optionList %> </select></div> </div> """ # --------------------------------------------------------------- regionSelector: _.template """<option value="<%= id %>"><%= name %></option>""" # --------------------------------------------------------------- yearSelector: _.template """ <div class="yearrow" id="year-<%= year %>"> <label class="name"><input class="yearselector" name="yearselector" type="radio" value="<%= year %>" /> <%= year %></label> </div> """ # --------------------------------------------------------------- sectionSelector: _.template """ <div class="sectionselector" id="section-<%= id %>"> <label class="name" <% if (presence == 'required') { print('title="This section is required"'); } %> ><input type="checkbox" value="<%= id %>" checked="checked" <% if (presence == 'required') { print('disabled="disabled"'); } %> /> <%= name %></label> <p class="description"><%= description %></p> </div> """ # --------------------------------------------------------------- subsections: _.template """ <div class="subsections clearfix"> </div> """ # --------------------------------------------------------------- }} module.exports = AppView
113041
# $ = require 'jquery' # _ = require 'lodash' # Backbone = require 'backbone' # L = require 'leaflet' # MapLayer = require '../models/maplayer' require '../util/shims' # help IE to get up to date # disable the jshint warning about "did you mean to return a # conditional" which crops up all the time in coffeescript compiled # code. ### jshint -W093 ### # disable the jshint warning about "use !== to compare with null" # which coffeescript compiled code sometimes triggers. ### jshint -W041 ### # ------------------------------------------------------------------- debug = (itemToLog, itemLevel)-> levels = ['verydebug', 'debug', 'message', 'warning'] # threshold = 'verydebug' # threshold = 'debug' threshold = 'message' itemLevel = 'debug' unless itemLevel thresholdNum = levels.indexOf threshold messageNum = levels.indexOf itemLevel return if thresholdNum > messageNum if itemToLog + '' == itemToLog # it's a string.. console.log "[#{itemLevel}] #{itemToLog}" else console.log itemToLog # ------------------------------------------------------------------- # ------------------------------------------------------------------- AppView = Backbone.View.extend { # --------------------------------------------------------------- # this view's base element tagName: 'form' className: '' id: 'reportform' # --------------------------------------------------------------- # some settings speciesDataUrl: "#{location.protocol}//#{location.host}/speciesdata" rasterApiUrl: "#{location.protocol}//localhost:10600/api/raster/1/wms_data_url" # --------------------------------------------------------------- # tracking the splitter bar trackSplitter: false trackPeriod: 100 # --------------------------------------------------------------- events: 'change .sectionselector input': 'updateSectionSelection' 'change .regionselect input': 'updateRegionSelection' 'change .regionselect select': 'updateRegionSelection' 'change .yearselect input': 'updateYearSelection' 'click .getreport': 'getReport' # --------------------------------------------------------------- initialize: ()-> debug 'AppView.initialize' # more annoying version of bindAll requires this concat stuff _.bindAll.apply _, [this].concat _.functions(this) # kick off the fetching of stuff @fetchReportSections() @fetchRegions() @fetchYears() # @tick() # --------------------------------------------------------------- render: ()-> debug 'AppView.render' @$el.append AppView.templates.layout {} $('#contentwrap .maincontent').append @$el # --------------------------------------------------------------- # actually go get the report # --------------------------------------------------------------- getReport: ()-> debug 'AppView.getReport' # remove any previous form @$('#reportform').remove() form = [] form.push '<form action="/regionreport" method="get" id="reportform">' # selected year form.push '<input type="hidden" name="year" value="' + @selectedYear + '">' # selected region form.push '<input type="hidden" name="regiontype" value="' + @selectedRegionType + '">' form.push '<input type="hidden" name="region" value="' + @selectedRegion + '">' # selected report sections form.push '<input type="hidden" name="sections" value="' + @selectedSections.join(' ') + '">' form.push '</form>' @$el.append form.join '\n' @$('#reportform').submit() # --------------------------------------------------------------- # deal with report sections # --------------------------------------------------------------- fetchReportSections: ()-> debug 'AppView.fetchReportSections' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @possibleSections = data.sections sectionselect = @$ '.sectionselect' sectionselect.empty().removeClass 'loading' @buildReportSectionList @possibleSections, sectionselect # pretend it took a while to get the data.. setTimeout ()-> fetch.resolve({ sections: [ { id: 'intro' name: 'Introduction' description: 'title, credits, and introductory paragraphs.' presence: 'required' sections: [] },{ id: 'climatereview' name: 'Climate Review' description: 'a description of the region\'s current and projected climate.' presence: 'optional' sections: [ { id: 'temperature' name: 'Temperature' description: 'current and projected temperature.' presence: 'optional' sections: [] },{ id: 'rainfall' name: 'Rainfall' description: 'current and projected precipitation.' presence: 'optional' sections: [] } ] },{ id: 'biodiversity' name: 'Biodiversity Review' description: 'a description of the region\'s current and projected biodiversity.' presence: 'optional' sections: [ { id: 'overall' name: 'Overall' description: 'current and projected biodiversity over all modelled species.' presence: 'optional' sections: [] },{ id: 'mammals' name: 'Mammals' description: 'current and projected biodiversity over mammal species.' presence: 'optional' sections: [] },{ id: 'amphibians' name: 'Amphibians' description: 'current and projected biodiversity over amphibian species.' presence: 'optional' sections: [{ id: 'allamphibians' name: 'All' description: 'current and projected biodiversity over all amphibian species.' presence: 'optional' sections: [] },{ id: 'streamfrogs' name: 'Stream frogs' description: 'current and projected biodiversity over stream frogs.' presence: 'optional' sections: [] } ] },{ id: 'reptiles' name: 'Reptiles' description: 'current and projected biodiversity over reptile species.' presence: 'optional' sections: [{ id: 'allreptiles' name: 'All' description: 'current and projected biodiversity over all reptile species.' presence: 'optional' sections: [] },{ id: 'turtles' name: 'Turtles' description: 'current and projected biodiversity over turtles.' presence: 'optional' sections: [] } ] },{ id: 'birds' name: 'Birds' description: 'current and projected biodiversity over bird species.' presence: 'optional' sections: [] },{ id: 'freshwaterfish' name: 'Freshwater fish' description: 'current and projected biodiversity over freshwater fish species.' presence: 'optional' sections: [] } ] },{ id: 'pests' name: 'Pest Species' description: 'climate suitability and distribution of pest species.' presence: 'optional' sections: [ { id: 'pestplants' name: 'Pest Plants' description: 'summary of projections for selected pest plants.' presence: 'optional' sections: [] } ] },{ id: 'appendixes' name: 'Appendices' description: 'tables and other appendices.' presence: 'required' sections: [ { id: 'observedmammallist' name: 'Mammals Present' description: 'list of mammals currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedamphibianslist' name: 'Amphibians Present' description: 'list of amphibians currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedstreamfrogslist' name: 'Steam Frogs Present' description: 'list of stream frogs currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedreptileslist' name: 'Reptiles Present' description: 'list of reptiles currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedturtleslist' name: 'Turtles Present' description: 'list of turtles currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedbirdslist' name: 'Birds Present' description: 'list of birds currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'science' name: 'Science' description: 'description of the climate and species distribution modelling used to generate the data in the report.' presence: 'required' sections: [] } ] } ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildReportSectionList: (data, wrapper)-> debug 'AppView.buildReportSectionList' $.each data, (index, item)=> # make a row for this item selectorRow = $ AppView.templates.sectionSelector(item) $(wrapper).append selectorRow # if the item has subitems, insert those if item.sections.length > 0 subsections = $ AppView.templates.subsections() @buildReportSectionList item.sections, subsections $(selectorRow).addClass('hassubsections').append(subsections) # --------------------------------------------------------------- updateSectionSelection: (event)-> debug 'AppView.updateSectionSelection' @handleSectionSelection @possibleSections # --------------------------------------------------------------- handleSectionSelection: (sectionList, parent)-> debug 'AppView.handleSectionSelection' $.each sectionList, (index, item)=> # find the selection checkbox.. selector = @$ "#section-#{ item.id }" selectionControl = selector.find 'input' # set the right class on the selector if selectionControl.prop 'checked' selector.removeClass 'unselected' else selector.addClass 'unselected' if item.sections?.length > 0 @handleSectionSelection item.sections, item.id @updateSummary() # --------------------------------------------------------------- # deal with regions # --------------------------------------------------------------- fetchRegions: ()-> debug 'AppView.fetchRegions' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @buildRegionList data # pretend it took a while to get the data.. setTimeout ()-> fetch.resolve({ regiontypes: [ { id: 'nrm' name: 'NRM region' regions: [ { id: 'NRM_ACT', name: 'ACT' }, { id: 'NRM_Adelaide_and_Mount_Lofty_Ranges', name: 'Adelaide and Mount Lofty Ranges' }, { id: 'NRM_Alinytjara_Wilurara', name: 'Alinytjara Wilurara' }, { id: 'NRM_Avon', name: '<NAME>' }, { id: 'NRM_Border_Rivers-Gwydir', name: 'Border Rivers-Gwydir' }, { id: 'NRM_Border_Rivers_Maranoa-Balonne', name: 'Border Rivers Maranoa-Balonne' }, { id: 'NRM_Burdekin', name: 'Bur<NAME>' }, { id: 'NRM_Burnett_Mary', name: '<NAME>' }, { id: 'NRM_Cape_York', name: 'Cape York' }, { id: 'NRM_Central_West', name: 'Central West' }, { id: 'NRM_Condamine', name: 'Condamine' }, { id: 'NRM_Cooperative_Management_Area', name: 'Cooperative Management Area' }, { id: 'NRM_Corangamite', name: 'Corangamite' }, { id: 'NRM_Desert_Channels', name: 'Desert Channels' }, { id: 'NRM_East_Gippsland', name: 'East Gippsland' }, { id: 'NRM_Eyre_Peninsula', name: 'Eyre Peninsula' }, { id: 'NRM_Fitzroy', name: '<NAME>' }, { id: 'NRM_Glenelg_Hopkins', name: '<NAME>' }, { id: 'NRM_Goulburn_Broken', name: 'Goulburn Broken' }, { id: 'NRM_Hawkesbury-Nepean', name: 'Hawkesbury-Nepean' }, { id: 'NRM_Hunter-Central_Rivers', name: 'Hunter-Central_Rivers' }, { id: 'NRM_Kangaroo_Island', name: 'Kangaroo Island' }, { id: 'NRM_Lachlan', name: 'Lachlan' }, { id: 'NRM_Lower_Murray_Darling', name: 'Lower Murray Darling' }, { id: 'NRM_<NAME>_<NAME>', name: '<NAME>' }, { id: 'NRM_<NAME>', name: '<NAME>' }, { id: 'NRM_<NAME>ur<NAME>', name: '<NAME>' }, { id: 'NRM_<NAME>', name: '<NAME>' }, { id: 'NRM_Namoi', name: '<NAME>' }, { id: 'NRM_North', name: 'North' }, { id: 'NRM_North_Central', name: 'North Central' }, { id: 'NRM_North_East', name: 'North East' }, { id: 'NRM_North_West', name: 'North West' }, { id: 'NRM_Northern_Agricultural', name: 'Northern Agricultural' }, { id: 'NRM_Northern_Gulf', name: 'Northern Gulf' }, { id: 'NRM_Northern_Rivers', name: 'Northern Rivers' }, { id: 'NRM_Northern_Territory', name: 'Northern Territory' }, { id: 'NRM_Northern_and_Yorke', name: 'Northern and Yorke' }, { id: 'NRM_Perth', name: 'Perth' }, { id: 'NRM_Port_Phillip_and_Western_Port', name: 'Port Phillip and Western Port' }, { id: 'NRM_Rangelands', name: 'Rangelands' }, { id: 'NRM_South', name: 'South' }, { id: 'NRM_South_Australian_Arid_Lands', name: 'South Australian Arid Lands' }, { id: 'NRM_South_Australian_Murray_Darling_Basin', name: 'South Australian Murray Darling Basin' }, { id: 'NRM_South_Coast', name: 'South Coast' }, { id: 'NRM_South_East', name: 'South East' }, { id: 'NRM_South_East_Queensland', name: 'South East Queensland' }, { id: 'NRM_South_West', name: 'South West' }, { id: 'NRM_South_West_Queensland', name: 'South West Queensland' }, { id: 'NRM_Southern_Gulf', name: 'Southern Gulf' }, { id: 'NRM_Southern_Rivers', name: 'Southern Rivers' }, { id: 'NRM_Sydney_Metro', name: 'Sydney Metro' }, { id: 'NRM_Torres_Strait', name: 'Torres Strait' }, { id: 'NRM_West_Gippsland', name: 'West Gippsland' }, { id: 'NRM_Western', name: 'Western' }, { id: 'NRM_Wet_Tropics', name: 'Wet Tropics' }, { id: 'NRM_Wimmera', name: 'Wimmera' } ] },{ id: 'ibra' name: 'IBRA bioregion' regions: [] },{ id: 'park' name: 'Parks, reserves' regions: [] },{ id: 'state' name: 'State, territory' regions: [ { id: 'State_Australian_Capital_Territory', name: 'ACT' }, { id: 'State_New_South_Wales', name: 'New South Wales' }, { id: 'State_Northern_Territory', name: 'Northern Territory' }, { id: 'State_Queensland', name: 'Queensland' }, { id: 'State_South_Australia', name: 'South Australia' }, { id: 'State_Tasmania', name: 'Tasmania' }, { id: 'State_Victoria', name: 'Victoria' }, { id: 'State_Western_Australia', name: 'Western Australia' } ] } ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildRegionList: (data)-> debug 'AppView.buildRegionList' @regions = data.regiontypes regionselect = @$ '.regionselect' regionselect.empty().removeClass 'loading' $.each @regions, (index, regionType)=> # make a row for this regiontype # first the regions go into a select box regionType.optionList = [ AppView.templates.regionSelector(reg) for reg in regionType.regions ].join "\n" regionTypeRow = $ AppView.templates.regionTypeSelector(regionType) regionselect.append regionTypeRow # --------------------------------------------------------------- updateRegionSelection: (event)-> debug 'AppView.updateRegionSelection' selectedType = @$('[name=regiontype]:checked').val() $.each @regions, (index, regionType)=> # find the selection checkbox.. selector = @$ "#regiontype-#{ regionType.id }" # set the right class on the selector if selectedType == regionType.id selector.addClass 'typeselected' @selectedRegionType = regionType.id @selectedRegion = $(selector.find('select')).val() if @selectedRegion == null selector.removeClass 'regionselected' else selector.addClass 'regionselected' # note the region data for later.. @selectedRegionInfo = _.find regionType.regions, (region)=> region.id == @selectedRegion else selector.removeClass 'typeselected' @updateSummary() # --------------------------------------------------------------- # deal with years # --------------------------------------------------------------- fetchYears: ()-> debug 'AppView.fetchYears' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @buildYearList data # pretend it took a second to get the data.. setTimeout ()-> fetch.resolve({ years: [ '2015' '2025' '2035' '2045' '2055' '2065' '2075' '2085' ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildYearList: (data)-> debug 'AppView.buildYearList' @years = data.years yearselect = @$ '.yearselect' yearselect.empty().removeClass 'loading' $.each @years, (index, year)=> # make a selector for this year yearselect.append AppView.templates.yearSelector({ year: year }) # --------------------------------------------------------------- updateYearSelection: (event)-> debug 'AppView.updateYearSelection' @selectedYear = @$('[name=yearselector]:checked').val() $.each @years, (index, year)=> # find the selection checkbox.. selector = @$ "#year-#{ year }" # set the right class on the selector if @selectedYear == year selector.addClass 'yearselected' else selector.removeClass 'yearselected' @updateSummary() # --------------------------------------------------------------- # update report summary # --------------------------------------------------------------- sectionId: (sectionDom)-> debug 'AppView.sectionId' $(sectionDom).find('input').attr 'value' # --------------------------------------------------------------- sectionName: (sectionDom)-> debug 'AppView.sectionName' @sectionInfo(sectionDom).name # --------------------------------------------------------------- sectionInfo: (sectionDom)-> debug 'AppView.sectionInfo' # get a list of this section's parent ids parentage = $(sectionDom).parents '.sectionselector' parentIds = parentage.map( (i, elem)=> @sectionId elem ).get().reverse() # add this section's own id parentIds.push @sectionId(sectionDom) @selectedSections.push parentIds.join('.') # now walk into the sections hierarchy info = { sections: @possibleSections } parentIds.forEach (id)-> info = _.filter(info.sections, (section)-> section.id == id)[0] # finally we have a pointer to the info for this section return info # --------------------------------------------------------------- subSectionList: (sectionDom)-> debug 'AppView.sectionList' list = [] subsections = $(sectionDom).children('.subsections') subsections.children('.sectionselector').not('.unselected').each (i, elem)=> name = @sectionName(elem) subs = @subSectionList(elem) if subs isnt '' name = name + ' (' + subs + ')' list.push name return list.join ', ' # --------------------------------------------------------------- updateSummary: ()-> debug 'AppView.updateSummary' selectedSections = @$('.sectionselect > .sectionselector').not('.unselected') @selectedSections = [] contentList = [] selectedSections.each (index, section)=> info = @sectionName section subList = @subSectionList section if subList isnt '' info = info + ': ' + subList.toLowerCase() contentList.push info + '.' content = '' if contentList.length > 0 content = '<li>' + contentList.join('</li><li>') + '</li>' summary = { regionName: @selectedRegionInfo?.name year: @selectedYear content: content } @$('.reviewblock').html AppView.templates.reviewBlock(summary) # --------------------------------------------------------------- },{ templates: { # ================================================== # templates here # --------------------------------------------------------------- layout: _.template """ <div class="reviewblock"></div> <div class="formblock"> <h1>Report on</h1> <div class="loading select regionselect">loading available regions..</div> <h1>In the year</h1> <div class="loading select yearselect">loading available years..</div> <h1>Including</h1> <div class="loading select sectionselect">loading available sections..</div> </div> """ # --------------------------------------------------------------- reviewBlock: _.template """ <h1>Selected Report</h1> <p class="coverage">Covers <% if (regionName) { %><%= regionName %><% } else { %><em>(unspecified region)</em><% } %> in <% if (year) { %><%= year %>.<% } else { %><em>(unspecified year)</em>.<% } %> </p> <ul class="contents"><%= content %></ul> <button type="button" class="getreport">download report</button> """ # --------------------------------------------------------------- reviewContentItem: _.template """ <li>item</li> """ # --------------------------------------------------------------- regionTypeSelector: _.template """ <div class="regiontypeselector" id="regiontype-<%= id %>"> <label class="name"><input class="regiontype" name="regiontype" type="radio" value="<%= id %>" /> <%= name %> </label> <div class="regionselectorwrapper"><select class="regionselector"> <option value="" disabled="disabled" selected="selected">select a region&hellip;</option> <%= optionList %> </select></div> </div> """ # --------------------------------------------------------------- regionSelector: _.template """<option value="<%= id %>"><%= name %></option>""" # --------------------------------------------------------------- yearSelector: _.template """ <div class="yearrow" id="year-<%= year %>"> <label class="name"><input class="yearselector" name="yearselector" type="radio" value="<%= year %>" /> <%= year %></label> </div> """ # --------------------------------------------------------------- sectionSelector: _.template """ <div class="sectionselector" id="section-<%= id %>"> <label class="name" <% if (presence == 'required') { print('title="This section is required"'); } %> ><input type="checkbox" value="<%= id %>" checked="checked" <% if (presence == 'required') { print('disabled="disabled"'); } %> /> <%= name %></label> <p class="description"><%= description %></p> </div> """ # --------------------------------------------------------------- subsections: _.template """ <div class="subsections clearfix"> </div> """ # --------------------------------------------------------------- }} module.exports = AppView
true
# $ = require 'jquery' # _ = require 'lodash' # Backbone = require 'backbone' # L = require 'leaflet' # MapLayer = require '../models/maplayer' require '../util/shims' # help IE to get up to date # disable the jshint warning about "did you mean to return a # conditional" which crops up all the time in coffeescript compiled # code. ### jshint -W093 ### # disable the jshint warning about "use !== to compare with null" # which coffeescript compiled code sometimes triggers. ### jshint -W041 ### # ------------------------------------------------------------------- debug = (itemToLog, itemLevel)-> levels = ['verydebug', 'debug', 'message', 'warning'] # threshold = 'verydebug' # threshold = 'debug' threshold = 'message' itemLevel = 'debug' unless itemLevel thresholdNum = levels.indexOf threshold messageNum = levels.indexOf itemLevel return if thresholdNum > messageNum if itemToLog + '' == itemToLog # it's a string.. console.log "[#{itemLevel}] #{itemToLog}" else console.log itemToLog # ------------------------------------------------------------------- # ------------------------------------------------------------------- AppView = Backbone.View.extend { # --------------------------------------------------------------- # this view's base element tagName: 'form' className: '' id: 'reportform' # --------------------------------------------------------------- # some settings speciesDataUrl: "#{location.protocol}//#{location.host}/speciesdata" rasterApiUrl: "#{location.protocol}//localhost:10600/api/raster/1/wms_data_url" # --------------------------------------------------------------- # tracking the splitter bar trackSplitter: false trackPeriod: 100 # --------------------------------------------------------------- events: 'change .sectionselector input': 'updateSectionSelection' 'change .regionselect input': 'updateRegionSelection' 'change .regionselect select': 'updateRegionSelection' 'change .yearselect input': 'updateYearSelection' 'click .getreport': 'getReport' # --------------------------------------------------------------- initialize: ()-> debug 'AppView.initialize' # more annoying version of bindAll requires this concat stuff _.bindAll.apply _, [this].concat _.functions(this) # kick off the fetching of stuff @fetchReportSections() @fetchRegions() @fetchYears() # @tick() # --------------------------------------------------------------- render: ()-> debug 'AppView.render' @$el.append AppView.templates.layout {} $('#contentwrap .maincontent').append @$el # --------------------------------------------------------------- # actually go get the report # --------------------------------------------------------------- getReport: ()-> debug 'AppView.getReport' # remove any previous form @$('#reportform').remove() form = [] form.push '<form action="/regionreport" method="get" id="reportform">' # selected year form.push '<input type="hidden" name="year" value="' + @selectedYear + '">' # selected region form.push '<input type="hidden" name="regiontype" value="' + @selectedRegionType + '">' form.push '<input type="hidden" name="region" value="' + @selectedRegion + '">' # selected report sections form.push '<input type="hidden" name="sections" value="' + @selectedSections.join(' ') + '">' form.push '</form>' @$el.append form.join '\n' @$('#reportform').submit() # --------------------------------------------------------------- # deal with report sections # --------------------------------------------------------------- fetchReportSections: ()-> debug 'AppView.fetchReportSections' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @possibleSections = data.sections sectionselect = @$ '.sectionselect' sectionselect.empty().removeClass 'loading' @buildReportSectionList @possibleSections, sectionselect # pretend it took a while to get the data.. setTimeout ()-> fetch.resolve({ sections: [ { id: 'intro' name: 'Introduction' description: 'title, credits, and introductory paragraphs.' presence: 'required' sections: [] },{ id: 'climatereview' name: 'Climate Review' description: 'a description of the region\'s current and projected climate.' presence: 'optional' sections: [ { id: 'temperature' name: 'Temperature' description: 'current and projected temperature.' presence: 'optional' sections: [] },{ id: 'rainfall' name: 'Rainfall' description: 'current and projected precipitation.' presence: 'optional' sections: [] } ] },{ id: 'biodiversity' name: 'Biodiversity Review' description: 'a description of the region\'s current and projected biodiversity.' presence: 'optional' sections: [ { id: 'overall' name: 'Overall' description: 'current and projected biodiversity over all modelled species.' presence: 'optional' sections: [] },{ id: 'mammals' name: 'Mammals' description: 'current and projected biodiversity over mammal species.' presence: 'optional' sections: [] },{ id: 'amphibians' name: 'Amphibians' description: 'current and projected biodiversity over amphibian species.' presence: 'optional' sections: [{ id: 'allamphibians' name: 'All' description: 'current and projected biodiversity over all amphibian species.' presence: 'optional' sections: [] },{ id: 'streamfrogs' name: 'Stream frogs' description: 'current and projected biodiversity over stream frogs.' presence: 'optional' sections: [] } ] },{ id: 'reptiles' name: 'Reptiles' description: 'current and projected biodiversity over reptile species.' presence: 'optional' sections: [{ id: 'allreptiles' name: 'All' description: 'current and projected biodiversity over all reptile species.' presence: 'optional' sections: [] },{ id: 'turtles' name: 'Turtles' description: 'current and projected biodiversity over turtles.' presence: 'optional' sections: [] } ] },{ id: 'birds' name: 'Birds' description: 'current and projected biodiversity over bird species.' presence: 'optional' sections: [] },{ id: 'freshwaterfish' name: 'Freshwater fish' description: 'current and projected biodiversity over freshwater fish species.' presence: 'optional' sections: [] } ] },{ id: 'pests' name: 'Pest Species' description: 'climate suitability and distribution of pest species.' presence: 'optional' sections: [ { id: 'pestplants' name: 'Pest Plants' description: 'summary of projections for selected pest plants.' presence: 'optional' sections: [] } ] },{ id: 'appendixes' name: 'Appendices' description: 'tables and other appendices.' presence: 'required' sections: [ { id: 'observedmammallist' name: 'Mammals Present' description: 'list of mammals currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedamphibianslist' name: 'Amphibians Present' description: 'list of amphibians currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedstreamfrogslist' name: 'Steam Frogs Present' description: 'list of stream frogs currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedreptileslist' name: 'Reptiles Present' description: 'list of reptiles currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedturtleslist' name: 'Turtles Present' description: 'list of turtles currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'observedbirdslist' name: 'Birds Present' description: 'list of birds currently or projected to be present in region.' presence: 'optional' sections: [] },{ id: 'science' name: 'Science' description: 'description of the climate and species distribution modelling used to generate the data in the report.' presence: 'required' sections: [] } ] } ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildReportSectionList: (data, wrapper)-> debug 'AppView.buildReportSectionList' $.each data, (index, item)=> # make a row for this item selectorRow = $ AppView.templates.sectionSelector(item) $(wrapper).append selectorRow # if the item has subitems, insert those if item.sections.length > 0 subsections = $ AppView.templates.subsections() @buildReportSectionList item.sections, subsections $(selectorRow).addClass('hassubsections').append(subsections) # --------------------------------------------------------------- updateSectionSelection: (event)-> debug 'AppView.updateSectionSelection' @handleSectionSelection @possibleSections # --------------------------------------------------------------- handleSectionSelection: (sectionList, parent)-> debug 'AppView.handleSectionSelection' $.each sectionList, (index, item)=> # find the selection checkbox.. selector = @$ "#section-#{ item.id }" selectionControl = selector.find 'input' # set the right class on the selector if selectionControl.prop 'checked' selector.removeClass 'unselected' else selector.addClass 'unselected' if item.sections?.length > 0 @handleSectionSelection item.sections, item.id @updateSummary() # --------------------------------------------------------------- # deal with regions # --------------------------------------------------------------- fetchRegions: ()-> debug 'AppView.fetchRegions' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @buildRegionList data # pretend it took a while to get the data.. setTimeout ()-> fetch.resolve({ regiontypes: [ { id: 'nrm' name: 'NRM region' regions: [ { id: 'NRM_ACT', name: 'ACT' }, { id: 'NRM_Adelaide_and_Mount_Lofty_Ranges', name: 'Adelaide and Mount Lofty Ranges' }, { id: 'NRM_Alinytjara_Wilurara', name: 'Alinytjara Wilurara' }, { id: 'NRM_Avon', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_Border_Rivers-Gwydir', name: 'Border Rivers-Gwydir' }, { id: 'NRM_Border_Rivers_Maranoa-Balonne', name: 'Border Rivers Maranoa-Balonne' }, { id: 'NRM_Burdekin', name: 'BurPI:NAME:<NAME>END_PI' }, { id: 'NRM_Burnett_Mary', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_Cape_York', name: 'Cape York' }, { id: 'NRM_Central_West', name: 'Central West' }, { id: 'NRM_Condamine', name: 'Condamine' }, { id: 'NRM_Cooperative_Management_Area', name: 'Cooperative Management Area' }, { id: 'NRM_Corangamite', name: 'Corangamite' }, { id: 'NRM_Desert_Channels', name: 'Desert Channels' }, { id: 'NRM_East_Gippsland', name: 'East Gippsland' }, { id: 'NRM_Eyre_Peninsula', name: 'Eyre Peninsula' }, { id: 'NRM_Fitzroy', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_Glenelg_Hopkins', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_Goulburn_Broken', name: 'Goulburn Broken' }, { id: 'NRM_Hawkesbury-Nepean', name: 'Hawkesbury-Nepean' }, { id: 'NRM_Hunter-Central_Rivers', name: 'Hunter-Central_Rivers' }, { id: 'NRM_Kangaroo_Island', name: 'Kangaroo Island' }, { id: 'NRM_Lachlan', name: 'Lachlan' }, { id: 'NRM_Lower_Murray_Darling', name: 'Lower Murray Darling' }, { id: 'NRM_PI:NAME:<NAME>END_PI_PI:NAME:<NAME>END_PI', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_PI:NAME:<NAME>END_PI', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_PI:NAME:<NAME>END_PIurPI:NAME:<NAME>END_PI', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_PI:NAME:<NAME>END_PI', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_Namoi', name: 'PI:NAME:<NAME>END_PI' }, { id: 'NRM_North', name: 'North' }, { id: 'NRM_North_Central', name: 'North Central' }, { id: 'NRM_North_East', name: 'North East' }, { id: 'NRM_North_West', name: 'North West' }, { id: 'NRM_Northern_Agricultural', name: 'Northern Agricultural' }, { id: 'NRM_Northern_Gulf', name: 'Northern Gulf' }, { id: 'NRM_Northern_Rivers', name: 'Northern Rivers' }, { id: 'NRM_Northern_Territory', name: 'Northern Territory' }, { id: 'NRM_Northern_and_Yorke', name: 'Northern and Yorke' }, { id: 'NRM_Perth', name: 'Perth' }, { id: 'NRM_Port_Phillip_and_Western_Port', name: 'Port Phillip and Western Port' }, { id: 'NRM_Rangelands', name: 'Rangelands' }, { id: 'NRM_South', name: 'South' }, { id: 'NRM_South_Australian_Arid_Lands', name: 'South Australian Arid Lands' }, { id: 'NRM_South_Australian_Murray_Darling_Basin', name: 'South Australian Murray Darling Basin' }, { id: 'NRM_South_Coast', name: 'South Coast' }, { id: 'NRM_South_East', name: 'South East' }, { id: 'NRM_South_East_Queensland', name: 'South East Queensland' }, { id: 'NRM_South_West', name: 'South West' }, { id: 'NRM_South_West_Queensland', name: 'South West Queensland' }, { id: 'NRM_Southern_Gulf', name: 'Southern Gulf' }, { id: 'NRM_Southern_Rivers', name: 'Southern Rivers' }, { id: 'NRM_Sydney_Metro', name: 'Sydney Metro' }, { id: 'NRM_Torres_Strait', name: 'Torres Strait' }, { id: 'NRM_West_Gippsland', name: 'West Gippsland' }, { id: 'NRM_Western', name: 'Western' }, { id: 'NRM_Wet_Tropics', name: 'Wet Tropics' }, { id: 'NRM_Wimmera', name: 'Wimmera' } ] },{ id: 'ibra' name: 'IBRA bioregion' regions: [] },{ id: 'park' name: 'Parks, reserves' regions: [] },{ id: 'state' name: 'State, territory' regions: [ { id: 'State_Australian_Capital_Territory', name: 'ACT' }, { id: 'State_New_South_Wales', name: 'New South Wales' }, { id: 'State_Northern_Territory', name: 'Northern Territory' }, { id: 'State_Queensland', name: 'Queensland' }, { id: 'State_South_Australia', name: 'South Australia' }, { id: 'State_Tasmania', name: 'Tasmania' }, { id: 'State_Victoria', name: 'Victoria' }, { id: 'State_Western_Australia', name: 'Western Australia' } ] } ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildRegionList: (data)-> debug 'AppView.buildRegionList' @regions = data.regiontypes regionselect = @$ '.regionselect' regionselect.empty().removeClass 'loading' $.each @regions, (index, regionType)=> # make a row for this regiontype # first the regions go into a select box regionType.optionList = [ AppView.templates.regionSelector(reg) for reg in regionType.regions ].join "\n" regionTypeRow = $ AppView.templates.regionTypeSelector(regionType) regionselect.append regionTypeRow # --------------------------------------------------------------- updateRegionSelection: (event)-> debug 'AppView.updateRegionSelection' selectedType = @$('[name=regiontype]:checked').val() $.each @regions, (index, regionType)=> # find the selection checkbox.. selector = @$ "#regiontype-#{ regionType.id }" # set the right class on the selector if selectedType == regionType.id selector.addClass 'typeselected' @selectedRegionType = regionType.id @selectedRegion = $(selector.find('select')).val() if @selectedRegion == null selector.removeClass 'regionselected' else selector.addClass 'regionselected' # note the region data for later.. @selectedRegionInfo = _.find regionType.regions, (region)=> region.id == @selectedRegion else selector.removeClass 'typeselected' @updateSummary() # --------------------------------------------------------------- # deal with years # --------------------------------------------------------------- fetchYears: ()-> debug 'AppView.fetchYears' # later this will be an ajax call, for now make a deferred object fetch = $.Deferred() fetch.done (data)=> @buildYearList data # pretend it took a second to get the data.. setTimeout ()-> fetch.resolve({ years: [ '2015' '2025' '2035' '2045' '2055' '2065' '2075' '2085' ] }) , 500 + (500 * Math.random()) # now return a promise in case we need to wait for this return fetch.promise() # --------------------------------------------------------------- buildYearList: (data)-> debug 'AppView.buildYearList' @years = data.years yearselect = @$ '.yearselect' yearselect.empty().removeClass 'loading' $.each @years, (index, year)=> # make a selector for this year yearselect.append AppView.templates.yearSelector({ year: year }) # --------------------------------------------------------------- updateYearSelection: (event)-> debug 'AppView.updateYearSelection' @selectedYear = @$('[name=yearselector]:checked').val() $.each @years, (index, year)=> # find the selection checkbox.. selector = @$ "#year-#{ year }" # set the right class on the selector if @selectedYear == year selector.addClass 'yearselected' else selector.removeClass 'yearselected' @updateSummary() # --------------------------------------------------------------- # update report summary # --------------------------------------------------------------- sectionId: (sectionDom)-> debug 'AppView.sectionId' $(sectionDom).find('input').attr 'value' # --------------------------------------------------------------- sectionName: (sectionDom)-> debug 'AppView.sectionName' @sectionInfo(sectionDom).name # --------------------------------------------------------------- sectionInfo: (sectionDom)-> debug 'AppView.sectionInfo' # get a list of this section's parent ids parentage = $(sectionDom).parents '.sectionselector' parentIds = parentage.map( (i, elem)=> @sectionId elem ).get().reverse() # add this section's own id parentIds.push @sectionId(sectionDom) @selectedSections.push parentIds.join('.') # now walk into the sections hierarchy info = { sections: @possibleSections } parentIds.forEach (id)-> info = _.filter(info.sections, (section)-> section.id == id)[0] # finally we have a pointer to the info for this section return info # --------------------------------------------------------------- subSectionList: (sectionDom)-> debug 'AppView.sectionList' list = [] subsections = $(sectionDom).children('.subsections') subsections.children('.sectionselector').not('.unselected').each (i, elem)=> name = @sectionName(elem) subs = @subSectionList(elem) if subs isnt '' name = name + ' (' + subs + ')' list.push name return list.join ', ' # --------------------------------------------------------------- updateSummary: ()-> debug 'AppView.updateSummary' selectedSections = @$('.sectionselect > .sectionselector').not('.unselected') @selectedSections = [] contentList = [] selectedSections.each (index, section)=> info = @sectionName section subList = @subSectionList section if subList isnt '' info = info + ': ' + subList.toLowerCase() contentList.push info + '.' content = '' if contentList.length > 0 content = '<li>' + contentList.join('</li><li>') + '</li>' summary = { regionName: @selectedRegionInfo?.name year: @selectedYear content: content } @$('.reviewblock').html AppView.templates.reviewBlock(summary) # --------------------------------------------------------------- },{ templates: { # ================================================== # templates here # --------------------------------------------------------------- layout: _.template """ <div class="reviewblock"></div> <div class="formblock"> <h1>Report on</h1> <div class="loading select regionselect">loading available regions..</div> <h1>In the year</h1> <div class="loading select yearselect">loading available years..</div> <h1>Including</h1> <div class="loading select sectionselect">loading available sections..</div> </div> """ # --------------------------------------------------------------- reviewBlock: _.template """ <h1>Selected Report</h1> <p class="coverage">Covers <% if (regionName) { %><%= regionName %><% } else { %><em>(unspecified region)</em><% } %> in <% if (year) { %><%= year %>.<% } else { %><em>(unspecified year)</em>.<% } %> </p> <ul class="contents"><%= content %></ul> <button type="button" class="getreport">download report</button> """ # --------------------------------------------------------------- reviewContentItem: _.template """ <li>item</li> """ # --------------------------------------------------------------- regionTypeSelector: _.template """ <div class="regiontypeselector" id="regiontype-<%= id %>"> <label class="name"><input class="regiontype" name="regiontype" type="radio" value="<%= id %>" /> <%= name %> </label> <div class="regionselectorwrapper"><select class="regionselector"> <option value="" disabled="disabled" selected="selected">select a region&hellip;</option> <%= optionList %> </select></div> </div> """ # --------------------------------------------------------------- regionSelector: _.template """<option value="<%= id %>"><%= name %></option>""" # --------------------------------------------------------------- yearSelector: _.template """ <div class="yearrow" id="year-<%= year %>"> <label class="name"><input class="yearselector" name="yearselector" type="radio" value="<%= year %>" /> <%= year %></label> </div> """ # --------------------------------------------------------------- sectionSelector: _.template """ <div class="sectionselector" id="section-<%= id %>"> <label class="name" <% if (presence == 'required') { print('title="This section is required"'); } %> ><input type="checkbox" value="<%= id %>" checked="checked" <% if (presence == 'required') { print('disabled="disabled"'); } %> /> <%= name %></label> <p class="description"><%= description %></p> </div> """ # --------------------------------------------------------------- subsections: _.template """ <div class="subsections clearfix"> </div> """ # --------------------------------------------------------------- }} module.exports = AppView
[ { "context": "gexp#=~ used in case statements.\n #\n # a = \"HELLO\"\n # R(/^[a-z]*$/)['==='](a) # => false\n # ", "end": 2106, "score": 0.802518367767334, "start": 2101, "tag": "NAME", "value": "HELLO" } ]
lib/oo/regexp.coffee
hasclass/core-lib
1
class RubyJS.Regexp extends RubyJS.Object # TODO: remove and document this. not needed/making sense in JS. IGNORECASE: 1 EXTENDED: 2 MULTILINE: 4 # ---- Constructors & Typecast ---------------------------------------------- constructor: (@__native__) -> @new: (arg) -> if typeof arg is 'string' # optimize R.Regexp.new("foo") with string primitive arg = @__compile__( arg ) else if R.Regexp.isRegexp(arg) else if arg.is_regexp? arg = arg.to_native() else arg = @__compile__( RCoerce.to_str_native(arg)) new R.Regexp(arg) @compile: @new @try_convert: (obj) -> if obj is null null else if @isRegexp(obj) new R.Regexp(obj) else if obj.to_regexp? obj.to_regexp() else null @isRegexp: (obj) -> obj?.is_regexp? or nativeToString.call(obj) is '[object RegExp]' # ---- RubyJSism ------------------------------------------------------------ # ---- Javascript primitives -------------------------------------------------- is_regexp: -> true to_native: -> @__native__ # ---- Instance methods ----------------------------------------------------- # @todo escaping of forward slashes: \ inspect: -> src = @source().to_native() R("/#{src}/#{@__flags__()}") # Equality—Two regexps are equal if their patterns are identical, they have # the same character set code, and their casefold? values are the same. # # @todo Check ruby-docs # # @example Basics (wrong online doc in ruby-doc.org) # # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # # @example aliased by #equals # # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # # @alias #equals, #eql # equals: (other) -> other = R(other) (other.to_native().source is @to_native().source) and (other.casefold() is @casefold()) # Case Equality—Synonym for Regexp#=~ used in case statements. # # a = "HELLO" # R(/^[a-z]*$/)['==='](a) # => false # R(/^[a-z]*$/)['==='](a) # => false # R(/^[A-Z]*$/)['==='](a) # => true # # @alias #equal_case # '===': (other) -> @match(other) != null '=~': (str, offset) -> matches = @match(str, offset) matches?.begin(0) # Returns the value of the case-insensitive flag. # # @example # # R(/a/).casefold() #=> false # R(/a/i).casefold() #=> true # # @example Unsupported Ruby syntax # # R(/(?i:a)/).casefold() #=> false # casefold: -> @to_native().ignoreCase # @unsupported currently no support for encodings in RubyJS encoding: -> throw R.NotSupportedError.new() # @alias to #== eql: -> @equals.apply(this, arguments) # @unsupported currently no support for encodings in RubyJS fixed_encoding: -> throw R.NotSupportedError.new() # @unsupported currently no support for hash in RubyJS hash: -> throw R.NotSupportedError.new() # Returns a MatchData object describing the match, or nil if there was no # match. This is equivalent to retrieving the value of the special variable # $~ following a normal match. If the second parameter is present, it # specifies the position in the string to begin the search. # # @example # R(/(.)(.)(.)/).match("abc")[2] # => "b" # R(/(.)(.)/).match("abc", 1)[2] # => "c" # # If a block is given, invoke the block with MatchData if match succeed, so that you can write # # pat.match(str) {|m| ...} # # instead of # # if m = pat.match(str) # ... # end # # The return value is a value from block execution in this case. # # @todo: # R(/(.)(.)?(.)/).match("fo") # # should => ["fo" 1:"f" 2:nil 3:"o">'] # # but => ["fo" 1:"f" 2:undefined 3:"o">'] # # @example Parameters # match(str) → matchdata or nil # match(str,pos) → matchdata or nil # match: (str, offset) -> block = __extract_block(nativeSlice.call(arguments)) if str is null R['$~'] = null else str = RCoerce.to_str_native(str) opts = {string: str, regexp: this} if offset opts.offset = offset str = str[offset..-1] if matches = str.match(@to_native()) R['$~'] = new R.MatchData(matches, opts) else R['$~'] = null result = R['$~'] if block if result then block(result) else new R.Array([]) else result quote: (pattern) -> R.Regexp.quote(pattern) # Returns the original string of the pattern. # # R(/ab+c/i).source() #=> "ab+c" # # Note that escape sequences are retained as is. # # R(/\x20\+/).source() #=> "\\x20\\+" # source: () -> R(@to_native().source) # Returns a string containing the regular expression and its options (using the (?opts:source) notation. This string can be fed back in to Regexp::new to a regular expression with the same semantics as the original. (However, Regexp#== may not return true when comparing the two, as the source of the regular expression itself may differ, as the example shows). Regexp#inspect produces a generally more readable version of rxp. # # @example # r1 = R(/ab+c/) #=> /ab+c/ # s1 = r1.to_s() #=> "(ab+c)" # r2 = Regexp.new(s1) #=> /(ab+c)/ # r1 == r2 #=> false # r1.source() #=> "ab+c" # r2.source() #=> "(ab+c)" # # @example Ruby difference # # r1 = R(/ab+c/i) #=> /ab+c/i # s1 = r1.to_s() #=> "(ab+c)" # # i option is lost! # # Ruby: # /ab+c/i.to_s #=> "(?i-mx:ab+c)" # to_s: () -> R("(#{@source()})") valueOf: -> @__native__ # ---- Class methods -------------------------------------------------------- # The first form returns the MatchData object generated by the last # successful pattern match. Equivalent to reading the global variable $~. # The second form returns the nth field in this MatchData object. n can be a # string or symbol to reference a named capture. # # Note that the last_match is local to the thread and method scope of the # method that did the pattern match. # # @example # R(/c(.)t/)['=~'] 'cat' #=> 0 # Regexp.last_match() #=> #<MatchData "cat" 1:"a"> # Regexp.last_match(0) #=> "cat" # Regexp.last_match(1) #=> "a" # Regexp.last_match(2) #=> null # # @example Edge cases # R(/nomatch/)['=~'] 'foo' # Regexp.last_match(2) #=> null # # @example Unsupported Ruby Syntax: named captures # # /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ "var = val" # # R.Regexp.last_match() #=> #<MatchData "var = val" lhs:"var" rhs:"val"> # # R.Regexp.last_match(:lhs) #=> "var" # # R.Regexp.last_match(:rhs) #=> "val" # # @example Parameters # R.Regexp.last_match() → matchdata click to toggle source # R.Regexp.last_match(n) → str # @last_match: (n) -> if (n and R['$~']) then R['$~'][n] else R['$~'] # @see Regexp.escape # @quote: (pattern) -> @escape(pattern) # Escapes any characters that would have special meaning in a regular # expression. Returns a new escaped string, or self if no characters are # escaped. For any string, Regexp.new(Regexp.escape(str))=~str will be true. # # @example # R.Regexp.escape('\*?{}.') #=> \\\*\?\{\}\. # # @alias Regexp.quote # @escape: (pattern) -> pattern = pattern + '' pattern.replace(/([.?*+^$[\](){}|-])/g, "\\$1") # .replace(/[\\]/g, '\\\\') # .replace(/[\"]/g, '\\\"') # .replace(/[\/]/g, '\\/') # .replace(/[\b]/g, '\\b') .replace(/[\f]/g, '\\f') .replace(/[\n]/g, '\\n') .replace(/[\r]/g, '\\r') .replace(/[\t]/g, '\\t') .replace(/[\s]/g, '\\ ') # This must been an empty space ' ' # Return a Regexp object that is the union of the given patterns, i.e., will # match any of its parts. The patterns can be Regexp objects, in which case # their options will be preserved, or Strings. If no patterns are given, # returns /(?!)/. The behavior is unspecified if any given pattern contains # capture. # # @example # R.Regexp.union() #=> /(?!)/ # R.Regexp.union("penzance") #=> /penzance/ # R.Regexp.union("a+b*c") #=> /a\+b\*c/ # R.Regexp.union("skiing", "sledding") #=> /skiing|sledding/ # R.Regexp.union(["skiing", "sledding"]) #=> /skiing|sledding/ # R.Regexp.union(/dogs/, /cats/) #=> /(dogs)|(cats)/ # # @example Ruby difference # # RubyJS.Regexp.union(/dogs/, /cats/) # => /(dogs)|(cats)/ # # Ruby: # Regexp.union(/dogs/, /cats/) # => /(?-mix:dogs)|(?i-mx:cats)/ # # @example Edge cases # R.Regexp.union(["skiing", "sledding"], 'foo') #=> TypeError! # # @example Parameters # R.Regexp.union(pat1, pat2, ...) → new_regexp # R.Regexp.union(pats_ary) → new_regexp # @union: (args...) -> # FIX: check specs... return R(/(?!)/) if args.length == 0 first_arg = R(args[0]) if first_arg.is_array? and args.length == 1 args = first_arg sources = for arg in args arg = R(arg) if arg.is_regexp? then arg.to_s() else RCoerce.to_str(arg) # TODO: use proper Regexp.compile/new method new R.Regexp( new nativeRegExp( sources.join('|') )) # ---- Private methods ------------------------------------------------------ # @see Regexp.new @__compile__: (arg) -> try return new nativeRegExp(arg) catch error throw R.RegexpError.new() __flags__: -> if @casefold() then 'i' else '' # ---- Unsupported methods -------------------------------------------------- # @unsupported named captures are not supported in JS names: -> throw R.NotSupportedError.new() # @unsupported named captures are not supported in JS named_captures: -> throw R.NotSupportedError.new() # @unsupported JS options are different from Ruby options. options: -> throw R.NotSupportedError.new() # ---- Aliases -------------------------------------------------------------- @__add_default_aliases__(@prototype) fixedEncoding: @prototype.fixed_encoding
149334
class RubyJS.Regexp extends RubyJS.Object # TODO: remove and document this. not needed/making sense in JS. IGNORECASE: 1 EXTENDED: 2 MULTILINE: 4 # ---- Constructors & Typecast ---------------------------------------------- constructor: (@__native__) -> @new: (arg) -> if typeof arg is 'string' # optimize R.Regexp.new("foo") with string primitive arg = @__compile__( arg ) else if R.Regexp.isRegexp(arg) else if arg.is_regexp? arg = arg.to_native() else arg = @__compile__( RCoerce.to_str_native(arg)) new R.Regexp(arg) @compile: @new @try_convert: (obj) -> if obj is null null else if @isRegexp(obj) new R.Regexp(obj) else if obj.to_regexp? obj.to_regexp() else null @isRegexp: (obj) -> obj?.is_regexp? or nativeToString.call(obj) is '[object RegExp]' # ---- RubyJSism ------------------------------------------------------------ # ---- Javascript primitives -------------------------------------------------- is_regexp: -> true to_native: -> @__native__ # ---- Instance methods ----------------------------------------------------- # @todo escaping of forward slashes: \ inspect: -> src = @source().to_native() R("/#{src}/#{@__flags__()}") # Equality—Two regexps are equal if their patterns are identical, they have # the same character set code, and their casefold? values are the same. # # @todo Check ruby-docs # # @example Basics (wrong online doc in ruby-doc.org) # # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # # @example aliased by #equals # # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # # @alias #equals, #eql # equals: (other) -> other = R(other) (other.to_native().source is @to_native().source) and (other.casefold() is @casefold()) # Case Equality—Synonym for Regexp#=~ used in case statements. # # a = "<NAME>" # R(/^[a-z]*$/)['==='](a) # => false # R(/^[a-z]*$/)['==='](a) # => false # R(/^[A-Z]*$/)['==='](a) # => true # # @alias #equal_case # '===': (other) -> @match(other) != null '=~': (str, offset) -> matches = @match(str, offset) matches?.begin(0) # Returns the value of the case-insensitive flag. # # @example # # R(/a/).casefold() #=> false # R(/a/i).casefold() #=> true # # @example Unsupported Ruby syntax # # R(/(?i:a)/).casefold() #=> false # casefold: -> @to_native().ignoreCase # @unsupported currently no support for encodings in RubyJS encoding: -> throw R.NotSupportedError.new() # @alias to #== eql: -> @equals.apply(this, arguments) # @unsupported currently no support for encodings in RubyJS fixed_encoding: -> throw R.NotSupportedError.new() # @unsupported currently no support for hash in RubyJS hash: -> throw R.NotSupportedError.new() # Returns a MatchData object describing the match, or nil if there was no # match. This is equivalent to retrieving the value of the special variable # $~ following a normal match. If the second parameter is present, it # specifies the position in the string to begin the search. # # @example # R(/(.)(.)(.)/).match("abc")[2] # => "b" # R(/(.)(.)/).match("abc", 1)[2] # => "c" # # If a block is given, invoke the block with MatchData if match succeed, so that you can write # # pat.match(str) {|m| ...} # # instead of # # if m = pat.match(str) # ... # end # # The return value is a value from block execution in this case. # # @todo: # R(/(.)(.)?(.)/).match("fo") # # should => ["fo" 1:"f" 2:nil 3:"o">'] # # but => ["fo" 1:"f" 2:undefined 3:"o">'] # # @example Parameters # match(str) → matchdata or nil # match(str,pos) → matchdata or nil # match: (str, offset) -> block = __extract_block(nativeSlice.call(arguments)) if str is null R['$~'] = null else str = RCoerce.to_str_native(str) opts = {string: str, regexp: this} if offset opts.offset = offset str = str[offset..-1] if matches = str.match(@to_native()) R['$~'] = new R.MatchData(matches, opts) else R['$~'] = null result = R['$~'] if block if result then block(result) else new R.Array([]) else result quote: (pattern) -> R.Regexp.quote(pattern) # Returns the original string of the pattern. # # R(/ab+c/i).source() #=> "ab+c" # # Note that escape sequences are retained as is. # # R(/\x20\+/).source() #=> "\\x20\\+" # source: () -> R(@to_native().source) # Returns a string containing the regular expression and its options (using the (?opts:source) notation. This string can be fed back in to Regexp::new to a regular expression with the same semantics as the original. (However, Regexp#== may not return true when comparing the two, as the source of the regular expression itself may differ, as the example shows). Regexp#inspect produces a generally more readable version of rxp. # # @example # r1 = R(/ab+c/) #=> /ab+c/ # s1 = r1.to_s() #=> "(ab+c)" # r2 = Regexp.new(s1) #=> /(ab+c)/ # r1 == r2 #=> false # r1.source() #=> "ab+c" # r2.source() #=> "(ab+c)" # # @example Ruby difference # # r1 = R(/ab+c/i) #=> /ab+c/i # s1 = r1.to_s() #=> "(ab+c)" # # i option is lost! # # Ruby: # /ab+c/i.to_s #=> "(?i-mx:ab+c)" # to_s: () -> R("(#{@source()})") valueOf: -> @__native__ # ---- Class methods -------------------------------------------------------- # The first form returns the MatchData object generated by the last # successful pattern match. Equivalent to reading the global variable $~. # The second form returns the nth field in this MatchData object. n can be a # string or symbol to reference a named capture. # # Note that the last_match is local to the thread and method scope of the # method that did the pattern match. # # @example # R(/c(.)t/)['=~'] 'cat' #=> 0 # Regexp.last_match() #=> #<MatchData "cat" 1:"a"> # Regexp.last_match(0) #=> "cat" # Regexp.last_match(1) #=> "a" # Regexp.last_match(2) #=> null # # @example Edge cases # R(/nomatch/)['=~'] 'foo' # Regexp.last_match(2) #=> null # # @example Unsupported Ruby Syntax: named captures # # /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ "var = val" # # R.Regexp.last_match() #=> #<MatchData "var = val" lhs:"var" rhs:"val"> # # R.Regexp.last_match(:lhs) #=> "var" # # R.Regexp.last_match(:rhs) #=> "val" # # @example Parameters # R.Regexp.last_match() → matchdata click to toggle source # R.Regexp.last_match(n) → str # @last_match: (n) -> if (n and R['$~']) then R['$~'][n] else R['$~'] # @see Regexp.escape # @quote: (pattern) -> @escape(pattern) # Escapes any characters that would have special meaning in a regular # expression. Returns a new escaped string, or self if no characters are # escaped. For any string, Regexp.new(Regexp.escape(str))=~str will be true. # # @example # R.Regexp.escape('\*?{}.') #=> \\\*\?\{\}\. # # @alias Regexp.quote # @escape: (pattern) -> pattern = pattern + '' pattern.replace(/([.?*+^$[\](){}|-])/g, "\\$1") # .replace(/[\\]/g, '\\\\') # .replace(/[\"]/g, '\\\"') # .replace(/[\/]/g, '\\/') # .replace(/[\b]/g, '\\b') .replace(/[\f]/g, '\\f') .replace(/[\n]/g, '\\n') .replace(/[\r]/g, '\\r') .replace(/[\t]/g, '\\t') .replace(/[\s]/g, '\\ ') # This must been an empty space ' ' # Return a Regexp object that is the union of the given patterns, i.e., will # match any of its parts. The patterns can be Regexp objects, in which case # their options will be preserved, or Strings. If no patterns are given, # returns /(?!)/. The behavior is unspecified if any given pattern contains # capture. # # @example # R.Regexp.union() #=> /(?!)/ # R.Regexp.union("penzance") #=> /penzance/ # R.Regexp.union("a+b*c") #=> /a\+b\*c/ # R.Regexp.union("skiing", "sledding") #=> /skiing|sledding/ # R.Regexp.union(["skiing", "sledding"]) #=> /skiing|sledding/ # R.Regexp.union(/dogs/, /cats/) #=> /(dogs)|(cats)/ # # @example Ruby difference # # RubyJS.Regexp.union(/dogs/, /cats/) # => /(dogs)|(cats)/ # # Ruby: # Regexp.union(/dogs/, /cats/) # => /(?-mix:dogs)|(?i-mx:cats)/ # # @example Edge cases # R.Regexp.union(["skiing", "sledding"], 'foo') #=> TypeError! # # @example Parameters # R.Regexp.union(pat1, pat2, ...) → new_regexp # R.Regexp.union(pats_ary) → new_regexp # @union: (args...) -> # FIX: check specs... return R(/(?!)/) if args.length == 0 first_arg = R(args[0]) if first_arg.is_array? and args.length == 1 args = first_arg sources = for arg in args arg = R(arg) if arg.is_regexp? then arg.to_s() else RCoerce.to_str(arg) # TODO: use proper Regexp.compile/new method new R.Regexp( new nativeRegExp( sources.join('|') )) # ---- Private methods ------------------------------------------------------ # @see Regexp.new @__compile__: (arg) -> try return new nativeRegExp(arg) catch error throw R.RegexpError.new() __flags__: -> if @casefold() then 'i' else '' # ---- Unsupported methods -------------------------------------------------- # @unsupported named captures are not supported in JS names: -> throw R.NotSupportedError.new() # @unsupported named captures are not supported in JS named_captures: -> throw R.NotSupportedError.new() # @unsupported JS options are different from Ruby options. options: -> throw R.NotSupportedError.new() # ---- Aliases -------------------------------------------------------------- @__add_default_aliases__(@prototype) fixedEncoding: @prototype.fixed_encoding
true
class RubyJS.Regexp extends RubyJS.Object # TODO: remove and document this. not needed/making sense in JS. IGNORECASE: 1 EXTENDED: 2 MULTILINE: 4 # ---- Constructors & Typecast ---------------------------------------------- constructor: (@__native__) -> @new: (arg) -> if typeof arg is 'string' # optimize R.Regexp.new("foo") with string primitive arg = @__compile__( arg ) else if R.Regexp.isRegexp(arg) else if arg.is_regexp? arg = arg.to_native() else arg = @__compile__( RCoerce.to_str_native(arg)) new R.Regexp(arg) @compile: @new @try_convert: (obj) -> if obj is null null else if @isRegexp(obj) new R.Regexp(obj) else if obj.to_regexp? obj.to_regexp() else null @isRegexp: (obj) -> obj?.is_regexp? or nativeToString.call(obj) is '[object RegExp]' # ---- RubyJSism ------------------------------------------------------------ # ---- Javascript primitives -------------------------------------------------- is_regexp: -> true to_native: -> @__native__ # ---- Instance methods ----------------------------------------------------- # @todo escaping of forward slashes: \ inspect: -> src = @source().to_native() R("/#{src}/#{@__flags__()}") # Equality—Two regexps are equal if their patterns are identical, they have # the same character set code, and their casefold? values are the same. # # @todo Check ruby-docs # # @example Basics (wrong online doc in ruby-doc.org) # # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # # @example aliased by #equals # # R(/abc/).equals(/abc/) #=> false # R(/abc/).equals(/abc/) #=> false # # @alias #equals, #eql # equals: (other) -> other = R(other) (other.to_native().source is @to_native().source) and (other.casefold() is @casefold()) # Case Equality—Synonym for Regexp#=~ used in case statements. # # a = "PI:NAME:<NAME>END_PI" # R(/^[a-z]*$/)['==='](a) # => false # R(/^[a-z]*$/)['==='](a) # => false # R(/^[A-Z]*$/)['==='](a) # => true # # @alias #equal_case # '===': (other) -> @match(other) != null '=~': (str, offset) -> matches = @match(str, offset) matches?.begin(0) # Returns the value of the case-insensitive flag. # # @example # # R(/a/).casefold() #=> false # R(/a/i).casefold() #=> true # # @example Unsupported Ruby syntax # # R(/(?i:a)/).casefold() #=> false # casefold: -> @to_native().ignoreCase # @unsupported currently no support for encodings in RubyJS encoding: -> throw R.NotSupportedError.new() # @alias to #== eql: -> @equals.apply(this, arguments) # @unsupported currently no support for encodings in RubyJS fixed_encoding: -> throw R.NotSupportedError.new() # @unsupported currently no support for hash in RubyJS hash: -> throw R.NotSupportedError.new() # Returns a MatchData object describing the match, or nil if there was no # match. This is equivalent to retrieving the value of the special variable # $~ following a normal match. If the second parameter is present, it # specifies the position in the string to begin the search. # # @example # R(/(.)(.)(.)/).match("abc")[2] # => "b" # R(/(.)(.)/).match("abc", 1)[2] # => "c" # # If a block is given, invoke the block with MatchData if match succeed, so that you can write # # pat.match(str) {|m| ...} # # instead of # # if m = pat.match(str) # ... # end # # The return value is a value from block execution in this case. # # @todo: # R(/(.)(.)?(.)/).match("fo") # # should => ["fo" 1:"f" 2:nil 3:"o">'] # # but => ["fo" 1:"f" 2:undefined 3:"o">'] # # @example Parameters # match(str) → matchdata or nil # match(str,pos) → matchdata or nil # match: (str, offset) -> block = __extract_block(nativeSlice.call(arguments)) if str is null R['$~'] = null else str = RCoerce.to_str_native(str) opts = {string: str, regexp: this} if offset opts.offset = offset str = str[offset..-1] if matches = str.match(@to_native()) R['$~'] = new R.MatchData(matches, opts) else R['$~'] = null result = R['$~'] if block if result then block(result) else new R.Array([]) else result quote: (pattern) -> R.Regexp.quote(pattern) # Returns the original string of the pattern. # # R(/ab+c/i).source() #=> "ab+c" # # Note that escape sequences are retained as is. # # R(/\x20\+/).source() #=> "\\x20\\+" # source: () -> R(@to_native().source) # Returns a string containing the regular expression and its options (using the (?opts:source) notation. This string can be fed back in to Regexp::new to a regular expression with the same semantics as the original. (However, Regexp#== may not return true when comparing the two, as the source of the regular expression itself may differ, as the example shows). Regexp#inspect produces a generally more readable version of rxp. # # @example # r1 = R(/ab+c/) #=> /ab+c/ # s1 = r1.to_s() #=> "(ab+c)" # r2 = Regexp.new(s1) #=> /(ab+c)/ # r1 == r2 #=> false # r1.source() #=> "ab+c" # r2.source() #=> "(ab+c)" # # @example Ruby difference # # r1 = R(/ab+c/i) #=> /ab+c/i # s1 = r1.to_s() #=> "(ab+c)" # # i option is lost! # # Ruby: # /ab+c/i.to_s #=> "(?i-mx:ab+c)" # to_s: () -> R("(#{@source()})") valueOf: -> @__native__ # ---- Class methods -------------------------------------------------------- # The first form returns the MatchData object generated by the last # successful pattern match. Equivalent to reading the global variable $~. # The second form returns the nth field in this MatchData object. n can be a # string or symbol to reference a named capture. # # Note that the last_match is local to the thread and method scope of the # method that did the pattern match. # # @example # R(/c(.)t/)['=~'] 'cat' #=> 0 # Regexp.last_match() #=> #<MatchData "cat" 1:"a"> # Regexp.last_match(0) #=> "cat" # Regexp.last_match(1) #=> "a" # Regexp.last_match(2) #=> null # # @example Edge cases # R(/nomatch/)['=~'] 'foo' # Regexp.last_match(2) #=> null # # @example Unsupported Ruby Syntax: named captures # # /(?<lhs>\w+)\s*=\s*(?<rhs>\w+)/ =~ "var = val" # # R.Regexp.last_match() #=> #<MatchData "var = val" lhs:"var" rhs:"val"> # # R.Regexp.last_match(:lhs) #=> "var" # # R.Regexp.last_match(:rhs) #=> "val" # # @example Parameters # R.Regexp.last_match() → matchdata click to toggle source # R.Regexp.last_match(n) → str # @last_match: (n) -> if (n and R['$~']) then R['$~'][n] else R['$~'] # @see Regexp.escape # @quote: (pattern) -> @escape(pattern) # Escapes any characters that would have special meaning in a regular # expression. Returns a new escaped string, or self if no characters are # escaped. For any string, Regexp.new(Regexp.escape(str))=~str will be true. # # @example # R.Regexp.escape('\*?{}.') #=> \\\*\?\{\}\. # # @alias Regexp.quote # @escape: (pattern) -> pattern = pattern + '' pattern.replace(/([.?*+^$[\](){}|-])/g, "\\$1") # .replace(/[\\]/g, '\\\\') # .replace(/[\"]/g, '\\\"') # .replace(/[\/]/g, '\\/') # .replace(/[\b]/g, '\\b') .replace(/[\f]/g, '\\f') .replace(/[\n]/g, '\\n') .replace(/[\r]/g, '\\r') .replace(/[\t]/g, '\\t') .replace(/[\s]/g, '\\ ') # This must been an empty space ' ' # Return a Regexp object that is the union of the given patterns, i.e., will # match any of its parts. The patterns can be Regexp objects, in which case # their options will be preserved, or Strings. If no patterns are given, # returns /(?!)/. The behavior is unspecified if any given pattern contains # capture. # # @example # R.Regexp.union() #=> /(?!)/ # R.Regexp.union("penzance") #=> /penzance/ # R.Regexp.union("a+b*c") #=> /a\+b\*c/ # R.Regexp.union("skiing", "sledding") #=> /skiing|sledding/ # R.Regexp.union(["skiing", "sledding"]) #=> /skiing|sledding/ # R.Regexp.union(/dogs/, /cats/) #=> /(dogs)|(cats)/ # # @example Ruby difference # # RubyJS.Regexp.union(/dogs/, /cats/) # => /(dogs)|(cats)/ # # Ruby: # Regexp.union(/dogs/, /cats/) # => /(?-mix:dogs)|(?i-mx:cats)/ # # @example Edge cases # R.Regexp.union(["skiing", "sledding"], 'foo') #=> TypeError! # # @example Parameters # R.Regexp.union(pat1, pat2, ...) → new_regexp # R.Regexp.union(pats_ary) → new_regexp # @union: (args...) -> # FIX: check specs... return R(/(?!)/) if args.length == 0 first_arg = R(args[0]) if first_arg.is_array? and args.length == 1 args = first_arg sources = for arg in args arg = R(arg) if arg.is_regexp? then arg.to_s() else RCoerce.to_str(arg) # TODO: use proper Regexp.compile/new method new R.Regexp( new nativeRegExp( sources.join('|') )) # ---- Private methods ------------------------------------------------------ # @see Regexp.new @__compile__: (arg) -> try return new nativeRegExp(arg) catch error throw R.RegexpError.new() __flags__: -> if @casefold() then 'i' else '' # ---- Unsupported methods -------------------------------------------------- # @unsupported named captures are not supported in JS names: -> throw R.NotSupportedError.new() # @unsupported named captures are not supported in JS named_captures: -> throw R.NotSupportedError.new() # @unsupported JS options are different from Ruby options. options: -> throw R.NotSupportedError.new() # ---- Aliases -------------------------------------------------------------- @__add_default_aliases__(@prototype) fixedEncoding: @prototype.fixed_encoding