PageRenderTime 42ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/Resources/tools/persHandler.js

https://bitbucket.org/dharmik/dharmik
JavaScript | 48 lines | 18 code | 6 blank | 24 comment | 0 complexity | 58a9a30672f6e3dcc1c2ed3ae45ee3e2 MD5 | raw file
Possible License(s): Apache-2.0
  1. /*
  2. * persHandler
  3. * ==========
  4. *
  5. * This file controls the storing and retrieval of the persistent data.
  6. *
  7. */
  8. var persNames = {
  9. lon : 'longitude',
  10. lat : 'latitude',
  11. width : 'screenWidth',
  12. height : 'screenHeight',
  13. bearing : 'bearing'
  14. };
  15. /*
  16. * putPersData
  17. * ============
  18. *
  19. * This function puts the persistent data. Passed in is the name value based on the array
  20. * and the data to be stored.
  21. *
  22. */
  23. function putPersData(inParam)
  24. {
  25. Ti.App.Properties.setString(persNames[inParam.type], inParam.data);
  26. return null;
  27. }
  28. /*
  29. * retPersData
  30. * ============
  31. *
  32. * This function returns the persistent data. Passed in is the name value based on the array
  33. */
  34. function retPersData(inParam)
  35. {
  36. return Ti.App.Properties.getString(persNames[inParam.type]);
  37. }
  38. /*
  39. * Export the required functions for access
  40. */
  41. exports.putPersData = putPersData;
  42. exports.retPersData = retPersData;