medium-editor-rails 0.6.0 → 0.7.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: de3084d0909db7d3d67266cfdeaf99e101b8e5f6
4
- data.tar.gz: 4b293fb97470b784f2e403539508341d69fecbb7
3
+ metadata.gz: 554e3a6e3408a75f8e89fc0371beac9b7325a35c
4
+ data.tar.gz: 0f2118fc0e0f8a4bfb2a6b3f0d655c7257a10c51
5
5
  SHA512:
6
- metadata.gz: 1274ffd197650a59773239fff7ba46e4de0f955573229f194d316a55e71ae9bbc3c271639e0c06518282a7adf15ee213d86f5acd1ad0b6699a286aaf5f847929
7
- data.tar.gz: fbf9b90cd1dc2c8860244ca5024a62fa44f42c995efb069c81181549fadea94b4eb829cbbe7e15694370203e827d52a1f391d89bb7918314c0005748f7c02cfd
6
+ metadata.gz: 664af57a4d68e08d935f32bb42f302d47a70c455714d54783e516589a5682e7c55f9304b6bb7bab413c4518a4298688719f719aa723db76ca1337b340aec2c1a
7
+ data.tar.gz: 1622122cb12a97fe15d3b3942c46d24aac89cc5f66fbc8285992a54401925eed360e4ec5ee0db525494df8e2531be1967e9a4ab45685a901c1e424537f8b9852
@@ -1,5 +1,9 @@
1
1
 
2
2
  #### [Current]
3
+ * [99ba025](../../commit/99ba025) - __(Ahmet Sezgin Duran)__ Update Medium Editor files
4
+
5
+ #### 0.6.0
6
+ * [0f80209](../../commit/0f80209) - __(Ahmet Sezgin Duran)__ Bump versions 0.6.0 and 1.7.3
3
7
  * [72a817d](../../commit/72a817d) - __(Ahmet Sezgin Duran)__ Update Medium Editor files
4
8
 
