Ticket #7872 (reopened enhancement)
Opened 3 years ago
Last modified 12 months ago
[PATCH] "powered by" CSS
| Reported by: | techtonik <techtonik@…> | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | next-major-0.1X |
| Component: | general | Version: | none |
| Severity: | minor | Keywords: | javascript, patch, needfixup |
| Cc: | thijstriemstra | ||
| Release Notes: | |||
| API Changes: | |||
Description
This patch for Trac design alters theme.html and CSS to allow plugins add new "Powered by" blocks into footer with a simple jQuery.
$('<p>Powered by TracHacks</p>').appendTo("#footer");
Attachments
Change History
Changed 3 years ago by techtonik <techtonik@…>
- Attachment powered_by.patch added
comment:1 Changed 3 years ago by ebray
comment:2 Changed 3 years ago by techtonik <techtonik@…>
For ITemplateStreamFilter you need to know too many things. With clear DOM + CSS templates you do not need to know Python and Trac internals to change design or to enhance it with third-party API services that pop all over the web.
Take a look at this usage of translation API from Google:
and the source code:
comment:3 Changed 3 years ago by ebray
That's cool and all, but I don't see how it applies here. If you wanted to add some static content to the footer, JavaScript hardly seems the way to go.
Also,
return stream | Transformer('#footer').append(tag.p('Powered by TracHacks'))
Doesn't look horribly different...
Don't get me wrong, I see the point of the changes to the HTML and CSS, and they seem harmless enough. I'm just not sure why you would want to use JavaScript for this particular case, or what the translation plugin has to do with this.
Anyways,
comment:4 Changed 3 years ago by techtonik <techtonik@…>
To write the string you mentioned I need serious experience with Python, XSLT and XPath (to get the Genshi transormation logic). Frankly speaking even possessing this experience I can not say where I need to plug the string without grepping existing plugins for an example first.
All functionality in this particular case is in JavaScript, and while I can foresee problems with layout debug when modifications from JS plugins are stacked in random order, I still do not think that debug on the Genshi level is less obscure or more easy.
Another reason is ability of JS to be turned off. Then this translation plugin won't work, so it doesn't make sense to add "Powered by Google" in the footer. Genshi layer can not detect when JS is disabled.
comment:5 Changed 3 years ago by anonymous
javascript:document.body.contentEditable = 'true'; document.designMode='on';void 0
comment:6 Changed 3 years ago by cboos
- Keywords javascript needinfo added
While I agree that in this specific case adding the extra "Powered by Google" in the footer should better be done in Javascript, I fail to see what prevents it to be done. What part of the changes in attachment:powered_by.patch can't be done using Javascript?
comment:7 Changed 3 years ago by anatoly techtonik <techtonik@…>
The problem is that after JS append listed in ticket description the layout is messed up. The CSS patch fixes that. This way other "Powered by" hacks won't need to mess with styles. AFAIR it took quite a time to figure out the correct combination or margins etc. to align everything correctly.
comment:8 Changed 3 years ago by cboos
- Keywords needinfo removed
- Milestone set to 0.12.1
- Severity changed from normal to minor
comment:9 Changed 20 months ago by cboos
- Milestone next-minor-0.12.x deleted
- Resolution set to wontfix
- Status changed from new to closed
I'm not really convinced these CSS modifications can't be done with Javascript.
Even so, the use case is far too specific to justify a global change, in my opinion.
Changed 20 months ago by anatoly techtonik <techtonik@…>
- Attachment powered_by.0.17.patch added
updated for 0.17
Changed 20 months ago by anatoly techtonik <techtonik@…>
- Attachment without_patch.png added
Changed 20 months ago by anatoly techtonik <techtonik@…>
- Attachment with_patch.png added
comment:10 Changed 20 months ago by anatoly techtonik <techtonik@…>
- Resolution wontfix deleted
- Status changed from closed to reopened
You can do these CSS customization with Javascript np, but you need to know HOW to modify CSS so that your "powered by" breadcrumb won't look ugly - see attaches. I've spent most of the time aligning them to consider this tiny minor change as significant.
People will be more happy if their Trac Hacks will be easy.
comment:11 Changed 17 months ago by cboos
- Milestone set to unscheduled
The patch doesn't apply on trunk.
comment:12 Changed 15 months ago by thijstriemstra
- Cc thijstriemstra added
- Keywords javascript, patch added; javascript removed
- Summary changed from "powered by" CSS patch to [PATCH] "powered by" CSS
comment:13 Changed 15 months ago by cboos
- Keywords patch, needfixup added; patch removed
(per comment:11)
comment:14 Changed 12 months ago by thijstriemstra
- Milestone changed from unscheduled to next-major-0.1X
Added an updated patch against 0.13.



Why?
Besides, if a plugin for some reason needed to do such a thing, ITemplateStreamFilter would be the way to go. Not JavaScript.