joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

Stencil usage #73

Closed RichGriffin closed 12 years ago

RichGriffin commented 12 years ago

Its been a while since I did any JS so its more than likely something that i have missed, however I am not grokin the stencil control, could you please give me high level overview of what this control does please ??

I am wanting to implement selection of text in the reader and was following another thread https://github.com/joseph/Monocle/issues/35 and i have a much better understanding of the events. However i am no closer to understanding how higlights work in the stencil control.

Thanks

RichGriffin commented 12 years ago

Ok, so managed to get further but not sure if i have this right, so if someone can help me clarify that would really help.

  1. I was not overriding the stencil styles in my css i had to do this otherwise the control would barf on me
  2. i also had to kick the stencil control and i am doing this by calling the calculateRectangles function

So, the conclusion i am coming to is that the stencil control is great for picking up specific tags that you have defined in the markup being rendered by the reader in the iframe. Could someone validate this for me please.

So, not sure how muc this helps me with selection functionality but it has made me understand the controls alot more which is good.

thanks

Rich

RichGriffin commented 12 years ago

Ok, so managed to get further but not sure if i have this right, so if someone can help me clarify that would really help.

  1. I was not overriding the stencil styles in my css i had to do this otherwise the control would barf on me
  2. i also had to kick the stencil control and i am doing this by calling the calculateRectangles function

So, the conclusion i am coming to is that the stencil control is great for picking up specific tags that you have defined in the markup being rendered by the reader in the iframe. Could someone validate this for me please.

So, not sure how muc this helps me with selection functionality but it has made me understand the controls alot more which is good.

thanks

Rich

RichGriffin commented 12 years ago

Gah!

Did not mean to close it Sorry =P

joseph commented 12 years ago

I recommend using a different panel setup, like Marginal or I-Mode, for text selection. Stencil simply isn't going to help you out with this.