2016-02-17 14:33:50 -05:00
|
|
|
ModalView = require 'views/core/ModalView'
|
|
|
|
template = require 'templates/play/level/modal/picoctf-victory-modal'
|
|
|
|
|
|
|
|
module.exports = class PicoCTFVictoryModal extends ModalView
|
|
|
|
id: 'picoctf-victory-modal'
|
|
|
|
template: template
|
|
|
|
closesOnClickOutside: false
|
|
|
|
|
|
|
|
initialize: (options) ->
|
|
|
|
@session = options.session
|
|
|
|
@level = options.level
|
|
|
|
|
2016-03-04 14:44:36 -05:00
|
|
|
form = {flag: options.world.picoCTFFlag, pid: @level.picoCTFProblem.pid}
|
|
|
|
@supermodel.addRequestResource(url: '/picoctf/submit', method: 'POST', data: form, success: (response) =>
|
|
|
|
console.log 'submitted', form, 'and got response', response
|
2016-03-03 20:18:17 -05:00
|
|
|
).load()
|
2016-02-17 14:33:50 -05:00
|
|
|
|
|
|
|
@playSound 'victory'
|
|
|
|
|
|
|
|
onLoaded: ->
|
|
|
|
super()
|