wysihtml5x-rails 0.4.11 → 0.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b947a36a20f9fb548d69f5d19a3d3598764c897c
4
- data.tar.gz: beea337fa9d8a0fab17c87456c8b9d508545e8e8
3
+ metadata.gz: 1907d5edb4a6bbbdf40f6d95e5b8bb0a8fd16769
4
+ data.tar.gz: 3f18eb241af83236b88cf71f83c58cb623a32063
5
5
  SHA512:
6
- metadata.gz: 9b730a0844fc040d82807bff6b7f16ce8cb4d0af011de4b204e010f993a6a519cd0268f5e225d82277700a981d7712edc3c7c0e6a022adfa5340d084e6f60e51
7
- data.tar.gz: 3d20acf3e2991c32e150a20a0db8c12b3a5ebe971753c6de618792933d50b5bbc941fe1e967ced1625abcff650222ed7e14bfb8d048f691a932b1e2bdf2d879e
6
+ metadata.gz: 5d5e5b649260f6c3848bd34c55dfbda1ba7562fe4e8b2d16cd796b58b0110f91c92290965d86e3dbeaeb8f1bf8aaefa76540c5bedf3611b7dd4eada9c28b3143
7
+ data.tar.gz: 5b2383c3215776c3412defa93781c037a31814828c684cc9536eca3dc516b2aa3d06c365fbdf32e18f850819c4405d233b1d7ac9e7a6ca0011b5dc54a0972620
@@ -1,5 +1,5 @@
1
1
  module Wysihtml5x
2
2
  module Rails
3
- VERSION = "0.4.11"
3
+ VERSION = "0.4.12"
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ if(!Array.isArray) {
25
25
  return Object.prototype.toString.call(arg) === '[object Array]';
26
26
  };
27
27
  };/**
28
- * @license wysihtml5x v0.4.11
28
+ * @license wysihtml5x v0.4.12
29
29
  * https://github.com/Edicy/wysihtml5
30
30
  *
31
31
  * Author: Christopher Blum (https://github.com/tiff)
@@ -36,7 +36,7 @@ if(!Array.isArray) {
36
36
  *
37
37
  */
38
38
  var wysihtml5 = {
39
- version: "0.4.11",
39
+ version: "0.4.12",
40
40
 
41
41
  // namespaces
42
42
  commands: {},
@@ -7046,6 +7046,13 @@ wysihtml5.dom.replaceWithChildNodes = function(node) {
7046
7046
  unset = function() {
7047
7047
  if (view.hasPlaceholderSet()) {
7048
7048
  view.clear();
7049
+ view.element.focus();
7050
+ setTimeout(function() {
7051
+ var sel = view.selection.getSelection();
7052
+ if (!sel.focusNode || !sel.anchorNode) {
7053
+ view.selection.selectNode(view.element.firstChild || view.element);
7054
+ }
7055
+ }, 0);
7049
7056
  }
7050
7057
  view.placeholderSet = false;
7051
7058
  dom.removeClass(view.element, CLASS_NAME);
@@ -11845,7 +11852,7 @@ wysihtml5.views.View = Base.extend(
11845
11852
 
11846
11853
  isEmpty: function() {
11847
11854
  var innerHTML = this.element.innerHTML.toLowerCase();
11848
- return (/^\s*$/i).test(innerHTML) ||
11855
+ return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
11849
11856
  innerHTML === "" ||
11850
11857
  innerHTML === "<br>" ||
11851
11858
  innerHTML === "<p></p>" ||
@@ -25,7 +25,7 @@ if(!Array.isArray) {
25
25
  return Object.prototype.toString.call(arg) === '[object Array]';
26
26
  };
27
27
  };/**
28
- * @license wysihtml5x v0.4.11
28
+ * @license wysihtml5x v0.4.12
29
29
  * https://github.com/Edicy/wysihtml5
30
30
  *
31
31
  * Author: Christopher Blum (https://github.com/tiff)
@@ -36,7 +36,7 @@ if(!Array.isArray) {
36
36
  *
37
37
  */
38
38
  var wysihtml5 = {
39
- version: "0.4.11",
39
+ version: "0.4.12",
40
40
 
41
41
  // namespaces
42
42
  commands: {},
@@ -7046,6 +7046,13 @@ wysihtml5.dom.replaceWithChildNodes = function(node) {
7046
7046
  unset = function() {
7047
7047
  if (view.hasPlaceholderSet()) {
7048
7048
  view.clear();
7049
+ view.element.focus();
7050
+ setTimeout(function() {
7051
+ var sel = view.selection.getSelection();
7052
+ if (!sel.focusNode || !sel.anchorNode) {
7053
+ view.selection.selectNode(view.element.firstChild || view.element);
7054
+ }
7055
+ }, 0);
7049
7056
  }
7050
7057
  view.placeholderSet = false;
7051
7058
  dom.removeClass(view.element, CLASS_NAME);
@@ -11845,7 +11852,7 @@ wysihtml5.views.View = Base.extend(
11845
11852
 
11846
11853
  isEmpty: function() {
11847
11854
  var innerHTML = this.element.innerHTML.toLowerCase();
11848
- return (/^\s*$/i).test(innerHTML) ||
11855
+ return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
11849
11856
  innerHTML === "" ||
11850
11857
  innerHTML === "<br>" ||
11851
11858
  innerHTML === "<p></p>" ||
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wysihtml5x-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.11
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanel Jakobsoo