[SPIP] +2.1.12
[velocampus/web/www.git] / www / plugins / auto / aveline / inclure / js_formulaire_reponse_volant.html
1 <script type="text/javascript">/*<!#EVAL{chr(91)}CDATA#EVAL{chr(91)}*/
2
3 jQuery.fn.add_reply_to = function(id_thread){
4 var me = jQuery(this).parents('li.comment-li').eq(0);
5 if (me.find('#formulaire_forum').length==0){
6 jQuery('div.comments p.repondre').show();
7 jQuery('#formulaire_forum')
8 .hide()
9 .detach()
10 .appendTo(me.children('div.form_response'))
11 .slideDown('fast')
12 .find('form')
13 .removeClass('noajax')
14 .find('input[name=id_forum]').val(id_thread);
15
16 me.find('p.repondre').first().hide();
17 jQuery('#formulaire_forum').find('form.preview,.reponse_formulaire').remove();
18 if ($('.comment-form h2 a').length == 0)
19 jQuery('.comment-form h2').wrapInner('<a href="#forum-formulaire-principal" onClick="jQuery(this).main_reply();return false;"><\/a>');
20 jQuery(me).find('.comment').last().find('p').last().positionner(true);
21 }
22 }
23 jQuery(function(){
24 var ancre = window.location.hash;
25 var id;
26 if ((id=ancre.match(/^#(forum|comment)([0-9]+$)/)) && jQuery(ancre).length==0){
27 var a = jQuery('.comments-thread a.lien_pagination').last();
28 if( a.length > 0){
29 var href = a.attr('href');
30 href = href.replace(/debut_comments-list=[0-9]+#.*$/,'debut_comments-list=@@'+id[2]+ancre);
31 a.after("<a href='"+href+"' style='visibility:hidden' id='forum"+id[2]+"' class='lien_pagination'>Go<\/a>");
32 jQuery(a.parents('div.ajaxbloc').first()).ajaxbloc();
33 jQuery(ancre).eq(0).click();
34 }
35 }
36 });
37 jQuery.fn.main_reply = function(){
38 var me = jQuery(this).parents('.comment-form').eq(0);
39 if (me.find('#formulaire_forum').length==0){
40 jQuery('div.comments p.repondre').show();
41 jQuery('#formulaire_forum')
42 .hide()
43 .detach()
44 .appendTo(me)
45 .slideDown('fast')
46 .find('form')
47 .removeClass('noajax')
48 .find('input[name=id_forum]').val(0);
49
50 me.find('h2 a').contents().unwrap();
51 jQuery('#formulaire_forum').find('form.preview,.reponse_formulaire').remove();
52 me.find('h2').positionner(true);
53 }
54 }
55 /*#EVAL{chr(93)}[(#EVAL{chr(93)})]>*/</script>