Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2015-09-15 09:11:07

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

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

#38 2015-09-15 09:39:14

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#39 2015-09-15 19:13:22

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [plugin] [ORPHAN] peg_nested_comments

Previous post definitely updated… I hope!


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#40 2015-09-16 11:10:03

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

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

#41 2015-09-16 11:16:26

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#42 2015-09-16 11:44:18

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

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

#43 2015-09-16 11:51:30

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [plugin] [ORPHAN] peg_nested_comments

etc wrote #294873:

Ok, let’s do it. I’m not fluent in js yet but I would be glad to help for easy things if I can.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#44 2015-09-16 12:29:41

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: [plugin] [ORPHAN] peg_nested_comments

Ok, created a repository for it. What is your github username?

Offline

#45 2015-09-16 12:32:31

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#46 2015-09-16 12:39:23

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

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,304

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

#48 2015-09-16 13:06:41

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

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! :)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB