Simple notes

Many times I’ve been looking for a quick place to paste a load of text as I gather it from various places or need to tidy up some formatting before I put the text into a document. Back in the old Windows days I’d have a shortcut to Notepad on my Taskbar and just open that paste in what I needed and away you go.

Trying to find something similar on my Chromebook I came across using the following pasted directly into the omnibox to give you an in-browser text editor of sorts:

data:text/html, <html contenteditable>

It worked well enough but I found it wasn’t stripping formatting from the content I pasted in. Then I came across a number of places suggesting using a textarea instead:

data:text/html, <textarea style=”width: 100%; height: 100%; border: none; outline: none” autofocus />

This works well for me and I now have it bookmarked for quick access!

Next step is to use some more code to customise the textarea, perhaps a different background colour?

UPDATE: I added a way to display a Leave/Stay warning before closing the page so I didn’t accidentally close the tab and lose my work

data:text/html, <html><head>function myFunction() {return “”;}</head><body onbeforeunload=”return myFunction()”><textarea style=”width: 100%; height: 100%; border: none; outline: none; background-color: lightyellow; padding: 30px; font-family: verdana” autofocus />

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s