summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/javascripts/mx/extensions/mx.movements.js5
-rw-r--r--public/assets/javascripts/rectangles/engine/sculpture/types/_object.js12
-rw-r--r--public/assets/javascripts/ui/editor/SculptureEditor.js31
-rwxr-xr-xpublic/assets/stylesheets/app.css3
-rw-r--r--views/controls/editor/sculpture.ejs10
5 files changed, 54 insertions, 7 deletions
diff --git a/public/assets/javascripts/mx/extensions/mx.movements.js b/public/assets/javascripts/mx/extensions/mx.movements.js
index bc71fc4..931caac 100644
--- a/public/assets/javascripts/mx/extensions/mx.movements.js
+++ b/public/assets/javascripts/mx/extensions/mx.movements.js
@@ -162,7 +162,10 @@ MX.Movements = function (cam) {
case 8: // backspace
e.preventDefault()
- if (app.controller.mediaEditor.scenery) {
+ if (app.controller.sculptureEditor.sculpture) {
+ app.controller.sculptureEditor.sculpture.remove()
+ }
+ else if (app.controller.mediaEditor.scenery) {
app.controller.mediaEditor.scenery.remove()
}
else if (app.controller.textEditor.scenery) {
diff --git a/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js b/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js
index 6c93b41..48fd96a 100644
--- a/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js
+++ b/public/assets/javascripts/rectangles/engine/sculpture/types/_object.js
@@ -43,6 +43,18 @@ Sculpture.types.base = Fiber.extend(function(base){
this.move.unbind()
},
+ setOutline: function(val){
+ this.outline = val
+ // show/hide outline
+ },
+ setOutlineColor: function(val){
+ this.outlineColor = val
+ // set outline color
+ },
+ setBillboard: function(val){
+ this.billboard = val
+ },
+
remove: function(){
if (this.removed) return
this.removed = true
diff --git a/public/assets/javascripts/ui/editor/SculptureEditor.js b/public/assets/javascripts/ui/editor/SculptureEditor.js
index cce000e..ab0ccd2 100644
--- a/public/assets/javascripts/ui/editor/SculptureEditor.js
+++ b/public/assets/javascripts/ui/editor/SculptureEditor.js
@@ -10,12 +10,15 @@ var SculptureEditor = FormView.extend({
"mousedown": "stopPropagation",
"change [name=keyframe]": "seek",
"change [name=autoplay]": "setAutoplay",
+ "change [name=billboard]": "setBillboard",
+ "change [name=outline]": "setOutline",
+ "change [name=outlineColor]": "setOutlineColor",
"change [name=loop]": "setLoop",
"change [name=mute]": "setMute",
"change [name=width]": 'changeWidth',
"change [name=height]": 'changeHeight',
"change [name=units]": 'changeUnits',
- "click [data-role=destroy-media]": "destroy",
+ "click [data-role=destroy-sculpture]": "destroy",
},
initialize: function(opt){
@@ -25,6 +28,10 @@ var SculptureEditor = FormView.extend({
this.$name = this.$("[name=name]")
this.$description = this.$("[name=description]")
+ this.$billboard = this.$("[name=billboard]")
+ this.$outline = this.$("[name=outline]")
+ this.$outlineColor = this.$("[name=outlineColor]")
+
// image fields
this.$width = this.$("[name=width]")
this.$height = this.$("[name=height]")
@@ -71,6 +78,11 @@ var SculptureEditor = FormView.extend({
this.$description.val(media.description)
this.setDimensions()
this.$units.val( "ft" )
+
+ this.$outline.prop( 'checked', !! media.outline )
+ this.$outlineColor.val( media.outlineColor )
+ this.$billboard.prop( 'checked', !! media.billboard )
+
switch (media.type) {
case "image":
@@ -138,6 +150,23 @@ var SculptureEditor = FormView.extend({
this.tainted = true
},
+
+ setBillboard: function(){
+ var checked = this.$billboard.prop('checked')
+ this.sculpture.setBillboard(checked)
+ this.tainted = true
+ },
+ setOutline: function(){
+ var checked = this.$outline.prop('checked')
+ this.sculpture.setOutline(checked)
+ this.tainted = true
+ },
+ setOutlineColor: function(){
+ var color = this.$outlineColor.val()
+ this.sculpture.setOutlineColor(color)
+ this.tainted = true
+ },
+
setDimensions: function(){
if (! this.sculpture) return
this.$width.unitVal( Number(this.sculpture.naturalDimensions.a * this.sculpture.scale) || "" )
diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css
index b23b50b..6e97500 100755
--- a/public/assets/stylesheets/app.css
+++ b/public/assets/stylesheets/app.css
@@ -2455,6 +2455,9 @@ input[type="range"]::-webkit-slider-thumb {
#mediaEditor .setting.number [type=text] {
width: 140px;
}
+#sculptureEditor .setting.number input[type=text] {
+ width: 130px;
+}
.playButton,.muteButton {
border-radius: 50%;
diff --git a/views/controls/editor/sculpture.ejs b/views/controls/editor/sculpture.ejs
index 21e5039..4b8535a 100644
--- a/views/controls/editor/sculpture.ejs
+++ b/views/controls/editor/sculpture.ejs
@@ -13,14 +13,14 @@
</div>
<div class="setting">
- <input type="checkbox" name="outline" value="1" id="sculpture_outline">
- <label for="sculpture_outline">Show outline?</label>
- <input type="color" name="color" value="#000000">
+ <input type="checkbox" name="outline" value="1" id="sculpture-outline">
+ <label for="sculpture-outline">Show outline?</label>
+ <input type="color" name="outlineColor" value="#000000">
</div>
<div class="setting">
- <input type="checkbox" name="billboard" value="1" id="sculpture_billboard">
- <label for="sculpture_billboard">Billboard?</label>
+ <input type="checkbox" name="billboard" value="1" id="sculpture-billboard">
+ <label for="sculpture-billboard">Billboard?</label>
</div>
<div class="setting number">