Gnus development mailing list
 help / color / mirror / Atom feed
* shr - span elements with title attribute, tooltip?
@ 2011-03-27  7:54 Adam Sjøgren
  2011-03-27  8:32 ` [PATCH] Show title attribute of span elements as mouse over text Adam Sjøgren
  2011-03-28 18:58 ` shr - span elements with title attribute, tooltip? Ted Zlatanov
  0 siblings, 2 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-27  7:54 UTC (permalink / raw)
  To: ding

With shr, does span elements with title attributes get a tooltip (the
small pop-up text that appears if you hold the mouse over the element
for a while) with the text of the attribute?

Shouldn't they?


  Best regards,

    Adam

-- 
 "Ge mig en vinterdrog, ge mig allt du har                    Adam Sjøgren
  Kom nu jag är kroniskt låg, bara mörkret hörs"         asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH] Show title attribute of span elements as mouse over text.
  2011-03-27  7:54 shr - span elements with title attribute, tooltip? Adam Sjøgren
@ 2011-03-27  8:32 ` Adam Sjøgren
  2011-03-28 18:58 ` shr - span elements with title attribute, tooltip? Ted Zlatanov
  1 sibling, 0 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-27  8:32 UTC (permalink / raw)
  To: ding

* shr.el (shr-tag-span): New function.
---

Here is an attempt at providing it. What do you think?

  Best regards,

    Adam

 lisp/shr.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lisp/shr.el b/lisp/shr.el
index 113137a..05b681e 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -896,6 +896,13 @@ ones, in case fg and bg are nil."
     (shr-indent))
   (shr-generic cont))
 
