Wednesday, May 27, 2009

The To-Do gadget's XML file

<?xml version="1.0" encoding="UTF-8" ?>
- <Module>
- <ModulePrefs
title="__UP_title__"
category="tools"
render_inline="optional"
scrolling="false"
author="Sophia B."
directory_title="__MSG_todo__"
author_email="sophia.feedback+todo@gmail.com"
author_affiliation="Google Inc."
author_location="Mountain View, CA"
screenshot="/ig/modules/todo.png"
singleton="false"
thumbnail="/ig/modules/todo-thm.png"
description="__MSG_description__">
<Locale messages="todo_content/todo_en.xml" />
<Locale lang="ar"
messages="todo_content/todo_ar.xml" language_direction="rtl" />
<Locale lang="bg"
messages="todo_content/todo_bg.xml" />
<Locale lang="ca"
messages="todo_content/todo_ca.xml" />
...
<Require feature="setprefs" />
</ModulePrefs>
<UserPref name="title"
display_name="__MSG_title__"
required="false"
default_value="__MSG_todo__" />
- <UserPref name="bgcolor"
display_name="__MSG_background_color__"
default_value="#e5ecf9" datatype="enum">
<EnumValue display_value="__MSG_yellow__" value="#ffffcc" />
<EnumValue display_value="__MSG_blue__" value="#e5ecf9" />
...
</UserPref>
<UserPref name="todos" default_value="" datatype="hidden" />
- <Content type="html" view="home,canvas">
- <![CDATA[

<script
src="/ig/f/SEyhujSxXEM/modules/todo/todo_content/json_1.js">
</script>

<script>
var todos__MODULE_ID__,
editedPrior__MODULE_ID__,
editedName__MODULE_ID__,
prefs__MODULE_ID__,
evenRowColor__MODULE_ID__="#fff";

_IG_RegisterOnloadHandler(
function(){
loadTodos__MODULE_ID__();
window._IG_RegisterMaximizeHandler && _IG_RegisterMaximizeHandler( __MODULE_ID__,
loadTodos__MODULE_ID__)
}
);
function loadTodos__MODULE_ID__(){
prefs__MODULE_ID__=new _IG_Prefs(__MODULE_ID__);
evenRowColor__MODULE_ID__ =
prefs__MODULE_ID__.getString("bgcolor").replace(/[^a-f0-9#]/g,"");
var a=prefs__MODULE_ID__.getString("todos");
todos__MODULE_ID__=a==""?{array:[]}:JSON.parse(a);
editedName__MODULE_ID__ = editedPrior__MODULE_ID__=-1;
createTable__MODULE_ID__()
}
function saveTodos__MODULE_ID__(){
prefs__MODULE_ID__.set(
"todos",
JSON.stringify(todos__MODULE_ID__)
);
_gel("newTodoInput__MODULE_ID__").focus()
}
function addTodo__MODULE_ID__(a,c){
resolvePendingEdits__MODULE_ID__();
a=_trim(a);
_gel("newTodoInput__MODULE_ID__").value="";
if(!(a=="")){
todos__MODULE_ID__.array[
todos__MODULE_ID__.array.length]
={name:a,priority:c};
createTable__MODULE_ID__();
saveTodos__MODULE_ID__();
return false
}
}
function deleteTodo__MODULE_ID__(a){
resolvePendingEdits__MODULE_ID__();
var c=todos__MODULE_ID__.array.slice(0,a),
b=todos__MODULE_ID__.array.slice(
a+1,todos__MODULE_ID__.array.length);
todos__MODULE_ID__.array=c.concat(b);
createTable__MODULE_ID__();
saveTodos__MODULE_ID__()
}
function swapTodos__MODULE_ID__(a,c){...}
function sortByPriority__MODULE_ID__(a){...}
function setPriority__MODULE_ID__(a,c){...}
function createTable__MODULE_ID__(){...}
function createRow__MODULE_ID__(a,c,b){...}
...
</script>

<style>...</style>

<form name = newTodoForm__MODULE_ID__
onsubmit="return addTodo__MODULE_ID__(
document.newTodoForm__MODULE_ID__.
newTodoInput__MODULE_ID__.value, 3, false)">
<table cellspacing=0>
<tr>
<td id=new_todo_td__MODULE_ID__>
<nobr>__MSG_new_item__</nobr>
</td>
<td style=width:100%>
<input id=newTodoInput__MODULE_ID__ style=width:100%>
</td>
<td>
<input onclick="javascript:addTodo__MODULE_ID__(
document.newTodoForm__MODULE_ID__.
newTodoInput__MODULE_ID__.value, 3, false)" type=button value="__MSG_add__">
</td>
</table>
<div id=todosDiv__MODULE_ID__></div>
</form>
]]>
</Content>
</Module>


No comments:

Post a Comment