[mobile] Add format method for the String type.
This commit is contained in:
parent
398004c59c
commit
7dbe75f117
|
@ -42,6 +42,16 @@
|
||||||
define(
|
define(
|
||||||
['jquery','underscore','framework7'],
|
['jquery','underscore','framework7'],
|
||||||
function () {
|
function () {
|
||||||
|
//Extend String
|
||||||
|
if (!String.prototype.format) {
|
||||||
|
String.prototype.format = function() {
|
||||||
|
var args = arguments;
|
||||||
|
return this.replace(/{(\d+)}/g, function(match, number) {
|
||||||
|
return typeof args[number] != 'undefined' ? args[number] : match;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
//Extend jQuery functions
|
//Extend jQuery functions
|
||||||
jQuery.fn.extend( {
|
jQuery.fn.extend( {
|
||||||
single: function(types, selector, data, fn) {
|
single: function(types, selector, data, fn) {
|
||||||
|
|
Loading…
Reference in a new issue