ace_vimtura-rails 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ace_vimtura/ace_vimtura.js +49 -23
- data/lib/ace_vimtura/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: cb80492b1f9659e15ae344bafe36fb65eb6d3e09
|
4
|
+
data.tar.gz: 17fc6630d6fbaa639f6258f40fc95ba4bc36cb44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8a42bdcb6ba6c7c844c746c82dadefdf88611ade5b9d75cf383c6995d843c6d161f5041727f4b06978a90ea5f5a44aa66ead09131e9a8cf56fe7b33fc07fe8c
|
7
|
+
data.tar.gz: 65e720ff86a38399b6b90342a37bfc9571a83156f4a2d7703bb9cb9c222813c1b59010c15d5e562b4fd1b5992bb6f745216b370bf3f339ff6c3f819505e77228
|
@@ -21,7 +21,10 @@ define(['ace', 'ace/keyboard/vim', 'style'], function() {
|
|
21
21
|
};
|
22
22
|
AceVimtura.Renderers = {};
|
23
23
|
AceVimtura.Renderers.Vendor = {};
|
24
|
-
AceVimtura.Views = {
|
24
|
+
AceVimtura.Views = {
|
25
|
+
Help: '<h2>Ace Vimtura</h2><h3>Index</h3><h3>Mappings</h3><p>Type in <code>:map</code> to see mappings.<h3>Commands</h3><p><code>:help</code> show this text </p><p><code>:pre</code> toggle preview mode</p><p><code>:map</code> see key mappings</p><p><code>:w</code> or <code>:write</code> save current text to your browser</p><p><code>:q</code> or <code>:quit</code> close preview and also disable rendering</p><p><code>:set</code> or <code>:se</code> sets variable if value given, shows current value otherwise<h3>Variables</h3><p>theme</p><p>renderer<small>renderer only</small></p><p>filetype <small>changes both renderer and syntax hightlighter</small></p>',
|
26
|
+
Mappings: '<h2>Supported key bindings</h2><h3>Motion:</h3><p>h, j, k, l</p><p> gj, gk </p><p> e, E, w, W, b, B, ge, gE </p><p>f<character>, F<character>, t<character>, T<character> </p><p> $, ^, 0, -, +, _ </p><p> gg, G </p><p> % </p><p> \'<character>, `<character> </p><h3>Operator:</h3><p> d, y, c </p><p> dd, yy, cc </p><p> g~, g~g~ </p><p> >, <, >>, << </p><h3> Operator-Motion: </h3><p> x, X, D, Y, C, ~ </p><h3> Action: </h3><p> a, i, s, A, I, S, o, O </p><p> zz, z., z<CR>, zt, zb, z- </p><p> J </p><p> u, Ctrl-r </p><p> m<character> </p><p> r<character> </p><h3> Modes: </h3><p> ESC - leave insert mode, visual mode, and clear input state. </p><p> Ctrl-[, Ctrl-c - same as ESC.</p>'
|
27
|
+
};
|
25
28
|
AceVimtura.Utils = {};
|
26
29
|
AceVimtura.init = function(id, options) {
|
27
30
|
var div, i, key, len;
|
@@ -41,11 +44,10 @@ define(['ace', 'ace/keyboard/vim', 'style'], function() {
|
|
41
44
|
this.ace.dom = div;
|
42
45
|
this.ace.setKeyboardHandler('ace/keyboard/vim');
|
43
46
|
this.vimapi = ace.require('ace/keyboard/vim').CodeMirror.Vim;
|
44
|
-
this.setFiletype('markdown');
|
45
47
|
this._initPreview();
|
46
48
|
this.setTheme(AceVimtura.options.theme);
|
47
49
|
this._defineCommands();
|
48
|
-
this.load() || this.showHelp();
|
50
|
+
this.load() || this.showHelp() && this.setFiletype('markdown');
|
49
51
|
if (options.autoFocus) {
|
50
52
|
return this.ace.focus();
|
51
53
|
}
|
@@ -96,14 +98,22 @@ define(['ace', 'ace/keyboard/vim', 'style'], function() {
|
|
96
98
|
return this.filetypeName;
|
97
99
|
};
|
98
100
|
AceVimtura.goSplit = function() {
|
99
|
-
|
100
|
-
|
101
|
-
|
101
|
+
return require(['preview'], (function(_this) {
|
102
|
+
return function() {
|
103
|
+
_this.ace.dom.classList.remove('fullscreen');
|
104
|
+
_this.preview.enable();
|
105
|
+
return _this.isSplit = true;
|
106
|
+
};
|
107
|
+
})(this));
|
102
108
|
};
|
103
109
|
AceVimtura.goFullscreen = function() {
|
104
|
-
|
105
|
-
|
106
|
-
|
110
|
+
return require(['preview'], (function(_this) {
|
111
|
+
return function() {
|
112
|
+
_this.ace.dom.classList.add('fullscreen');
|
113
|
+
_this.preview.disable();
|
114
|
+
return _this.isSplit = false;
|
115
|
+
};
|
116
|
+
})(this));
|
107
117
|
};
|
108
118
|
AceVimtura.toggleSplit = function() {
|
109
119
|
if (this.isSplit) {
|
@@ -112,29 +122,45 @@ define(['ace', 'ace/keyboard/vim', 'style'], function() {
|
|
112
122
|
return this.goSplit();
|
113
123
|
}
|
114
124
|
};
|
115
|
-
AceVimtura.save = function() {
|
125
|
+
AceVimtura.save = function(filename) {
|
116
126
|
var ls;
|
127
|
+
if (filename == null) {
|
128
|
+
filename = null;
|
129
|
+
}
|
117
130
|
ls = window.localStorage;
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
131
|
+
filename || (filename = this.filename || 'noname');
|
132
|
+
ls.ace_vimtura_value = this.ace.getValue();
|
133
|
+
return ls.ace_vimtura_filetype = this.getFiletype();
|
134
|
+
};
|
135
|
+
AceVimtura.load = function(filename) {
|
136
|
+
var ls, val;
|
137
|
+
if (filename == null) {
|
138
|
+
filename = null;
|
139
|
+
}
|
122
140
|
ls = window.localStorage;
|
123
|
-
if (
|
124
|
-
return this.ace.setValue(data);
|
125
|
-
} else {
|
141
|
+
if (!(ls && (val = ls.ace_vimtura_value))) {
|
126
142
|
return false;
|
127
143
|
}
|
144
|
+
this.ace.setValue(val);
|
145
|
+
this.setFiletype(ls.ace_vimtura_filetype);
|
146
|
+
return true;
|
128
147
|
};
|
129
148
|
AceVimtura.showHelp = function() {
|
130
|
-
|
131
|
-
|
132
|
-
|
149
|
+
return require(['preview'], (function(_this) {
|
150
|
+
return function() {
|
151
|
+
_this.goSplit();
|
152
|
+
return _this.preview.html(_this.Views.Help);
|
153
|
+
};
|
154
|
+
})(this));
|
133
155
|
};
|
134
156
|
AceVimtura.showMappings = function() {
|
135
|
-
|
136
|
-
|
137
|
-
|
157
|
+
return require(['preview'], (function(_this) {
|
158
|
+
return function() {
|
159
|
+
_this.save();
|
160
|
+
_this.goSplit();
|
161
|
+
return _this.preview.html(_this.Views.Mappings);
|
162
|
+
};
|
163
|
+
})(this));
|
138
164
|
};
|
139
165
|
AceVimtura.setVariable = function(variable, value) {
|
140
166
|
var methBase;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ace_vimtura-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
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-06-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|