diff options
| -rw-r--r-- | public/assets/javascripts/mx/primitives/mx.text.js | 4 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/editor/ColorControl.js | 8 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/editor/TextEditor.js | 94 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/lib/LabColorPicker.js | 4 | ||||
| -rwxr-xr-x | public/assets/stylesheets/app.css | 23 | ||||
| -rw-r--r-- | server/lib/auth/mail.js | 4 | ||||
| -rw-r--r-- | server/lib/middleware.js | 4 | ||||
| -rw-r--r-- | server/lib/util.js | 2 | ||||
| -rw-r--r-- | server/lib/views/index.js | 2 | ||||
| -rw-r--r-- | views/controls/editor/collaborators.ejs | 2 | ||||
| -rw-r--r-- | views/controls/editor/color-control.ejs | 2 | ||||
| -rw-r--r-- | views/controls/editor/text-editor.ejs | 23 | ||||
| -rw-r--r-- | views/controls/editor/toolbar.ejs | 2 | ||||
| -rw-r--r-- | views/controls/reader/embed.ejs | 2 | ||||
| -rw-r--r-- | views/mail/collaborator.html.ejs | 2 | ||||
| -rw-r--r-- | views/mail/collaborator.text.ejs | 2 | ||||
| -rw-r--r-- | views/mail/welcome.html.ejs | 2 | ||||
| -rw-r--r-- | views/mail/welcome.text.ejs | 2 | ||||
| -rw-r--r-- | views/partials/meta.ejs | 2 |
19 files changed, 151 insertions, 35 deletions
diff --git a/public/assets/javascripts/mx/primitives/mx.text.js b/public/assets/javascripts/mx/primitives/mx.text.js index 1d975ec..a0f9283 100644 --- a/public/assets/javascripts/mx/primitives/mx.text.js +++ b/public/assets/javascripts/mx/primitives/mx.text.js @@ -38,16 +38,18 @@ MX.Text = MX.Object3D.extend({ load: function(ops){ var media = ops.media - if (media.color) this.el.style.color = media.color; if (media.font) this.setFont(media.font) this.setText( media.description ) }, setFont: function(font){ + if (! font.color || font.color[0] == "#") { font.color = [0,0,0] } + this.inner.style.fontFamily = "'" + font.family + "',sans-serif" this.el.style.fontSize = (2 * font.size) + "pt" this.el.style.textAlign = font.align + this.el.style.color = rgb_string(font.color) }, setText: function(text){ diff --git a/public/assets/javascripts/ui/editor/ColorControl.js b/public/assets/javascripts/ui/editor/ColorControl.js index 0c5463e..9ab2623 100644 --- a/public/assets/javascripts/ui/editor/ColorControl.js +++ b/public/assets/javascripts/ui/editor/ColorControl.js @@ -28,8 +28,8 @@ var ColorControl = View.extend({ this.parent = opt.parent this.colorPicker = new LabColorPicker(this, 155, 155) - this.$("#color-picker").append( this.colorPicker.canvas ) - this.$("#color-picker").append( this.colorPicker.cursor ) + this.$(".color-picker").append( this.colorPicker.canvas ) + this.$(".color-picker").append( this.colorPicker.cursor ) this.$(".slider").append( this.colorPicker.brightness ) this.$swatches = this.$(".swatch") @@ -85,7 +85,7 @@ var ColorControl = View.extend({ this.toggle(false) }, - pick: function(rgb, Lab){ + pickColor: function(rgb, Lab){ this.labColor = Lab this.setSwatchColor(this.mode, rgb) // console.log(rgb) @@ -142,7 +142,7 @@ var ColorControl = View.extend({ setHue: function(e){ var color = $(e.currentTarget).data('color') this.labColor = this.colorPicker.load(color) - this.pick(color, this.labColor) + this.pickColor(color, this.labColor) } }) diff --git a/public/assets/javascripts/ui/editor/TextEditor.js b/public/assets/javascripts/ui/editor/TextEditor.js index 2949943..d897f91 100644 --- a/public/assets/javascripts/ui/editor/TextEditor.js +++ b/public/assets/javascripts/ui/editor/TextEditor.js @@ -11,25 +11,47 @@ var TextEditor = FormView.extend({ "change [name=font-family]": 'changeFontFamily', "change [name=font-size]": 'changeFontSize', "change [name=text-align]": 'changeTextAlign', + "click .swatch": 'showColorPicker', + "click [data-role=hide-color-picker]": 'hideColorPicker', + "click [data-role=hide-text-editor]": 'hide', "input [name=text-body]": 'changeText', "click [data-role=destroy-text]": "destroy", + "click .colors span": "setHue", }, initialize: function(opt){ this.parent = opt.parent this.__super__.initialize.call(this) - this.$settings = this.$(".setting") + this.$textSettings = this.$(".text-setting") + this.$colorSettings = this.$(".color-setting") this.$noTextMessage = this.$(".no-text") this.$fontFamily = this.$("[name=font-family]") this.$fontSize = this.$("[name=font-size]") this.$textBody = this.$("[name=text-body]") this.$textAlign = this.$("[name=text-align]") - + this.$swatch = this.$(".swatch") + + this.colorPicker = new LabColorPicker(this, 155, 155) + this.$(".color-picker").append( this.colorPicker.canvas ) + this.$(".color-picker").append( this.colorPicker.cursor ) + this.$(".slider").append( this.colorPicker.brightness ) + + this.$colors = this.$(".colors") + this.parent.colorControl.colors.forEach(function(color){ + var $swatch = $("<span>") + $swatch.css("background-color","rgb(" + color + ")") + $swatch.data('color', color) + this.$colors.append($swatch) + }.bind(this)) + + this.$(".setting").hide() + app.on("cancel-scenery", function(){ this.createMode(true) $("body").toggleClass("addText", false) }.bind(this)) + }, toggle: function(state){ @@ -55,6 +77,7 @@ var TextEditor = FormView.extend({ if (this.scenery) { this.unbind() } + Scenery.resize.hide() this.toggle(false) }, @@ -68,7 +91,8 @@ var TextEditor = FormView.extend({ this.scenery = scenery this.scenery.mx.bound = true this.scenery.mx.el.classList.add("picked") - }, + this.scenery.media.font.color = this.scenery.media.font.color || [0,0,0] + }, unbind: function(){ if (this.scenery) { @@ -88,7 +112,8 @@ var TextEditor = FormView.extend({ }, createMode: function(state){ - this.$settings.toggle(! state) + this.hideColorPicker() + this.$textSettings.toggle(! state) this.$noTextMessage.toggle(!! state) $("body").toggleClass("addText", !! state) }, @@ -109,6 +134,7 @@ var TextEditor = FormView.extend({ this.$fontFamily.val( this.scenery.media.font.family ) this.$fontSize.val( this.scenery.media.font.size ) this.$textAlign.val( this.scenery.media.font.align ) + this.setSwatchColor( this.scenery.media.font.color ) this.createMode(false) @@ -147,5 +173,65 @@ var TextEditor = FormView.extend({ this.scenery.remove() this.hide() }, + + setSwatchColor: function(rgb){ + this.$swatch.css("background-color", rgb_string(rgb)) + }, + showColorPicker: function(){ + this.$textSettings.hide() + this.$colorSettings.show() + + var color = this.scenery.media.font.color + this.labColor = this.colorPicker.load(color) + this.pickColor(color, this.labColor) + + this.$el.addClass("color-mode") + }, + + hideColorPicker: function(e){ + e && e.preventDefault() + this.$textSettings.show() + this.$colorSettings.hide() + this.$el.removeClass("color-mode") + }, + + pickColor: function(rgb, Lab){ + this.labColor = Lab + this.setSwatchColor(rgb) + this.scenery.setFont({ color: rgb }) + this.tainted = true + }, + + setHue: function(e){ + var color = $(e.currentTarget).data('color') + this.labColor = this.colorPicker.load(color) + this.pickColor(color, this.labColor) + }, + + initialState: null, + + begin: function(){ + // this.initialState = this.serialize() + }, + + serialize: function(){ + return { + rgb: Walls.colors[ this.mode ] + } + }, + + finalize: function(){ + if (! this.initialState) { return } + UndoStack.push({ + type: 'update-colors', + undo: this.initialState, + redo: this.serialize(), + }) + + this.initialState = null + + // TODO: watch individual wall object here + Minotaur.watch( app.router.editorView.settings ) + }, }) diff --git a/public/assets/javascripts/ui/lib/LabColorPicker.js b/public/assets/javascripts/ui/lib/LabColorPicker.js index 0e1563a..7ddcdd5 100644 --- a/public/assets/javascripts/ui/lib/LabColorPicker.js +++ b/public/assets/javascripts/ui/lib/LabColorPicker.js @@ -64,7 +64,7 @@ var LabColorPicker = function (parent, w, h) { var y = mix( j/hh, b_range[0], b_range[1] ) var rgb = xyz2rgb(hunterlab2xyz(val, x, y)).map(Math.round) this.moveCursor(i, j) - parent.pick( rgb, [val,x,y] ) + parent.pickColor( rgb, [val,x,y] ) } this.load = function(rgba){ var Lab = xyz2hunterlab(rgb2xyz(rgba)) @@ -107,7 +107,7 @@ var LabColorPicker = function (parent, w, h) { this.updateBrightness = function(){ parent.labColor[0] = parseFloat( $brightnessControl.val() ) var rgb = base.setLab( parent.labColor ) - parent.pick(rgb, parent.labColor) + parent.pickColor(rgb, parent.labColor) } this.setBrightness = function(Lab){ $brightnessControl.val(Lab[0]) diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 9924b33..ef7736f 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -596,7 +596,6 @@ iframe.embed { border-top: 0px solid; font-weight: 500; font-size: 40px; - text-transform:capitalize; } .docs .content img { max-width: 90%; @@ -643,8 +642,8 @@ iframe.embed { text-decoration:underline; } -.docs .content.doc-privacy p, -.docs .content.doc-terms p { +.docs .content.doc-privacy, +.docs .content.doc-terms { font-size: 15px; line-height: 25px; font-weight: 300; @@ -1845,7 +1844,7 @@ input[type="range"]::-webkit-slider-thumb { 50% { opacity:0.7; } } -#color-picker { +.color-picker { position: relative; } .colorPicker { @@ -1983,6 +1982,22 @@ input[type="range"]::-webkit-slider-thumb { transition: -webkit-transform 0.2s ease-in-out; width: 210px; } +#textEditor.settings { + width: 320px; +} +#textEditor .swatch { + position: relative; + top: 6px; + margin-left: 6px; + cursor: pointer; + float: none; +} +#textEditor.color-mode { + width: 180px; +} +#textEditor.color-mode h4:after { + content: ' Colors'; +} .settings.active { -webkit-transform: translateY(0px); diff --git a/server/lib/auth/mail.js b/server/lib/auth/mail.js index 0ba6d5d..eac4007 100644 --- a/server/lib/auth/mail.js +++ b/server/lib/auth/mail.js @@ -6,7 +6,7 @@ var email = require("emailjs"), var mail = { - from: 'Vvalls <info@vvalls.com>', + from: 'VValls <info@vvalls.com>', templates: {}, init: function(){ @@ -40,7 +40,7 @@ var mail = { text: mail.templates.welcome.text(user), from: mail.from, to: user.email, - subject: "Welcome to Vvalls", + subject: "Welcome to VValls", attachment: [ { data: mail.templates.welcome.html(user), alternative: true }, ] diff --git a/server/lib/middleware.js b/server/lib/middleware.js index 870451a..60f2e46 100644 --- a/server/lib/middleware.js +++ b/server/lib/middleware.js @@ -41,10 +41,10 @@ var middleware = { res.locals.config = config res.locals.profile = null res.locals.ogImage = "" - res.locals.ogTitle = "Vvalls" + res.locals.ogTitle = "VValls" res.locals.ogUrl = "http://vvalls.com/" res.locals.ogDescription = "3D gallery space, fully customizable" - res.locals.ogAuthor = "Vvalls" + res.locals.ogAuthor = "VValls" res.locals.opt = {} next() }, diff --git a/server/lib/util.js b/server/lib/util.js index 0a71cb7..1f63a30 100644 --- a/server/lib/util.js +++ b/server/lib/util.js @@ -31,7 +31,7 @@ util.escapeRegExp = function (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } util.htmlize = function(s) { - return ("<p>" + s.replace(/\n/g,"</p><p>") + "</p>").replace(/<p><\/p>/, "<br>") + return s.replace(/\n/g,"<br>") } util.cleanQuery = function (query) { diff --git a/server/lib/views/index.js b/server/lib/views/index.js index b3a15c2..31cb1db 100644 --- a/server/lib/views/index.js +++ b/server/lib/views/index.js @@ -169,7 +169,7 @@ var views = module.exports = { isOwnProfile: isOwnProfile, profile: user, projects: projects || [], - ogTitle: "Vvalls: Profile of " + user.displayName, + ogTitle: "VValls: Profile of " + user.displayName, ogUrl: "http://vvalls.com/profile/" + user.username + "/", ogImage: user.photo, }) diff --git a/views/controls/editor/collaborators.ejs b/views/controls/editor/collaborators.ejs index 8ad8c00..5de7d25 100644 --- a/views/controls/editor/collaborators.ejs +++ b/views/controls/editor/collaborators.ejs @@ -7,7 +7,7 @@ <h2>Collaborators</h2> <p> - To invite others to contribute to this project, submit their email address below. They'll receive an email with instructions to join this project and register if they're not a Vvalls user yet. + To invite others to contribute to this project, submit their email address below. They'll receive an email with instructions to join this project and register if they're not a VValls user yet. </p> <form> diff --git a/views/controls/editor/color-control.ejs b/views/controls/editor/color-control.ejs index 1fa1688..c035e24 100644 --- a/views/controls/editor/color-control.ejs +++ b/views/controls/editor/color-control.ejs @@ -4,7 +4,7 @@ <div class="colors"> </div> - <div id="color-picker"> + <div class="color-picker"> </div> <div class="slider"> diff --git a/views/controls/editor/text-editor.ejs b/views/controls/editor/text-editor.ejs index c30cb67..baf9239 100644 --- a/views/controls/editor/text-editor.ejs +++ b/views/controls/editor/text-editor.ejs @@ -5,7 +5,7 @@ Click a wall to add text. </div> - <div class="setting"> + <div class="setting text-setting"> <select name="font-family"> <option>Baskerville</option> <option>Brush Script</option> @@ -46,14 +46,29 @@ <option value="right">Right</option> <option value="justify">Justify</option> </select> + <div class="swatch"></div> </div> - <div class="setting"> + <div class="setting text-setting"> <textarea name="text-body"></textarea> </div> - <div class="setting"> - <a href="#" class="warn btn" data-role="destroy-text">remove from wall</a> + <div class="setting text-setting"> + <a href="#" class="btn left" data-role="hide-text-editor">done</a> + <a href="#" class="warn btn right" data-role="destroy-text">remove from wall</a> + </div> + + <div class="setting color-setting"> + <a href="#" class="btn" data-role="hide-color-picker">done</a><br><br> + + <div class="colors"> + </div> + + <div class="color-picker"> + </div> + + <div class="slider"> + </div> </div> </div> diff --git a/views/controls/editor/toolbar.ejs b/views/controls/editor/toolbar.ejs index 23d5eb4..6960cbc 100644 --- a/views/controls/editor/toolbar.ejs +++ b/views/controls/editor/toolbar.ejs @@ -32,12 +32,10 @@ data-role='toggle-color-control' data-info="edit room colors" class="ion-ios7-sunny-outline"></span> -[[ if (user.username == "asdf") { ]] <span data-role='toggle-text-editor' data-info="add text to wall" class="ion-ios7-compose-outline"></span> -[[ } ]] <!-- <span data-role='toggle-map-view' diff --git a/views/controls/reader/embed.ejs b/views/controls/reader/embed.ejs index cc21c74..814644d 100644 --- a/views/controls/reader/embed.ejs +++ b/views/controls/reader/embed.ejs @@ -4,7 +4,7 @@ <div class="rap"> <div class="holder"> <div class="inner vvbox"> - <h2>Embed Vvalls</h2> + <h2>Embed VValls</h2> <p> This code generates an iframe which will embed this room in your website or blog. diff --git a/views/mail/collaborator.html.ejs b/views/mail/collaborator.html.ejs index 2a08a1c..c4832d1 100644 --- a/views/mail/collaborator.html.ejs +++ b/views/mail/collaborator.html.ejs @@ -7,7 +7,7 @@ <p> <a href="http://vvalls.com/profile/[[- username ]]">[[- username ]]</a> has invited you to join the project - <a href="http://vvalls.com/project/[[- projectSlug ]]">[[- projectName ]]</a> on Vvalls. + <a href="http://vvalls.com/project/[[- projectSlug ]]">[[- projectName ]]</a> on VValls. </p> <p> diff --git a/views/mail/collaborator.text.ejs b/views/mail/collaborator.text.ejs index 52d39b6..2de78ad 100644 --- a/views/mail/collaborator.text.ejs +++ b/views/mail/collaborator.text.ejs @@ -1,5 +1,5 @@ -[[- username ]] has invited you to join the project [[- projectName ]] on Vvalls. +[[- username ]] has invited you to join the project [[- projectName ]] on VValls. Accept the invitation below: diff --git a/views/mail/welcome.html.ejs b/views/mail/welcome.html.ejs index b2c329f..1d45faf 100644 --- a/views/mail/welcome.html.ejs +++ b/views/mail/welcome.html.ejs @@ -6,7 +6,7 @@ </p> <p> - Welcome to Vvalls, [[- username ]] + Welcome to VValls, [[- username ]] </p> <p> diff --git a/views/mail/welcome.text.ejs b/views/mail/welcome.text.ejs index 02b449b..5c0b51d 100644 --- a/views/mail/welcome.text.ejs +++ b/views/mail/welcome.text.ejs @@ -1,4 +1,4 @@ -Welcome to Vvalls, [[- username ]] +Welcome to VValls, [[- username ]] http://www.vvalls.com diff --git a/views/partials/meta.ejs b/views/partials/meta.ejs index f1b6f48..defb187 100644 --- a/views/partials/meta.ejs +++ b/views/partials/meta.ejs @@ -25,7 +25,7 @@ <meta property="og:type" content="website" /> <meta property="og:image" content="[[- ogImage ]]" /> <meta property="og:url" content="[[- ogUrl ]]" /> - <meta property="og:site_name" content="Vvalls" /> + <meta property="og:site_name" content="VValls" /> <link rel="icon" href="/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link href='/assets/stylesheets/ionicons.css' rel='stylesheet' type='text/css'> |
