Forum Diagram Annotation Wrapping

Is something wrong? Do you have any suggestions? Let us know.
Post Reply
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Forum Diagram Annotation Wrapping

Post by Kirby »

I noticed that people sometimes include annotation in their go diagrams, which are somewhat lengthy. This results in a long sentence that ends up overrunning the length of the image. It's also possible that someone would want to include line breaks in their comments.

To provide a bit of added functionality to the diagram annotation feature, you can now use the following text to indicate that you'd like to include a line break in a diagram:

Code: Select all

\n


Here's an example:
Click Here To Show Diagram Code
[go]$$W This is a game.\nI like it a lot.\nI decided that I'd make a poem about the game.\nOK, it's not really a poem...\nJust a string of sentences.
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . B . . . . . . . . . . . . . |
$$ | . . . O . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . 3 . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . 1 O . . . . . . . . . . . . . . . |
$$ | . . X . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . X . . . . . . . . . . . . . . . |
$$ | . . X , . O . . . , . . . . . X . . . |
$$ | . . 2 O . . . . . . . . . O . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------[/go]


I would like to force line wrapping if the comment text is of greater width than the image itself. I'm still thinking about how to do this, though, since the images are created on the fly.

In any case, please feel free to use the newline code above to put linebreaks in your diagram annotations.
be immersed
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: Forum Diagram Annotation Wrapping

Post by HermanHiddema »

Kirby wrote:I would like to force line wrapping if the comment text is of greater width than the image itself. I'm still thinking about how to do this, though, since the images are created on the fly.


The only way to do this is to set the width of the surrounding div to slightly more than the width of the image. You could use javascript for it, but there is no pure css way to create what they call a "shrink wrap" effect.
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: Forum Diagram Annotation Wrapping

Post by Kirby »

HermanHiddema wrote:The only way to do this is to set the width of the surrounding div to slightly more than the width of the image. You could use javascript for it, but there is no pure css way to create what they call a "shrink wrap" effect.


The width of the image is the variable I want to get at. As you know, the image is generated within the div on-the-fly from php, so I am not sure if information about the width of the image is available at the time that the div is constructed.

Is this inaccurate?
be immersed
User avatar
HermanHiddema
Gosei
Posts: 2011
Joined: Tue Apr 20, 2010 10:08 am
Rank: Dutch 4D
GD Posts: 645
Universal go server handle: herminator
Location: Groningen, NL
Has thanked: 202 times
Been thanked: 1086 times

Re: Forum Diagram Annotation Wrapping

Post by HermanHiddema »

Kirby wrote:
HermanHiddema wrote:The only way to do this is to set the width of the surrounding div to slightly more than the width of the image. You could use javascript for it, but there is no pure css way to create what they call a "shrink wrap" effect.


The width of the image is the variable I want to get at. As you know, the image is generated within the div on-the-fly from php, so I am not sure if information about the width of the image is available at the time that the div is constructed.

Is this inaccurate?


After page load, you could probably find the width of the img element and set the width of the surrounding div then.
User avatar
Joaz Banbeck
Judan
Posts: 5546
Joined: Sun Dec 06, 2009 11:30 am
Rank: 1D AGA
GD Posts: 1512
Kaya handle: Test
Location: Banbeck Vale
Has thanked: 1080 times
Been thanked: 1434 times

Re: Forum Diagram Annotation Wrapping

Post by Joaz Banbeck »

Thanks, Kirby. I had been intending to request that.
Help make L19 more organized. Make an index: https://lifein19x19.com/viewtopic.php?f=14&t=5207
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: Forum Diagram Annotation Wrapping

Post by Kirby »

Joaz Banbeck wrote:Thanks, Kirby. I had been intending to request that.


No problem. I will still try to implement the "auto-wrapping" when the text extends the image width, but even then, I think I will leave the line break functionality in so that people can leave linebreaks at arbitrary locations.

The other issue I am pondering with the diagrams is the "Show Diagram Code" text that includes smileys. When we get the text for processing go diagrams, smileys have already been substituted in so the smileys show up in the code text. I'm trying to think of an easier way to show the original diagram code than manually parsing all of the text for every smiley we've added.
be immersed
User avatar
Dusk Eagle
Gosei
Posts: 1758
Joined: Tue Apr 20, 2010 4:02 pm
Rank: 4d
GD Posts: 0
Has thanked: 378 times
Been thanked: 375 times

Re: Forum Diagram Annotation Wrapping

Post by Dusk Eagle »

Kirby wrote:The other issue I am pondering with the diagrams is the "Show Diagram Code" text that includes smileys. When we get the text for processing go diagrams, smileys have already been substituted in so the smileys show up in the code text. I'm trying to think of an easier way to show the original diagram code than manually parsing all of the text for every smiley we've added.

Is it that big of a deal? At least on my (KDE Linux, Firefox) system, when you copy an image as you copy text, the alternate text gets copied in the images' place. Since the alt-text of a smiley is the code to make that smiley, it copies seamlessly. Is that not the case on some OS or browser?

Click Here To Show Diagram Code
[go]$$W This is a game. :)\nI like it a lot. :D\nI decided that I'd make a poem about the game. :ugeek: \nOK, it's not really a poem... :mad: \nJust a string of sentences. :-|
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . B . . . . . . . . . . . . . |
$$ | . . . O . . . . . , . . . . . X . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . 3 . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . 1 O . . . . . . . . . . . . . . . |
$$ | . . X . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . X . . . . . . . . . . . . . . . |
$$ | . . X , . O . . . , . . . . . X . . . |
$$ | . . 2 O . . . . . . . . . O . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------[/go]
We don't know who we are; we don't know where we are.
Each of us woke up one moment and here we were in the darkness.
We're nameless things with no memory; no knowledge of what went before,
No understanding of what is now, no knowledge of what will be.
User avatar
Phelan
Gosei
Posts: 1449
Joined: Tue Apr 20, 2010 3:15 pm
Rank: KGS 6k
GD Posts: 892
Has thanked: 1550 times
Been thanked: 140 times

Re: Forum Diagram Annotation Wrapping

Post by Phelan »

Same thing on my WinXP Firefox.
a1h1 [1d]: You just need to curse the gods and defend.
Good Go = Shape.
Associação Portuguesa de Go
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: Forum Diagram Annotation Wrapping

Post by Kirby »

For me, the images are not pasted, but just ignored (only the text is pasted)... And, it's just a little annoying to me. I guess it's not a huge deal.
be immersed
User avatar
daniel_the_smith
Gosei
Posts: 2116
Joined: Wed Apr 21, 2010 8:51 am
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: daniel_the_smith
Location: Silicon Valley
Has thanked: 152 times
Been thanked: 330 times
Contact:

Re: Forum Diagram Annotation Wrapping

Post by daniel_the_smith »

Whoa, did you do something else after the line break thing? Diagrams are all one character wide for me now... :sad: :sad:

Edit: using Chrome.

Edit 2: working again now...
That which can be destroyed by the truth should be.
--
My (sadly neglected, but not forgotten) project: http://dailyjoseki.com
Post Reply