mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-13 01:01:34 -05:00
33 lines
175 KiB
CoffeeScript
33 lines
175 KiB
CoffeeScript
|
WizardSettingsModal = require 'views/modal/wizard_settings_modal'
|
||
|
|
||
|
module.exports = ->
|
||
|
modal = new WizardSettingsModal
|
||
|
rootView = currentView
|
||
|
currentView.openModalView modal
|
||
|
|
||
|
wizardRequest = jasmine.Ajax.requests.mostRecent()
|
||
|
wizardRequest.response
|
||
|
status: 200
|
||
|
responseText: '{"_id":"5326914a5e02dd0000f5d20e","index":true,"slug":"wizard","name":"Wizard","creator":"5162fab9c92b4c751e000274","original":"52a00d55cf1818f2be00000b","__v":0,"raw":{"shapes":{"0":{"p":"AgHBdQgQgBgLgDQgRgFgKgMQgKgLgBgSIAAgOIAAgEIAAgBQgIgGgEgMQgDgJgBgRIACgyIAAgXIBtABIAGgBQAIAAAJACQANADAKAHQAHAGAFAJIAAAAIAFAJQADAKAAALIgEAkQgCAQgIALQgEAGgFAEIAAACQABAGgCAJQgFASgNAJQgMAJgRADIgQABIgJgBgAgoA1QAGAFAIACIARADIAEAAIAKABIAKgBQAIgBAHgEQAGgFAFgGQgJABgLAAIgKAAQgggCgTgFIgIgCQADAIAFAGgAg6gUQAAAKACAGIACAEIACADIAHAEQAFADAMADQARAEAXABIAJAAQAPAAAHgDQAEgBAEgEIACgFIADgKIADgfQgBgJgDgGIgHgHQgGgFgNAAIgDAAIgBABIgRAAIhAgBIgCArg","t":[19.4,11],"fc":"#1D2226"},"1":{"p":"AgUBBIgEAAQAMgFAKgKIAIAAQAKAAAJgBQgEAGgGAEQgHAFgIABIgJABgAgBAUQgZgBgSgFQgLgCgGgDIgGgFIgCgDQAdgBAVggQAIgOAGgOIAPAAIABgBIADAAQAMAAAHAEIAHAIQADAFAAAKIgCAeIgDAKIgDAGQgDADgFACQgGADgPAAgABChAIAAgBIAEABIAAAJIgEgJg","t":[20.9,10.9],"fc":"#6B4F32"},"2":{"p":"AgCA8QgIgCgGgFQgFgFgDgJIAIADQAQAEAjADQgKAKgMAEIgPgDgAgggDQgCgGAAgKIACgrIBAAAQgGAPgIANQgTAigdAAIgCgDg","t":[17,11],"fc":"#9F815D"},"3":{"p":"AApAvQgZgFgagMQgdgNgUgPQgNgIgIgJIgKgMIgIgOIAbgNIAPAOQAGAGANAJQASALAWALQATAHAcAIIAxAOIgEAdQgdgCgZgGg","t":[28.7,34.2,1,1,-25.4],"fc":"#1D2226"},"4":{"p":"ABWCjQgfAAgegGQgegGgbgMQg7gbgngvIABACIgIgKIgEgIIgCgGICEipIAOgPQATgPAXgFQALgCAOABIAMADIALAEIABAAQAYAKANAXQALAUABAaQABALgBAKIgKA5QgKAygXBjIgDAMgAA0h4QgLACgNAKIgMAKIghApQgbAhgWAYIgpAuIAAAAQAjArA0AWQAXALAbAGQAUAEAXABQARhbAIgtIAHg2QABgIgBgJQgCgQgHgLQgGgLgNgFQgJgDgJAAIgHAAg","t":[26.6,31.4,1,1,-25.4],"fc":"#1D2226"},"5":{"p":"AguAeQgEgCAphIIA5AQIgGBIQg/gIgZgGg","t":[35,38.9,1,1,-25.4],"fc":"#AF4F00"},"6":{"p":"AgpBTQAUgfARgmQAfhKgOglQAVAHAFA3QAFAqgGAiQgFAfgRAag","t":[32.3,25.9,1,1,-25.4],"fc":"#7E7E7E"},"7":{"p":"AgwANIAagXQAagZADgIQAYAKATAFIghBIQg2gVgLgKg","t":[30,39.9,1,1,-25.4],"fc":"#E28600"},"8":{"p":"AgHBgIgogLQAXghAQgnQAfhMgdgcQAPgIATAGQARAGADAJQACAHgTBGQgTBBgIASQgEANgEABIgBAAIgCAAg","t":[29.9,26,1,1,-25.4],"fc":"#8C8C8C"},"9":{"p":"Ag+AgQgjgagRgYIAxg/QAZAqBPAfQAoANAjAGQAEgCgVBJQhbAAhEgyg","t":[28.4,37.9,1,1,-25.4],"fc":"#FBA40B"},"10":{"p":"AgvBmQhJgpgFgSQANgUBwiEQAogyAvAUQAvAUgKBJQgOBVgXBqIgFAAQg1AAhMgrg","t":[26.7,31.7,1,1,-25.4],"fc":"#BABABA"},"11":{"p":"AgKAQIgJgEQAcgVALgOIgIAfQgCAKABAGIgVgIg","t":[34,44.1,1,1,-25.4],"fc":"#1D2226"},"12":{"p":"AAoBKQgMgDgGgJIgCgCIgNAGQgNAGgJABQgJACgKgCQgRgEgQgNQgNgMgJgPQgMgWABgXIADgPIAEgRQAEgKAEgGIAZAQIgEAKIgEANIgCAMIAAABQAAANAHANQAHAMAJAHQAIAIALACIAJABQAGgBAKgEIALgHIARgHIAQgEIADARQAAAFACABIACAAIAHgFQAKgMADgSQAHgdgNgsIAcgJQAQA0gIAkQgFAWgKAOQgKAOgNAGQgHADgIAAIgFAAg","t":[30,43.7,1,1,-25.4],"fc":"#1D2226"},"13":{"p":"AgkAxQgvgJAGgrQARAMAXAFQAsAIAdgyQAGgHAQgJIAPgGIAFAyQAAA0gggBQgJAAgIgKQgGgLgCgCQgKAXgcAAQgJAAgKgCg","t":[31,44.3,1,1,-25.4],"fc":"#EAB28C"},"14":{"p":"AgXA1QgbgHgQgiQgOgeAGgXQAFgRAWAGQANADAiANQATAFAkADQAaAFgFARQgGAUghAXQgcASgUAAQgGAAgGgCg","t":[28.3,45,1,1,-25.4],"fc":"#FFCDAB"},"15":{"p":"AhVAgQAugFAjgQQASgKAOgJIANgNIAIgLIABgCIAkAXIgLAKIgKAGIgVAMQgTAJgZAFQgUAEgXAAQgUAAgWgDgAAygiIAAAAg","t":[48.1,42.3],"fc":"#1D2226"},"16":{"p":"AAAAcQgQgEgVgIIgcgQIgJgGIAigZIADAFIAFAGIALALQAMAJAPAIQAeAQAnAHIgdABQgYAAgWgEg","t":[25.8,39.9],"fc":"#1D2226"},"17":{"p":"AhqBRQgegJgXgOQgOgJgKgKQgGgFgFgHIgKgQIgCgHIACgFQAFgPgBgPIgCgPIgDgKIgBgCIAlgVIADAHIACAGIADALQADALAAAMQABATgFAQIABABIAGAJQAHAJAJAHQASAOAZAJQAqAOA4gBQBBgCAmgLQAZgHAPgPQALgKAGgUIgMgoIgGgYQgDgRAAgLIAqAAIAIAqQAGAYAHAUIADAGIgDAGQgJATgFAIQgJAPgNAJQgUARgjAIQgoAJhGACIgHAAQg8AAgqgMg","t":[38,43.3],"fc":"#1D2226"},"18":{"p":"AhbAeQgbgIgSgIIgWgLIgVgNIAegeQAEAGAJAIQAHAHAJAFQASAMAUAFQAoAPAqgBQAogBAsgQQArgOAhgZIAUAkQg4AUggAJQgwANgsACIgJAAQgrAAgngLg","t":[37.5,35.2],"fc":"#1D2226"},"19":{"p":"AhoEwQgLgBgLgFQgMgEgZgQQgrgagZgNIg0gZIgQgEIgmgCIgLgBIgIgCIgEgCIgCgBIgDgDIgBgBIgBgBIgBAAIAAgBIgFgHIgGgKQgJgSgDgZIgBgVIAAgMIADgNQAIgUAWgRQARgNAWgIQAUgHAUgEQAXgEAQAAIAZgIIABgLQACgQADgKQADg1AHgrQADgZAGgZQAGgdAKgVQAHgOAIgKQAJgKAMgJQAVgPAbgJQAtgPA4ADQAxACAzAQQAaAJAVALIAWANIATANIABABIABABIABABQAqAkAXArQANAZAEAYQAFAYgDAcIAAACQgFAQgQAPQgQAOgSAAQgVABgPgQQgKgKgIgTIAAgBIgBgBQgBgMADgHQACgGAGgDQAFgCAEAAIAMAAQACgBABgHIgBgJIAAgBIAAAAIgDgBIgFgCQgLgCgMADQgXAHgDAWQgBAJABAMIABAIIAIAh
|
||
|
|
||
|
takenNames = ['bobson']
|
||
|
|
||
|
server = ->
|
||
|
request = jasmine.Ajax.requests.mostRecent()
|
||
|
name = request.url.split('/')[3]
|
||
|
if name in takenNames
|
||
|
request.response
|
||
|
status: 409
|
||
|
responseText: JSON.stringify name: name + '0'
|
||
|
else
|
||
|
request.response
|
||
|
status: 200
|
||
|
responseText: JSON.stringify name: name
|
||
|
console.log request
|
||
|
server = _.debounce server, 500
|
||
|
|
||
|
Backbone.listenTo modal, 'nameChanged', server
|
||
|
|
||
|
|
||
|
return
|