User:Animum/todo.js

//HOW-TO: //Add the following lines and to-do items to your JavaScript file (without the "//") where appropriate: //importScript('User:Animum/todo.js'); //var todo_list = ["Item 1", "Item 2", "Item 3", "etc."]; //The last item shouldn't have a comma after the closing quotation mark.

function displayTodoList { if(typeof(todo_list) == 'undefined') { alert("Please add a to-do list to your JavaScript file in this format (you can have as many items in the list as you like) and then purge your cache:\n\nvar todo_list = [\"Item 1\", \"Item 2\", \"Item 3\"];"); } else { var todo_list_text = ""; for(i=0; i<todo_list.length; i++) { todo_list_text += (i+1) + ". " + todo_list[i] + "\n\n"; }       alert(todo_list_text); } }

$(function {   mw.util.addPortletLink("p-cactions", "javascript:displayTodoList", "todo", "ca-todo"); });