medium-editor-rails 2.0.0 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/medium-editor-rails/version.rb +2 -2
- data/vendor/assets/javascripts/medium-editor.js +27 -25
- data/vendor/assets/stylesheets/medium-editor/themes/default.css +3 -3
- data/vendor/assets/stylesheets/medium-editor/themes/mani.css +2 -2
- data/vendor/assets/stylesheets/medium-editor/themes/roman.css +2 -2
- 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: d8fb5c49e21f1b03042ba8ad59518b87b3cf192d
|
4
|
+
data.tar.gz: 7ab4220ad510d1fb71fbbb4701a8cc9f0bdad1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a23c6ac2a76c3d10ca7618f1a9c5497c46e824c0b2f2a267ae615402aeeb135ed9faeac8e46fcb272e1dbdac84060a734e04ca73bf4c21166e52debf385e14c
|
7
|
+
data.tar.gz: ff5df8ce9a1824510b46b8598960b8088c82d1c180f16859e17a12509039c68492d985267cd3d0937f0abbc5c10b677a4b47badee2ced3a97d5724e71f19f864
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
|
2
2
|
#### [Current]
|
3
|
+
* [8efdb52](../../commit/8efdb52) - __(Ahmet Sezgin Duran)__ Update Medium Editor files
|
4
|
+
* [b838798](../../commit/b838798) - __(Ahmet Sezgin Duran)__ Merge tag '2.0.0' into develop
|
5
|
+
|
6
|
+
2.0.0
|
7
|
+
|
8
|
+
#### 2.0.0
|
9
|
+
* [418af6d](../../commit/418af6d) - __(Ahmet Sezgin Duran)__ Bump versions 2.0.0 and 3.0.0
|
3
10
|
* [c615afc](../../commit/c615afc) - __(Ahmet Sezgin Duran)__ Update Medium Editor files
|
4
11
|
* [ba615ed](../../commit/ba615ed) - __(Ahmet Sezgin Duran)__ Merge tag '1.4.5' into develop
|
5
12
|
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ This gem integrates [Medium Editor](https://github.com/daviferreira/medium-edito
|
|
8
8
|
|
9
9
|
## Version
|
10
10
|
|
11
|
-
The latest version of Medium Editor bundled by this gem is [3.0.
|
11
|
+
The latest version of Medium Editor bundled by this gem is [3.0.7](https://github.com/daviferreira/medium-editor/releases)
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
@@ -176,7 +176,9 @@ if (!("classList" in document.createElement("_"))) {
|
|
176
176
|
if (typeof module === 'object') {
|
177
177
|
module.exports = factory;
|
178
178
|
} else if (typeof define === 'function' && define.amd) {
|
179
|
-
define(
|
179
|
+
define(function () {
|
180
|
+
return factory;
|
181
|
+
});
|
180
182
|
} else {
|
181
183
|
root.MediumEditor = factory;
|
182
184
|
}
|
@@ -848,11 +850,7 @@ var DefaultButton,
|
|
848
850
|
queryCommandState: function () {
|
849
851
|
var queryState = null;
|
850
852
|
if (this.options.useQueryState) {
|
851
|
-
|
852
|
-
queryState = this.base.options.ownerDocument.queryCommandState(this.getAction());
|
853
|
-
} catch (exc) {
|
854
|
-
queryState = null;
|
855
|
-
}
|
853
|
+
queryState = this.base.queryCommandState(this.getAction());
|
856
854
|
}
|
857
855
|
return queryState;
|
858
856
|
},
|
@@ -2377,6 +2375,28 @@ function MediumEditor(elements, options) {
|
|
2377
2375
|
return this;
|
2378
2376
|
},
|
2379
2377
|
|
2378
|
+
// Wrapper around document.queryCommandState for checking whether an action has already
|
2379
|
+
// been applied to the current selection
|
2380
|
+
queryCommandState: function (action) {
|
2381
|
+
var fullAction = /^full-(.+)$/gi,
|
2382
|
+
match,
|
2383
|
+
queryState = null;
|
2384
|
+
|
2385
|
+
// Actions starting with 'full-' need to be modified since this is a medium-editor concept
|
2386
|
+
match = fullAction.exec(action);
|
2387
|
+
if (match) {
|
2388
|
+
action = match[1];
|
2389
|
+
}
|
2390
|
+
|
2391
|
+
try {
|
2392
|
+
queryState = this.options.ownerDocument.queryCommandState(action);
|
2393
|
+
} catch (exc) {
|
2394
|
+
queryState = null;
|
2395
|
+
}
|
2396
|
+
|
2397
|
+
return queryState;
|
2398
|
+
},
|
2399
|
+
|
2380
2400
|
execAction: function (action, opts) {
|
2381
2401
|
/*jslint regexp: true*/
|
2382
2402
|
var fullAction = /^full-(.+)$/gi,
|
@@ -2427,26 +2447,8 @@ function MediumEditor(elements, options) {
|
|
2427
2447
|
return this.options.ownerDocument.execCommand(action, false, null);
|
2428
2448
|
},
|
2429
2449
|
|
2430
|
-
// TODO: move these two methods to selection.js
|
2431
|
-
// http://stackoverflow.com/questions/15867542/range-object-get-selection-parent-node-chrome-vs-firefox
|
2432
|
-
rangeSelectsSingleNode: function (range) {
|
2433
|
-
var startNode = range.startContainer;
|
2434
|
-
return startNode === range.endContainer &&
|
2435
|
-
startNode.hasChildNodes() &&
|
2436
|
-
range.endOffset === range.startOffset + 1;
|
2437
|
-
},
|
2438
|
-
|
2439
2450
|
getSelectedParentElement: function () {
|
2440
|
-
|
2441
|
-
range = this.selectionRange;
|
2442
|
-
if (this.rangeSelectsSingleNode(range) && range.startContainer.childNodes[range.startOffset].nodeType !== 3) {
|
2443
|
-
selectedParentElement = range.startContainer.childNodes[range.startOffset];
|
2444
|
-
} else if (range.startContainer.nodeType === 3) {
|
2445
|
-
selectedParentElement = range.startContainer.parentNode;
|
2446
|
-
} else {
|
2447
|
-
selectedParentElement = range.startContainer;
|
2448
|
-
}
|
2449
|
-
return selectedParentElement;
|
2451
|
+
return Selection.getSelectedParentElement();
|
2450
2452
|
},
|
2451
2453
|
|
2452
2454
|
execFormatBlock: function (el) {
|
@@ -10,7 +10,7 @@
|
|
10
10
|
border: 1px solid #000;
|
11
11
|
background-color: #242424;
|
12
12
|
background: -webkit-linear-gradient(bottom, #242424, rgba(36, 36, 36, 0.75));
|
13
|
-
background: linear-gradient(bottom, #242424, rgba(36, 36, 36, 0.75));
|
13
|
+
background: linear-gradient(to bottom, #242424, rgba(36, 36, 36, 0.75));
|
14
14
|
border-radius: 5px;
|
15
15
|
box-shadow: 0 0 3px #000; }
|
16
16
|
.medium-editor-toolbar li button {
|
@@ -23,7 +23,7 @@
|
|
23
23
|
background-color: #242424;
|
24
24
|
color: #fff;
|
25
25
|
background: -webkit-linear-gradient(bottom, #242424, rgba(36, 36, 36, 0.89));
|
26
|
-
background: linear-gradient(bottom, #242424, rgba(36, 36, 36, 0.89));
|
26
|
+
background: linear-gradient(to bottom, #242424, rgba(36, 36, 36, 0.89));
|
27
27
|
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
|
28
28
|
-webkit-transition: background-color .2s ease-in;
|
29
29
|
transition: background-color .2s ease-in; }
|
@@ -40,7 +40,7 @@
|
|
40
40
|
background-color: #000;
|
41
41
|
color: #fff;
|
42
42
|
background: -webkit-linear-gradient(bottom, #242424, rgba(0, 0, 0, 0.89));
|
43
|
-
background: linear-gradient(bottom, #242424, rgba(0, 0, 0, 0.89)); }
|
43
|
+
background: linear-gradient(to bottom, #242424, rgba(0, 0, 0, 0.89)); }
|
44
44
|
|
45
45
|
.medium-editor-toolbar-form {
|
46
46
|
background: #242424;
|
@@ -6,7 +6,7 @@
|
|
6
6
|
background-color: #dee7f0;
|
7
7
|
background-color: rgba(222, 231, 240, 0.95);
|
8
8
|
background: -webkit-linear-gradient(bottom, #dee7f0, #ffffff);
|
9
|
-
background: linear-gradient(bottom, #dee7f0, #ffffff);
|
9
|
+
background: linear-gradient(to bottom, #dee7f0, #ffffff);
|
10
10
|
border-radius: 2px;
|
11
11
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
|
12
12
|
.medium-editor-toolbar li button {
|
@@ -33,7 +33,7 @@
|
|
33
33
|
background-color: rgba(92, 144, 199, 0.45);
|
34
34
|
color: #000;
|
35
35
|
background: -webkit-linear-gradient(bottom, #dee7f0, rgba(0, 0, 0, 0.1));
|
36
|
-
background: linear-gradient(bottom, #dee7f0, rgba(0, 0, 0, 0.1)); }
|
36
|
+
background: linear-gradient(to bottom, #dee7f0, rgba(0, 0, 0, 0.1)); }
|
37
37
|
|
38
38
|
.medium-editor-toolbar-form {
|
39
39
|
background: #dee7f0;
|
@@ -15,7 +15,7 @@
|
|
15
15
|
color: #889aac;
|
16
16
|
box-shadow: inset 0 0 3px #f8f8e6;
|
17
17
|
background: -webkit-linear-gradient(top, #fff, rgba(0, 0, 0, 0.1));
|
18
|
-
background: linear-gradient(top, #fff, rgba(0, 0, 0, 0.1));
|
18
|
+
background: linear-gradient(to top, #fff, rgba(0, 0, 0, 0.1));
|
19
19
|
text-shadow: 1px 4px 6px #def, 0 0 0 #000, 1px 4px 6px #def;
|
20
20
|
-webkit-transition: background-color .2s ease-in;
|
21
21
|
transition: background-color .2s ease-in; }
|
@@ -34,7 +34,7 @@
|
|
34
34
|
color: #000;
|
35
35
|
color: rgba(0, 0, 0, 0.8);
|
36
36
|
background: -webkit-linear-gradient(bottom, #fff, rgba(0, 0, 0, 0.2));
|
37
|
-
background: linear-gradient(bottom, #fff, rgba(0, 0, 0, 0.2)); }
|
37
|
+
background: linear-gradient(to bottom, #fff, rgba(0, 0, 0, 0.2)); }
|
38
38
|
|
39
39
|
.medium-editor-toolbar-form {
|
40
40
|
background: #fff;
|
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: 2.0.
|
4
|
+
version: 2.0.7
|
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: 2015-02-
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|