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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fb1e7d6e8bd300433afc68a7be04bfbc11d73ce
4
- data.tar.gz: 813b331ad2f0bdb088a26aa7444e10bdc186787b
3
+ metadata.gz: 9798042447d173738c20be3fab4609eb56da5ce3
4
+ data.tar.gz: fcc476827e161c35e2b5d0adc88d0efd6cc2cfbc
5
5
  SHA512:
6
- metadata.gz: 2ffe45cacc5ee5044ef4f264c2f134aa20f0e7c6d57713e88c7599730327ab1b286aeac299afb81664fa9f3f0dba3af3b80aa38b277282ef5c68e86718bfd3f3
7
- data.tar.gz: b893abd43b3e314f66aa7110b47021bf26be2b78a8183b1020a93713e416d5f7c34eb313507e6cff2fe3432bc6701e9bf75f4f94e8826765c808151364b20754
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.5](https://github.com/daviferreira/medium-editor/releases)
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
 
@@ -1,6 +1,6 @@
1
1
  module MediumEditorRails
2
2
  module Rails
3
- VERSION = '0.4.0'
4
- MEDIUM_EDITOR_VERSION = '1.6.5'
3
+ VERSION = '0.5.0'
4
+ MEDIUM_EDITOR_VERSION = '1.6.7'
5
5
  end
6
6
  end
@@ -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("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent) !== null))),
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 === "pre") {
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>&ldquo;</b>',
266
271
  'orderedlist': '<b>1.</b>',
267
272
  'unorderedlist': '<b>&bull;</b>',
268
- 'pre': '<b>0101</b>'
273
+ 'pre': '<b>0101</b>',
274
+ 'indent': '<b>&rarr;</b>',
275
+ 'outdent': '<b>&larr;</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.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-08 00:00:00.000000000 Z
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: