normal string format and locale support string format

This commit is contained in:
Xuan Sang LE 2018-03-10 23:24:53 +01:00
parent 7fefc17f04
commit 800c95830d
2 changed files with 3 additions and 2 deletions

View File

@ -62,7 +62,8 @@ String.prototype.asUint8Array = () ->
if not String.prototype.format
String.prototype.format = () ->
args = arguments
return new FormatedString(@, args)
return @replace /{(\d+)}/g, (match, number) ->
return if typeof args[number] != 'undefined' then args[number] else match
String.prototype.f = () ->
args = arguments

View File

@ -14,7 +14,7 @@
}
this.on("update", function(){
if(self.updateContent)
self.updateContent()
self.root.innerHTML = self.updateContent()
})
</script>
</afx-html>