Classes for entry images without comments

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Classes for entry images without comments

Post 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?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Classes for entry images without comments

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Classes for entry images without comments

Post 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. :P
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Classes for entry images without comments

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Classes for entry images without comments

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Classes for entry images without comments

Post by garvinhicking »

Hi!

It's done :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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.....
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Actually, "center" is "noposition". We have no "center" position, only thre positions:

unfloated, left, right.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post 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".
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply