Live data from Hacker News

Bertrand Russell Is the Pope (2010)

ceadserv1.nku.edu

1–10 of 122 posts

Re: Bertrand Russell Is the Pope (2010)

#6
post #3

Why does this site open Wikipedia when I double-click?

Presumably because of the JavaScript implementing that behaviour in the footer, charmingly pasted in from one of those JavaScript library sites and even still including the original credit:

Neither of those sites seem to be available though.

The code below that comment is -

  var NS = (navigator.appName == "Netscape") ? 1 : 0;
  if (NS) document.captureEvents(Event.DBLCLICK);
  document.ondblclick = dict;
  var newwin;
    function dict() {
    if (NS) {
      t = document.getSelection();
      opennewwin(t);
    }
    else {
      t = document.selection.createRange();
      if(document.selection.type == 'Text' && t.text != '') {
        document.selection.empty();
        opennewwin(t.text);
            }
    }
  }
  function opennewwin(text) {
    if (text > '') {
      newwin = window.open('http://en.wikipedia.org/wiki/Special:Search?search='+text, 's&go=Go');
      setTimeout('newwin.focus()', 100);
    }
  }

Re: Bertrand Russell Is the Pope (2010)

#9
I love Bertrand Russell man. His essays are so beautifully written.

In praise of idleness is a banger. The conquest of happiness is a joy to read. His writings are so clear. The way he elucidates his thought process is sublime. What a cool guy.

Re: Bertrand Russell Is the Pope (2010)

#10

Earlier quoted context omitted.

Presumably because of the JavaScript implementing that behaviour in the footer, charmingly pasted in from one of those JavaScript library sites and even still including the original credit:

Neither of those sites seem to be available though. The code below that comment is - var NS = (navigator.appName == "Netscape") ? 1 : 0; if (NS) document.captureEvents(Event.DBLCLICK); document.ondblclick = dict; var newwin; function dict() { if (NS) { t = document.getSelection(); opennewwin(t); } else { t = document.selection.createRange(); if(document.selection.type == 'Text' && t.text != '') { document.selection.e…

Well yes, I assumed that anyone interested in the actual implementation could go view-source it for themselves. Obviously this was cut-and-pasted into this website's generic footer many, many moons ago, and the fact that it remains long after the original source is gone is part of the charm.
Post reply on HN