diff options
Diffstat (limited to 'public')
| -rw-r--r-- | public/assets/javascripts/defaults.js | 7 | ||||
| -rw-r--r-- | public/assets/javascripts/mx/primitives/mx.text.js | 8 | ||||
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/scenery/types/text.js | 2 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/editor/MediaEditor.js | 10 | ||||
| -rw-r--r-- | public/assets/javascripts/ui/editor/TextEditor.js | 6 | ||||
| -rwxr-xr-x | public/assets/stylesheets/app.css | 12 |
6 files changed, 33 insertions, 12 deletions
diff --git a/public/assets/javascripts/defaults.js b/public/assets/javascripts/defaults.js index 038a882..c779233 100644 --- a/public/assets/javascripts/defaults.js +++ b/public/assets/javascripts/defaults.js @@ -12,3 +12,10 @@ app.defaults = { ceiling: [255,255,255], }, } + +marked.setOptions({ + gfm: true, + breaks: true, + sanitize: true, + smartypants: true, +}) diff --git a/public/assets/javascripts/mx/primitives/mx.text.js b/public/assets/javascripts/mx/primitives/mx.text.js index 7b8e595..b4089f3 100644 --- a/public/assets/javascripts/mx/primitives/mx.text.js +++ b/public/assets/javascripts/mx/primitives/mx.text.js @@ -26,11 +26,11 @@ MX.Text = MX.Object3D.extend({ ops.className && this.el.classList.add(ops.className) this.backface && this.el.classList.add("backface-visible") - this.el.classList.add("text") + this.el.classList.add("mx-text") this.el.classList.add("mx-scenery") this.inner = document.createElement("div") - this.inner.style.width = "100%" + this.inner.classList.add("inner") this.el.appendChild(this.inner) this.load(ops) @@ -41,11 +41,11 @@ MX.Text = MX.Object3D.extend({ if (ops.fontFamily) this.el.style.fontFamily = "'" + ops.fontFamily + "',sans-serif"; if (ops.fontSize) this.el.style.fontSize = ops.fontSize + "px"; - this.inner.innerHTML = ops.media.description || "" + this.inner.innerHTML = marked( ops.media.description || "" ) }, setText: function(text){ - this.inner.innerHTML = text + this.inner.innerHTML = marked( text || "" ) }, }) diff --git a/public/assets/javascripts/rectangles/engine/scenery/types/text.js b/public/assets/javascripts/rectangles/engine/scenery/types/text.js index 16c7a5c..20e9883 100644 --- a/public/assets/javascripts/rectangles/engine/scenery/types/text.js +++ b/public/assets/javascripts/rectangles/engine/scenery/types/text.js @@ -47,7 +47,7 @@ Scenery.types.text = Scenery.types.base.extend(function(base){ setText: function(text){ this.media.description = text - this.mx.setText(text) + this.mx.setText( text ) }, serialize: function(){ diff --git a/public/assets/javascripts/ui/editor/MediaEditor.js b/public/assets/javascripts/ui/editor/MediaEditor.js index 0a4d894..9b81db1 100644 --- a/public/assets/javascripts/ui/editor/MediaEditor.js +++ b/public/assets/javascripts/ui/editor/MediaEditor.js @@ -160,10 +160,12 @@ var MediaEditor = FormView.extend({ }, unbind: function(){ - if (this.scenery && this.tainted) { - this.scenery.media.title = this.$name.val() - this.scenery.media.description = this.$description.val() - Minotaur.watch( app.router.editorView.settings ) + if (this.scenery) { + if (this.tainted) { + this.scenery.media.title = this.$name.val() + this.scenery.media.description = this.$description.val() + Minotaur.watch( app.router.editorView.settings ) + } if (this.scenery.mx) { this.scenery.mx.bound = false this.scenery.mx.el.classList.remove("picked") diff --git a/public/assets/javascripts/ui/editor/TextEditor.js b/public/assets/javascripts/ui/editor/TextEditor.js index 0d082ca..3d3124b 100644 --- a/public/assets/javascripts/ui/editor/TextEditor.js +++ b/public/assets/javascripts/ui/editor/TextEditor.js @@ -55,8 +55,10 @@ var TextEditor = FormView.extend({ }, unbind: function(){ - if (this.scenery && this.tainted) { - Minotaur.watch( app.router.editorView.settings ) + if (this.scenery) { + if (this.tainted) { + Minotaur.watch( app.router.editorView.settings ) + } if (this.scenery.mx) { this.scenery.mx.bound = false diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index e746cad..02bbe6a 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -698,6 +698,16 @@ iframe.embed { .mx-object3d video { pointer-events: none; } +.mx-text { + overflow: hidden; +} +.mx-text .inner { + width: 100%; + pointer-events: none; +} +.mx-text p { + margin-bottom: 1em; +} #keyhint { position: fixed; bottom:0; @@ -2117,7 +2127,7 @@ a[data-role="forgot-password"] { background: white; padding: 10px; margin: 20px auto; -position: relative; + position: relative; } .collaborators button { |
