customer.js 714 B

1234567891011121314151617181920212223242526272829
  1. ;(function () {
  2. var map = { wps: 'word', word: 'word', et: 'et' }
  3. function getCustomerData(type, field) {
  4. var maptype = map[type]
  5. if (!window.hasOwnProperty('setting')) return null
  6. if (field === undefined) return window.setting[maptype]
  7. else
  8. return !!window.setting[maptype] ? window.setting[maptype][field] : null
  9. }
  10. function getCustomerTitle(type) {
  11. return getCustomerData(type, 'title')
  12. }
  13. function getCustomerDir(type) {
  14. return getCustomerData(type, 'tmpdir')
  15. }
  16. function getCustomerHeart(type) {
  17. return getCustomerData(type, 'heart')
  18. }
  19. window.OACustomer = Object.assign({}, window.OACustomer, {
  20. getCustomerTitle,
  21. getCustomerDir,
  22. getCustomerHeart,
  23. getCustomerData,
  24. })
  25. })()