+(defun shr-tag-span (cont)
+  (let ((title (cdr (assq :title cont))))
+    (shr-generic cont)
+    (when title
+      (let ((overlay (make-overlay (or start shr-start) (point))))
+        (overlay-put overlay 'help-echo title)))))
+
 (defun shr-tag-h1 (cont)
   (shr-heading cont 'bold 'underline))
 
-- 
1.7.4.1




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-27  7:54 shr - span elements with title attribute, tooltip? Adam Sjøgren
  2011-03-27  8:32 ` [PATCH] Show title attribute of span elements as mouse over text Adam Sjøgren
@ 2011-03-28 18:58 ` Ted Zlatanov
  2011-03-28 19:17   ` Adam Sjøgren
  2011-03-29 17:52   ` Lars Magne Ingebrigtsen
  1 sibling, 2 replies; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-28 18:58 UTC (permalink / raw)
  To: ding

On Sun, 27 Mar 2011 09:54:04 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> With shr, does span elements with title attributes get a tooltip (the
AS> small pop-up text that appears if you hold the mouse over the element
AS> for a while) with the text of the attribute?

AS> Shouldn't they?

What if two such titled span elements are nested?

Also the mouse is required for tooltips and that's annoying when there's
no mouse.  Maybe it can be an `shr-show-titles' toggling command on an
article, like `t' toggles the headers?  I think we already have
something like that for toggling images in the shr renderer, right?

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 18:58 ` shr - span elements with title attribute, tooltip? Ted Zlatanov
@ 2011-03-28 19:17   ` Adam Sjøgren
  2011-03-28 19:33     ` Ted Zlatanov
  2011-03-29 17:52   ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-28 19:17 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 13:58:52 -0500, Ted wrote:

> What if two such titled span elements are nested?

When in HTML-land, do as the browser do, I'd say. I.e. last/closest one
wins:

 * http://koldfront.dk/misc/gnus/span.html

(If you save the example, you can use M-x shr-visit-file to check if it
works as in the browser of your choice.)

> Also the mouse is required for tooltips and that's annoying when there's
> no mouse.

Sure. But you can't see them at all now.

> Maybe it can be an `shr-show-titles' toggling command on an article,
> like `t' toggles the headers? I think we already have something like
> that for toggling images in the shr renderer, right?

How would you render the titles?


  Best regards,

    Adam

-- 
 "Money always takes the place of life"                       Adam Sjøgren
                                                         asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 19:17   ` Adam Sjøgren
@ 2011-03-28 19:33     ` Ted Zlatanov
  2011-03-28 19:59       ` Adam Sjøgren
  0 siblings, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-28 19:33 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 21:17:57 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> On Mon, 28 Mar 2011 13:58:52 -0500, Ted wrote:
>> What if two such titled span elements are nested?

AS> When in HTML-land, do as the browser do, I'd say. I.e. last/closest one
AS> wins:

AS>  * http://koldfront.dk/misc/gnus/span.html

AS> (If you save the example, you can use M-x shr-visit-file to check if it
AS> works as in the browser of your choice.)

The problem is that shr.el is not as capable as a web browser so it's
hard to tell what spans are nested and how.  So you don't necessarily
know what you're pointing to.  This is actually a problem in regular web
browsers too--I use the Chrome and Firebug "inspect element" all the
time.

>> Maybe it can be an `shr-show-titles' toggling command on an article,
>> like `t' toggles the headers? I think we already have something like
>> that for toggling images in the shr renderer, right?

AS> How would you render the titles?

Instead of span1 span2 I'd render [title1: span1] [title2: span2] but
the actual visual is not too important.  It could be customizable as a
`format' HTML string for instance.

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 19:33     ` Ted Zlatanov
@ 2011-03-28 19:59       ` Adam Sjøgren
  2011-03-28 20:14         ` Ted Zlatanov
  0 siblings, 1 reply; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-28 19:59 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 14:33:04 -0500, Ted wrote:

> On Mon, 28 Mar 2011 21:17:57 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 
AS> On Mon, 28 Mar 2011 13:58:52 -0500, Ted wrote:

>>> What if two such titled span elements are nested?

AS> When in HTML-land, do as the browser do, I'd say. I.e. last/closest one
AS> wins:

AS> * http://koldfront.dk/misc/gnus/span.html

AS> (If you save the example, you can use M-x shr-visit-file to check if it
AS> works as in the browser of your choice.)

> The problem is that shr.el is not as capable as a web browser so it's
> hard to tell what spans are nested and how.  So you don't necessarily
> know what you're pointing to.  This is actually a problem in regular web
> browsers too--I use the Chrome and Firebug "inspect element" all the
> time.

Did you actually try it, or are you just speculating?


  Best regards,

    Adam

-- 
 "How different? It seems like you are just biased in         Adam Sjøgren
  favour of your own style. In fact, you are nothing     asjo@koldfront.dk
  but not a serious fellow."




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 19:59       ` Adam Sjøgren
@ 2011-03-28 20:14         ` Ted Zlatanov
  2011-03-28 20:34           ` Adam Sjøgren
  0 siblings, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-28 20:14 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 21:59:21 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> On Mon, 28 Mar 2011 14:33:04 -0500, Ted wrote:
>> On Mon, 28 Mar 2011 21:17:57 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 
AS> On Mon, 28 Mar 2011 13:58:52 -0500, Ted wrote:

>>>> What if two such titled span elements are nested?

AS> When in HTML-land, do as the browser do, I'd say. I.e. last/closest one
AS> wins:

AS> * http://koldfront.dk/misc/gnus/span.html

AS> (If you save the example, you can use M-x shr-visit-file to check if it
AS> works as in the browser of your choice.)

>> The problem is that shr.el is not as capable as a web browser so it's
>> hard to tell what spans are nested and how.  So you don't necessarily
>> know what you're pointing to.  This is actually a problem in regular web
>> browsers too--I use the Chrome and Firebug "inspect element" all the
>> time.

AS> Did you actually try it, or are you just speculating?

`shr-visit-file' on that URL gives me (first line is underlined):

"span

riverrun, past Eve and Adam's, from swerve of shore to bend of bay,
brings us by a commodius vicus of recirculation back to Howth Castle
and Environs."

...which I took to indicate nested spans are not easy to differentiate
visually with shr.el.  (Actually I tested it originally on my own file
but same idea.)  Did I do something wrong?

Anyhow, what's wrong with a "toggle-titles" command for shr.el?

Thanks
Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 20:14         ` Ted Zlatanov
@ 2011-03-28 20:34           ` Adam Sjøgren
  2011-03-28 21:02             ` Adam Sjøgren
  2011-03-28 21:07             ` Ted Zlatanov
  0 siblings, 2 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-28 20:34 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 15:14:46 -0500, Ted wrote:

> `shr-visit-file' on that URL gives me (first line is underlined):

> "span

> riverrun, past Eve and Adam's, from swerve of shore to bend of bay,
> brings us by a commodius vicus of recirculation back to Howth Castle
> and Environs."

> ...which I took to indicate nested spans are not easy to differentiate
> visually with shr.el.  (Actually I tested it originally on my own file
> but same idea.)  Did I do something wrong?

When I try that, I get the same colours and the same tooltips as in
Firefox.

Otherwise I wouldn't have linked to the example.

(With the patch applied, of course.)

> Anyhow, what's wrong with a "toggle-titles" command for shr.el?

Nothing, I think you should go for it :-)


  Best regards,

    Adam

-- 
 "How different? It seems like you are just biased in         Adam Sjøgren
  favour of your own style. In fact, you are nothing     asjo@koldfront.dk
  but not a serious fellow."




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 20:34           ` Adam Sjøgren
@ 2011-03-28 21:02             ` Adam Sjøgren
  2011-03-28 21:07             ` Ted Zlatanov
  1 sibling, 0 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-28 21:02 UTC (permalink / raw)
  To: ding

On Mon, 28 Mar 2011 22:34:08 +0200, Adam wrote:

> When I try that, I get the same colours and the same tooltips as in
> Firefox.

Screenshot for illustration:

 * http://koldfront.dk/misc/gnus/span.png

(I couldn't catch the mouse-arrow, but it was over the last red word.)


  :-),

   Adam

-- 
 "The world is short of delimiters," says Don.                Adam Sjøgren
                                                         asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 20:34           ` Adam Sjøgren
  2011-03-28 21:02             ` Adam Sjøgren
@ 2011-03-28 21:07             ` Ted Zlatanov
  1 sibling, 0 replies; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-28 21:07 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]

On Mon, 28 Mar 2011 22:34:08 +0200 asjo@koldfront.dk (Adam Sjøgren) wrote: 

AS> When I try that, I get the same colours and the same tooltips as in
AS> Firefox.

AS> Otherwise I wouldn't have linked to the example.

AS> (With the patch applied, of course.)

I must be doing something wrong, Adam.  I eval-ed your `shr-tag-span'
function and the buffer still looks the same.  

I'd just like to provide a more direct way of viewing the titles *in
addition* to tooltips as you had it.  See attached patch.

AS> On Mon, 28 Mar 2011 15:14:46 -0500, Ted wrote:
>> Anyhow, what's wrong with a "toggle-titles" command for shr.el?
AS> Nothing, I think you should go for it :-)

It would be great if someone who knew shr.el did it similarly to the way
`shr-show-alt-text' and `shr-insert-image' work, plus added a way (maybe
with display properties) to toggle the titles in the buffer.  My first
attempt is attached but I think it's overeager: on your example, 
"M-: (shr-show-title)" shows "Blue" everywhere in the buffer.

Thanks
Ted


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: shr-titles.patch --]
[-- Type: text/x-diff, Size: 1042 bytes --]

diff --git a/lisp/shr.el b/lisp/shr.el
index 113137a..3a217f8 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -161,6 +161,14 @@ redirects somewhere else."
 	(copy-region-as-kill (point-min) (point-max))
 	(message "Copied %s" url))))))
 
