options.js 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * The 'properties.js' file is generated in the output directory next to this file
  3. * and contains the parameters configured in the current transformation.
  4. */
  5. define(['properties'], function (properties) {
  6. return {
  7. get : function (property) {
  8. return properties[property];
  9. },
  10. getBoolean : function (property) {
  11. var prop = properties[property];
  12. return prop == 'true' || prop == 'yes';
  13. },
  14. getInteger : function (property) {
  15. var prop = properties[property];
  16. return parseInt(prop, 10);
  17. },
  18. getIndexerLanguage : function() {
  19. // Implementation copied from IndexerTask.setIndexerLanguage()
  20. var language = this.get('webhelp.language');
  21. if (language) {
  22. var pos = language.indexOf('_');
  23. if (pos != -1) {
  24. language = language.substring(0, pos);
  25. }
  26. }
  27. return language;
  28. }
  29. };
  30. });