Skip to content

Commit

Permalink
Ported date formating capabilities for Xtemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
christiaanwesterbeek committed Nov 29, 2014
1 parent 178d387 commit 79815f3
Show file tree
Hide file tree
Showing 5 changed files with 1,775 additions and 3 deletions.
34 changes: 31 additions & 3 deletions Ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ var Ext = { //based on 4.2.1.833 only rewritten to fit node
// Test against whitelist which includes known iterable collection types
return iterableRe.test(toString.call(value));
},
log : console.log,
log : function(str) {throw(new Error(str))},//console.error,
util: {},
dom : {},

Expand All @@ -231,10 +231,38 @@ var Ext = { //based on 4.2.1.833 only rewritten to fit node
F.prototype.constructor = F;

return F;
}
},
}

Ext.String = require('./String')(Ext);
//http://stackoverflow.com/questions/20129236/creating-functions-dynamically-in-js
//
Ext.functionFactory= function() {
var me = this,
args = Array.prototype.slice.call(arguments),
ln;

/**
* Alternative way of Sandboxing needed. To get Ext in scope of the function produced by Ext.functionFactory
* Make sure to add scope.ExtReference=Ext when you call the produced function
* 2 Examples can be found in lang/Date.js. It's like this:
* var f = Ext.functionFactory("return 'stuff'"");
* date.ExtReference = Ext;
* return f.call(date);
*/
if (true) {
ln = args.length;
if (ln > 0) {
ln--;
args[ln] = 'var Ext=this.ExtReference;' + args[ln];
}
}

return Function.prototype.constructor.apply(Function.prototype, args);
};

Ext.String = require('./lang/String')(Ext);
Ext.Date = require('./lang/Date')(Ext);
Ext.Number = require('./lang/Number')(Ext);
Ext.util.Format = require('./util/Format')(Ext);

Ext.XTemplateParser = require('./XTemplateParser')(Ext);
Expand Down
Loading

0 comments on commit 79815f3

Please sign in to comment.