Arc Forumnew | comments | leaders | submitlogin
1 point by markkat 5128 days ago | link | parent

I wasn't sure if this warranted a new submission, so I am just adding it here for now:

Continuing my news.arc mods, I am currently trying to create a 'hover-over' effect on the .comhead that isn't just text-style, but pulls up the top comment in a popup. For example, ATM, the comment of fallintothis would popup onmouseover on the mainpage. I might be over my head here yet, but any pointers would be appreciated.



1 point by rocketnia 5128 days ago | link

It sounds like you're talking about what forums usually accomplish using the HTML "title" attribute. Doing it in JavaScript lets your bubble be more stylish, and there might even be a way to do stylish bubbles using just CSS (having a separate :hover style or something, with the regular style hiding the children), but "title" should be the easiest to try first:

  <a href="http:..." title="Agreed.">Ask so-and-so: ...</a>
Something you might find convenient here is Arc's 'ellipsize function, which shortens long strings and puts ... at the end.

-----

1 point by markkat 5127 days ago | link

Thanks. Struggling with it, but I'll keep at it. Will title really work if I am referencing a call to comment text? I'm going to give the :hover route a shot. Not too worried about style though. :)

Ellipsize will definitely come in handy. Thanks for the tip.

-----

1 point by markkat 5125 days ago | link

Hm. This is breaking my brain. I can create a td class for comments that enables an independent hover effect, but I get a large space in the preceding subtext class cell, which I can't seem to resolve.

Using spanclass the spacing is conserved, but I only get some attributes onto the comment, but not hover. Here's where I am working, with a spanclass comref that only seems to be able to override the color of the subtext class.

  (def commentlink (i user)
    (when (cansee user i) 
      (pr bar*)
      (tag (a href (item-url i!id))
        (let n (- (visible-family user i) 1)
          (if (> n 0)
              (spanclass comref
              (do (pr (plural n "comment"))
                  (awhen (and show-threadavg* (admin user) (threadavg i))
                    (pr " (@(num it 1 t t))"))))
              (pr "Add comment"))))))
I tried to define an ID class, but #class doesn't seem to work as a declaration? Not sure if it is a failing of my CSS, Arc, or both. :/

If anyone has an idea how to create a hover effect on comments when n<0, please throw me a bone. :)

-----

2 points by akkartik 5127 days ago | link

One suggestion: position the popup to the right of the main panel (like on google search)

-----

1 point by markkat 5127 days ago | link

That is a great idea. I have no clue how to do it, but I am trying... Like I said, I am a noob.

I often find myself clicking through to comments on HN and reddit, just curious to see what the highest rated one is. -I thought it be nice to be able to save the trip.

I've set out to refashion news.arc in my own way, and teach myself some programming along the way. I'll share it once I'm done. So far I am enjoying it. Arc is a bit terse, but clear once I can get a handle on a concept. Slowly, I am getting familiar with it. I've been able to modify karma from a point system into a type of currency on my own, and I am pretty happy at that.

-----