At bottom of reply form, show post being replied to (Technics)

by Francois @, France, Thursday, November 01, 2012, 16:18 (4187 days ago)

Hi,
Thanks for a lot for this wonderful mylittleforum...
I'm creating a forum which about literature and it's quite important to see the message being replied to.
I know we can get the preview by clicking on the "bubble" button, but it's not ergonomic and it disappear as soon as we write in the reply form.
I would like the message being replied to, to appear as a block, at the bottom of the reply form.

How can I achieve that?

Thanks a lot for your help...

Avatar

At bottom of reply form, show post being replied to

by Alfie ⌂, Vienna, Austria, Thursday, November 01, 2012, 20:37 (4187 days ago) @ Francois

How can I achieve that?

With active JavaScript:

[image]

--
Cheers,
Alfie (Helmut Schütz)
BEBA-Forum (v1.8β)

At bottom of reply form, show post being replied to

by François @, Thursday, November 01, 2012, 23:43 (4187 days ago) @ Alfie

Thanks! But I would like to achieve this automatically. So people don't have to click on any button to display the post being replied to.
I can use {$text} in the posting.inc.tpl file, but then, instead of the line breaks I get ">" symbols.

At bottom of reply form, show post being replied to

by François @, Friday, November 02, 2012, 01:00 (4187 days ago) @ François

I also tried to use {$posting}but it doesn't display the message being replied to. Is there any solution?

Avatar

At bottom of reply form, show post being replied to

by Auge ⌂, Saturday, November 03, 2012, 00:30 (4186 days ago) @ François

Hello

I also tried to use {$posting}but it doesn't display the message being replied to. Is there any solution?

Please test the answer form with disabled JavaScript. You will see, that the message, you want to reply to, will be displayed on top of the textarea. The script hides the message after loading the answer page and inserts the "quote message" link into the document.

Milo should be able to name the JavaScript function wich hides the message and how to disable this function (in this context).

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!

Avatar

At bottom of reply form, show post being replied to

by Micha ⌂, Saturday, November 03, 2012, 08:34 (4186 days ago) @ Auge

Hi,

Milo should be able to name the JavaScript function wich hides the message and how to disable this function (in this context).

The function is in posting.js (or rather in posting.min.js).

The old posting in the area is saved in an attribute quote of the textarea.

 /**
  * Initialisiert die Textarea
  * und setzt Funktionen zum Ermitteln 
  * des selektierten Textes
  */
 var initTextArea = function() {
  // Sichert den (alten) Text in der Area
  textarea.quote = "";
  if (document.getElementById("quote") && document.getElementById("quote").value == "true") {
   textarea.quote = textarea.value;
   textarea.value = "";
  }
 
  textarea.getQuote = function() {
   return textarea.quote.trim();
  }
 
  // Zitieren-Link einfuegen
  if (textarea.getQuote() != "" && document.getElementById("message")) {
   var labels = document.getElementById("message").getElementsByTagName("label");
   var label = null;
   for (var i=0; i<labels.length; i++) { 
    if (labels[i].className.search(/textarea/) != -1) {
     label = labels[i];
     break;
    }
   }
   if (label) {
    label.appendChild( document.createTextNode( String.fromCharCode(160) ) );
    var quoteLink = document.createElementWithAttributes("a", {"onclick": function(e) {textarea.value = textarea.getQuote() + "\r\n\r\n" + textarea.value; this.style.display = "none"; textarea.focus(); return false;}, "id": "insert-quote", "href": window.location.href, "title": lang["quote_title"] }, label);
    quoteLink.appendChild( document.createTextNode(lang["quote_label"]) );
   }
  }
//....

cu Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

At bottom of reply form, show post being replied to

by François @, Saturday, November 03, 2012, 12:54 (4186 days ago) @ Micha

Thanks a lot for your very kind help!
I tried this method, (hope I did it right) and I can see the text, but the problem is that I would like to get the message being replied to, outside the text area for important ergonomic reasons.

Let me show you a picture of what I try to achieve (I did it with photoshop)
For now, I can display the text using {$text} but problem is that it doesn't keep the line breaks.

[image]

Avatar

At bottom of reply form, show post being replied to

by Alex ⌂, Saturday, November 03, 2012, 13:41 (4186 days ago) @ François

Hi François,

you can display the raw text with the following code (themes/default/subtemplates/posting.inc.tpl):

{if $text}<pre>{$text}</pre>{/if}

But it isn't HTML formatted, it's the text displayed in the textarea. For everything else you would need to go deeper in the code.

Alex

RSS Feed of thread