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.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | watcher-263117-12.patch | 6.42 KB | fuerst |
| #15 | 02.png | 8.04 KB | skizzo |
| #12 | watcher.module.patch | 6.18 KB | mr.j |
| #9 | links.patch | 5.65 KB | mr.j |
| #1 | links.patch | 7.43 KB | mr.j |
Comments
Comment #1
mr.j commentedOk here is another patch adding the ability to customise the watch link text in the admin settings UI.
Comment #2
mr.j commentedSolution 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.
Comment #3
solipsist commentedThe 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().
Comment #4
solipsist commentedComment #5
skizzo commentedGlad 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!
Comment #6
solipsist commentedIt's coming in the next version for Drupal 6.
Comment #7
RikiB commentedwas this ever added?
Comment #8
solipsist commentedNot yet.
Comment #9
mr.j commentedPatch against the current 5.x-1.6 release of watcher.
I don't use Drupal 6 currently, so please don't ask (I'll post it if/when we upgrade).
Comment #10
mr.j commentedPatch attached against 6.x-1.3. To summarise it does the following:
- Allows you to put the watcher link in the node links section instead of the node body
- Allows you to change the text used for the links
Hmm no drupal won't let me upload saying some sort of validation error, so here it is in text:
Comment #11
skizzo commentedwill this be included in next release?
Comment #12
mr.j commentedPatch against 6.x-1.4 attached.
It also contains a fix for #937894: Watcher always sends notifications after updating published comments as we needed it.
Comment #13
skizzo commentedThank you. How would I apply this patch? The usual
Linux command "patch < patchfile" will not take it.
Comment #14
mr.j commentedStrange it may be my IDE's fault (I created it using NetBeans). Just eyeballing it the format looks fine.
Try removing the first 2 comment lines at the start?
Comment #15
skizzo commentedI see. It's just the filename that is missing in the header. The background image gets scrambled in Garland, as per attachment. Apart from that (not a problem for me, I removed the bg image in anyway) the patch works nicely. Thank you.
Comment #16
mr.j commentedAh yes see my original post #1 up top - you can use some css to stop that happening.
Comment #17
wickedwookie commentedThanks for your patch, apart from the css issue it worked like a charm!
Comment #18
skizzo commentedAs this feature is included in the roadmap for version 6.x-1.x, could it be committed to dev?
Also, it would be nice to have a text only display blending in the node links line (as in flags module).
Comment #19
Ela commentedThank you as well! :)
Works in Dev version as well
Comment #20
Ela commentedComment #21
fuerst commentedI applied the patch from #12 and re-created it using
diff -up. Content of the patch is the same as in #12.Comment #22
mr.j commentedAny chance of this being committed before its 4th birthday?
Comment #23
d.novikov commentedCommited http://drupal.org/node/263117#comment-4709916 patch to 6.x-1.x-dev branch. Also I adjusted CSS for correct display of a watcher link in the "links" section. Thank you all!