sidewiki

By 2x Last update Mar 25, 2010 — Installed 301 times.

Suggestion

in
Subscribe to Suggestion 4 posts, 2 voices



Alexander Gieg User
FirefoxWindows

Hi! First of all, thank you very much for providing this script. I don't have space in my limited netbook screen space for another toolbar so, even though this is read-only for now, being able to read sidewikis is still pretty useful!

But I have a suggestion. I use the NoScript addon in Firefox (http://noscript.net), and while it usually allows Greasemonkey scripts to run on otherwise JavaScript-disabled pages, it doesn't allow code inserted into the blocked page itself by Greasemonkey scripts to run, as NoScript has no means to differentiate Greasemonkey-inserted scripts from page-provided ones. As a result, when one enters a NoScript-blocked while using sidewiki, two things happen: first, sidewiki seems to not be working at all (maybe it is actually working, just unable to "act" on its floating frame, I don't know); second, the "No sidewiki annotations" text stays visible on the page forever, never disappearing.

So, would it be possible to make it more compatible with NoScript? Ideally this would mean sidewikis being "findable" and "displayable" even for JavaScript-disabled pages. If that's not possible, another solution would be to recode the "No sidewiki annotations" piece (or the whole frame) so that it also only appears when JavaScript is available, thus preventing sidewiki-related content from appearing at blocked pages.

A third option would be for the "No sidewiki annotations" text to not exist at all, what would also help on frame and iframe-based sites, as on those, every frame shows the text, something a little distracting.

What do you think?

 
2x Script's Author
MozillaX11

I'm thinking about removing the no-annotations div entirely (simple to do: put a "return" right before "sw.innerHTML = 'No sidewiki annotations';" in the script code).

BTW, the mere fact that it shows means that NoScript failed to block scripts on the page. At least not completely. Otherwise you wouldn't see the DIV (it's an added DIV element, not a frame, as IFRAME) at all.

I just don't know what is it NoScript blocking, so it is broken the way you describe it. Maybe scripts orginating from "file://"? (that's what I had enabled, when I started to play with sidewiki, reasoning that GreaseMonkey scripts must come from local filesystem).

Regarding your suggestion to not screw the page when script is blocked: any idea how detect that the javascript is blocked on the page (and react to it being blocked)?

 
Alexander Gieg User
FirefoxWindows

Unfortunately I don't know JavaScript, so I don't have any way to help directly. But I've searched around and it seems the problem is with the "setTimeout" thing (?). This link describes the problem:

http://www.oreillynet.com/pub/a/network/2005/11...

And on another script (http://userscripts.org/scripts/review/3377) I found a comment inside a function saying it is a workaround:

   function fadeinbuttons(delayBeforeStart, id, fadeDurationInSeconds)
   {
      var timer = 0;
      // var id = "TNLbuttons"; // now an argument
      var numSecondsToFade = fadeDurationInSeconds // 1.5;
      var fadeSteps = 30;
      var stepSizeInMs = numSecondsToFade * 1000 / fadeSteps; // number of ms between each transition.
      var startDelay = (1 * delayBeforeStart) + (1 * stepSizeInMs); // fade won't start for 1000 ms

      
      // with the noScript extension, the setTimeout functionality might stop working.  This is a kludge workaround:
      document.getElementById(id).style.opacity = "1";
      setTimeout("document.getElementById('" + id + "').style.opacity = 0", 10); 

      //setTimeout("alert('there it is');", 1000);
      for (i = 0; i < 115; i += Math.ceil(115 / fadeSteps))
      {
         setTimeout("document.getElementById('" + id + "').style.opacity = " + (0 - Math.cos(Math.PI * i / 100)), Math.ceil(timer * stepSizeInMs + startDelay)); 
         timer++;
      }
      
   }

As for detecting NoScript, I have no idea, sorry. Maybe someone at NoScript's might provide something?

 
2x Script's Author
FirefoxWindows

I removed the "No sidewiki annotations" popup. It managed to annoy me enough, showing up on each and every page :)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel