dwp-forge / refnotes

4 stars 6 forks source link

[request] a parameter to hide footnote #25

Closed dwp-forge closed 9 years ago

dwp-forge commented 9 years ago
The plugin is great, thank you.
It would be very useful to add a function that would leave the popup when the mouse
is placed over the note, and which would hide the footnote that appears at the bottom
of the page.

For exemple, on the following page, I used the note to show instructions and photos
in a table, but it is useless to display the note again at the bottom.

http://odeur.comuv.com/doku.php?id=construction:hotte_a_flux_laminaire#budget

#What version of the product are you using? On what operating system?
#Release 2012-10-13 "Adora Belle"
#Refnotes 2012-05-14
#Windows 7, firefox

Original issue reported on code.google.com by william.belr on 2013-01-06 19:58:08

dwp-forge commented 9 years ago
I'm not sure if that feature would fit well into scope of RefNotes. It seems that what
you are looking for is just a tooltip without any references. Maybe some other plugin
(e.g. https://www.dokuwiki.org/plugin:tooltip ) will suite your needs better.

Original issue reported on code.google.com by dwp-forge on 2013-01-06 20:15:38

dwp-forge commented 9 years ago
The tooltip plugin is not compatible with the lastest dokuwiki version. RefNotes would
be just fine with a slight adjustment.

Original issue reported on code.google.com by william.belr on 2013-01-06 20:47:27

dwp-forge commented 9 years ago
Sorry, but lack of support for other plugins doesn't sound like a good reason for feature
creep in RefNotes. It is not a generic text formatting plugin -- it's designed to manage
footnotes.

If you consider it a slight adjustment, go ahead and patch it yourself. I don't mind.

Original issue reported on code.google.com by dwp-forge on 2013-01-06 21:43:57

dwp-forge commented 9 years ago
I meant that you might add a parameter to the namespaces options. Of course I would
if I could, but I don't have as much skill as you in that domain. Fortunatly, dokuwiki
allows me to share others skills. I'm glad that you shared that plugin and I'm glad
that I can use it in many ways, even if the result is not ideal.

Original issue reported on code.google.com by william.belr on 2013-01-07 03:45:36

dwp-forge commented 9 years ago
As I said, I don't want to officially add this feature. Using RefNotes for tooltips
is just like hammering nails with a microscope. But if you really want to do that,
a simple hack would be to skip rendering of notes in particular namespace:

===================================================================
--- namespace.php   (revision 505)
+++ namespace.php   (working copy)
@@ -440,7 +440,7 @@
         $this->resetScope();
         $html = '';

-        if (count($this->scope) > 0) {
+        if (($this->name != ":hidden:") && (count($this->scope) > 0)) {
             $html = $this->getCurrentScope()->renderNotes($limit);
         }

Original issue reported on code.google.com by dwp-forge on 2013-01-07 08:02:51

dwp-forge commented 9 years ago
Indeed, it hides the footnote. But do you have any clues why it also blocks the popup?
Thank you.

Original issue reported on code.google.com by william.belr on 2013-01-07 22:10:25

dwp-forge commented 9 years ago
Yeah, I didn't think of that. The popup shows the text of footnote. No footnote -- no
popup. Maybe you can experiment with wrapping notes HTML for :hidden: namespace into
a div with display:none style, so that HTML is still there but it isn't shown.

Original issue reported on code.google.com by dwp-forge on 2013-01-07 22:48:07

dwp-forge commented 9 years ago
Awesome! Thanks !

    public function renderNotes($limit = '') {
        $this->resetScope();
        $html = '';

        if (($this->name != ":hidden:") && (count($this->scope) > 0)) {
            $html = $this->getCurrentScope()->renderNotes($limit);
        } elseif (count($this->scope) > 0) {
            $html = '<div style="display:none">'.$this->getCurrentScope()->renderNotes($limit).'</div>';
        }

        return $html;
    }

Original issue reported on code.google.com by william.belr on 2013-01-08 00:48:03