Venciity

TODO List Module [ uncompleted ]

Nov 4th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // createContainer(containerTitle)
  2. // createSection(containerTitle, sectionTitle, argumentsList) MAY ONLY CONTAINS ITEMS !
  3. // addItem(content, status)
  4.  
  5. var todoListModule = (function () {
  6.  
  7.     var todoListModule = function () {
  8.         // console.log("Todo list module created");
  9.     };
  10.  
  11.  
  12.     todoListModule.prototype.createContainer = function (containerTitle) {
  13.         var body = document.getElementsByTagName("BODY")[0];
  14.         var divContainer = document.createElement("DIV");
  15.         var title = document.createElement("H4");
  16.         var textnode = document.createTextNode(containerTitle);
  17.         title.appendChild(textnode);
  18.  
  19.         divContainer.appendChild(title);
  20.         body.appendChild(divContainer);
  21.     };
  22.  
  23.     todoListModule.prototype.createSection = function (containerID, sectionTitle, argumentsList) {
  24.         var container = document.getElementById(containerID);
  25.         var title = document.createElement("H4");
  26.         var textnode = document.createTextNode(sectionTitle);
  27.         title.appendChild(textnode);
  28.         container.appendChild(title);
  29.  
  30.         for (var i = 0; i < argumentsList.Length; i++) {
  31.             // container.appendChild(argumentsList[i]);
  32.         }
  33.     };
  34.  
  35.     return todoListModule;
  36.  
  37. }());
  38.  
  39. var todo = new todoListModule();
  40. todo.createContainer("MY TODO LIST");
Advertisement
Add Comment
Please, Sign In to add comment