Fixed typo.
This commit is contained in:
parent
54550e5bf2
commit
bc979bbf4a
4 changed files with 14 additions and 14 deletions
|
@ -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()
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
}
|
||||
else {
|
||||
setTimeout($.proxy(function(){
|
||||
App.Utils.htmlClanup(this.$element)
|
||||
App.Utils.htmlCleanup(this.$element)
|
||||
}, _this), 0)
|
||||
}
|
||||
|
||||
|
|
|
@ -278,44 +278,44 @@ test( "htmlRemoveRichtext", function() {
|
|||
|
||||
});
|
||||
|
||||
// htmlClanup
|
||||
test( "htmlClanup", function() {
|
||||
// htmlCleanup
|
||||
test( "htmlCleanup", function() {
|
||||
|
||||
var source = "<div><a href=\"test\">test</a></div>"
|
||||
var should = "test"
|
||||
var result = App.Utils.htmlClanup( $(source) )
|
||||
var result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<a href=\"some_link\">some link to somewhere</a>"
|
||||
should = "some link to somewhere"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><h1>some link to somewhere</h1></a>"
|
||||
should = "<div>some link to somewhere</div>"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><small>some link to somewhere</small></a>"
|
||||
//should = "<div>some link to somewhere</div>"
|
||||
should = "some link to somewhere"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><time>some link to somewhere</time></a>"
|
||||
//should = "<div>some link to somewhere</div>"
|
||||
should = "some link to somewhere"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><h1>some link to somewhere</h1><p><hr></p></div>"
|
||||
should = "<div>some link to somewhere</div><p></p><p></p>"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><br></div>"
|
||||
should = "<br>"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
result = App.Utils.htmlCleanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><div class=\"xxx\"><br></div></div>"
|
||||
|
|
Loading…
Reference in a new issue