1. 01. Incoming
  2. 02. Hifi
  3. 03. Lofi
  4. 04. The Lab
  5. 05. Tags

frequency decoder

Little Yellow Stickies

Posted Tuesday September 13, 2005

frequency decoder

An experimental browser based "post-it" note system that stores the note contents and status information in a cookie

Please explain…

The frequency decoder take on the currently in-vogue browser sticky (now Internet Explorer 6 friendly!) that stores the sticky text in a browser cookie. Stickies are draggable and the font shrinks or expands on sticky resize. To enable you to leave more expressive notes, stickies now accept a subset of Texile. Finally, a double, not single-click now initiates the editing process; this means the Textile generated HTML can be copied and pasted into other applications (such as the dreadful MSWord)

Privacy issues

Please remember that the sticky content is not private. As the content is stored in a cookie and cookies are sent to the server with each HTTP request, nasty site admins could theoretically read the content of all your sticky notes (I can assure you that nothing of the sort happens on frequency decoder).

Elsewhere

The Little Yellow Stickies script has been spotted in the wild! PhotoArcs, a web application that facilitates the online equivalent of co-present storytelling through photos currently uses the script to create the “narratives”. Additionally, a thread has been opened on the Opera forums to discuss the Opera toolbar port of the original Little Yellow Sticky script.

Tested in Internet Explorer 6, Opera 8, Firefox and Mozilla.

View the little yellow sticky demo.

Tags: javascript, postit, stickies

Previous Comments ~

Antonio · http://digilander.libero.it/odnalro
#1 · Friday October 7, 2005
Really cool script, I’ve unsuccessfully tried those on http://clagnut.com/blog/1405/ with my Opera browser, but no luck: your script seems the only one working in Opera, bravo!

I’m not sure, anyway I think the “disappearing bug” you say is due to the fact that multiple stickies are initialized with the same timestamp, so the ids are the same and successive cookies overwrite previous ones: that is, the line “sticky.date = new Date();” should be moved into the “function sticky(c,x,y,w,id) {” function…

Besides, where you do:
o._mx = 0; o._my = 0; o._x = x||100; o._y = y||100; o._w = w||140;

...I prefer:
var init_x = 100 + Math.floor(Math.random()*501);
var init_y = window.pageYOffset + 100 + Math.floor(Math.random()*201);
o._mx = 0; o._my = 0; o._x = x||init_x; o._y = y||init_y; o._w = w||140;

This avoids new stickies appearing on the same place, and lets them appear in a visible area even if the page is long and scrolled down so far ;)

I’ve added the document url into the cookie data, so I check for that when I’m on a page, and if there are cookies associated to that url I let them be displayed: now I suppose I can use the script as an Opera “user script” (they run at every document loading), with the newStiky() button being a button on the Opera toolbar: it will be a valuable tool to add notes to web pages, wherever I want on the page! :)
Thank you very much (I can send my little modified one if you want).

PS: a little “bug” on this site, you’ve not specified the background color (white) in this area; in fact, I have a grey system background color (in order to avoid this error), and I can see the area containing this textarea (and other links) is grey: the top of the page (with the main column) is white (with a gradient), then a big area with no background color specified, than a white (with gradient) footer. The same on the main page. Bye
frequency decoder
#2 · Saturday October 8, 2005
Nice one, you found the elusive “disappearing stickies” bug – thanks!

As for sticky creation, I really liked the drag & drop idea Richard came up with and was hoping to add the same sort of functionality to my own script at some point (when I actually have more than two nano seconds of spare time).

I also like the idea of a browser toolbar version. It would allow "notes" to be taken on any website, not just the host site. A "Create site-wide sticky?" checkbox could be included along with the button to allow stickies to be created for a specific page or for the entire site.

...and thanks for noticing the background color nastiness, I would never have spotted it.
Antonio · http://digilander.libero.it/odnalro
#3 · Saturday October 8, 2005
Note: the “window.pageYOffset” equivalent for Internet Explorer is “document.body.scrollTop”.

And yes, the sitewide sticky checkbox is a good idea :)

So it was that the disappearing bug… I’m really new to javascript, anyway your code was so clean that I’ve been able to debug it rather fluently, and I’ve learned a lot: thank you for your evident effort in writing readable code, it’s better and more straightforward than any tutorial.

Oh, I’ve noticed that sticky content is not saved to the cookie when it exceeds 2627 characters: this is due to a limit for cookie data I suppose. Anyway, even staying into that limit, having more than one sticky and filling with too much stuff one of more of them, weird behaviours (in cookie saving) occur. So it would be nice to add some control to prevent user inserting more than, say, one thousand characters in the textarea: I’ve seen you’ve already coded something useful for that, I hope it could be integrated into the stickies script.