+(defun shr-show-title ()
+  "Show the title text of the image under point."
+  (interactive)
+  (let ((text (get-text-property (point) 'shr-title)))
+    (if (not text)
+	(message "No title under point")
+      (message "%s" text))))
+
 (defun shr-show-alt-text ()
   "Show the ALT text of the image under point."
   (interactive)
@@ -896,6 +904,14 @@ ones, in case fg and bg are nil."
     (shr-indent))
   (shr-generic cont))
 
+(defun shr-tag-span (cont)
+  (let ((title (cdr (assq :title cont))))
+    (shr-generic cont)
+    (when title
+      (put-text-property (or start shr-start) (point) 'shr-title title)
+      (let ((overlay (make-overlay (or start shr-start) (point))))
+        (overlay-put overlay 'help-echo title)))))
+
 (defun shr-tag-h1 (cont)
   (shr-heading cont 'bold 'underline))
 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-28 18:58 ` shr - span elements with title attribute, tooltip? Ted Zlatanov
  2011-03-28 19:17   ` Adam Sjøgren
@ 2011-03-29 17:52   ` Lars Magne Ingebrigtsen
  2011-03-29 18:07     ` Ted Zlatanov
                       ` (2 more replies)
  1 sibling, 3 replies; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 17:52 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> AS> With shr, does span elements with title attributes get a tooltip (the
> AS> small pop-up text that appears if you hold the mouse over the element
> AS> for a while) with the text of the attribute?
>
> AS> Shouldn't they?

The patch looks good, but all elements can have titles, can't they?  So
if shr is going to support titles, it should probably be done in the
general tag handling thing.  (And, of course, <td> handling needs
special-casing.)

> What if two such titled span elements are nested?

shr aims to be fast, not a complete HTML renderer.  So if that's
difficult, it's not essential.

> Also the mouse is required for tooltips and that's annoying when there's
> no mouse.  Maybe it can be an `shr-show-titles' toggling command on an
> article, like `t' toggles the headers?  I think we already have
> something like that for toggling images in the shr renderer, right?

Hm...  isn't there a general Emacs tool tip thing that can show the tool
tip without using the mouse?  I have no idea, but there probably should
be if there isn't.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 17:52   ` Lars Magne Ingebrigtsen
@ 2011-03-29 18:07     ` Ted Zlatanov
  2011-03-29 18:23       ` Lars Magne Ingebrigtsen
  2011-03-29 21:09     ` Adam Sjøgren
  2011-03-30  0:58     ` Kevin Ryde
  2 siblings, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-29 18:07 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 19:52:17 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
AS> With shr, does span elements with title attributes get a tooltip (the
AS> small pop-up text that appears if you hold the mouse over the element
AS> for a while) with the text of the attribute?
>> 
AS> Shouldn't they?

LMI> The patch looks good, but all elements can have titles, can't they?  So
LMI> if shr is going to support titles, it should probably be done in the
LMI> general tag handling thing.  (And, of course, <td> handling needs
LMI> special-casing.)

I hope you can look at that.  I don't know shr.el well at all.

>> What if two such titled span elements are nested?

LMI> shr aims to be fast, not a complete HTML renderer.  So if that's
LMI> difficult, it's not essential.

It's not difficult.  Just render "[title: content]" instead of "content"
when the user asks to toggle the title, and give the user a way to do it
locally or globally for the whole buffer.

>> Also the mouse is required for tooltips and that's annoying when there's
>> no mouse.  Maybe it can be an `shr-show-titles' toggling command on an
>> article, like `t' toggles the headers?  I think we already have
>> something like that for toggling images in the shr renderer, right?

LMI> Hm...  isn't there a general Emacs tool tip thing that can show the tool
LMI> tip without using the mouse?  I have no idea, but there probably should
LMI> be if there isn't.  :-)

I don't think so.  And here's my argument against going down that road...

Tool tips are (arguably) one of the worst UI elements you can use
generally, as they are only intended for controls that don't have space
for labels (e.g. toolbars).  They require fine control, *a mouse*, and
the user to be patient while hovering above something.  There is not
even a hint that hovering will reveal a tool tip, you just have to hope.

See Raskin's "The Humane Interface" and Cooper's "About Face" for more
on this topic; Raskin is particularly consistent on the universal use of
text.  So I hope we use tool tips sparingly and only in addition to a
simple, inline way of showing titles.

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 18:07     ` Ted Zlatanov
@ 2011-03-29 18:23       ` Lars Magne Ingebrigtsen
  2011-03-29 18:46         ` Ted Zlatanov
  0 siblings, 1 reply; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 18:23 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> It's not difficult.  Just render "[title: content]" instead of "content"
> when the user asks to toggle the title, and give the user a way to do it
> locally or globally for the whole buffer.

It doesn't seem very useful to me.  The common use case for "title" is
to add a textual explanation for a non-textual rendering element, which
is why I've implemented it for <IMG>, and nothing else.

> Tool tips are (arguably) one of the worst UI elements you can use
> generally, as they are only intended for controls that don't have space
> for labels (e.g. toolbars).  They require fine control, *a mouse*, and
> the user to be patient while hovering above something.  There is not
> even a hint that hovering will reveal a tool tip, you just have to hope.

Yes.  Which is why people don't put "title" on random textual objects in
HTML, but virtually only on images.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 18:23       ` Lars Magne Ingebrigtsen
@ 2011-03-29 18:46         ` Ted Zlatanov
  2011-03-29 19:04           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-29 18:46 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 20:23:08 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> It's not difficult.  Just render "[title: content]" instead of "content"
>> when the user asks to toggle the title, and give the user a way to do it
>> locally or globally for the whole buffer.

LMI> It doesn't seem very useful to me.  The common use case for "title" is
LMI> to add a textual explanation for a non-textual rendering element, which
LMI> is why I've implemented it for <IMG>, and nothing else.

It's commonly used for form and a elements and it's required for abbr
and acronym.  Plus it often makes sense for other HTML elements.  So I
think it's useful generally, not just for images.  But even for
images...

>> Tool tips are (arguably) one of the worst UI elements you can use
>> generally, as they are only intended for controls that don't have space
>> for labels (e.g. toolbars).  They require fine control, *a mouse*, and
>> the user to be patient while hovering above something.  There is not
>> even a hint that hovering will reveal a tool tip, you just have to hope.

LMI> Yes.  Which is why people don't put "title" on random textual objects in
LMI> HTML, but virtually only on images.  :-)

...you can't possibly argue that it makes sense for the user to hover
over every image hoping it has a tooltip?  That works for XKCD because
the users have been trained by now to play that joke, but not generally.

As I keep saying, tooltips require a mouse while Emacs runs just fine
without a mouse or graphics.  So let's just provide a way to toggle
titles in the shr buffer, it's a tiny amount of work.  I'll do it if you
don't feel like it--it will be off by default in any case.

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 18:46         ` Ted Zlatanov
@ 2011-03-29 19:04           ` Lars Magne Ingebrigtsen
  2011-03-29 19:16             ` Ted Zlatanov
  2011-03-29 21:15             ` Adam Sjøgren
  0 siblings, 2 replies; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 19:04 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> ...you can't possibly argue that it makes sense for the user to hover
> over every image hoping it has a tooltip?  That works for XKCD because
> the users have been trained by now to play that joke, but not generally.

I think the idea is that people will hover over images that they don't
understand.  :-)

(Make xkcd pun here.)

> As I keep saying, tooltips require a mouse while Emacs runs just fine
> without a mouse or graphics.  So let's just provide a way to toggle
> titles in the shr buffer, it's a tiny amount of work.  I'll do it if you
> don't feel like it--it will be off by default in any case.

Well, so far we don't have any titles (other than on images, and TAB-ing
to them will show the titles)...

I'm not sure "title" on non-image elements is relevant to shr.  Just
like shr doesn't implement <form>, title on non-image elements may be
outside its domain.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 19:04           ` Lars Magne Ingebrigtsen
@ 2011-03-29 19:16             ` Ted Zlatanov
  2011-03-29 19:35               ` Lars Magne Ingebrigtsen
  2011-03-29 21:15             ` Adam Sjøgren
  1 sibling, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-29 19:16 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 21:04:00 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> ...you can't possibly argue that it makes sense for the user to hover
>> over every image hoping it has a tooltip?  That works for XKCD because
>> the users have been trained by now to play that joke, but not generally.

LMI> I think the idea is that people will hover over images that they don't
LMI> understand.  :-)

They can't hover without a mouse.  I keep saying that and it's the aorta
of the problem.  The vena cava, OTOH, is that you expect users to TAB to
each image in order to possibly discover its tooltip.  Do you have to
TAB in dired to see file sizes and permissions?

LMI> I'm not sure "title" on non-image elements is relevant to shr.  Just
LMI> like shr doesn't implement <form>, title on non-image elements may be
LMI> outside its domain.

OK, let's improve titled images then.  I don't feel strongly about
titled elements in general, although Adam and maybe others want them
rendered.

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 19:16             ` Ted Zlatanov
@ 2011-03-29 19:35               ` Lars Magne Ingebrigtsen
  2011-03-29 19:50                 ` Ted Zlatanov
  0 siblings, 1 reply; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 19:35 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> They can't hover without a mouse.  I keep saying that and it's the aorta
> of the problem.  The vena cava, OTOH, is that you expect users to TAB to
> each image in order to possibly discover its tooltip.  Do you have to
> TAB in dired to see file sizes and permissions?

No, but you have to RET to see the contents.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 19:35               ` Lars Magne Ingebrigtsen
@ 2011-03-29 19:50                 ` Ted Zlatanov
  2011-03-29 20:15                   ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-29 19:50 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 21:35:22 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> Ted Zlatanov <tzz@lifelogs.com> writes:
>> They can't hover without a mouse.  I keep saying that and it's the aorta
>> of the problem.  The vena cava, OTOH, is that you expect users to TAB to
>> each image in order to possibly discover its tooltip.  Do you have to
>> TAB in dired to see file sizes and permissions?

LMI> No, but you have to RET to see the contents.  :-)

Hrm.

Well, at least show more than the title so it's entertaining to TAB
around the buffer.  Can the message be a format string where you can
specify %u (URL), %w and %h (dimensions), %d (JPEG comments, etc. data)
in addition to %t (title)?  I would really like the URL to be easily
visible, for instance.

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 19:50                 ` Ted Zlatanov
@ 2011-03-29 20:15                   ` Lars Magne Ingebrigtsen
  2011-03-29 21:31                     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 20:15 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Well, at least show more than the title so it's entertaining to TAB
> around the buffer.  Can the message be a format string where you can
> specify %u (URL), %w and %h (dimensions), %d (JPEG comments, etc. data)
> in addition to %t (title)?  I would really like the URL to be easily
> visible, for instance.

I think that's veering off into debugging land.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 17:52   ` Lars Magne Ingebrigtsen
  2011-03-29 18:07     ` Ted Zlatanov
@ 2011-03-29 21:09     ` Adam Sjøgren
  2011-03-30  0:58     ` Kevin Ryde
  2 siblings, 0 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-29 21:09 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 19:52:17 +0200, Lars wrote:

> The patch looks good, but all elements can have titles, can't they?

They can indeed, but I thought I'd keep in line with the 'simple' in shr
and make it work just for the case I had.

(Also, it looked easier to me to only do spans...)

>> What if two such titled span elements are nested?

> shr aims to be fast, not a complete HTML renderer.  So if that's
> difficult, it's not essential.

It works out of the box with the patch, at least in the thrice-nested
example I tried/posted a link to.


  Best regards,

    Adam

-- 
 "Soon we'll have spent a whole month at sea,                 Adam Sjøgren
  splitting atoms for no apparent reason"                asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 19:04           ` Lars Magne Ingebrigtsen
  2011-03-29 19:16             ` Ted Zlatanov
@ 2011-03-29 21:15             ` Adam Sjøgren
  1 sibling, 0 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-29 21:15 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 21:04:00 +0200, Lars wrote:

>> As I keep saying, tooltips require a mouse while Emacs runs just fine
>> without a mouse or graphics.  So let's just provide a way to toggle
>> titles in the shr buffer, it's a tiny amount of work.  I'll do it if you
>> don't feel like it--it will be off by default in any case.

> Well, so far we don't have any titles (other than on images, and TAB-ing
> to them will show the titles)...

> I'm not sure "title" on non-image elements is relevant to shr.  Just
> like shr doesn't implement <form>, title on non-image elements may be
> outside its domain.

I think of title-attributes and tooltips as "extra bonus information for
those who are really curious". So in my mind the xkcd case, where the
tooltip is part of the real content, is an outlier - usually tooltips
are not really important, so I don't think it is crucial to support the
no-mouse situation for them.

The case that made me try and implement this was a quotation with
certain parts elided, using "[...]" and a tooltip on the dots containing
the elided text - so you can get the "hidden" text by just putting your
mouse where the missing text-"symbol" is shown, rather than having to
follow the link to the original.

I don't think that is a very common case, but since I wrote the text in
question¹, I thought it was very, very important to have it work in shr
as well as in Firefox.


  Best regards,

    Adam


¹ http://kammeratadam.dk/arkiv/2011/03/27/no_fly_zone

-- 
 "Soon we'll have spent a whole month at sea,                 Adam Sjøgren
  splitting atoms for no apparent reason"                asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 20:15                   ` Lars Magne Ingebrigtsen
@ 2011-03-29 21:31                     ` Lars Magne Ingebrigtsen
  2011-03-30  6:05                       ` Adam Sjøgren
  2011-03-30 13:13                       ` Ted Zlatanov
  0 siblings, 2 replies; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-03-29 21:31 UTC (permalink / raw)
  To: ding

Speaking of horrible HTML things that shr probably won't ever implement:
I just got an HTML invoice in email.  That's usually fine, but shr
didn't render it in a form that was any way comprehensible.

So I looked at the HTML.  It only consisted of a bunch of <div>s, on
this form:

<div style="position:absolute; top:401; left:662; width:69; height:18;text-align: right; clip:rect(0 69 18 0)"><B>1311,00 </B></div>

(I think that's the total amount.)

I guess now we all understand why using <table> is so horrible.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 17:52   ` Lars Magne Ingebrigtsen
  2011-03-29 18:07     ` Ted Zlatanov
  2011-03-29 21:09     ` Adam Sjøgren
@ 2011-03-30  0:58     ` Kevin Ryde
  2 siblings, 0 replies; 28+ messages in thread
From: Kevin Ryde @ 2011-03-30  0:58 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> Hm...  isn't there a general Emacs tool tip thing that can show the tool
> tip without using the mouse?  I have no idea, but there probably should
> be if there isn't.  :-)

w3m.el does its own `message' into the echo area when point moves onto a
link.  I suppose it might use a general mechanism too if there was one.
I struck some text non-link title="" at the oeis recently,

    http://oeis.org/A000290

on the "KEYWORD" keywords at the bottom of the page, saying what the
keywords mean.  Probably better as links so it's visible in lesser
browsers, but could be cute to pick it out if help-echo was somehow
echoed on the console.



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 21:31                     ` Lars Magne Ingebrigtsen
@ 2011-03-30  6:05                       ` Adam Sjøgren
  2011-03-30 13:13                       ` Ted Zlatanov
  1 sibling, 0 replies; 28+ messages in thread
From: Adam Sjøgren @ 2011-03-30  6:05 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 23:31:08 +0200, Lars wrote:

> <div style="position:absolute; top:401; left:662; width:69;
> height:18;text-align: right; clip:rect(0 69 18 0)"><B>1311,00
> </B></div>

> (I think that's the total amount.)

> I guess now we all understand why using <table> is so horrible.

But it's SEMANTIC!


  Best regards,

     Adam

-- 
 "This reporter was clearly from the "stenography"            Adam Sjøgren
  school of reporting. Math is hard, let's go            asjo@koldfront.dk
  shopping."




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-29 21:31                     ` Lars Magne Ingebrigtsen
  2011-03-30  6:05                       ` Adam Sjøgren
@ 2011-03-30 13:13                       ` Ted Zlatanov
  2011-03-30 13:39                         ` Richard Riley
  1 sibling, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-30 13:13 UTC (permalink / raw)
  To: ding

On Tue, 29 Mar 2011 23:31:08 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> So I looked at the HTML.  It only consisted of a bunch of <div>s, on
LMI> this form:

LMI> <div style="position:absolute; top:401; left:662; width:69; height:18;text-align: right; clip:rect(0 69 18 0)"><B>1311,00 </B></div>

LMI> (I think that's the total amount.)

LMI> I guess now we all understand why using <table> is so horrible.

How does the usage of <div> elements predicate your statement?  Or is my
irony meter broken again?

Ted




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-30 13:13                       ` Ted Zlatanov
@ 2011-03-30 13:39                         ` Richard Riley
  2011-03-30 19:02                           ` Ted Zlatanov
  0 siblings, 1 reply; 28+ messages in thread
From: Richard Riley @ 2011-03-30 13:39 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Tue, 29 Mar 2011 23:31:08 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 
>
> LMI> So I looked at the HTML.  It only consisted of a bunch of <div>s, on
> LMI> this form:
>
> LMI> <div style="position:absolute; top:401; left:662; width:69; height:18;text-align: right; clip:rect(0 69 18 0)"><B>1311,00 </B></div>
>
> LMI> (I think that's the total amount.)
>
> LMI> I guess now we all understand why using <table> is so horrible.
>
> How does the usage of <div> elements predicate your statement?  Or is my
> irony meter broken again?
>
> Ted
>

Just a sidenote/history tale..

Nightmare times. What was "broken" was the reality level of many CSS
advocates a couple of years ago who somewhat smugly informed everyone to
use CSS rather than tables for "simple" layouts and point blankly
refused any help to those trying to use tables for cross browser layout
"working solutions". If I had a penny for everytime I saw someone new to
CSS asking in #css how to do something "elementary" or common like a 3
columned layout or a horizontal toolbar that works cross browser in CSS
and told to "read the docs" I would be a billionaire. Most gave up and
went back to tables ;) Google holds the myriad of "solutions" many of
which dont work. Tableless CSS was all well and good if you're paid by
the hour I dare say and have the patience to work out the idiosyncrasies
of 9 different browsers and their adherence to CSS standards over the
past years. In short it was a nightmare and tables were used on many
many many of the top web sites until only very recently. Thank God for
the decline in usage of the IE 6 browser and the better adherence to CSS
standards. That said IE 7 still has nasties with regard to layout
triggering.


-- 
☘ http://www.shamrockirishbar.com, http://splash-of-open-sauce.blogspot.com/ http://www.richardriley.net



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-30 13:39                         ` Richard Riley
@ 2011-03-30 19:02                           ` Ted Zlatanov
  2011-04-03 12:10                             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 28+ messages in thread
From: Ted Zlatanov @ 2011-03-30 19:02 UTC (permalink / raw)
  To: ding

On Wed, 30 Mar 2011 15:39:58 +0200 Richard Riley <rileyrg@googlemail.com> wrote: 

RR> Nightmare times. What was "broken" was the reality level of many CSS
RR> advocates a couple of years ago who somewhat smugly informed everyone to
RR> use CSS rather than tables for "simple" layouts and point blankly
RR> refused any help to those trying to use tables for cross browser layout
RR> "working solutions".

<rant> 

I think 99% of things about HTML, CSS, and web browsers are
either ridiculous or broken.  The good bits (in SGML's domain) are
basically Lisp without `eval'.

Specifically regarding layouts, it's sad that the only layout management
in HTML (without Javascript) is the equivalent of Java's FlowLayout.
Tables are sort of a GridBagLayout, but the idiocy inherent in the
inability (in the early days of HTML) to design and implement a sensible
layout manager for HTML is simply staggering.  Now, of course, it's too
late to make HTML anything but a presentation layer for Javascript.

And then we have CSS, the out-of-band, braindead solution that can
either go inline or separately and which uses selectors and multiple
classes to achieve amazing complexity.  Where HTML is at least a data
language, CSS is a crazy mish-mash of direct instructions, inheritance,
browser hacks, and unmodifiable stylesheets you hope will work but
usually don't.

</rant>

Ted

p.s. Yes, I realize the irony of using SGML tags above.




^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: shr - span elements with title attribute, tooltip?
  2011-03-30 19:02                           ` Ted Zlatanov
@ 2011-04-03 12:10                             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 28+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-04-03 12:10 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Specifically regarding layouts, it's sad that the only layout management
> in HTML (without Javascript) is the equivalent of Java's FlowLayout.
> Tables are sort of a GridBagLayout, but the idiocy inherent in the
> inability (in the early days of HTML) to design and implement a sensible
> layout manager for HTML is simply staggering.

I've been annoyed about this ever since CSS appeared.

99% of what people want to do with layout on normal web pages can be
done with a GridBagLayout-like layout.  

Instead we're still fiddling with the idiocies of CSS layout.

And it's not like creating a language for specifying a GridBagLayout
would be difficult with XML; what with it being all hierarchical and
stuff.  Which all browsers already have a parser for.

It's just mind-boggling...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2011-04-03 12:10 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-27  7:54 shr - span elements with title attribute, tooltip? Adam Sjøgren
2011-03-27  8:32 ` [PATCH] Show title attribute of span elements as mouse over text Adam Sjøgren
2011-03-28 18:58 ` shr - span elements with title attribute, tooltip? Ted Zlatanov
2011-03-28 19:17   ` Adam Sjøgren
2011-03-28 19:33     ` Ted Zlatanov
2011-03-28 19:59       ` Adam Sjøgren
2011-03-28 20:14         ` Ted Zlatanov
2011-03-28 20:34           ` Adam Sjøgren
2011-03-28 21:02             ` Adam Sjøgren
2011-03-28 21:07             ` Ted Zlatanov
2011-03-29 17:52   ` Lars Magne Ingebrigtsen
2011-03-29 18:07     ` Ted Zlatanov
2011-03-29 18:23       ` Lars Magne Ingebrigtsen
2011-03-29 18:46         ` Ted Zlatanov
2011-03-29 19:04           ` Lars Magne Ingebrigtsen
2011-03-29 19:16             ` Ted Zlatanov
2011-03-29 19:35               ` Lars Magne Ingebrigtsen
2011-03-29 19:50                 ` Ted Zlatanov
2011-03-29 20:15                   ` Lars Magne Ingebrigtsen
2011-03-29 21:31                     ` Lars Magne Ingebrigtsen
2011-03-30  6:05                       ` Adam Sjøgren
2011-03-30 13:13                       ` Ted Zlatanov
2011-03-30 13:39                         ` Richard Riley
2011-03-30 19:02                           ` Ted Zlatanov
2011-04-03 12:10                             ` Lars Magne Ingebrigtsen
2011-03-29 21:15             ` Adam Sjøgren
2011-03-29 21:09     ` Adam Sjøgren
2011-03-30  0:58     ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).