5
9
  #### 0.5.0
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.7.3](https://github.com/daviferreira/medium-editor/releases)
10
+ The latest version of Medium Editor bundled by this gem is [1.7.5](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.6.0'
4
- MEDIUM_EDITOR_VERSION = '1.7.3'
3
+ VERSION = '0.7.0'
4
+ MEDIUM_EDITOR_VERSION = '1.7.5'
5
5
  end
6
6
  end
@@ -117,7 +117,6 @@ if (typeof module === 'object') {
117
117
  if (this.elements.length === 0) {
118
118
  return;
119
119
  }
120
- this.isActive = true;
121
120
  this.parentElements = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'pre'];
122
121
  this.id = document.querySelectorAll('.medium-editor-toolbar').length + 1;
123
122
  this.options = extend(options, this.defaults);
@@ -125,6 +124,7 @@ if (typeof module === 'object') {
125
124
  },
126
125
 
127
126
  setup: function () {
127
+ this.isActive = true;
128
128
  this.initElements()
129
129
  .bindSelect()
130
130
  .bindPaste()
@@ -173,15 +173,14 @@ if (typeof module === 'object') {
173
173
  this.elements[index].addEventListener('keyup', function (e) {
174
174
  var node = getSelectionStart(),
175
175
  tagName;
176
- if (node && node.getAttribute('data-medium-element') && node.children.length === 0 &&
177
- !(self.options.disableReturn || node.getAttribute('data-disable-return'))) {
176
+ if (node && node.getAttribute('data-medium-element') && node.children.length === 0 && !(self.options.disableReturn || node.getAttribute('data-disable-return'))) {
178
177
  document.execCommand('formatBlock', false, 'p');
179
178
  }
180
179
  if (e.which === 13) {
181
180
  node = getSelectionStart();
182
181
  tagName = node.tagName.toLowerCase();
183
182
  if (!(self.options.disableReturn || this.getAttribute('data-disable-return')) &&
184
- tagName !== 'li' && !self.isListItemChild(node)) {
183
+ tagName !== 'li' && !self.isListItemChild(node)) {
185
184
  if (!e.shiftKey) {
186
185
  document.execCommand('formatBlock', false, 'p');
187
186
  }
@@ -271,7 +270,7 @@ if (typeof module === 'object') {
271
270
  attrname,
272
271
  buttonLabels = {
273
272
  'bold': '<b>B</b>',
274
- 'italic' : '<b><i>I</i></b>',
273
+ 'italic': '<b><i>I</i></b>',
275
274
  'underline': '<b><u>U</u></b>',
276
275
  'superscript': '<b>x<sup>1</sup></b>',
277
276
  'subscript': '<b>x<sub>1</sub></b>',
@@ -289,7 +288,7 @@ if (typeof module === 'object') {
289
288
  if (buttonLabelType === 'fontawesome') {
290
289
  customButtonLabels = {
291
290
  'bold': '<i class="fa fa-bold"></i>',
292
- 'italic' : '<i class="fa fa-italic"></i>',
291
+ 'italic': '<i class="fa fa-italic"></i>',
293
292
  'underline': '<i class="fa fa-underline"></i>',
294
293
  'superscript': '<i class="fa fa-superscript"></i>',
295
294
  'subscript': '<i class="fa fa-subscript"></i>',
@@ -393,7 +392,7 @@ if (typeof module === 'object') {
393
392
  if (this.keepToolbarAlive !== true && !this.options.disableToolbar) {
394
393
  newSelection = window.getSelection();
395
394
  if (newSelection.toString().trim() === '' ||
396
- (this.options.allowMultiParagraphSelection === false && this.hasMultiParagraphs())) {
395
+ (this.options.allowMultiParagraphSelection === false && this.hasMultiParagraphs())) {
397
396
  this.hideToolbarActions();
398
397
  } else {
399
398
  selectionElement = this.getSelectionElement();
@@ -407,7 +406,7 @@ if (typeof module === 'object') {
407
406
  return this;
408
407
  },
409
408
 
410
- clickingIntoArchorForm: function(e) {
409
+ clickingIntoArchorForm: function (e) {
411
410
  var self = this;
412
411
  if (e.type && e.type.toLowerCase() === 'blur' && e.relatedTarget && e.relatedTarget === self.anchorInput) {
413
412
  return true;
@@ -443,16 +442,16 @@ if (typeof module === 'object') {
443
442
  current = range.commonAncestorContainer,
444
443
  parent = current.parentNode,
445
444
  result,
446
- getMediumElement = function(e) {
447
- var parent = e;
445
+ getMediumElement = function (e) {
446
+ var localParent = e;
448
447
  try {
449
- while (!parent.getAttribute('data-medium-element')) {
450
- parent = parent.parentNode;
448
+ while (!localParent.getAttribute('data-medium-element')) {
449
+ localParent = localParent.parentNode;
451
450
  }
452
451
  } catch (errb) {
453
452
  return false;
454
453
  }
455
- return parent;
454
+ return localParent;
456
455
  };
457
456
  // First try on current node
458
457
  try {
@@ -461,7 +460,7 @@ if (typeof module === 'object') {
461
460
  } else {
462
461
  result = getMediumElement(parent);
463
462
  }
464
- // If not search in the parent nodes.
463
+ // If not search in the parent nodes.
465
464
  } catch (err) {
466
465
  result = getMediumElement(parent);
467
466
  }
@@ -590,7 +589,7 @@ if (typeof module === 'object') {
590
589
  // allowing nesting, we need to use outdent
591
590
  // https://developer.mozilla.org/en-US/docs/Rich-Text_Editing_in_Mozilla
592
591
  if (el === 'blockquote' && selectionData.el &&
593
- selectionData.el.parentNode.tagName.toLowerCase() === 'blockquote') {
592
+ selectionData.el.parentNode.tagName.toLowerCase() === 'blockquote') {
594
593
  return document.execCommand('outdent', false, null);
595
594
  }
596
595
  if (selectionData.tagName === el) {
@@ -649,7 +648,7 @@ if (typeof module === 'object') {
649
648
  this.toolbarActions.style.display = 'block';
650
649
  this.keepToolbarAlive = false;
651
650
  clearTimeout(timer);
652
- timer = setTimeout(function() {
651
+ timer = setTimeout(function () {
653
652
  if (!self.toolbar.classList.contains('medium-editor-toolbar-active')) {
654
653
  self.toolbar.classList.add('medium-editor-toolbar-active');
655
654
  }
@@ -695,7 +694,7 @@ if (typeof module === 'object') {
695
694
  },
696
695
 
697
696
 
698
- hideAnchorPreview: function() {
697
+ hideAnchorPreview: function () {
699
698
  this.anchorPreview.classList.remove('medium-editor-anchor-preview-active');
700
699
  },
701
700
 
@@ -718,7 +717,7 @@ if (typeof module === 'object') {
718
717
  defaultLeft = self.options.diffLeft - halfOffsetWidth;
719
718
 
720
719
  clearTimeout(timer);
721
- timer = setTimeout(function() {
720
+ timer = setTimeout(function () {
722
721
  if (!self.anchorPreview.classList.contains('medium-editor-anchor-preview-active')) {
723
722
  self.anchorPreview.classList.add('medium-editor-anchor-preview-active');
724
723
  }
@@ -741,20 +740,20 @@ if (typeof module === 'object') {
741
740
  },
742
741
 
743
742
  // TODO: break method
744
- observeAnchorPreview: function(anchorEl) {
743
+ observeAnchorPreview: function (anchorEl) {
745
744
  var self = this,
746
745
  lastOver = (new Date()).getTime(),
747
746
  over = true,
748
- stamp = function() {
747
+ stamp = function () {
749
748
  lastOver = (new Date()).getTime();
750
749
  over = true;
751
750
  },
752
- unstamp = function(e) {
751
+ unstamp = function (e) {
753
752
  if (!e.relatedTarget || !/anchor-preview/.test(e.relatedTarget.className)) {
754
753
  over = false;
755
754
  }
756
755
  },
757
- interval_timer = setInterval(function() {
756
+ interval_timer = setInterval(function () {
758
757
  if (over) {
759
758
  return true;
760
759
  }
@@ -788,7 +787,7 @@ if (typeof module === 'object') {
788
787
  anchorPreview.innerHTML = this.anchorPreviewTemplate();
789
788
  document.body.appendChild(anchorPreview);
790
789
 
791
- anchorPreview.addEventListener('click', function() {
790
+ anchorPreview.addEventListener('click', function () {
792
791
  self.anchorPreviewClickHandler();
793
792
  });
794
793
 
@@ -797,11 +796,11 @@ if (typeof module === 'object') {
797
796
 
798
797
  anchorPreviewTemplate: function () {
799
798
  return '<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview">' +
800
- ' <i class="medium-editor-toolbar-anchor-preview-inner">http://google.com/</i>' +
799
+ ' <i class="medium-editor-toolbar-anchor-preview-inner"></i>' +
801
800
  '</div>';
802
801
  },
803
802
 
804
- anchorPreviewClickHandler: function(e) {
803
+ anchorPreviewClickHandler: function (e) {
805
804
  if (this.activeAnchor) {
806
805
 
807
806
  var self = this,
@@ -811,7 +810,7 @@ if (typeof module === 'object') {
811
810
  range.selectNodeContents(self.activeAnchor);
812
811
  sel.removeAllRanges();
813
812
  sel.addRange(range);
814
- setTimeout(function() {
813
+ setTimeout(function () {
815
814
  self.showAnchorForm(self.activeAnchor.href);
816
815
  self.keepToolbarAlive = false;
817
816
  }, 100 + self.options.delay);
@@ -821,10 +820,10 @@ if (typeof module === 'object') {
821
820
  this.hideAnchorPreview();
822
821
  },
823
822
 
824
- editorAnchorObserver: function(e) {
823
+ editorAnchorObserver: function (e) {
825
824
  var self = this,
826
825
  overAnchor = true,
827
- leaveAnchor = function() {
826
+ leaveAnchor = function () {
828
827
  // mark the anchor as no longer hovered, and stop listening
829
828
  overAnchor = false;
830
829
  self.activeAnchor.removeEventListener('mouseout', leaveAnchor);
@@ -848,7 +847,7 @@ if (typeof module === 'object') {
848
847
  this.activeAnchor.addEventListener('mouseout', leaveAnchor);
849
848
  // show the anchor preview according to the configured delay
850
849
  // if the mouse has not left the anchor tag in that time
851
- setTimeout(function() {
850
+ setTimeout(function () {
852
851
  if (overAnchor) {
853
852
  self.showAnchorPreview(e.target);
854
853
  }
@@ -860,7 +859,7 @@ if (typeof module === 'object') {
860
859
 
861
860
  bindAnchorPreview: function (index) {
862
861
  var self = this;
863
- this.elements[index].addEventListener('mouseover', function(e) {
862
+ this.elements[index].addEventListener('mouseover', function (e) {
864
863
  self.editorAnchorObserver(e);
865
864
  });
866
865
  return this;
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.6.0
4
+ version: 0.7.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-22 00:00:00.000000000 Z
11
+ date: 2014-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Medium Editor integrated in Rails asset pipeline
14
14
  email: