Difference between revisions of "MediaWiki:Common.js"

From MakeICT Wiki
Jump to navigationJump to search
Line 3: Line 3:
 
   var todos = $(".makeict-todo");
 
   var todos = $(".makeict-todo");
 
   var todoContainer = $("#makeict-decision-summary")[0];
 
   var todoContainer = $("#makeict-decision-summary")[0];
  console.log(todoContainer);
 
 
   for(var i=0; i<todos.length; i++){
 
   for(var i=0; i<todos.length; i++){
 
     var listItem = document.createElement("li");
 
     var listItem = document.createElement("li");
Line 9: Line 8:
 
     todoContainer.appendChild(listItem);
 
     todoContainer.appendChild(listItem);
 
   }
 
   }
 +
}());
  
 +
(function () {
 +
  var decisions = $(".makeict-todo");
 +
  var decisionContainer = $("#makeict-decision-summary");
 +
  for(var i=0; i<decisions.length; i++){
 +
    var listItem = document.createElement("li");
 +
    listItem.appendChild(decisions[i].cloneNode(true));
 +
    decisionContainer.appendChild(listItem);
 +
  }
 
}());
 
}());
/*
 
  var todos = $(".makeict-todo");
 
  var todoContainer = $("#makeict-decision-summary");
 
*/
 

Revision as of 11:51, 8 March 2015

/* Any JavaScript here will be loaded for all users on every page load. */
(function () {
  var todos = $(".makeict-todo");
  var todoContainer = $("#makeict-decision-summary")[0];
  for(var i=0; i<todos.length; i++){
    var listItem = document.createElement("li");
    listItem.appendChild(todos[i].cloneNode(true));
    todoContainer.appendChild(listItem);
  }
}());

(function () {
  var decisions = $(".makeict-todo");
  var decisionContainer = $("#makeict-decision-summary");
  for(var i=0; i<decisions.length; i++){
    var listItem = document.createElement("li");
    listItem.appendChild(decisions[i].cloneNode(true));
    decisionContainer.appendChild(listItem);
  }
}());