legend.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. define(function () {
  2. return function () {
  3. var self = this
  4. self.render = function (el) {
  5. var p = document.createElement("p")
  6. p.setAttribute("class", "legend")
  7. el.appendChild(p)
  8. var spanNew = document.createElement("span")
  9. spanNew.setAttribute("class", "legend-new")
  10. var symbolNew = document.createElement("span")
  11. symbolNew.setAttribute("class", "symbol")
  12. var textNew = document.createTextNode(" Neuer Knoten")
  13. spanNew.appendChild(symbolNew)
  14. spanNew.appendChild(textNew)
  15. p.appendChild(spanNew)
  16. var spanOnline = document.createElement("span")
  17. spanOnline.setAttribute("class", "legend-online")
  18. var symbolOnline = document.createElement("span")
  19. symbolOnline.setAttribute("class", "symbol")
  20. var textOnline = document.createTextNode(" Knoten ist online")
  21. spanOnline.appendChild(symbolOnline)
  22. spanOnline.appendChild(textOnline)
  23. p.appendChild(spanOnline)
  24. var spanOffline = document.createElement("span")
  25. spanOffline.setAttribute("class", "legend-offline")
  26. var symbolOffline = document.createElement("span")
  27. symbolOffline.setAttribute("class", "symbol")
  28. var textOffline = document.createTextNode(" Knoten ist offline")
  29. spanOffline.appendChild(symbolOffline)
  30. spanOffline.appendChild(textOffline)
  31. p.appendChild(spanOffline)
  32. }
  33. return self
  34. }
  35. })