Opened 11 years ago

Closed 10 years ago

#570 closed enhancement (fixed)

RFC: Clicking alignment button when image selected should set image align="" attribute

Reported by: gogo Owned by: gogo
Priority: high Milestone:
Component: Plugin_ContextMenu Version: trunk
Severity: normal Keywords:
Cc:

Description (last modified by gogo)

The is a request for comment on a change I think is useful for the core, but changes behaviour slightly.

Currently, if you select an image in the Xinha area, and click left/right then the entire paragraph the image is in is left/right justified.

The change makes it so that the image has it's align="" attribute set to left/right (so that text flows around the right/left of the image). Clicking the same justification button again removes the align="" attribute.

The advantage of this is simply that it seems more intuitive, if you select an image and click the alignment button then the image is aligned, not surrounding text. It also gives functionality which is not available presently without opening one of the image dialogs.

The change is a simple addition to the switch in execCommand()

    case 'justifyleft'  :
    case 'justifyright' :
    {
      cmdID.match(/^justify(.*)$/);
      var ae = this._activeElement(this._getSelection());      
      if(ae && ae.tagName.toLowerCase() == 'img')
      {
        ae.align = ae.align == RegExp.$1 ? '' : RegExp.$1;
      }
      else
      {
        this._doc.execCommand(cmdID, UI, param);
      }
    }    
    break;

