configuration.js 720 B

1234567891011121314151617181920212223242526272829303132
  1. elgg.provide('elgg.config');
  2. /**
  3. * Returns the current site URL
  4. *
  5. * @return {String} The site URL.
  6. */
  7. elgg.get_site_url = function() {
  8. return elgg.config.wwwroot;
  9. };
  10. /**
  11. * Get the URL for the cached file
  12. *
  13. * @param {String} type
  14. * @param {String} view
  15. * @return {String} The site URL.
  16. */
  17. elgg.get_simplecache_url = function(type, view) {
  18. var lastcache;
  19. if (elgg.config.simplecache_enabled) {
  20. lastcache = elgg.config.lastcache;
  21. } else {
  22. lastcache = 0;
  23. }
  24. if ((type === 'js' || type === 'css') && 0 === view.indexOf(type + '/')) {
  25. view = view.substr(type.length + 1);
  26. }
  27. var path = '/cache/' + lastcache + '/' + elgg.config.viewtype + '/' + type + '/' + view;
  28. return elgg.normalize_url(path);
  29. };