Opened 16 years ago
Last modified 9 years ago
#7872 new enhancement
[Patch] Styling for "Powered by" footer element
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | general | Version: | none |
Severity: | minor | Keywords: | javascript, patch, needfixup |
Cc: | Thijs Triemstra | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal 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 (5)
Change History (21)
by , 16 years ago
Attachment: | powered_by.patch added |
---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
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 by , 16 years ago
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 by , 16 years ago
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 by , 16 years ago
javascript:document.body.contentEditable = 'true'; document.designMode='on';void 0
comment:6 by , 16 years ago
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 by , 16 years ago
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 by , 15 years ago
Keywords: | needinfo removed |
---|---|
Milestone: | → 0.12.1 |
Severity: | normal → minor |
comment:9 by , 14 years ago
Milestone: | next-minor-0.12.x |
---|---|
Resolution: | → wontfix |
Status: | new → 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.
by , 14 years ago
Attachment: | without_patch.png added |
---|
by , 14 years ago
Attachment: | with_patch.png added |
---|
comment:10 by , 14 years ago
Resolution: | wontfix |
---|---|
Status: | closed → 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:12 by , 14 years ago
Cc: | added |
---|---|
Keywords: | patch added |
Summary: | "powered by" CSS patch → [PATCH] "powered by" CSS |
comment:14 by , 14 years ago
Milestone: | unscheduled → next-major-0.1X |
---|
Added an updated patch against 0.13.
comment:15 by , 10 years ago
Status: | reopened → new |
---|
comment:16 by , 9 years ago
Summary: | [PATCH] "powered by" CSS → [Patch] Styling for "Powered by" footer element |
---|
Changed summary to more accurately reflect what the enhancement involves.
Why?
Besides, if a plugin for some reason needed to do such a thing,
ITemplateStreamFilter
would be the way to go. Not JavaScript.