AnonSec Team
Server IP : 10.128.40.6  /  Your IP : 216.73.216.233
Web Server : Apache
System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : logmcpe ( 111175)
PHP Version : 7.3.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/logmcpe/www/TEST/www/../../MC/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/logmcpe/www/TEST/www/../../MC/todo.js
window.addEvent('domready', function() {

	Sortables.implement({
		serialize: function(){
			var serial = '';
			this.list.getChildren().each(function(el, i){
				serial += el.getProperty('id') + '_';
			}, this);
			return serial;
		}
	});
	
	var check = function(){
		$$('input.gtd_tache').each(function(item, index){
			item.addEvent('click', function(e) {
				gtd_done(item);
			});
		 });
		$$('input.gtd_done').each(function(item, index){
			item.addEvent('click', function(e) {
				gtd_undone(item);
			});
		 });
	}
	
	var check_sup = function(){
		$$('input.gtd_sup').each(function(item, index){
			item.addEvent('click', function(e) {
				if(warning()) gtd_sup(item);
			});
		 });
	}
	
	var loader = function(){
		check();
		mySortables = new Sortables('.todo', {
			handle: '.drag-handle',
			//This will constrain the list items to the list.
			constrain: true,
			//We'll get to see a nice cloned element when we drag.
			clone: true,
			//This function will happen when the user 'drops' an item in a new place.
			onComplete: function(){
				check();
				myString = mySortables.serialize();
				savePos.send("ordre_modifie="+myString);
			}  
		});
		mySortables_done = new Sortables('.done', {
			handle: '.drag-handle',
			//This will constrain the list items to the list.
			constrain: true,
			//We'll get to see a nice cloned element when we drag.
			clone: true,
			//This function will happen when the user 'drops' an item in a new place.
			onComplete: function(){
				check();
				myString = mySortables_done.serialize();
				savePos.send("ordre_modifie="+myString);
			}  
		});
		$('taches').addEvent('submit', function(e) {
			e.stop();
			var valv = $('taches_intitule').get('value');
			if (!valv) {
				$('taches_intitule').highlight('#f00').focus();	
				return; //Return will skip the rest of the code in the function. 
			}
			var val = '<img src="images/spacer.gif" width="6" />';
			var val = val + valv;
			
			this.set('load', {
				url: this.get("action"),
				method: this.get("method"),
				update: $('log'),
				evalScripts: true,
				onComplete: function() {
					var insert_id = $('log').get('text');
					var input = new Element('input', {type:'checkbox', 'class':'gtd_tache', id: 'check_'+insert_id});
					input.setProperty('name',insert_id);
					var li = new Element('li', {id: insert_id, style:'padding:8px; font-size:12px;', 'class':'gtd'});
					var handle = new Element('span', {id:'handle-'+i, 'class':'drag-handle', html:val});
					handle.inject(li, 'top');
					input.inject(li,'top');
					$('todo').adopt(li);
					li.highlight();
					i++;
					loader();
					mySortables.addItems(li);
				}
			});
			this.load(); 	
			$('taches_intitule').set('value', '');
		});
		
		$$('li.gtd').each(function(item, index){
			mySortables.addItems(item);
		});
		
		$$('li.gtdone').each(function(item, index){
			mySortables_done.addItems(item);
		});
		
		var list = 'edition_todolist'+typet;
		if (typet!='') var list_editer = editer_todolist_projets;
		else var list_editer = editer_todolist;
		
		$(list).addEvent('click', function(e) {
			list_editer.send();
		});
	}
	
	var loader_edi = function(){
		if (typet!='') var list = todolist_projets;
		else var list = todolist;
		check_sup();
		$('load_todolist').addEvent('click', function(e) {
			list.send();
		});
		$('taches').addEvent('submit', function(e) {
			e.stop();
			this.set('load', {
				url: this.get("action"),
				method: this.get("method"),
				update: $('test'),
				onComplete: function() {list.send();}
			});
			this.load(); 	
		});
	}

	
	
	var gtd_done = function(item){
		name = item.getProperties('name');
		val_name = name['name'];
		effectue_todolist = new Request.HTML({url:'code/taches/traitements.php', evalScript: true, update: $('test'), method: 'post', data: 'action=tache_accomplie&taches_id='+val_name});
		effectue_todolist.send();
		mySortables_done.addItems($(val_name));
		mySortables.removeItems($(val_name));
		$(val_name).inject($('done'),'top');
		$(val_name).highlight();
		$(val_name).removeClass('gtd');
		$(val_name).addClass('gtdone');
		name = 'check_'+val_name;
		$(name).removeClass('gtd_tache');
		$(name).addClass('gtd_done');
		$$('li.gtd').each(function(item, index){
			mySortables.addItems(item);
		});
		$$('li.gtdone').each(function(item, index){
			mySortables_done.addItems(item);
		});
		check();
	}
	
	var gtd_undone = function(item){
		name = item.getProperties('name');
		val_name = name['name'];
		non_effectue_todolist = new Request.HTML({url:'code/taches/traitements.php', evalScript: true, update: $('test'), method: 'post', data: 'action=tache_nonaccomplie&taches_id='+val_name});
		non_effectue_todolist.send();
		mySortables.addItems($(val_name));
		mySortables_done.removeItems($(val_name));
		$(val_name).inject($('todo'),'bottom');
		$(val_name).highlight();
		$(val_name).removeClass('gtdone');
		$(val_name).addClass('gtd');
		name = 'check_'+val_name;
		$(name).removeClass('gtd_done');
		$(name).addClass('gtd_tache');
		$$('li.gtd').each(function(item, index){
			mySortables.addItems(item);
		});
		
		$$('li.gtdone').each(function(item, index){
			mySortables_done.addItems(item);
		});
		
		check();
	}
	
	var gtd_sup = function(item){
		name = item.getProperties('name');
		val_name = name['name'];
		sup_todolist = new Request.HTML({url:'code/taches/traitements.php', evalScript: true, update: $('test'), method: 'post', data: 'action=tache_supprimee&taches_id='+val_name});
		sup_todolist.send();
		mySortables.removeItems($(val_name));
		$(val_name).dispose();
		$('test').highlight();
		//check_sup();
	}
	
	var savePos = new Request.HTML({method: 'post', evalScript: true, update: $('test'), url: 'code/taches/traitements.php'});
	
	var i = compteur;
	
	editer_todolist = new Request.HTML({url:'todo.php', update: $('todolist'), evalScript: true, method: 'post', data: 'type=edition', onComplete: function() {loader_edi();}});
	
	editer_todolist_projets = new Request.HTML({url:'todo_projets.php', update: $('todolist'), evalScript: true, method: 'post', data: 'type=edition', onComplete: function() {loader_edi();}});
	
	todolist = new Request.HTML({url:'todo.php', update: $('todolist'), evalScript: true, method: 'post', onComplete: function() {loader();}});
	todolist_projets = new Request.HTML({url:'todo_projets.php', update: $('todolist'), evalScript: true, method: 'post', onComplete: function() {loader();}});
	loader();
});

AnonSec - 2021