Difference between revisions of "MediaWiki:Common.js"
From MakeICT Wiki
Jump to navigationJump to searchLine 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
(function () { | (function () { | ||
− | var | + | var cloneNodesToList = function(list, nodes) { |
− | + | for(var i=0; i<nodes.length; i++){ | |
− | + | var listItem = document.createElement("li"); | |
− | + | listItem.appendChild(nodes[i].cloneNode(true)); | |
− | + | list.appendChild(listItem); | |
− | + | } | |
+ | }; | ||
− | + | ||
− | + | cloneNodesToList($("#makeict-todo-summary")[0], $(".makeict-todo")); | |
− | + | cloneNodesToList($("#makeict-decision-summary")[0], $(".makeict-decision")); | |
− | |||
− | |||
− | |||
− | |||
}()); | }()); |
Revision as of 11:55, 8 March 2015
/* Any JavaScript here will be loaded for all users on every page load. */
(function () {
var cloneNodesToList = function(list, nodes) {
for(var i=0; i<nodes.length; i++){
var listItem = document.createElement("li");
listItem.appendChild(nodes[i].cloneNode(true));
list.appendChild(listItem);
}
};
cloneNodesToList($("#makeict-todo-summary")[0], $(".makeict-todo"));
cloneNodesToList($("#makeict-decision-summary")[0], $(".makeict-decision"));
}());