var groupId = Math.floor(Math.random()*1000000000); var error_message = "Une erreur est survenue !!\n\nRaffraichissez votre navigateur..."; var block1_content = ''; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function findObj(theObj, theDoc) { var p, i, foundObj; if(!theDoc) theDoc = document; if( (p = theObj.indexOf("?")) > 0 && parent.frames.length) { theDoc = parent.frames[theObj.substring(p+1)].document; theObj = theObj.substring(0,p); } if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj]; for (i=0; !foundObj && i < theDoc.forms.length; i++) foundObj = theDoc.forms[i][theObj]; for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) foundObj = findObj(theObj,theDoc.layers[i].document); if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj); return foundObj; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function myCallBackOnFinishUp(obj){ document.getElementById('block1').innerHTML = block1_content; //Cookie.set('ma_une_perso_active',1); //initBlock(); //new Effect.BlindDown(obj.element.id,{duration:3,afterFinish: myCallBackOnFinishDown}); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function myCallBackOnFinishDown(obj){ //alert(block1_content); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function active_votre_une() { var opt = { method: 'get', onSuccess: function(t) { block1_content = t.responseText; //new Effect.BlindUp('block_votre_une',{duration:3,afterFinish: myCallBackOnFinishUp}); document.getElementById('block_votre_une').innerHTML = block1_content; Cookie.set('ma_une_perso_active',1); initBlock(); }, // Handle 404 on404: function(t) { alert(error_message); }, // Handle other errors onFailure: function(t) { alert(error_message); } } new Ajax.Request('/static/your_block.php', opt); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function desactive_votre_une() { var opt = { method: 'get', // Handle successful response onSuccess: function(t) { block1_content = t.responseText; //new Effect.BlindUp('block_votre_une',{duration:3,afterFinish: myCallBackOnFinishUp}); Sortable.destroy('thelist'); Cookie.set('ma_une_perso_active',0); document.getElementById('block_votre_une').innerHTML = block1_content; }, // Handle 404 on404: function(t) { alert(error_message); }, // Handle other errors onFailure: function(t) { alert(error_message); } } new Ajax.Request('', opt); } var configAllOpened = false; //////////////////////////////////////////////////////////////////////////////// function openConfigAll() { var opt = { method: 'get', // Handle successful response onSuccess: function(t) { document.getElementById('config_all').innerHTML = t.responseText; if(!forConfig) new Effect.BlindDown('config_all'); configAllOpened = true; forConfig = 0; document.getElementById("block_list").innerHTML = ""; for(var i=0;i
"+tabBlocks[i]['title']+" ("+tabBlocks[i]['limit']+" article)
X
"; } Sortable.create('block_list',{onUpdate:getNewConfig}); }, // Handle 404 on404: function(t) { alert(error_message); }, // Handle other errors onFailure: function(t) { alert(error_message); } } if(!configAllOpened) new Ajax.Request('/static/your_block_config.php', opt); else close_config_all(); } //////////////////////////////////////////////////////////////////////////////// function delBlock(id) { var tmpData = new Array(); for(var i=0;i
"+tabBlocks[i]['title']+" ("+tabBlocks[i]['limit']+" article)
X
"; } Sortable.create('block_list',{onUpdate:getNewConfig}); } if(!reloadNotAllblock) initBlock(); reloadNotAllblock = 0; } //////////////////////////////////////////////////////////////////////////////// function close_config_all(){ configAllOpened = false; new Effect.BlindUp('config_all'); } //////////////////////////////////////////////////////////////////////////////// function serialize_tabBlocks(data) { var str_serialize = ''; for(var i=0;i0) str_serialize+='|NEWLINE|'; str_serialize+=escape(data[i]['id'])+'|SEPARATOR|'; str_serialize+=escape(data[i]['title'])+'|SEPARATOR|'; str_serialize+=escape(data[i]['collection'])+'|SEPARATOR|'; str_serialize+=escape(data[i]['limit']); } return str_serialize; } ////////////////////////////////////// function unserialize_tabBlocks(str) { var str = new String(str); var data = new Array(); var data_0 = str.split('|NEWLINE|'); for(var i=0;i 0) { sousMenu = UL[0].style; if(sousMenu.display == 'none' || sousMenu.display == '') { sousMenu.display = 'block'; if(document.all) { for(var i=0;i