1
0
mirror of https://github.com/fazo96/markcloud.git synced 2025-01-10 11:04:21 +01:00

added ace editor

This commit is contained in:
Enrico Fasoli 2014-10-09 18:18:13 +02:00
parent 4f7f3c5de1
commit 5399e44104
5 changed files with 27 additions and 2 deletions

View File

@ -15,4 +15,4 @@ mrt:moment
reactive-var reactive-var
kevohagan:sweetalert kevohagan:sweetalert
accounts-twitter accounts-twitter
mandrill:ace

View File

@ -36,6 +36,7 @@ less@1.0.9
livedata@1.0.10 livedata@1.0.10
localstorage@1.0.0 localstorage@1.0.0
logging@1.0.3 logging@1.0.3
mandrill:ace@1.0.2
meteor-platform@1.1.1 meteor-platform@1.1.1
meteor@1.1.1 meteor@1.1.1
minifiers@1.1.0 minifiers@1.1.0
@ -63,6 +64,7 @@ sha@1.0.0
spacebars-compiler@1.0.2 spacebars-compiler@1.0.2
spacebars@1.0.2 spacebars@1.0.2
srp@1.0.0 srp@1.0.0
standard-app-packages@1.0.2
templating@1.0.7 templating@1.0.7
tracker@1.0.2 tracker@1.0.2
twitter@1.1.0 twitter@1.1.0

View File

@ -61,6 +61,9 @@ Router.map ->
controller: loggedInController controller: loggedInController
waitOn: -> Meteor.subscribe 'doc', @params._id waitOn: -> Meteor.subscribe 'doc', @params._id
data: -> docs.findOne @params._id data: -> docs.findOne @params._id
action: ->
if !Meteor.user() then @render '404'
else if @ready() then @render()
@route 'profile', @route 'profile',
path: '/@:user' path: '/@:user'
waitOn: -> waitOn: ->
@ -102,6 +105,13 @@ Template.home.events
else else
Meteor.subscribe 'user' Meteor.subscribe 'user'
notify type: 'success', msg: 'Logged in' notify type: 'success', msg: 'Logged in'
Template.editor.rendered = ->
ed = MandrillAce.getInstance(); ed.isFocused()
#ed.setTheme 'ace/theme/monokai'
ed.setMode 'ace/mode/markdown'
if Router.current().data().text
ed.ace.setValue Router.current().data().text
Template.editor.isPublic = -> return "checked" if @public is yes Template.editor.isPublic = -> return "checked" if @public is yes
Template.editor.showTitleChecked = -> return "checked" unless @showTitle is no Template.editor.showTitleChecked = -> return "checked" unless @showTitle is no
Template.editor.events Template.editor.events

View File

@ -49,6 +49,18 @@
#title { #title {
margin-bottom: 1em; margin-bottom: 1em;
} }
#mandrill_ace {
height: 400px;
/*
position: absolute;
width: 300px;
top: 0;
right: 0;
bottom: 0;
left: 0;
*/
}
#editor { #editor {
margin-top: 1em; margin-top: 1em;
margin-bottom: 1em; margin-bottom: 1em;

View File

@ -106,7 +106,8 @@ You will be able to delete your account and all your data whenever you want.
Show title in document Show title in document
<input type="checkbox" id="make-public" {{isPublic}}> <input type="checkbox" id="make-public" {{isPublic}}>
Make document visible on your profile Make document visible on your profile
<textarea id="editor" class="form-control" rows="10" placeholder="Write your markdown :)" autofocus>{{text}}</textarea> <!--<textarea id="editor" class="form-control" rows="10" placeholder="Write your markdown :)" autofocus>{{text}}</textarea>-->
{{> mandrill_ace}}
<p>Remember that this app is still in development so you should keep a backup <p>Remember that this app is still in development so you should keep a backup
of your text somewhere else in case something goes wrong!</p> of your text somewhere else in case something goes wrong!</p>
<button id="upload" class="btn btn-primary"> <button id="upload" class="btn btn-primary">