Page 1 of 1
Classes for entry images without comments
Posted: Wed Jan 02, 2008 5:31 am
by Don Chambers
Happy New Year!!!!!
This has been bugging me for awhile. Can we get classes for entry images without comments?
What I am thinking of is something comparable to serendipity_imageComment_center (plus left and right) in serendipity_editor.js. Maybe serendipity_imageNoComment_center ????
In addition, I would love to see the elimination of all inline styles for all these images, or at least some option to disable them. !important will suffice for now in css if that is not possible due to BC.
I would also like to see this in the 1.2 branch, not just 1.3.
We can get around this with general img styling for entries, then specifically styling imageComments and entry icons, but that is clumsy IMHO.
Opinions?
Re: Classes for entry images without comments
Posted: Wed Jan 02, 2008 11:04 am
by garvinhicking
Hi!
When someone doesn't want a comment, they don't need a wrapping div, so the s9y image manager inserts none.
I want to keep the image insertion HTML code to a minimum, because else it might look odd to people who add it to their raw HTML, if s9y swamps them with too many HTML attributes.
I could add a CSS class to the <img> container, though? <img ... class="s9y_image"> ?
In addition, I would love to see the elimination of all inline styles for all these images, or at least some option to disable them. !important will suffice for now in css if that is not possible due to BC.
I don't think this could be done in a BC way. When removing the styles, people would all need to update their CSS styles so that it shows properly again.
I would also like to see this in the 1.2 branch, not just 1.3.
I'm actually not planning on releasing another 1.2 point release.
Best regards,
Garvin
Re: Classes for entry images without comments
Posted: Wed Jan 02, 2008 3:47 pm
by Don Chambers
garvinhicking wrote:I could add a CSS class to the <img> container, though? <img ... class="s9y_image"> ?
Personally, I would prefer the extra markup for the sole reason of making it consistent with images that contain comments (I often favor consistency over purity). However, I can live with img class="serendipity_imageNoComment" PROVIDED it is also appended with the same positioning attributes used for comments (ie, left, right, center, etc) which is important for setting margins and padding, among other things. It could also set the stage for a possible future elimination of the current inline styles, such as float: right.
In addition, I would love to see the elimination of all inline styles for all these images, or at least some option to disable them. !important will suffice for now in css if that is not possible due to BC.
I don't think this could be done in a BC way. When removing the styles, people would all need to update their CSS styles so that it shows properly again.
Yeah, I was afraid BC might be a problem here. At some point in the future, s9y will need to be willing to turn its back on BC!!! Seems like we are justifying some bad habits/markup/code in the name of BC.

Re: Classes for entry images without comments
Posted: Wed Jan 02, 2008 6:19 pm
by garvinhicking
Hi!
However, I can live with img class="serendipity_imageNoComment" PROVIDED it is also appended with the same positioning attributes used for comments (ie, left, right, center, etc) which is important for setting margins and padding, among other things. It could also set the stage for a possible future elimination of the current inline styles, such as float: right.
That would be doable. I'd prefer short terms though, like
class = "image"
class = "image_left"
class = "image_right"
At some point in the future, s9y will need to be willing to turn its back on BC!!!
I'm always in favor of breaking BC, where it provides an actual benefit that couldn'T be done otherwise.
I'm hugely against breaking things which are not necessary, and can already be achieved with different approaches, like in this case the "!important" and CSS class selector override.
Best regards,
Garvin
Re: Classes for entry images without comments
Posted: Wed Jan 02, 2008 6:48 pm
by Don Chambers
garvinhicking wrote:
That would be doable. I'd prefer short terms though, like
class = "image"
class = "image_left"
class = "image_right"
The comment versions are:
class="serendipity_imageComment_center"
class="serendipity_imageComment_left"
class="serendipity_imageComment_right"
If you want to drop the leading "serendipity", perhaps a bit of consistency would be to add "center" to your first suggestion, so perhaps this?:
class = "image_center"
class = "image_left"
class = "image_right"
Personally, I think it should be preceeded with serendipity simply because a) the comment version is, and b) so are entry icons (img.serendipity_entryIcon).... but again, that's my personal opinion regarding consistency.
I'm hugely against breaking things which are not necessary, and can already be achieved with different approaches, like in this case the "!important" and CSS class selector override.
Inline styles
can be overridden (I do it all the time), I have been speaking from a position of removing presentation from markup when/wherever possible.
Re: Classes for entry images without comments
Posted: Thu Jan 03, 2008 2:56 pm
by garvinhicking
Hi!
It's done
Regards,
Garvin
Posted: Thu Jan 03, 2008 5:40 pm
by Don Chambers
Thanks Garvin. Before I download the latest svn, should we consider one other positioning possibility for both images with, and without comments:
serendipity_image_none (or noPosition, or something to indicate it is not centered, not floated left or right)????
Just thinking out loud.....
Posted: Thu Jan 03, 2008 5:49 pm
by garvinhicking
Hi!
Actually, "center" is "noposition". We have no "center" position, only thre positions:
unfloated, left, right.
Regards,
Garvin
Posted: Thu Jan 03, 2008 6:04 pm
by Don Chambers
Yeah, but many/most stylesheets that style .serendipity_imageComment_center, for instance, will do so in a way that centers the image... which is why I thought perhaps a 4th class should be available that designers do NOT feel compelled to style "centered".
Posted: Thu Jan 03, 2008 6:38 pm
by garvinhicking
Hi!
Don Chambers wrote:Yeah, but many/most stylesheets that style .serendipity_imageComment_center, for instance, will do so in a way that centers the image... which is why I thought perhaps a 4th class should be available that designers do NOT feel compelled to style "centered".
That would mean adding a fourth formatting option to the media popup, and adding inline styles to the output, so that it also works with old templates?
And a new image would needed to be created to indicate that formatting.
I'm all for it, but I don't have the time to do this.
Best regards,
Garvin