Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] peg_nested_comments
NicolasGraph wrote #294798:
Ok, i’ll give it a try.
Feel free to change the entire “Reply to” block if it helps, it was just a rapid bricolage for my own use. We can totally hide the input field and replace it with something less disturbing, for example.
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
etc wrote #294823:
Feel free to change the entire “Reply to” block if it helps, it was just a rapid bricolage for my own use. We can totally hide the input field and replace it with something less disturbing, for example.
Ok, I’ve done my own quick bricolage for now:
// adds an invisible value to the reply form
// telling us what comment is being replied to
// pretty much swiped from cha_comment_reply
function peg_reply_to($atts) {
extract(lAtts(array(
'back' => '#',
'label' => 'Replying to',
'close' => '×',
'size' => 25
),$atts));
$reply_to = htmlspecialchars(ps('peg_replyto'));
$reply_to_input = htmlspecialchars(ps('peg_replyto_input'));
return
'<span id="peg_replyto_wrap" style="'.($reply_to?'':'display:none').'">'.n.
'<label for="peg_replyto_input" id="peg_replyto_label">'.$label.'</label><input type="text" name="peg_replyto_input" id="peg_replyto_input" value="'.$reply_to_input.'" readonly="readonly" size="'.$size.'" /><input type="hidden" name="peg_replyto" id="peg_replyto" value="'.$reply_to.'" />'.n.
($back ? '<a id="peg_replyto_backlink" href='.($reply_to?"#c$reply_to":"#").'>'.$back.'</a>' : '').n.
($close ? '<a id="peg_replyto_closelink" href="#peg_replyto_input" title="Empty" onclick="return peg_selectComment(null,null,null,this);">'.$close.'</a>' : '').'</span>'.n.
'<script type="text/javascript">
function peg_selectComment(discussid,name,title,target) {
var pegSelect = document.getElementById("peg_replyto");
var pegSelectWrap = document.getElementById("peg_replyto_wrap");
var pegSelectInput = document.getElementById("peg_replyto_input");
var pegSelectBack = document.getElementById("peg_replyto_backlink");
if(pegSelect) pegSelect.value = discussid;
if(pegSelectWrap) {
pegSelectWrap.setAttribute("style", discussid?"":"display:none");
}
if(pegSelectInput) {
pegSelectInput.value = (name?name:"");
pegSelectInput.title = (title?title:"");
}
if(pegSelectBack) {
pegSelectBack.href = (discussid?"#c"+discussid:null);
pegSelectBack.title = (discussid?discussid:"");
}
return !!discussid;
}
</script>';
}
Instead of hidding the peg_replyto_dock
, I use display:none
on a wrapper span which hide the whole block and collapse it space when the user is not replying.
I also removed the peg_replyto_dock
span, added a label with its own attribute and changed the new
attribute to close
. That’s it I think.
On simple comment:
On replying (using custom attributes values):
Last edited by NicolasGraph (2015-09-15 20:01:02)
Offline
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
Thanks Nicolas, it’s fine with me, but display:none
could provoke a jump in some layouts. We could probably somehow delegate it to user CSS ?
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
Oh yes, we could just switch between two classes and let the user choose if he wants to hide the block and how, or if he wants to play with its opacity or whatever… CSS exemples can be include in plugin help.
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
NicolasGraph wrote #294868:
Oh yes, we could just switch between two classes and let the user choose if he wants to hide the block and how, or if he wants to play with its opacity or whatever… CSS exemples can be include in plugin help.
Yes, I like it! What if we put it on Github, so you will be able to modify it directly? It’s rather disappointing to wait for someone when you have inspiration.
Offline
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
Ok, created a repository for it. What is your github username?
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
etc wrote #294878:
Ok, created a repository for it. What is your github username?
It’s the sams as here: NicolasGraph
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
You’ve got the power to upload the new version now. :) I will then redirect the download link on my site to Github.
Offline
#47 2015-09-16 12:52:33
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: [plugin] [ORPHAN] peg_nested_comments
Do you want this topic still be labelled an orphaned plugin, Oleg?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: [plugin] [ORPHAN] peg_nested_comments
etc wrote #294882:
You’ve got the power to upload the new version now. :) I will then redirect the download link on my site to Github.
Thanks… I never felt as powerful as today! :)
Offline