[SPIP] +2.1.12
[velocampus/web/www.git] / www / plugins / auto / aveline / inclure / js_formulaire_reponse_volant.html
diff --git a/www/plugins/auto/aveline/inclure/js_formulaire_reponse_volant.html b/www/plugins/auto/aveline/inclure/js_formulaire_reponse_volant.html
new file mode 100644 (file)
index 0000000..e2ad8fb
--- /dev/null
@@ -0,0 +1,55 @@
+<script type="text/javascript">/*<!#EVAL{chr(91)}CDATA#EVAL{chr(91)}*/\r
+\r
+       jQuery.fn.add_reply_to = function(id_thread){\r
+               var me = jQuery(this).parents('li.comment-li').eq(0);\r
+               if (me.find('#formulaire_forum').length==0){\r
+                       jQuery('div.comments p.repondre').show();\r
+                       jQuery('#formulaire_forum')\r
+                               .hide()\r
+                               .detach()\r
+                               .appendTo(me.children('div.form_response'))\r
+                               .slideDown('fast')\r
+                               .find('form')\r
+                               .removeClass('noajax')\r
+                               .find('input[name=id_forum]').val(id_thread);\r
+\r
+                       me.find('p.repondre').first().hide();\r
+                       jQuery('#formulaire_forum').find('form.preview,.reponse_formulaire').remove();\r
+                       if ($('.comment-form h2 a').length == 0)\r
+                               jQuery('.comment-form h2').wrapInner('<a href="#forum-formulaire-principal" onClick="jQuery(this).main_reply();return false;"><\/a>');\r
+                       jQuery(me).find('.comment').last().find('p').last().positionner(true);\r
+               }\r
+       }\r
+       jQuery(function(){\r
+               var ancre = window.location.hash;\r
+               var id;\r
+               if ((id=ancre.match(/^#(forum|comment)([0-9]+$)/)) && jQuery(ancre).length==0){\r
+                       var a = jQuery('.comments-thread a.lien_pagination').last();\r
+                       if( a.length > 0){\r
+                               var href = a.attr('href');\r
+                               href = href.replace(/debut_comments-list=[0-9]+#.*$/,'debut_comments-list=@@'+id[2]+ancre);\r
+                               a.after("<a href='"+href+"' style='visibility:hidden' id='forum"+id[2]+"' class='lien_pagination'>Go<\/a>");\r
+                               jQuery(a.parents('div.ajaxbloc').first()).ajaxbloc();\r
+                               jQuery(ancre).eq(0).click();\r
+                       }\r
+               }\r
+       });\r
+       jQuery.fn.main_reply = function(){\r
+               var me = jQuery(this).parents('.comment-form').eq(0);\r
+               if (me.find('#formulaire_forum').length==0){\r
+                       jQuery('div.comments p.repondre').show();\r
+                       jQuery('#formulaire_forum')\r
+                               .hide()\r
+                               .detach()\r
+                               .appendTo(me)\r
+                               .slideDown('fast')\r
+                               .find('form')\r
+                               .removeClass('noajax')\r
+                               .find('input[name=id_forum]').val(0);\r
+\r
+                       me.find('h2 a').contents().unwrap();\r
+                       jQuery('#formulaire_forum').find('form.preview,.reponse_formulaire').remove();\r
+                       me.find('h2').positionner(true);\r
+               }\r
+       }\r
+       /*#EVAL{chr(93)}[(#EVAL{chr(93)})]>*/</script>
\ No newline at end of file