Updated some Bootstrap event names.
This commit is contained in:
parent
bd45930071
commit
6e40fa09a6
7 changed files with 18 additions and 12 deletions
app
assets/javascripts/workers
lib/surface
views
server/levels/thangs
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
instance
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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"
|
||||
|
|
Reference in a new issue