Earlier quoted context omitted.
No, it doesn't. It just drops you to another shell prompt.
Not in zsh it doesn't. (tip: it's a zsh thing.)
Turn your browser into a notepad with one line
171–180 of 186 posts
Re: Turn your browser into a notepad with one line
#172Re: Turn your browser into a notepad with one line
#173javascript:document.body.contentEditable='true';document.designMode='on';void 0
(lets you edit currently loaded page.)
Re: Turn your browser into a notepad with one line
#174Ah shoot. If Chrome allowed localStorage to be accessible from file:/// then we could add save (CTRL+S) and automatic load using this: data:text/html, window.onload=function(){var a=document.body;a.innerText=localStorage.mydoc;a.addEventListener("keydown",function(b){b.ctrlKey&&83==b.which&&(localStorage.mydoc=a.innerHTML,b.preventDefault())},!1)}; Firefox will save it to localStorage but clear the local storage afte…
data:text/html,window.onload=function(){var a=document.body;a.addEventListener("keydown", function(b){if(b.ctrlKey&&83===b.which){document.location = 'data:text/html,' + document.childNodes[0].outerHTML;b.preventDefault();}},!1);document.title= document.body.innerText.replace(/\n[\s\S]+$/," - ")+new Date().toString();};
With this you can save using the URL!Just press Ctrl+S and use the browser history to access it later! And this means it also haves a pseudo-version-control-system included! For easy access the first line in the text becomes the title.
In coderwall: https://coderwall.com/p/xh9u3w
Re: Turn your browser into a notepad with one line
#175This is what the scratch (EDIT: read scratch as * scratch * without the spaces--is there any way to escape that properly on HN?) buffer is for in Emacs, and I find it extremely useful. Also, unlike using a different tool, it allows me to use all the Emacs-specific features I usually rely on. (For example, I can easily type special characters like r₁ × r₂ ≈ r₃ using the TeX mode.) If you want more than one scratch buf…
Re: Turn your browser into a notepad with one line
#176For even more fun, turn your notepad into an interactive JavaScript environment: data:text/html, Then you can upgrade it by pasting in something like this: this.onkeyup = function () { this.style.backgroundColor = 'white'; try { eval(this.innerText); } catch (e) { this.style.backgroundColor = '#FFAAAA'; } }
Re: Turn your browser into a notepad with one line
#177any ideas how to smartly send the written things to evernote? the webclipper doesn't work.
Re: Turn your browser into a notepad with one line
#178Earlier quoted context omitted.
That is so cool :). I just slapped together a (really) simple chrome ext for opening up a new tab in "contenteditable" mode. It saves the contents into localStorage, thats it for now :) Here it is if anyones interested https://github.com/jwaterfaucett/textpad
I forked your code, added support so you can do (C-N) to open a new tab, click tab and start typing (the cursor will be at the end of the line), polished it up a bit (changed font to consolas, added a grey background with a tint of white text-shadow). I've sent a pull request. https://github.com/AeonAxan/textpad
Re: Turn your browser into a notepad with one line
#179Anyway...
So far I don't see one crucial feature: the ability to load an existing file, and edit it. Am I stupidly missing something 'obvious'?
Being able to edit text and save, but not load existing documents and edit them makes this a useless novelty.
I did notice one suggestion to load a doc then use a short js command to switch to contenteditable. But that's not quite there.
Ideally, a browser could be made to work like this:
* Multiple ways to get it started: bookmark, desktop shortcut icon, url to public or private html page containing the config script. Once working like an editor it should stay that way, for multiple file load/saves and multiple tabs open.
* An 'open file' for any existing plaintext or html file, loaded from local filesystem (via file selector popup or bookmark) or the web (type known url or use bookmark).
* Ability to switch back and forth between three modes on the same document: raw plain ascii (no formatting), minimal formatting (B, I, U, bullets), and full html formated display.
* A document 'save as' as plain text (formatting stripped) or html, to the local filesystem, OR (best feature yet) anywhere with write enabled on a public or private web server.
* Nice if also handles encrypted load/save, so the doc is never in plaintext except on the local machine.
With that, the big name 'cloud' services can go take a leap. I could use my own server(s), or ones I happened to trust. There is flatly no way I would ever trust large enterprise cloud services.
Also, a tool like that which would allow editing on ANY machine with web access and local file r/w enabled for the browser, would be very useful for... things.
It always astonished me that browsers did not provide the capability to natively edit the html they displayed. Such an obvious need, and you'd think so simple to implement, that I'd concluded the absence of this ability had to be a deliberate industry-wide agreed policy of capability avoidance. Which means, for political reasons.