Login   Register  
PHP Classes
elePHPant
Icontem

File: trgrs_Todos.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael J. Fuhrman  >  Todo List  >  trgrs_Todos.js  >  Download  
File: trgrs_Todos.js
Role: Auxiliary data
Content type: text/plain
Description: JavaScript functions that determine what should be done when a link is selected
Class: Todo List
Manage a list of tasks of a to do list
Author: By
Last change:
Date: 4 years ago
Size: 1,965 bytes
 

Contents

Class file image Download
/*	=======================================
	Copyright 1998 - 2010 - E Net Arch
	This program is distributed under the terms of the GNU 
	General Public License (or the Lesser GPL).
	======================================= */

var ENetArch = 
{
	Todos :
	{
		nFolderID : 0, 
		nPos : 0, 
		aryIDs: new Array (), 
		onCheckID : function (me) 
		{ 
			this.nPos = me.value; 
			if (me.checked)
			{ this.aryIDs [me.value] = me.value; }
			else
			{ this.aryIDs [me.value] = undefined; }
		},
		List : function () { location="List.php?nFolderID=" + this.nFolderID + "&"; } ,
		New : function () { location="New.php?nFolderID=" + this.nFolderID + "&"; } ,
		View : function () { location="View.php?nFolderID=" + this.nFolderID + "&nPos=" + this.nPos + "&"; } ,
		Edit : function () { location="Edit.php?nFolderID=" + this.nFolderID + "&nPos=" + this.nPos + "&"; } ,
		Delete : function () 
		{ 
			var szIDs = "";
			for (t=0; t<this.aryIDs.length; t++)
				if (this.aryIDs[t]!= undefined) 
					szIDs += this.aryIDs[t] + ",";
			
			location="Delete.php?nFolderID=" + this.nFolderID + "&szIDs=" + szIDs + "&"; 
		} ,
		Times : { nTime : { onChange : function () {} } } , 
		Lengths : { nLength : { onChange : function () {} } } , 
		AddNew : function (me) 
		{ 
			me.method="post"; 
			me.action="add.php?nFolderID=" + this.nFolderID + "&"; 
			me.submit; 
		} , 
		Update : function (me) 
		{ 
			me.method="post"; 
			me.action="update.php?nFolderID=" + this.nFolderID + "&nPos=" + this.nPos + "&"; 
			me.submit; 
		} , 
	},
	
	Calendar :
	{
		dSelected : function (thsDate)
		{ 
			var nPos = ENetArch.Todos.nPos;
			if (nPos != 0)
			{
				location="Move.php?nFolderID=" + ENetArch.Todos.nFolderID + "&" +
					"nPos=" + nPos + "&" + "dTarget=" + thsDate + "&";
			}
			else
			{
				location="List.php?nFolderID=" + ENetArch.Todos.nFolderID + "&" +
					"dTarget=" + thsDate + "&";
			}
		}
	}
}