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) =>
|
@$('.js-textarea').on('keyup', (e) =>
|
||||||
console.log('KU')
|
console.log('KU')
|
||||||
textarea = @$('.js-textarea')
|
textarea = @$('.js-textarea')
|
||||||
App.Utils.htmlClanup(textarea)
|
App.Utils.htmlCleanup(textarea)
|
||||||
)
|
)
|
||||||
|
|
||||||
@$('.js-textarea').on('paste', (e) =>
|
@$('.js-textarea').on('paste', (e) =>
|
||||||
|
@ -726,7 +726,7 @@ class RichText extends App.ControllerContent
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
textarea = @$('.js-textarea')
|
textarea = @$('.js-textarea')
|
||||||
App.Utils.htmlClanup(textarea)
|
App.Utils.htmlCleanup(textarea)
|
||||||
|
|
||||||
# remove marker for cursor
|
# remove marker for cursor
|
||||||
textarea.find('[data-cursor=1]').focus()
|
textarea.find('[data-cursor=1]').focus()
|
||||||
|
|
|
@ -107,8 +107,8 @@ class App.Utils
|
||||||
|
|
||||||
html
|
html
|
||||||
|
|
||||||
# cleanHtmlWithRichText = App.Utils.htmlClanup( html )
|
# cleanHtmlWithRichText = App.Utils.htmlCleanup( html )
|
||||||
@htmlClanup: (html) ->
|
@htmlCleanup: (html) ->
|
||||||
|
|
||||||
# remove style and class
|
# remove style and class
|
||||||
@_removeAttributes( html )
|
@_removeAttributes( html )
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setTimeout($.proxy(function(){
|
setTimeout($.proxy(function(){
|
||||||
App.Utils.htmlClanup(this.$element)
|
App.Utils.htmlCleanup(this.$element)
|
||||||
}, _this), 0)
|
}, _this), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,44 +278,44 @@ test( "htmlRemoveRichtext", function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// htmlClanup
|
// htmlCleanup
|
||||||
test( "htmlClanup", function() {
|
test( "htmlCleanup", function() {
|
||||||
|
|
||||||
var source = "<div><a href=\"test\">test</a></div>"
|
var source = "<div><a href=\"test\">test</a></div>"
|
||||||
var should = "test"
|
var should = "test"
|
||||||
var result = App.Utils.htmlClanup( $(source) )
|
var result = App.Utils.htmlCleanup( $(source) )
|
||||||
equal( result.html(), should, source )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<a href=\"some_link\">some link to somewhere</a>"
|
source = "<a href=\"some_link\">some link to somewhere</a>"
|
||||||
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 )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<div><h1>some link to somewhere</h1></a>"
|
source = "<div><h1>some link to somewhere</h1></a>"
|
||||||
should = "<div>some link to somewhere</div>"
|
should = "<div>some link to somewhere</div>"
|
||||||
result = App.Utils.htmlClanup( $(source) )
|
result = App.Utils.htmlCleanup( $(source) )
|
||||||
equal( result.html(), should, source )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<div><small>some link to somewhere</small></a>"
|
source = "<div><small>some link to somewhere</small></a>"
|
||||||
//should = "<div>some link to somewhere</div>"
|
//should = "<div>some link to somewhere</div>"
|
||||||
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 )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<div><time>some link to somewhere</time></a>"
|
source = "<div><time>some link to somewhere</time></a>"
|
||||||
//should = "<div>some link to somewhere</div>"
|
//should = "<div>some link to somewhere</div>"
|
||||||
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 )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<div><h1>some link to somewhere</h1><p><hr></p></div>"
|
source = "<div><h1>some link to somewhere</h1><p><hr></p></div>"
|
||||||
should = "<div>some link to somewhere</div><p></p><p></p>"
|
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 )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<div><br></div>"
|
source = "<div><br></div>"
|
||||||
should = "<br>"
|
should = "<br>"
|
||||||
result = App.Utils.htmlClanup( $(source) )
|
result = App.Utils.htmlCleanup( $(source) )
|
||||||
equal( result.html(), should, source )
|
equal( result.html(), should, source )
|
||||||
|
|
||||||
source = "<div><div class=\"xxx\"><br></div></div>"
|
source = "<div><div class=\"xxx\"><br></div></div>"
|
||||||
|
|
Loading…
Reference in a new issue