Optionally place watcher link in node links section
| Project: | Watcher |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
This patch allows you to choose where to put the watcher toggle link - either at the bottom of the node body (as it does now), or in the standard node links section.
I had to alter some CSS to get the link to display inline and without custom formatting, but its a little theme-specific so I'll just post it here and the module maintainer can integrate with the module as they see fit.
.links .watcher a {
background-image: url(/sites/all/modules/watcher/images/unwatch.gif) !important;
display: inline;
font-weight: normal;
}
.links .watcher a.watcher_node_toggle_watching_link_watched {
background-image: url(/sites/all/modules/watcher/images/watch.gif) !important;
}
.links .watcher a.watcher_node_help_link_to_binder {
display: none;
}
.links .watcher_node_watched {
background: none !important;
}A couple of minor issues I ran into:
- Use of !important in the standard style is nasty - it makes it harder to override in custom css.
- The "eye" background-image in css is a property of the parent element, not the link anchor, therefore it is not clickable. If moved to the anchor element it would be clickable as part of the link (my css above does this in node links mode).
- I would like shorter text when putting the watcher link in the links section (e.g. "Watch this" / "Stop watching" or "Notifications on/off"), but it has to be overridden in code, or using the locale module with a fake English language (yuck). Consider making the default link text strings admin variables? In fact I might go write another patch to enable this.
- Fade in/out when clicked causes problem when using inline links as all links to the right "squash up" to the left when the link disappears, then move back to the right when it reappears.
| Attachment | Size |
|---|---|
| links.patch | 5.43 KB |

#1
Ok here is another patch adding the ability to customise the watch link text in the admin settings UI.
#2
Solution to the other links shifting left/right when the watcher link fades out then back in:
In watcher.js,
replace
$(el).fadeOut("normal")(1 occurrence)with
$(el).fadeTo("normal", 0.2)and
$(el).fadeIn("normal")(2 occurrences)with
$(el).fadeTo("normal", 1)This does a partial fade, but the whole element does not disappear.
#3
The CSS is the way it is for several reasons, some of them due to legacy. I agree about the important statement, it's nasty, however it shouldn't stop you from overriding it.
I'll take into consideration having the module implement hook_link().
#4
#5
Glad I just found out about this module. The mark/unmark paradigm is very intuitive.
Indeed I would like to see for "watcher" a UI along the lines of the flag module.
In my D6 use case I have already a number of flag/unflag links (with configurable labels):
whether they come from "flags" or "watcher" should be transparent to the user.
I didn't dare to ask for this feature... but here it is. Thank You!
#6
It's coming in the next version for Drupal 6.
#7
was this ever added?
#8
Not yet.