diff --git a/app/assets/javascripts/workers/worker_world.js b/app/assets/javascripts/workers/worker_world.js index ae3cbec8a..d694e5743 100644 --- a/app/assets/javascripts/workers/worker_world.js +++ b/app/assets/javascripts/workers/worker_world.js @@ -43,6 +43,12 @@ importScripts('/javascripts/world.js'); //xhr.open("get", "script.js"); //xhr.send(); +// We could do way more from this: http://stackoverflow.com/questions/10653809/making-webworkers-a-safe-environment +Object.defineProperty(self, "XMLHttpRequest", { + get: function() { throw new Error("Access to XMLHttpRequest is forbidden."); }, + configurable: false +}); + self.transferableSupported = function transferableSupported() { // Not in IE, even in IE 11 try { diff --git a/app/lib/surface/CocoSprite.coffee b/app/lib/surface/CocoSprite.coffee index b8d24bf9d..9590507f2 100644 --- a/app/lib/surface/CocoSprite.coffee +++ b/app/lib/surface/CocoSprite.coffee @@ -54,7 +54,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass 'surface:ticked': 'onSurfaceTicked' constructor: (@thangType, options) -> - super() + super() @options = _.extend(_.cloneDeep(@options), options) @setThang @options.thang console.error @toString(), "has no ThangType!" unless @thangType @@ -69,7 +69,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass @stillLoading = true @thangType.fetch() @thangType.once 'sync', @onThangTypeLoaded, @ - + onThangTypeLoaded: -> @stillLoading = false @actions = @thangType.getActions() @@ -95,7 +95,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass sprite = new createjs.Shape() sprite.scaleX = sprite.scaleY = 1 / @options.resolutionFactor # temp, until these are re-exported with perspective - if @options.camera and @thangType.get('name') in ['Dungeon Floor', 'Grass', 'Goal Trigger', 'Obstacle'] + if @options.camera and @thangType.get('name') in ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Goal Trigger', 'Obstacle'] sprite.scaleY *= @options.camera.y2x @imageObject = sprite @displayObject.addChild(sprite) @@ -161,7 +161,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass updatePosition: -> return unless @thang?.pos and @options.camera? - if @thang.bobHeight + if @thang.bobHeight @thang.pos.z = @thang.pos.z + (Math.sin @ticker / @thang.bobTime) * 0.1 * @thang.bobHeight [p0, p1] = [@lastPos, @thang.pos] return if p0 and p0.x is p1.x and p0.y is p1.y and p0.z is p1.z and not @options.camera.tweeningZoomTo @@ -430,4 +430,4 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass name = AudioPlayer.nameForSoundReference sound instance = createjs.Sound.play name, "none", delay, 0, 0, volume # console.log @thang?.id, "played sound", name, "with delay", delay, "volume", volume, "and got sound instance", instance - instance \ No newline at end of file + instance diff --git a/app/views/editor/level/edit.coffee b/app/views/editor/level/edit.coffee index 8dfb9017c..e64641fee 100644 --- a/app/views/editor/level/edit.coffee +++ b/app/views/editor/level/edit.coffee @@ -70,7 +70,7 @@ module.exports = class EditorLevelView extends View return if @startsLoading super() new LevelSystem # temp; trigger the LevelSystem schema to be loaded, if it isn't already - @$el.find('a[data-toggle="tab"]').on 'shown', (e) => + @$el.find('a[data-toggle="tab"]').on 'shown.bs.tab', (e) => Backbone.Mediator.publish 'level:view-switched', e @thangsTab = @insertSubView new ThangsTabView world: @world, supermodel: @supermodel @settingsTab = @insertSubView new SettingsTabView world: @world, supermodel: @supermodel diff --git a/app/views/home_view.coffee b/app/views/home_view.coffee index d387b3729..758c0ee50 100644 --- a/app/views/home_view.coffee +++ b/app/views/home_view.coffee @@ -24,7 +24,7 @@ module.exports = class HomeView extends View afterRender: -> super() - @$el.find('.modal').on 'shown', -> + @$el.find('.modal').on 'shown.bs.modal', -> $('input:visible:first', @).focus() wizOriginal = "52a00d55cf1818f2be00000b" diff --git a/app/views/play/level/tome/spell_palette_entry_view.coffee b/app/views/play/level/tome/spell_palette_entry_view.coffee index bed5ae7c3..503846761 100644 --- a/app/views/play/level/tome/spell_palette_entry_view.coffee +++ b/app/views/play/level/tome/spell_palette_entry_view.coffee @@ -34,7 +34,7 @@ module.exports = class SpellPaletteEntryView extends View content: @doc.html() container: @$el.parent().parent().parent() ) - @$el.on 'show', => + @$el.on 'show.bs.popover', => # New, good event Backbone.Mediator.publish 'tome:palette-hovered', thang: @thang, prop: @doc.prop # Bad, old one for old scripts (TODO) diff --git a/app/views/play_view.coffee b/app/views/play_view.coffee index 4dfbcaee3..bde88cc61 100644 --- a/app/views/play_view.coffee +++ b/app/views/play_view.coffee @@ -175,5 +175,5 @@ module.exports = class PlayView extends View afterRender: -> super() - @$el.find('.modal').on 'shown', -> + @$el.find('.modal').on 'shown.bs.modal', -> $('input:visible:first', @).focus() diff --git a/server/levels/thangs/thang_type_schema.coffee b/server/levels/thangs/thang_type_schema.coffee index e8bbb79f0..8b70ccbaf 100644 --- a/server/levels/thangs/thang_type_schema.coffee +++ b/server/levels/thangs/thang_type_schema.coffee @@ -105,7 +105,7 @@ _.extend ThangTypeSchema.properties, shapes: c.object {title: 'Shapes', additionalProperties: ShapeObjectSchema} containers: c.object {title: 'Containers', additionalProperties: ContainerObjectSchema} animations: c.object {title: 'Animations', additionalProperties: RawAnimationObjectSchema} - kind: c.shortString { enum: ['Unit', 'Floor', 'Wall', 'Doodad', 'Misc'], default: 'Misc', title: 'Kind' } + kind: c.shortString { enum: ['Unit', 'Floor', 'Wall', 'Doodad', 'Misc', 'Mark'], default: 'Misc', title: 'Kind' } actions: c.object { title: 'Actions', additionalProperties: { $ref: '#/definitions/action' } } soundTriggers: c.object { title: "Sound Triggers", additionalProperties: c.array({}, { $ref: '#/definitions/sound' }) }, @@ -123,12 +123,12 @@ _.extend ThangTypeSchema.properties, title: 'Scale' type: 'number' positions: PositionsSchema - colorGroups: c.object + colorGroups: c.object title: 'Color Groups' additionalProperties: type:'array' format: 'thang-color-group' - items: {type:'string'} + items: {type:'string'} snap: c.object { title: "Snap", description: "In the level editor, snap positioning to these intervals.", required: ['x', 'y'] }, x: title: "Snap X"