json.js 458 B

123456789101112131415161718
  1. define(function(require, exports, module) {
  2. var data = require('../core/data');
  3. data.registerProtocol('json', module.exports = {
  4. fileDescription: 'KityMinder 格式',
  5. fileExtension: '.km',
  6. dataType: 'text',
  7. mineType: 'application/json',
  8. encode: function(json) {
  9. return JSON.stringify(json);
  10. },
  11. decode: function(local) {
  12. return JSON.parse(local);
  13. }
  14. });
  15. });