Skip to content

Commit

Permalink
Update to v0.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Pulges committed Jul 3, 2014
1 parent 1c3b798 commit 9378c34
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/wysihtml5x/rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Wysihtml5x
module Rails
VERSION = "0.4.11"
VERSION = "0.4.12"
end
end
13 changes: 10 additions & 3 deletions vendor/assets/javascripts/wysihtml5x-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(!Array.isArray) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
};/**
* @license wysihtml5x v0.4.11
* @license wysihtml5x v0.4.12
* https://github.com/Edicy/wysihtml5
*
* Author: Christopher Blum (https://github.com/tiff)
Expand All @@ -36,7 +36,7 @@ if(!Array.isArray) {
*
*/
var wysihtml5 = {
version: "0.4.11",
version: "0.4.12",

// namespaces
commands: {},
Expand Down Expand Up @@ -7046,6 +7046,13 @@ wysihtml5.dom.replaceWithChildNodes = function(node) {
unset = function() {
if (view.hasPlaceholderSet()) {
view.clear();
view.element.focus();
setTimeout(function() {
var sel = view.selection.getSelection();
if (!sel.focusNode || !sel.anchorNode) {
view.selection.selectNode(view.element.firstChild || view.element);
}
}, 0);
}
view.placeholderSet = false;
dom.removeClass(view.element, CLASS_NAME);
Expand Down Expand Up @@ -11845,7 +11852,7 @@ wysihtml5.views.View = Base.extend(

isEmpty: function() {
var innerHTML = this.element.innerHTML.toLowerCase();
return (/^\s*$/i).test(innerHTML) ||
return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
innerHTML === "" ||
innerHTML === "<br>" ||
innerHTML === "<p></p>" ||
Expand Down
13 changes: 10 additions & 3 deletions vendor/assets/javascripts/wysihtml5x.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if(!Array.isArray) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
};/**
* @license wysihtml5x v0.4.11
* @license wysihtml5x v0.4.12
* https://github.com/Edicy/wysihtml5
*
* Author: Christopher Blum (https://github.com/tiff)
Expand All @@ -36,7 +36,7 @@ if(!Array.isArray) {
*
*/
var wysihtml5 = {
version: "0.4.11",
version: "0.4.12",

// namespaces
commands: {},
Expand Down Expand Up @@ -7046,6 +7046,13 @@ wysihtml5.dom.replaceWithChildNodes = function(node) {
unset = function() {
if (view.hasPlaceholderSet()) {
view.clear();
view.element.focus();
setTimeout(function() {
var sel = view.selection.getSelection();
if (!sel.focusNode || !sel.anchorNode) {
view.selection.selectNode(view.element.firstChild || view.element);
}
}, 0);
}
view.placeholderSet = false;
dom.removeClass(view.element, CLASS_NAME);
Expand Down Expand Up @@ -11845,7 +11852,7 @@ wysihtml5.views.View = Base.extend(

isEmpty: function() {
var innerHTML = this.element.innerHTML.toLowerCase();
return (/^\s*$/i).test(innerHTML) ||
return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
innerHTML === "" ||
innerHTML === "<br>" ||
innerHTML === "<p></p>" ||
Expand Down

0 comments on commit 9378c34

Please sign in to comment.