| 1 |
define([ |
| 2 |
"dojo/_base/lang" |
| 3 |
], function(lang){ |
| 4 |
|
| 5 |
var o = lang.getObject("dojox.mobile.tests.doh.MyFileTypeMap", true); |
| 6 |
|
| 7 |
o.map = { |
| 8 |
"html": "html", |
| 9 |
"json": "json", |
| 10 |
"mydata": "json" |
| 11 |
}; |
| 12 |
|
| 13 |
o.add = function( key, contentType){ |
| 14 |
this.map[key] = contentType; |
| 15 |
}; |
| 16 |
|
| 17 |
o.getContentType = function( fileName){ |
| 18 |
var fileType = (fileName || "").replace(/.*\./, ""); |
| 19 |
return this.map[fileType]; |
| 20 |
}; |
| 21 |
|
| 22 |
console.log("This is MyFileTypeMap"); |
| 23 |
window._MyFileTypeMapFlag = true; |
| 24 |
|
| 25 |
return o; |
| 26 |
|
| 27 |
}); |