| Project: | Theme developer |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
I think it's possible to mark the theme calls using comments instead of spans. This would mangle the markup less than the current implementation. The javascript could walk the document tree finding these comments to display the same information as it currently does.
I've attached a rough demonstration of the idea. It's not for review as the implementation is currently quite ugly, uncommented and lacks most of the current functions, but it does let you see the information for a theme call that you've clicked on (but not its parents, it also doesn't show the red outlines as you hover over the page and doesn't show the root page call). I hope it demonstrates how this could work. I'd like to know what you think of it before I continue working on this and try to write a decent implementation.
| Attachment | Size |
|---|---|
| devel_themer.patch | 8.93 KB |
Comments
#1
Hi Daniel,
Both Moshe and I think this is VERY cool! Yes! Please finish your implementation.
You'll find that the rest of the Javascript code (most of which I wrote) is probably more ugly and uncommented than what I saw in your patch. So feel free to clean it up as you see fit.
I had originally written the Javascript with a minimum of commenting in order to keep the size down. However, these days, I've been using the online YUI compressor to create a .min.js version of BeautyTips. And that allows me to comment the code thoroughly. I think we should switch over to this method for the Theme Developer code too... But that's probably a different issue.
So if you're looking for encouragement, here it is... go! do it! awesome! :-)
#2
Now THAT is a fine idea... I am CONSTANTLY turning theme dev on and off because it breaks every theme I've ever written.
#3
I'd love to see this added also, it would signficantly cut down on the strange behavior caused by Devel Themer's extra markup.
#4
Yeah, I'd love to see us go this way too. Help wanted.
#5
Sorry I haven't done much on this. I've been busy with other things. I've attached where I'm currently at, although it's got some problems. It deals quite badly with some markup, I think I can improve this by placing the outlines adjacent to the the nodes they cover in the dom (so it they're in, say, an 'overflow: scroll' they'll scroll with the nodes). It's also quite slow on complicated pages - I can hopefully deal with this by looking at the location of less elements in the Dom.
#6
Alternatively, here's a much cruder but perhaps more effective implementation. It works by replacing the comments with span tags when you activate the theme developer. This does pretty much what the old version does to the markup, but only when it's turned on. It also messes up any javascript on the page but it might be possible to work around that by walking the dom as I did in the other version.
#7
Any progress here?
#8
#9
Sounds like a great idea. For whoever has the energy to work on it, please keep going. Please feel free to use code from #512476: output only as comments instead of the cool js if it's helpful. If a patch is submitted here that's ready for review, I'll review it. Otherwise, it might make sense to add the code from the other issue as a separate module.
#10
This would be fantastic. How are things going with this daniel? I'd love to help out...
#11
I'm finding an issue in my /admin/build/modules page, only when this module is enabled (devel_themer-6.x-1.x-dev.tar.gz):
In the table listing modules there are titles for each module (before listing its access details) I'm pretty sure the titles are in td tags with a class of: "module". Anyway, these particular titles end up showing all of the html tags that were meant for devel_themer's use, instead of properly being placed in the code.
For example, without devel_themer turned on, I might see a heading, like:
poll module
However, with devel_themer turned on, I see this heading:
<span id="thmr_1303" class="thmr_call"> poll</span> module
(i've attached a screen shot, in-case this submission tries to read the above ^ markup)
#12
jzacsh, What you're describing is exactly why we'd like to use HTML comments instead of spans. The currently approach breaks TONS of markup and JavaScript. In the mean time, you should turn off the Theme Developer tool entirely unless you're actively using it at that second.
#13
I'd be interested to know what people think of the idea of using 's as it already is, except that on page load we do what we want with the spanned objects (eg add js events to them) then actually remove the spans from the DOM thereby rendering the markup effectively untouched. If further access to the originally-spanned objects is needed, references to them can always be stored before we remove the span markup.
I've done this in a different module and it does work there. In this case it might involve a fairly big overhaul of things. Thoughts?
Jeff
#14
In the upgrade to D7, I try to avoid spans where possible by adding a themer attribute. However I like this approach, I may see if I can get it working in D7 version and backport it.
#15
Would people who have been involved with this and are still interested in it please review and test #1247280: Fixing html breakage once and for all, an alternate take on the problem for D7, and share your feedback there? Thanks! If you believe that's the wrong approach to the problem, and there's a viable comments-oriented approach, please say so.