Greasemonkey Script: Sticky Notes [Update 4]

I wrote my first greasemonkey script: Sticky Notes. With this script you can add sticky notes to every website. However, because this is my first greasmonkey script don't expect it to be perfect.

Update:
Now you can resize the sticky notes, there is no longer made a distinction between URL and URL#FOO, and I have also proper z-ordering implemented.

If anyone could tell me why moving and resizing the notes is so buggy I would be happy.

Update 2:
Moving and resizing is now much more stable! :)

Update 3:
With a little help from Mihai I added support for custom stylesheets. Now you can theme your sticky notes as you wish.

Update 4:
Tiny improvement: moving/resizing sticky notes should now work on more websites (because now I install some event handlers at the right place).

Also it's now possible to add sticky notes through a bookmarklet. Just add this link to your bookmarks.[1]

Download:
Sticky Notes on userscript.org

Screenshots:


PS: You may use this script under the terms of the GPLv2 or GPLv3.
PPS: I added it to userscripts.org.

Notes:
[1] I'm not completely confident with this because I have to use unsafeWindow for this feature.
Hermann (anonym) - 11. Mai, 13:46

Cool script!

If you change the file extension to .user.js the Greasemonkey installation dialog will automatically appear.
panzi - 11. Mai, 14:21

Thanks for the hint! :)
tomasiek (anonym) - 19. Aug, 12:21

save to file

Please add saving notes in an external file - then it could be synchronized between the computers.
panzi - 19. Aug, 16:05

@tomasiek
As far as I know this is not supported by greasemonkey. However, this scrip already provides a export/import functionality where you get the text you have to save into a file in a textbox. You have to copy+paste it to/from a text file yourself (be sure to not add additional blank lines).
Christine (anonym) - 21. Aug, 03:45

Thanks! This is perfect. Simple and uncomplicated. I really have missed the Internote add-On and I don't like the other Sticky Note FF add-on. But your script fits my needs exactly!
Tudor (anonym) - 4. Sep, 00:24

Nice script

Hi,
This looks like a very useful script, however after installing it (and restarting Firefox), nothing happens when I go to Greasemonkey|User script commands|Add sticky note. Is there anything else I should be doing?
Thanks
Tudor
Tudor (anonym) - 4. Sep, 00:41

...

Oh, and also: should a note that you've added for a certain URL not appear automatically whenever you come back to that URL? I thought that was the point of such a script (at least that's the reason *I* need it :) )
Rogerio M. Souza (anonym) - 20. Sep, 16:46

From Brazil

Congratulation!

Very Very good!

Similar the www.diigo.com

Thanks
gaspar (anonym) - 7. Dez, 20:49

I like this script very much; however, it doesn't work on local pages (file:///Users/...). The FF Tools > User_Scripts_Command menu is actually grayed out. Adding file:///* to the included pages doesn't help. Can this be fixed? In addition, editing the style sheets doesn't work. Is a restart necessary? Thanks for making this script available.
panzi - 7. Dez, 21:03

