diff --git a/ajax/listToReserve.php b/ajax/listToReserve.php
new file mode 100644
index 0000000..ecee938
--- /dev/null
+++ b/ajax/listToReserve.php
@@ -0,0 +1,18 @@
+
+$reserve = $_POST['reserve'];
+
+$doc = new DOMDocument;
+$doc->load('../db/links.xml');
+
+$xpath = new DOMXpath($doc);
+
+// Buffering and deleting moved element
+foreach($xpath->query('label/link[title = "'.$reserve.'"]') as $node) {
+ $buffer = $node;
+ $node->parentNode->removeChild($node);
+}
+
+$searchLabel = $xpath->query('reserve');
+
+$searchLabel->item(0)->appendChild($buffer);
+$doc->save('../db/links.xml');
\ No newline at end of file
diff --git a/ajax/loadReserve.php b/ajax/loadReserve.php
index c9daa1e..58f772b 100644
--- a/ajax/loadReserve.php
+++ b/ajax/loadReserve.php
@@ -5,7 +5,7 @@ if($links_xml = simplexml_load_file('../'.links::LINKS_FILE)){
foreach($links as $label){
echo '
';
}
diff --git a/class/Links.php b/class/Links.php
index 9af529e..f37184f 100644
--- a/class/Links.php
+++ b/class/Links.php
@@ -20,7 +20,7 @@ class links {
echo ''.$label['id'].'
';
@@ -28,7 +28,7 @@ class links {
}else{
echo 'Can\'t find '.self::LINKS_FILE;
}
- echo '';
+ echo '';
}
diff --git a/css/links.css b/css/links.css
index 82f65d4..028d916 100644
--- a/css/links.css
+++ b/css/links.css
@@ -1,4 +1,5 @@
#reserve{display:none;background:#000;}
+.deleteLink{display:none; position:absolute; top:-5px; right:-5px;width:16px !important; height:16px !important;}
.divider {
display:block;
@@ -12,6 +13,7 @@
ul.iconlist li, ul#reserveiconlist li{
/*display:inline-block;*/
+ position:relative;
float:left;
margin:0 10px 10px 0;
text-align:center;
diff --git a/images/links/meebo.png b/images/links/meebo.png
new file mode 100644
index 0000000..5e77224
Binary files /dev/null and b/images/links/meebo.png differ
diff --git a/js/jquery.links.js b/js/jquery.links.js
index af436d3..68da52f 100644
--- a/js/jquery.links.js
+++ b/js/jquery.links.js
@@ -5,7 +5,7 @@ $(document).ready(function(){
// Apparition de la reserve de liens
$('#links-menu').live('click', function(){
- $('#reserve').show();
+ //$('#reserve').show();
$.get('ajax/loadReserve.php', function(html){
$.fancybox(
html,
@@ -24,13 +24,23 @@ $(document).ready(function(){
$('#reserveiconlist .item').live('click', function(e){
e.preventDefault();
$.post("ajax/reserveToList.php", {reserve: $(this).attr('id')});
- $('#Entertainment').append($(this).parent().html());
+ $('.iconlist').last().append($(this).parent().html());
$.fancybox.close();
});
//Passage Liste => Reserve
+ $('.item').mouseover(function(){
+ $(this).children('.deleteLink').show();
+ });
+ $('.item').mouseout(function(){
+ $(this).children('.deleteLink').hide();
+ });
+ $('.deleteLink').click(function(){
+ $.post("ajax/listToReserve.php", {reserve: $(this).parent().attr('id')});
+ $(this).parent().fadeOut();
+ });
// ??
// Mouvement des liens avec enregistrement