And these other mods regards my personal tastes, they’re not bugs – read them for “statistical purposes” :) I don’t like font-size scaling, so I’ve set it to 12px, it’s ok for me. And I like to resize stickies as rectangulars, so I’ve added height information to the cookie data (and the code to resize in Y direction of course).
Antonio · http://digilander.libero.it/odnalro
#4 · Saturday October 8, 2005

[...] So it would be nice to add some control to prevent user inserting more than, say, one thousand characters in the textarea [...]

Ehm, it was simpler than expected, just added an if statement in the o.stopEdit function:

o.stopEdit = function(e) {
      var txt = o.safeText();
      txt = txt.replace(/\n/g,’’);
      if (txt.length > 1000){
         alert(“Hey, this is a little sticky: you can’t write an essay here!”);
         o.textarea.value = ‘’;
         txt = ‘’;
      }
      ...

Bye

frequency decoder
#5 · Saturday October 8, 2005

It might be easier to move the cropping of the text into the method safeText:

return o.textarea.value.trim().length == 0 ? ’ ’ : o.textarea.value.trim().substring(0,1000);
Antonio · http://digilander.libero.it/odnalro
#6 · Saturday October 8, 2005
I’ve seen the “Quick update #1” of the little yellow sticky demo, but
I want to alert you that now it works weirdy (I do try it in Opera 8.5).
Don’t know why, I think something related to the css, anyway when dragging or resizing the stickies beyond a little more than the half of the screen, they lose their shape and the inner textarea exceeds the sticky… the area with the “frequencydecoder*” logo shifts and is cropped. This bug was not present before, it should be related to something you’ve touched in the css formatting the page layout.

And a bug that was already present: the “Show stickies as plain text” doesn’t toggle into “Show stickies in note form”.

This message was a mail with attached my little modified version of your script, anyway the mail address written in the footer of this page sends me a 554 error: Relay access denied :(

I’ll let you know if I have success with the Opera integration experiment.
frequency decoder
#7 · Monday October 10, 2005
Hi Antonio,

I’ve fixed the “show stickies…” bug but haven’t had the time to look into the Opera CSS stuff. I had a quick look at the demo in Opera 8.5 but couldn’t reproduce the problem (remember, I only allow the stickies to be resized to a maximum of 400px – perhaps you have changed the code to allow arbitrary resizes?).

I’ll endeavour to look into it at some point this week – as for the email fiasco, I’ll also attempt to look into it this week! It’s only slightly embarassing to proudly present a broken email link on every page of your site!

Take care and thanks for the interest, I hope the Opera toolbar development goes well.
Antonio · http://digilander.libero.it/odnalro
#8 · Monday October 10, 2005
The Opera integration of your stickies script is finished, and the tutorial of how to set it up is ready and online. Here it is the link, you’re the first one to know this (after me :)

http://digilander.libero.it/odnalro/coding/sticky_notes/

Tomorrow I’ll announce it with a post on the Opera forum, I hope everything is good. Much thanks, bye!
Antonio · http://digilander.libero.it/odnalro
#9 · Tuesday October 11, 2005
> I had a quick look at the demo in Opera 8.5 but couldn’t
> reproduce the problem

PS: Your demo works well now.
Antonio · http://digilander.libero.it/odnalro/
#10 · Tuesday October 11, 2005
Hi, I have opened a thread about the sticky-notes integration with Opera, here:

http://my.opera.com/community/forums/topic.dml?id=107065&t=1129038797&page=1
frequency decoder
#11 · Thursday October 13, 2005
Hi Antonio,

Thanks for the Opera toolbar conversion, it’s quite cool indeed!

To make the stickies stay put when the user scrolls the screen, you can give them a fixed position within the CSS (which alas, won’t work in Internet Explorer):

position:fixed !important; /* Mozilla et al */
position:absolute; /* Internet Explorer */

I don’t know why I didn’t do this to begin with..
Antonio · http://digilander.libero.it/odnalro/
#12 · Monday October 17, 2005
I’ve just finished to make interesting changes to the script, try it and see if you like it. Bye!

Comments are currently closed for this article but feel free to email me with your input - I’d love to hear it.

Popular Frequencies

  • Unobtrusive Table Sort Script (revi…
    Saturday September 16, 2006
  • Unobtrusive Date-Picker Widget Upda…
    Monday October 02, 2006
  • Unobtrusive Table Sort Script
    Friday November 18, 2005
  • Unobtrusive Date-Picker Widgit
    Friday October 14, 2005
  • Unobtrusive Table Actions Script
    Thursday November 15, 2007

Google Ads

All articles