Center alignment is a bit more tricky, probably clicking center would have to add something like style="clear:both;display:block;margin-left:auto;margin-right:auto;" or something to get an "expected" behaviour (well, if HTML supported it then it would truely be centered with text flow on both left and right, but we don't have that option). Unfortunatly that CSS only works in Gecko, I can't find a way to get IE to center an image short of wrapping it in a div or something.

Change History (4)

comment:1 Changed 11 years ago by gogo

  • Description modified (diff)

comment:2 Changed 11 years ago by wymsy

I like the idea - I agree it seems more intuitive, and it's quicker. As for center and justify, I haven't thought this through, but would it make sense to just remove the align attribute in those two cases if it is set to left ot right?

comment:3 Changed 11 years ago by http://mamba.dynu.net/puzan/spankman-s-nude-older-women.html ZsKXnUSTCv

  • Component changed from Xinha Core to Plugin_ContextMenu
  • Milestone Version 1.0 deleted
  • Priority changed from normal to high
  • Version set to trunk

<a href='http://wvvw.dynu.net/masterzone/non-nude-asian-models.html'> http://wvvw.dynu.net/masterzone/non-nude-asian-models.html - non nude asian models </a> http://wvvw.dynu.net/masterzone/non-nude-asian-models.html
<a href='http://wvvw.dynu.net/vatnik/shemale-movie-hut.html'> http://wvvw.dynu.net/vatnik/shemale-movie-hut.html - shemale movie hut </a> http://wvvw.dynu.net/vatnik/shemale-movie-hut.html
<a href='http://wvvw.dynu.net/door/sexy-bbw-pic.html'> http://wvvw.dynu.net/door/sexy-bbw-pic.html - sexy bbw pic </a> http://wvvw.dynu.net/door/sexy-bbw-pic.html
<a href='http://pivasik.dynu.net/puzan/mature-sex-thumbs-free.html'> http://pivasik.dynu.net/puzan/mature-sex-thumbs-free.html - mature sex thumbs free </a> http://pivasik.dynu.net/puzan/mature-sex-thumbs-free.html
<a href='http://pivasik.dynu.net/green/ebony-oral-cum-shots.html'> http://pivasik.dynu.net/green/ebony-oral-cum-shots.html - ebony oral cum shots </a> http://pivasik.dynu.net/green/ebony-oral-cum-shots.html
<a href='http://wvvw.dynu.net/vatnik/free-hermaphrodite-xxx-pictures.html'> http://wvvw.dynu.net/vatnik/free-hermaphrodite-xxx-pictures.html - free hermaphrodite xxx pictures </a> http://wvvw.dynu.net/vatnik/free-hermaphrodite-xxx-pictures.html
<a href='http://mamba.dynu.net/vatnik/tranny-manual-np.html'> http://mamba.dynu.net/vatnik/tranny-manual-np.html - tranny manual np </a> http://mamba.dynu.net/vatnik/tranny-manual-np.html
<a href='http://wvvw.dynu.net/door/three-fat-chick.html'> http://wvvw.dynu.net/door/three-fat-chick.html - three fat chick </a> http://wvvw.dynu.net/door/three-fat-chick.html
<a href='http://pivasik.dynu.net//black-cum-shot.html'> http://pivasik.dynu.net//black-cum-shot.html - black cum shot </a> http://pivasik.dynu.net//black-cum-shot.html
<a href='http://wvvw.dynu.net//free-group-interracial-pictures-sex.html'> http://wvvw.dynu.net//free-group-interracial-pictures-sex.html - free group interracial pictures sex </a> http://wvvw.dynu.net//free-group-interracial-pictures-sex.html
<a href='http://wvvw.dynu.net/puzan/mature-ladies-nude-free.html'> http://wvvw.dynu.net/puzan/mature-ladies-nude-free.html - mature ladies nude free </a> http://wvvw.dynu.net/puzan/mature-ladies-nude-free.html
<a href='http://pivasik.dynu.net/masterzone/asian-ladyboy-xxx.html'> http://pivasik.dynu.net/masterzone/asian-ladyboy-xxx.html - asian ladyboy xxx </a> http://pivasik.dynu.net/masterzone/asian-ladyboy-xxx.html
<a href='http://mamba.dynu.net/masterzone/chinese-folktales.html'> http://mamba.dynu.net/masterzone/chinese-folktales.html - chinese folktales </a> http://mamba.dynu.net/masterzone/chinese-folktales.html
<a href='http://wvvw.dynu.net/puzan/mature-gay-sex-movies-clips.html'> http://wvvw.dynu.net/puzan/mature-gay-sex-movies-clips.html - mature gay sex movies clips </a> http://wvvw.dynu.net/puzan/mature-gay-sex-movies-clips.html
<a href='http://wvvw.dynu.net/masterzone/asian-porn-movie-site.html'> http://wvvw.dynu.net/masterzone/asian-porn-movie-site.html - asian porn movie site </a> http://wvvw.dynu.net/masterzone/asian-porn-movie-site.html
<a href='http://mamba.dynu.net/puzan/spankman-s-nude-older-women.html'> http://mamba.dynu.net/puzan/spankman-s-nude-older-women.html - spankman s nude older women </a> http://mamba.dynu.net/puzan/spankman-s-nude-older-women.html
<a href='http://pivasik.dynu.net/door/fat-fat-sex-women.html'> http://pivasik.dynu.net/door/fat-fat-sex-women.html - fat fat sex women </a> http://pivasik.dynu.net/door/fat-fat-sex-women.html
<a href='http://mamba.dynu.net/kozel/hot-teen-tease-tits-panties-gallery.html'> http://mamba.dynu.net/kozel/hot-teen-tease-tits-panties-gallery.html - hot teen tease tits panties gallery </a> http://mamba.dynu.net/kozel/hot-teen-tease-tits-panties-gallery.html
<a href='http://pivasik.dynu.net//adele-stephens-interracial.html'> http://pivasik.dynu.net//adele-stephens-interracial.html - adele stephens interracial </a> http://pivasik.dynu.net//adele-stephens-interracial.html
<a href='http://wvvw.dynu.net/masterzone/japanese-music.html'> http://wvvw.dynu.net/masterzone/japanese-music.html - japanese music </a> http://wvvw.dynu.net/masterzone/japanese-music.html
<a href='http://pivasik.dynu.net/puzan/free-fat-mature-mexican-hardcore.html'> http://pivasik.dynu.net/puzan/free-fat-mature-mexican-hardcore.html - free fat mature mexican hardcore </a> http://pivasik.dynu.net/puzan/free-fat-mature-mexican-hardcore.html
<a href='http://wvvw.dynu.net/masterzone/chinese-phrase-book-and-sex.html'> http://wvvw.dynu.net/masterzone/chinese-phrase-book-and-sex.html - chinese phrase book and sex </a> http://wvvw.dynu.net/masterzone/chinese-phrase-book-and-sex.html
<a href='http://mamba.dynu.net/kozel/free-movies-of-big-tits.html'> http://mamba.dynu.net/kozel/free-movies-of-big-tits.html - free movies of big tits </a> http://mamba.dynu.net/kozel/free-movies-of-big-tits.html
<a href='http://mamba.dynu.net/masterzone/chinese-chart-for-predicting-sex-of-baby.html'> http://mamba.dynu.net/masterzone/chinese-chart-for-predicting-sex-of-baby.html - chinese chart for predicting sex of baby </a> http://mamba.dynu.net/masterzone/chinese-chart-for-predicting-sex-of-baby.html
<a href='http://pivasik.dynu.net/puzan/mature-model-free-thumbs.html'> http://pivasik.dynu.net/puzan/mature-model-free-thumbs.html - mature model free thumbs </a> http://pivasik.dynu.net/puzan/mature-model-free-thumbs.html
<a href='http://wvvw.dynu.net/masterzone/best-asian-porn-sites.html'> http://wvvw.dynu.net/masterzone/best-asian-porn-sites.html - best asian porn sites </a> http://wvvw.dynu.net/masterzone/best-asian-porn-sites.html
<a href='http://wvvw.dynu.net/kozel/boob-flick-free.html'> http://wvvw.dynu.net/kozel/boob-flick-free.html - boob flick free </a> http://wvvw.dynu.net/kozel/boob-flick-free.html
<a href='http://pivasik.dynu.net/puzan/40-year-old-she-males.html'> http://pivasik.dynu.net/puzan/40-year-old-she-males.html - 40 year old she males </a> http://pivasik.dynu.net/puzan/40-year-old-she-males.html
<a href='http://wvvw.dynu.net/puzan/free-mature-xxx.html'> http://wvvw.dynu.net/puzan/free-mature-xxx.html - free mature xxx </a> http://wvvw.dynu.net/puzan/free-mature-xxx.html
<a href='http://wvvw.dynu.net/door/hairy-pussy-bbw.html'> http://wvvw.dynu.net/door/hairy-pussy-bbw.html - hairy pussy bbw </a> http://wvvw.dynu.net/door/hairy-pussy-bbw.html
<a href='http://wvvw.dynu.net/puzan/mature-xxx-pictures.html'> http://wvvw.dynu.net/puzan/mature-xxx-pictures.html - mature xxx pictures </a> http://wvvw.dynu.net/puzan/mature-xxx-pictures.html

WBR XfhqkwnYrbcTICaso

comment:4 Changed 10 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

No complaints, so changeset:666 (bad omen?).

Note: See TracTickets for help on using tickets.