not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

  1. define(["widepalette",
  2. "text!languagepalette.html"], function (palette, template) {
  3. 'use strict';
  4. var activitypalette = {};
  5. activitypalette.ActivityPalette = function (activityButton,
  6. datastoreObject) {
  7. palette.Palette.call(this, activityButton);
  8. var activityTitle;
  9. var descriptionLabel;
  10. var descriptionBox;
  11. this.getPalette().id = "activity-palette";
  12. var containerElem = document.createElement('div');
  13. containerElem.innerHTML = template;
  14. this.setContent([containerElem]);
  15. this.langobjects = document.getElementsByClassName("lang");
  16. var that = this;
  17. for (var i=0; i<this.langobjects.length; i++){
  18. this.langobjects[i].addEventListener('click', function(){
  19. var langobj = document.getElementsByClassName("lang");
  20. for (var j=0; j<langobj.length; j++){
  21. langobj[j].style.backgroundColor = "black";
  22. }
  23. this.style.backgroundColor = "grey";
  24. document.getElementById('speaklang').innerHTML = (this.id).split('-')[1];
  25. that.popDown();
  26. });
  27. var currentlang = document.getElementById("lang-"+document.getElementById('speaklang').innerHTML);
  28. if (currentlang == null) currentlang = document.getElementById("lang-en");
  29. currentlang.style.backgroundColor = "grey";
  30. }
  31. };
  32. activitypalette.ActivityPalette.prototype =
  33. Object.create(palette.Palette.prototype, {
  34. setTitleDescription: {
  35. value: "Language Select:",
  36. enumerable: true,
  37. configurable: true,
  38. writable: true
  39. }
  40. });
  41. return activitypalette;
  42. });