diff --git a/README.md b/README.md index 3e5bb8f..92260da 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -acelet +Acelet ====== -Edit code snippets in your browser \ No newline at end of file +Acelet is a bookmarklet that allows you to edit selected text and code snippets +in an advanced code editor, right in your browser. diff --git a/acelet.bookmarklet b/acelet.bookmarklet new file mode 100644 index 0000000..2faccf3 --- /dev/null +++ b/acelet.bookmarklet @@ -0,0 +1,71 @@ +javascript:(function(){ + function encodeString(string) { + return encodeURIComponent(string + .replace(/\\/g,"\\\\") + .replace(/\"/g, '\\"') + .replace(/\n\r?/g, '\\n') + .replace(/%/g, 'U0025') + .replace(//g, '\\>') + .replace(/script/ig, 'scr\"\+\"ipt') + ); + } + var aceletValue = encodeString(window.getSelection().toString()); + window.open(' +data:text/html;charset=utf-8, +