diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee index 1bc2bac8e..89f388c9f 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.js.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -701,7 +701,7 @@ class RichText extends App.ControllerContent @$('.js-textarea').on('keyup', (e) => console.log('KU') textarea = @$('.js-textarea') - App.Utils.htmlClanup(textarea) + App.Utils.htmlCleanup(textarea) ) @$('.js-textarea').on('paste', (e) => @@ -726,7 +726,7 @@ class RichText extends App.ControllerContent # cleanup textarea = @$('.js-textarea') - App.Utils.htmlClanup(textarea) + App.Utils.htmlCleanup(textarea) # remove marker for cursor textarea.find('[data-cursor=1]').focus() diff --git a/app/assets/javascripts/app/lib/app_post/utils.js.coffee b/app/assets/javascripts/app/lib/app_post/utils.js.coffee index 0ae38e317..2c05e97ac 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.js.coffee @@ -107,8 +107,8 @@ class App.Utils html - # cleanHtmlWithRichText = App.Utils.htmlClanup( html ) - @htmlClanup: (html) -> + # cleanHtmlWithRichText = App.Utils.htmlCleanup( html ) + @htmlCleanup: (html) -> # remove style and class @_removeAttributes( html ) diff --git a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js index ee1d5ac8c..c17f57f4d 100644 --- a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js +++ b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js @@ -126,7 +126,7 @@ } else { setTimeout($.proxy(function(){ - App.Utils.htmlClanup(this.$element) + App.Utils.htmlCleanup(this.$element) }, _this), 0) } diff --git a/public/assets/tests/html-utils.js b/public/assets/tests/html-utils.js index 2a7aaa134..eb1a5aa78 100644 --- a/public/assets/tests/html-utils.js +++ b/public/assets/tests/html-utils.js @@ -278,44 +278,44 @@ test( "htmlRemoveRichtext", function() { }); -// htmlClanup -test( "htmlClanup", function() { +// htmlCleanup +test( "htmlCleanup", function() { var source = "
test
" var should = "test" - var result = App.Utils.htmlClanup( $(source) ) + var result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "some link to somewhere" should = "some link to somewhere" - result = App.Utils.htmlClanup( $(source) ) + result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "

some link to somewhere

" should = "
some link to somewhere
" - result = App.Utils.htmlClanup( $(source) ) + result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "
some link to somewhere" //should = "
some link to somewhere
" should = "some link to somewhere" - result = App.Utils.htmlClanup( $(source) ) + result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "
" //should = "
some link to somewhere
" should = "some link to somewhere" - result = App.Utils.htmlClanup( $(source) ) + result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "

some link to somewhere


" should = "
some link to somewhere

" - result = App.Utils.htmlClanup( $(source) ) + result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "

" should = "
" - result = App.Utils.htmlClanup( $(source) ) + result = App.Utils.htmlCleanup( $(source) ) equal( result.html(), should, source ) source = "

"