From b6aa758e4a760c244594dd5bc17004347a66913d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 30 Sep 2014 11:59:53 -0400 Subject: keep showing resize dots after you click --- public/assets/javascripts/ui/editor/EditorView.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'public/assets/javascripts/ui/editor/EditorView.js') diff --git a/public/assets/javascripts/ui/editor/EditorView.js b/public/assets/javascripts/ui/editor/EditorView.js index e11f189..f200d0f 100644 --- a/public/assets/javascripts/ui/editor/EditorView.js +++ b/public/assets/javascripts/ui/editor/EditorView.js @@ -46,6 +46,8 @@ var EditorView = View.extend({ hideExtras: function(){ this.mediaEditor.hide() - } + Scenery.resize.hide() + Scenery.hovering = false + } }) -- cgit v1.2.3-70-g09d2 From 70efc8490ed885317f757eb5252bc14cdcb51a31 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 30 Sep 2014 12:44:42 -0400 Subject: crisper dots --- public/assets/javascripts/rectangles/engine/scenery/resize.js | 3 ++- public/assets/javascripts/ui/editor/EditorSettings.js | 4 ++++ public/assets/javascripts/ui/editor/EditorView.js | 2 +- public/assets/stylesheets/app.css | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'public/assets/javascripts/ui/editor/EditorView.js') diff --git a/public/assets/javascripts/rectangles/engine/scenery/resize.js b/public/assets/javascripts/rectangles/engine/scenery/resize.js index dc1a39a..ca77525 100644 --- a/public/assets/javascripts/rectangles/engine/scenery/resize.js +++ b/public/assets/javascripts/rectangles/engine/scenery/resize.js @@ -31,7 +31,8 @@ Scenery.resize = new function(){ // generate a dot element base.build_dot = function(side) { var dot = new MX.Object3D('.dot') - dot.width = dot.height = dot_side + dot.width = dot.height = dot_side * 2 + dot.scale = 0.5 dot.side = side $(dot.el).on({ mouseenter: function(){ base.hovering = true }, diff --git a/public/assets/javascripts/ui/editor/EditorSettings.js b/public/assets/javascripts/ui/editor/EditorSettings.js index 8a88f7a..f47eb81 100644 --- a/public/assets/javascripts/ui/editor/EditorSettings.js +++ b/public/assets/javascripts/ui/editor/EditorSettings.js @@ -65,6 +65,10 @@ var EditorSettings = FormView.extend({ data.media && Scenery.deserialize(data.media) } + + app.on("rooms-built", function(){ + Walls.paint() + }) }, showCollaborators: function(e){ diff --git a/public/assets/javascripts/ui/editor/EditorView.js b/public/assets/javascripts/ui/editor/EditorView.js index f200d0f..6636a8c 100644 --- a/public/assets/javascripts/ui/editor/EditorView.js +++ b/public/assets/javascripts/ui/editor/EditorView.js @@ -31,7 +31,7 @@ var EditorView = View.extend({ ready: function(data){ $("#map").hide() - + this.settings.load(data) }, diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 6929cef..a2db961 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -673,8 +673,8 @@ iframe.embed { .dot { background:white; - border-radius:20px; - border: 1px solid black; + border-radius: 50%; + border: 2px solid black; } .image { -- cgit v1.2.3-70-g09d2 From ddac735a463278e245e566105ace3e32c723128c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 1 Oct 2014 19:07:10 -0400 Subject: stubbing in text editor stuff --- .../assets/javascripts/ui/editor/EditorToolbar.js | 17 ++++- public/assets/javascripts/ui/editor/EditorView.js | 1 + public/assets/javascripts/ui/editor/TextEditor.js | 41 ++++++++++++ server/lib/views/index.js | 2 + views/controls/editor/light-control.ejs | 72 +++++++++------------- views/controls/editor/text-editor.ejs | 32 ++++++++++ views/controls/editor/toolbar.ejs | 10 ++- views/editor.ejs | 1 + views/partials/header.ejs | 3 + views/partials/scripts.ejs | 1 + 10 files changed, 131 insertions(+), 49 deletions(-) create mode 100644 public/assets/javascripts/ui/editor/TextEditor.js create mode 100644 views/controls/editor/text-editor.ejs (limited to 'public/assets/javascripts/ui/editor/EditorView.js') diff --git a/public/assets/javascripts/ui/editor/EditorToolbar.js b/public/assets/javascripts/ui/editor/EditorToolbar.js index bb4b145..513306d 100644 --- a/public/assets/javascripts/ui/editor/EditorToolbar.js +++ b/public/assets/javascripts/ui/editor/EditorToolbar.js @@ -10,7 +10,7 @@ var EditorToolbar = View.extend({ "click [data-role='destroy-media']": 'destroyMedia', "click [data-role='toggle-wallpaper-panel']": 'toggleWallpaper', "click [data-role='toggle-light-control']": 'toggleLightControl', - "click [data-role='edit-wall-text']": 'editWallText', + "click [data-role='toggle-text-editor']": 'toggleTextEditor', }, initialize: function(opt){ @@ -24,6 +24,7 @@ var EditorToolbar = View.extend({ toggleSettings: function(){ // this.resetMode() + this.parent.textEditor.hide() this.parent.lightControl.hide() this.parent.wallpaperPicker.hide() this.parent.mediaEditor.hide() @@ -47,6 +48,7 @@ var EditorToolbar = View.extend({ resetControls: function(){ $(".inuse").removeClass("inuse") + this.parent.textEditor.hide() this.parent.wallpaperPicker.hide() this.parent.lightControl.hide() this.parent.settings.hide() @@ -107,6 +109,7 @@ var EditorToolbar = View.extend({ $("[data-role='toggle-wallpaper-panel']").toggleClass("inuse", state) this.parent.mediaEditor.hide() this.parent.lightControl.hide() + this.parent.textEditor.hide() this.parent.settings.hide() this.parent.wallpaperPicker.toggle(state) }, @@ -117,12 +120,20 @@ var EditorToolbar = View.extend({ $("[data-role='toggle-light-control']").toggleClass("inuse", state) this.parent.mediaEditor.hide() this.parent.wallpaperPicker.hide() + this.parent.textEditor.hide() this.parent.settings.hide() this.parent.lightControl.toggle(state) }, - editWallText: function(){ - }, + toggleTextEditor: function(){ + var state = ! $("[data-role='toggle-text-editor']").hasClass("inuse") + this.resetMode() + $("[data-role='toggle-text-editor']").toggleClass("inuse", state) + this.parent.mediaEditor.hide() + this.parent.wallpaperPicker.hide() + this.parent.settings.hide() + this.parent.textEditor.toggle(state) + }, }) diff --git a/public/assets/javascripts/ui/editor/EditorView.js b/public/assets/javascripts/ui/editor/EditorView.js index 6636a8c..83db532 100644 --- a/public/assets/javascripts/ui/editor/EditorView.js +++ b/public/assets/javascripts/ui/editor/EditorView.js @@ -16,6 +16,7 @@ var EditorView = View.extend({ this.mediaEditor = new MediaEditor ({ parent: this }) this.wallpaperPicker = new WallpaperPicker ({ parent: this }) this.lightControl = new LightControl ({ parent: this }) + this.textEditor = new TextEditor ({ parent: this }) this.collaborators = new Collaborators ({ parent: this }) }, diff --git a/public/assets/javascripts/ui/editor/TextEditor.js b/public/assets/javascripts/ui/editor/TextEditor.js new file mode 100644 index 0000000..0319a31 --- /dev/null +++ b/public/assets/javascripts/ui/editor/TextEditor.js @@ -0,0 +1,41 @@ + +var TextEditor = FormView.extend({ + el: "#textEditor", + + events: { + "keydown": 'taint', + "focus [name]": "clearMinotaur", + "mousedown": "stopPropagation", + "change [name=font-family]": 'changeFontFamily', + "change [name=font-size]": 'changeFontSize', + "input [name=text-body]": 'changeText', + "click [data-role=destroy-media]": "destroy", + }, + + initialize: function(opt){ + this.parent = opt.parent + this.__super__.initialize.call(this) + + this.$fontFamily = this.$("[name=font-family]") + this.$fontSize = this.$("[name=font-size]") + this.$textBody = this.$("[name=text-body]") + }, + + toggle: function(state){ + this.$el.toggleClass("active", state); + }, + + taint: function(e){ + e.stopPropagation() + }, + + changeFontFamily: function(){ + }, + + changeFontSize: function(){ + }, + + changeText: function(){ + }, + +}) diff --git a/server/lib/views/index.js b/server/lib/views/index.js index 29b84d8..ca48159 100644 --- a/server/lib/views/index.js +++ b/server/lib/views/index.js @@ -27,6 +27,7 @@ views.editor_new = function (req, res) { res.redirect('/') } else { + res.locals.opt.editing = true res.render('editor') } } @@ -36,6 +37,7 @@ views.editor = function (req, res) { res.redirect('/') } else if (req.isOwner || req.isCollaborator || req.isStaff) { + res.locals.opt.editing = true res.render('editor') } else { diff --git a/views/controls/editor/light-control.ejs b/views/controls/editor/light-control.ejs index 37a243c..fdf95a7 100644 --- a/views/controls/editor/light-control.ejs +++ b/views/controls/editor/light-control.ejs @@ -8,49 +8,33 @@
- -
-
- -
-
- -
-
- -
-
- + +
+
+ +
+
+ +
+
+ +
+
+
+ +

Preset Styles

+
+ + Wireframe + + + Shaded + + + P.Funk + + + SeaPunk +
-

Preset Styles

-
- - Wireframe - - - Shaded - - - P.Funk - - - SeaPunk - -
- - - diff --git a/views/controls/editor/text-editor.ejs b/views/controls/editor/text-editor.ejs new file mode 100644 index 0000000..205fbdf --- /dev/null +++ b/views/controls/editor/text-editor.ejs @@ -0,0 +1,32 @@ +
+

Edit Text

+ +
+ + +
+ +
+ +
+ + +
+ + \ No newline at end of file diff --git a/views/controls/editor/toolbar.ejs b/views/controls/editor/toolbar.ejs index 63df73c..92807e1 100644 --- a/views/controls/editor/toolbar.ejs +++ b/views/controls/editor/toolbar.ejs @@ -12,9 +12,8 @@ data-role='destroy-media' data-info="delete media" class="icon-ios7-trash-outline"> - --> @@ -26,6 +25,13 @@ data-role='toggle-light-control' data-info="edit room colors" class="icon-ios7-sunny-outline"> + +[[ if (user.username == "test12343") { ]] + +[[ } ]] diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 88d832d..065385d 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -67,7 +67,10 @@ [[ } else if (! profile) { ]] Profile [[ } ]] + + [[ if (opt.editing) { ]] + [[ } ]] [[ } else { ]] diff --git a/views/partials/scripts.ejs b/views/partials/scripts.ejs index 2e2d8b6..1ce180a 100644 --- a/views/partials/scripts.ejs +++ b/views/partials/scripts.ejs @@ -100,6 +100,7 @@ + -- cgit v1.2.3-70-g09d2