footer-links.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* appjet:version 0.1 */
  2. /* appjet:library */
  3. // Copyright (c) 2009, Herbert Vojčík
  4. // Licensed by MIT license (http://www.opensource.org/licenses/mit-license.php)
  5. var _links = null;
  6. function _setup() {
  7. _links = {};
  8. page.head.write("<style type='text/css'>\n"+
  9. " #appjetfooterlinks a { text-decoration:none; color:#666; }\n"+
  10. "</style>\n");
  11. import({}, "lib-support/footer").extendTheFooter(function() {
  12. var result = SPAN({id:"appjetfooterlinks"}), delim = "";
  13. eachProperty(_links, function(key, value) {
  14. result.push(delim, link(key, value.replace(" ", "\xa0", "g"))); // non-breaking spaces
  15. delim = " - ";
  16. });
  17. return result;
  18. });
  19. }
  20. /**
  21. * Puts a link into the footer.
  22. * Beyond its direct use, this function is very convenient
  23. * for libraries that integrate into application and reserve
  24. * some path to include link to themselves in the footer.
  25. */
  26. function setFooterLink(url, name) {
  27. if (!_links) { _setup(); }
  28. _links[url] = name;
  29. }
  30. /* appjet:server */
  31. import(appjet.appName);
  32. setFooterLink("/testrunner/results", "Test Runner");
  33. setFooterLink("/lib-files/", "Files");
  34. setFooterLink("/lib-files/", "File repository");