Strange, both of this (file:// pages and editing the stylesheet) works for me. I use Firefox 3.5.5 on Fedora 11.
gaspar (anonym) - 7. Dez, 23:57

Thanks for the reply. I forgot to mention that I'm using FF 3.5.6 on OSX; I've tried the script on both Tiger (10.4) and Snow Leopard (10.6) with the same results. As for the style sheets, I can call up the edit window, or edit the script itself in BBEdit, but none of the changes I make are reflected in the new stickies that I create. For example, I would like the text to be centered (ideally, both horizontally and vertically in the sticky), but changing "text-align: center" under /* text when displayed / editing */\n\ results in no change. Same for when I try to change the default font, or font size, etc. Could there be an incompatibility with another FF extension?
panzi - 8. Dez, 00:29

The "\n\" in your post makes me suspicious. How do you edit the stylesheet? There is a "Edit Sticky Note Stylesheet" user script menu item. Edit it there and click save. The changes should be applied immediately. The hardcoded stylesheet is only used on first run when no stylesheet is is found in the configuration.

For me setting this style property to center worked. Please keep in mind that only the notes in the window/tab from where you called the stylesheet dialog will be updated. For the others a simple reload should do.
gaspar (anonym) - 8. Dez, 01:29

Ah, OK, using the edit stylesheet window works. (You were right, I was attempting to edit the script directly in BBEdit.) However, the script is still not working for me with local files.
panzi - 8. Dez, 02:07

Yeah, strange. My script does not care about that. I don't know what's causing this.
Nate (anonym) - 11. Dez, 04:09

To enable Greasemonkey to fire on local files (file://*), get into about:config, and change the [greasemonkey.fileIsGreaseable] value to TRUE.

This solved my problem with stickies not working on local files. Be aware, however, that this can potentially allow malicious GM scripts to read your local files, etc, etc.
gaspar (anonym) - 13. Dez, 00:51

Cool, thanks! Just of curiosity, how many GM scripts have ever been identified as malicious?
panzi - 13. Dez, 01:04

Does the number of malicious scripts really count? If it's just one and you've got it its one to many.

And I think any GM script (and any FF Add-On) can read your session data including username and passwords when logging in to any homepage and send it somewhere. So you should always check what you've downloaded. Either read the source or only use things that have a big user base and preferable several Independent developers so you can be (relatively) sure that someone else looked at the source and would have screamed if there is something malicious in it.
Gustronico - 12. Jan, 16:03

Sticky note in a family of pages

Hi!
How can I add a unique sticky note to a family of pages, so it appears on every subpage of a given basepage? Something like www.site.com/basepage/*
is it possible?
thanks panzi, this is a great tool.
panzi - 12. Jan, 16:28

It's not possible with the current implementation but it's certainly possible to add that feature. I just have no time to do that (nor do I feel like doing this right now).
Gustronico - 13. Jan, 22:18

Thank you very much for the response. It also would be very useful to ignore many question marked url queries that appear on a unique page.
panzi - 13. Jan, 23:34

Well this would only work on a per site basis, because there *are* sites where the query string is relevant.
Jack (anonym) - 15. Jan, 16:58

Alt+N

Hi, thank you very much for this little life saver! Very useful to me, seems very well thought through.

I can't use Alt+N to add a note though, is there something I have to enable somewhere?

The bookmarklet helped though :-)

Thanks again

Trackback URL:
http://twoday.tuwien.ac.at/pub/stories/324494/modTrackback


logo

pub - panzi's uni blog

Archiv

Mai 2009
Mo
Di
Mi
Do
Fr
Sa
So
 
 
 
 
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
10
15
16
17
19
20
21
22
23
24
26
27
28
29
30
31
 

User Status

Du bist nicht angemeldet.

Suche

 

Aktuelle Beiträge

Sun Java on Fedora
Because icedtea seems to still have problems (some...
panzi - 6. Feb, 19:15
Alt+N
Hi, thank you very much for this little life saver!...
Jack (anonym) - 15. Jan, 16:58
Well this would only...
Well this would only work on a per site basis, because...
panzi - 13. Jan, 23:34
Thank you very much for...
Thank you very much for the response. It also would...
Gustronico - 13. Jan, 22:18
It's not possible with...
It's not possible with the current implementation but...
panzi - 12. Jan, 16:28

Status

Online seit 1742 Tagen
Zuletzt aktualisiert: 6. Feb, 19:15

Credits

twoday.org

based on antville powered by Helma


  • xml version of this page

(sci)fi
algodat
c
comic
dies und das
film & tv
gefahren des internet
graphik
iug1
java
k(r)ampf mit dem computer
literatur
mathe
musik
netzkultur
open source
... weitere
Profil
Abmelden
Weblog abonnieren