footer-links.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* appjet:version 0.1 */
  2. // (c) 2009, Herbert Vojčík
  3. // Licensed by MIT license (http://www.opensource.org/licenses/mit-license.php)
  4. /* appjet:library */
  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-utils/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");