Eli Grey

CiteDrag drag and drop script

Firefox 3.1 beta 2 recently added support for the standard drag and drop model (also with some extra Mozilla-only ones). I had an idea to automatically add citation info to text dragged from websites to plain and rich text editors using this newly supported API. I named the finished script CiteDrag, which requires no setup other than adding a single script tag anywhere in your website’s page. CiteDrag is licensed GNU LGPL and free to download in two flavors: CiteDrag and CiteDrag + Drag Image. CiteDrag + Drag Image is all of the normal CiteDrag code with some additional code to give a fancy canvas-generated drag image that shows the text content being dragged. CiteDrag is mostly useful for when someone blogs about another person’s blog post. Having the text automatically go into a cited blockquote and having a link back is very useful. I have installed CiteDrag on this blog and I have a demo of it and a rich text area you can use to test out CiteDrag fully.

Here are some examples of what it does when you drag various data types to various input areas: (Note wherever it says title, it will be replaced with the host name of the source page if there is no page title)

  • Drag a link or image (or linked image) to a normal text input: { [link URI] or [image URI] } via {source title} ( {source URI} )
    • Example:  http://example.com/ via Foobar ( http://foo.bar/post/example.com-ftw/ )
  • Drag a link or image (or linked image) to a rich text input: { [clickable link to link URI] or [image URI] or [clickable image linked to link URI] } via {clickable link to source page with title as text}
  • Drag formatted or non-formatted text to a normal text input: “{Text dragged}” ― {source title} ( {source URI} )
    • Example:  “Lorem ipsum dolor sit amet.” ― Eli Grey ( http://www.eligrey.com/ )
  • Drag formatted or non-formatted text into a rich text input: The dragged text goes into a <blockquote cite=”{source URI}”> and after the blockquote is ― {clickable link to source page with title as text}
    • Example:

      Lorem ipsum dolor sit amet.

More rotⁿ fonts

I previously made two rot13 DejaVu fonts (rot13 DejaVu Sans and rot13 DejaVu Serif) so I thought I might as well make fonts for the other less-widely used rotn ciphers. All of these fonts are based on the open source DejaVu fonts. These are by no way official DejaVu fonts and are just remixes by me under the same license as the normal DejaVu fonts. If you want to distribute the fonts on your website, feel free to do so, and you could optionally link back to me if you want. I don’t care what you do with them. As with all the rotn ciphers, using them twice (ie. using the rot47 font to view rot47 encoded text) will result in the unciphered text. It’s a cipher that decodes what it encodes by doing the same rotations. The example pages require a modern browser that supports webfonts, such as Firefox 3.1 beta or Safari 3.1.2.

Noteboard 2.0

I have almost completely re-wrote Noteboard from the scratch and made Noteboard 2.0 because I felt that Noteboard 1.0.1 was not that extensible. There are a TON of changes in Noteboard 2.0, most notibly, multiple-document support. Just the same as the original Noteboard, it’s Firefox 3+ (and maby 2+) only. The reason there are only keyboard shortcuts (hotkeys) to control Noteboard is so there are no other elements other than a single text box. The stats bar has been disabled by default and can be toggled on by pushing Alt + Ctrl + I. All of the keyboard shortcuts are on the first document, ‘shortcuts’. I don’t reccomend deleting this document until you get used to using Noteboard.

With multiple document support, you can now create as many documents as you like. To create a document, push either Alt + Shift + N or Alt + Shift + C and type in the name of the document. To open a document you can push either Ctrl + Alt + O or Alt + Shift + O. To delete a document, you push Alt + Shift + D. To rename the current document you’re viewing, push Alt + Shift + R. All documents (and document names) have full Unicode support so you may name them whatever you want to and put whatever you want in them.

Another cool feature introduced in Noteboard 2.0 is document autoload URLs. (more…)

Noteboard 1.0.1 update

I have recently updated Noteboard. This update includes various improvements. You can visit Noteboard through noteboard.eligrey.com and noteboard.nfshost.com.

  • Instead of using Mozilla’s non-standard storage interface, I changed the code to use the standard WhatWG Storage Interface. Using this interface lets Firefox 3.1+ manage the data set by going to Options -> Advanced -> Network -> Offline Storage.
  • Ctrl+S now saves the text. I recommend you do Ctrl+Alt+S to not trigger the “Save As” dialog box. I accidentally used to push Ctrl+S all the time forgetting that it will autosave when I close the window and it couldn’t save in mid-edit. I can’t override the default Save As dialog box without having access privlaged scripts which are only for addons, ect.
  • Alt+Ctrl+D deletes all the data stored by Noteboard on the domain it is currently on. Think of it as clearing your cookies if Noteboard actually set cookies. This is mostly needed as an alternative to using Firefox 3’s buggy offline storage management that doesn’t work most of the time.
  • When you Ctrl+V paste, the text is autosaved.
  • Will work on any browser that supports localStorage or globalStorage and will temporary store the data for browsers that only support sessionStorage

Update: I never mentioned this but the last version of Noteboard had a tiny update that never got a blog post about it because of the update being so small. The update allowed it to be served in data URIs opened through links or in iframes due to most browsers allowing data URIs to inherit the domain of the referrer. This means you can serve Noteboard 1.0.1 in data URIs now.

rot13 DejaVu fonts

I found myself wondering how to rot13 cipher text in a web browser without JavaScript or server-side interaction. I then came up with this idea, rot13 fonts. I have made rot13 equivalents for 2 DejaVu fonts, Sans and Serif. I only have the fonts use the rot13 affected characters, a-z; A-Z, Unicode ranges: U+0041-005a, U+0061-007a. This is so it would be more suitable for web use because the DejaVu fonts are 500KB+ each. The rot13 fonts are 12kb to 14kb large.

You can test these fonts to view “Uryyb Jbeyq!” (rot13 “Hello World!”) at this test page. The test page requires Firefox 3.1+ or Safari 3.1+ or for both rot13 DejaVu Sans and Serif to be installed on your computer.

The fonts are available for download here.

rot13 DejaVu Fonts being rendered in Safari 3.1.2

rot13 DejaVu Fonts being rendered in Safari 3.1.2

rot47 DejaVu fonts may be added when I get the time.