wysihtml-rails 0.5.0.beta10 → 0.5.0.beta11

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: 81549cbb9a36c9d74e052ce4fb1ca5c0b232daa6
4
- data.tar.gz: 0cb8580a29fa4667a6afc9068f8839138a8612f0
3
+ metadata.gz: 8a424f7a7451c2ed2ee295f44fd26f3b8e50cad5
4
+ data.tar.gz: 699e6c52b926edc5bf8ac1eb437018af88d6cf62
5
5
  SHA512:
6
- metadata.gz: 5ed9c1cadd3b1e82d0bed2bb8d30c54f943193ad80aa96ec79efd3292dd94f3740dae8da8e512daf1f36c28100c81aceb09ac6b6dd85dd74789f7e500221f022
7
- data.tar.gz: 3d4c341657f1be7211eedcb52b0bce809b495e328b460ac46f6fa14cb57572958b65bd7d43f5c0fe33d05f1a855f1637cc882f2e88b43eb7521b21068769e4bc
6
+ metadata.gz: cb041671d6dbfe31ae9d63dfd177dd1d68a034d9ff2725cba285d80f06901395bea1845d5610fe4a08e004c68f482440346a867ef600febbc2cee0f96a2e0634
7
+ data.tar.gz: 0b1f3ca29b5e4f6466df2d59084c6b7f35a2e6c4a03714a1df865eea1084b31190858800d98d5c43e6e9533da5274b50b30255b977ca7da7edc20c3bb56e63a2
@@ -1,5 +1,5 @@
1
1
  module Wysihtml
2
2
  module Rails
3
- VERSION = "0.5.0.beta10"
3
+ VERSION = "0.5.0.beta11"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license wysihtml v0.5.0-beta10
2
+ * @license wysihtml v0.5.0-beta11
3
3
  * https://github.com/Voog/wysihtml
4
4
  *
5
5
  * Author: Christopher Blum (https://github.com/tiff)
@@ -10,7 +10,7 @@
10
10
  *
11
11
  */
12
12
  var wysihtml5 = {
13
- version: "0.5.0-beta10",
13
+ version: "0.5.0-beta11",
14
14
 
15
15
  // namespaces
16
16
  commands: {},
@@ -388,6 +388,7 @@ var wysihtml5 = {
388
388
 
389
389
  ret = (e.childNodes.length !== 1 || s.anchorNode !== e.firstChild || s.anchorOffset !== 2);
390
390
  e.parentNode.removeChild(e);
391
+ s.removeAllRanges();
391
392
  return ret;
392
393
  }
393
394
  };
@@ -5073,7 +5074,7 @@ wysihtml5.browser = (function() {
5073
5074
  It is on window but cannot return text/html
5074
5075
  Should actually check for clipboardData on paste event, but cannot in firefox
5075
5076
  */
5076
- supportsModenPaste: function () {
5077
+ supportsModernPaste: function () {
5077
5078
  return !("clipboardData" in window);
5078
5079
  },
5079
5080
 
@@ -10044,7 +10045,15 @@ wysihtml5.quirks.ensureProperClearing = (function() {
10044
10045
 
10045
10046
  if (includePrevLeaves) {
10046
10047
  var prevNode = this.getPreviousNode(startNode, true),
10047
- prevLeaf = prevNode ? wysihtml5.dom.domNode(prevNode).lastLeafNode() : null;
10048
+ prevLeaf = null;
10049
+
10050
+ if(prevNode) {
10051
+ if (prevNode.nodeType === 1 && wysihtml5.dom.hasClass(prevNode, this.unselectableClass)) {
10052
+ prevLeaf = prevNode;
10053
+ } else {
10054
+ prevLeaf = wysihtml5.dom.domNode(prevNode).lastLeafNode();
10055
+ }
10056
+ }
10048
10057
 
10049
10058
  if (prevLeaf) {
10050
10059
  return {
@@ -15394,7 +15403,7 @@ wysihtml5.views.View = Base.extend(
15394
15403
  var oldHtml,
15395
15404
  cleanHtml;
15396
15405
 
15397
- if (wysihtml5.browser.supportsModenPaste()) {
15406
+ if (wysihtml5.browser.supportsModernPaste()) {
15398
15407
  this.on("paste:composer", function(event) {
15399
15408
  event.preventDefault();
15400
15409
  oldHtml = wysihtml5.dom.getPastedHtml(event);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license wysihtml v0.5.0-beta10
2
+ * @license wysihtml v0.5.0-beta11
3
3
  * https://github.com/Voog/wysihtml
4
4
  *
5
5
  * Author: Christopher Blum (https://github.com/tiff)
@@ -10,7 +10,7 @@
10
10
  *
11
11
  */
12
12
  var wysihtml5 = {
13
- version: "0.5.0-beta10",
13
+ version: "0.5.0-beta11",
14
14
 
15
15
  // namespaces
16
16
  commands: {},
@@ -388,6 +388,7 @@ var wysihtml5 = {
388
388
 
389
389
  ret = (e.childNodes.length !== 1 || s.anchorNode !== e.firstChild || s.anchorOffset !== 2);
390
390
  e.parentNode.removeChild(e);
391
+ s.removeAllRanges();
391
392
  return ret;
392
393
  }
393
394
  };
@@ -5073,7 +5074,7 @@ wysihtml5.browser = (function() {
5073
5074
  It is on window but cannot return text/html
5074
5075
  Should actually check for clipboardData on paste event, but cannot in firefox
5075
5076
  */
5076
- supportsModenPaste: function () {
5077
+ supportsModernPaste: function () {
5077
5078
  return !("clipboardData" in window);
5078
5079
  },
5079
5080
 
@@ -10044,7 +10045,15 @@ wysihtml5.quirks.ensureProperClearing = (function() {
10044
10045
 
10045
10046
  if (includePrevLeaves) {
10046
10047
  var prevNode = this.getPreviousNode(startNode, true),
10047
- prevLeaf = prevNode ? wysihtml5.dom.domNode(prevNode).lastLeafNode() : null;
10048
+ prevLeaf = null;
10049
+
10050
+ if(prevNode) {
10051
+ if (prevNode.nodeType === 1 && wysihtml5.dom.hasClass(prevNode, this.unselectableClass)) {
10052
+ prevLeaf = prevNode;
10053
+ } else {
10054
+ prevLeaf = wysihtml5.dom.domNode(prevNode).lastLeafNode();
10055
+ }
10056
+ }
10048
10057
 
10049
10058
  if (prevLeaf) {
10050
10059
  return {
@@ -15394,7 +15403,7 @@ wysihtml5.views.View = Base.extend(
15394
15403
  var oldHtml,
15395
15404
  cleanHtml;
15396
15405
 
15397
- if (wysihtml5.browser.supportsModenPaste()) {
15406
+ if (wysihtml5.browser.supportsModernPaste()) {
15398
15407
  this.on("paste:composer", function(event) {
15399
15408
  event.preventDefault();
15400
15409
  oldHtml = wysihtml5.dom.getPastedHtml(event);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wysihtml-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.beta10
4
+ version: 0.5.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanel Jakobsoo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-04 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties