m_d_e-rails 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/app/assets/javascripts/m_d_e.js.coffee +8 -3
- data/lib/m_d_e/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb148ccf1829efbdc6a395786d0c39f58d8005a0
|
4
|
+
data.tar.gz: 4ddb1a1bfe1ae6266998c4dd2ffc266135d9d3e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9eb0514eeb7a721be42e1d1cd558ab1b1f62ae9d3ce5d4858c9ef5370df31fb15644e4443dff9f6c6d7f0572e39268aabf2bbcbb9a6b3d950fc21873bd66269
|
7
|
+
data.tar.gz: 4fb1fcc2d0992ef40267c8a63ac3ff21241ca97fb4c9774600c7b8deafe540ea2969acb5d2ba515d08c6089eb2e64e112cb8142ec29bcd294e0f4b4fbcdd5078
|
data/README.md
CHANGED
@@ -29,7 +29,10 @@ Or install it yourself as:
|
|
29
29
|
```javascript
|
30
30
|
//=require 'm_d_e'
|
31
31
|
...
|
32
|
-
editor = new Editor('textarea_id') // hidden textarea
|
32
|
+
var editor = new Editor('textarea_id'); // hidden textarea
|
33
|
+
editor.setTheme('solarized_light'); // optional
|
34
|
+
editor.setViMode(); // enable Vi key bindings
|
35
|
+
editor.setEmacsMode(); // you guessed!
|
33
36
|
```
|
34
37
|
|
35
38
|
2. `application.css`:
|
@@ -15,7 +15,6 @@ class window.Editor
|
|
15
15
|
mdm = require('ace/mode/markdown').Mode
|
16
16
|
@aedit.getSession().setMode(new mdm())
|
17
17
|
|
18
|
-
this.setTheme 'solarized_light'
|
19
18
|
$('#mde_preview').html(marked @aedit.getValue() )
|
20
19
|
|
21
20
|
@aedit.getSession().on 'change', this._change.bind(this)
|
@@ -23,7 +22,7 @@ class window.Editor
|
|
23
22
|
|
24
23
|
window.editor = this
|
25
24
|
|
26
|
-
_change: (e)
|
25
|
+
_change: (e)=>
|
27
26
|
clearTimeout(@ttimer) if @ttimer
|
28
27
|
@ttimer = window.setTimeout(() ->
|
29
28
|
$('#mde_preview').html(marked editor.aedit.getValue())
|
@@ -32,9 +31,15 @@ class window.Editor
|
|
32
31
|
$("##{@input_field}").val(editor.aedit.getValue())
|
33
32
|
true
|
34
33
|
|
35
|
-
setTheme: (name)
|
34
|
+
setTheme: (name) =>
|
36
35
|
@aedit.setTheme @theme_prefix + name
|
37
36
|
|
37
|
+
setViMode: =>
|
38
|
+
@aedit.setKeyboardHandler('ace/keyboard/vim')
|
39
|
+
|
40
|
+
setEmacsMode: =>
|
41
|
+
@aedit.setKeyboardHandler('ace/keyboard/emacs')
|
42
|
+
|
38
43
|
_syncScrolls: (val) ->
|
39
44
|
fs = parseInt $('#mde_editor').css('font-size')
|
40
45
|
$('#mde_preview').scrollTop(val * fs)
|
data/lib/m_d_e/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m_d_e-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- d-theus
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|