medium-editor-rails 0.4.0 → 0.5.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 +1 -1
- data/lib/medium-editor-rails/version.rb +2 -2
- data/vendor/assets/javascripts/medium-editor.js +14 -5
- 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: 9798042447d173738c20be3fab4609eb56da5ce3
|
4
|
+
data.tar.gz: fcc476827e161c35e2b5d0adc88d0efd6cc2cfbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe24df05443c9970e9d135814d16de89aa424800e713d907bf0358b417d1673c41c8abf684319d8227ae171af27daa5906fa0e7be2045d077e5d7e0d406d0bb9
|
7
|
+
data.tar.gz: a3b0bc3d7c994e3091ce9a0bbca04a1b141416506bd0fc8df272c77d8ed363852b05d1090710b84ec7c63acea725b4beea4d55298313426f286404bd9f15b8eb
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This gem integrates [Medium Editor](https://github.com/daviferreira/medium-edito
|
|
7
7
|
|
8
8
|
## Version
|
9
9
|
|
10
|
-
The latest version of Medium Editor bundled by this gem is [1.6.
|
10
|
+
The latest version of Medium Editor bundled by this gem is [1.6.7](https://github.com/daviferreira/medium-editor/releases)
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -106,10 +106,13 @@ if (typeof module === 'object') {
|
|
106
106
|
|
107
107
|
// http://stackoverflow.com/questions/17907445/how-to-detect-ie11#comment30165888_17907562
|
108
108
|
// by rg89
|
109
|
-
isIE: ((navigator.appName === 'Microsoft Internet Explorer') || ((navigator.appName === 'Netscape') && (new RegExp(
|
109
|
+
isIE: ((navigator.appName === 'Microsoft Internet Explorer') || ((navigator.appName === 'Netscape') && (new RegExp('Trident/.*rv:([0-9]{1,}[.0-9]{0,})').exec(navigator.userAgent) !== null))),
|
110
110
|
|
111
111
|
init: function (elements, options) {
|
112
112
|
this.elements = typeof elements === 'string' ? document.querySelectorAll(elements) : elements;
|
113
|
+
if (this.elements.nodeType === 1) {
|
114
|
+
this.elements = [this.elements];
|
115
|
+
}
|
113
116
|
if (this.elements.length === 0) {
|
114
117
|
return;
|
115
118
|
}
|
@@ -218,7 +221,7 @@ if (typeof module === 'object') {
|
|
218
221
|
if (e.which === 9) {
|
219
222
|
// Override tab only for pre nodes
|
220
223
|
var tag = getSelectionStart().tagName.toLowerCase();
|
221
|
-
if (tag ===
|
224
|
+
if (tag === 'pre') {
|
222
225
|
e.preventDefault();
|
223
226
|
document.execCommand('insertHtml', null, ' ');
|
224
227
|
}
|
@@ -243,7 +246,9 @@ if (typeof module === 'object') {
|
|
243
246
|
'quote': '<li><button class="medium-editor-action medium-editor-action-quote" data-action="append-blockquote" data-element="blockquote">' + buttonLabels.quote + '</button></li>',
|
244
247
|
'orderedlist': '<li><button class="medium-editor-action medium-editor-action-orderedlist" data-action="insertorderedlist" data-element="ol">' + buttonLabels.orderedlist + '</button></li>',
|
245
248
|
'unorderedlist': '<li><button class="medium-editor-action medium-editor-action-unorderedlist" data-action="insertunorderedlist" data-element="ul">' + buttonLabels.unorderedlist + '</button></li>',
|
246
|
-
'pre': '<li><button class="medium-editor-action medium-editor-action-pre" data-action="append-pre" data-element="pre">' + buttonLabels.pre + '</button></li>'
|
249
|
+
'pre': '<li><button class="medium-editor-action medium-editor-action-pre" data-action="append-pre" data-element="pre">' + buttonLabels.pre + '</button></li>',
|
250
|
+
'indent': '<li><button class="medium-editor-action medium-editor-action-indent" data-action="indent" data-element="ul">' + buttonLabels.indent + '</button></li>',
|
251
|
+
'outdent': '<li><button class="medium-editor-action medium-editor-action-outdent" data-action="outdent" data-element="ul">' + buttonLabels.outdent + '</button></li>'
|
247
252
|
};
|
248
253
|
return buttonTemplates[btnType] || false;
|
249
254
|
},
|
@@ -265,7 +270,9 @@ if (typeof module === 'object') {
|
|
265
270
|
'quote': '<b>“</b>',
|
266
271
|
'orderedlist': '<b>1.</b>',
|
267
272
|
'unorderedlist': '<b>•</b>',
|
268
|
-
'pre': '<b>0101</b>'
|
273
|
+
'pre': '<b>0101</b>',
|
274
|
+
'indent': '<b>→</b>',
|
275
|
+
'outdent': '<b>←</b>'
|
269
276
|
};
|
270
277
|
if (buttonLabelType === 'fontawesome') {
|
271
278
|
customButtonLabels = {
|
@@ -279,7 +286,9 @@ if (typeof module === 'object') {
|
|
279
286
|
'quote': '<i class="fa fa-quote-right"></i>',
|
280
287
|
'orderedlist': '<i class="fa fa-list-ol"></i>',
|
281
288
|
'unorderedlist': '<i class="fa fa-list-ul"></i>',
|
282
|
-
'pre': '<i class="fa fa-code fa-lg"></i>'
|
289
|
+
'pre': '<i class="fa fa-code fa-lg"></i>',
|
290
|
+
'indent': '<i class="fa fa-indent"></i>',
|
291
|
+
'outdent': '<i class="fa fa-outdent"></i>'
|
283
292
|
};
|
284
293
|
} else if (typeof buttonLabelType === 'object') {
|
285
294
|
customButtonLabels = buttonLabelType;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: medium-editor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ahmet Sezgin Duran
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Medium Editor integrated in Rails asset pipeline
|
14
14
|
email:
|