PostEditor 2.0
New!! postEditor 2.0
PostEditor 1.0
Using postEditor you can tabulate without losing your focus and maintain the tabsize in line brakes. You can also use snippets like in TextMate.
Snippets you can use in the example textarea (snippet+Tab): will be replaced with the code.
strong(<strong>something here</strong>)em(<em>something here</em>)blockquote(<bloquote>something here</bloquote>)code(<code>something here</code>)javascript(<javascript>something here</javascript>)html(<html>something here</html>)bq<bloquote>something here</bloquote>js(<javascript>something here</javascript>)
/*
Snippets forum.mootools.net
*/
var snippets = {
"strong" : ["<strong>\n ","something here","\n</strong>"],
"em" : ["<em>\n ","something here","\n</em>"],
"blockquote" : ["<blockquote>\n ","something here","\n</blockquote>"],
"code" : ["<code>\n ","something here","\n</code>"],
"javascript" : ["<javascript>\n ","something here","\n</javascript>"],
"html" : ["<html>\n ","something here","\n</html>"],
"bq" : ["<blockquote>\n ","something here","\n</blockquote>"],
"js" : ["<javascript>\n ","something here","\n</javascript>"],
"new Class" : {
//scope
scope: {"<javascript>":"</javascript>"},
snippet:["new Class({\n initialize: function(value){\n ",
"this.value = value;","\n }\n});"]
},
"{" : ["{\n ","","\n"]
};
//postEditor textarea#body
new postEditor('body',snippets,smartTypingPairs);
Autoclosing for ", ', (, {, [.
var smartTypingPairs = {
'"' : '"',
'(' : ')',
'{' : '}',
'[' : ']',
"<" : ">",
"`" : "`",
"'" : {
//scope
scope:{
"<javascript>":"</javascript>",
"<code>":"</code>",
"<html>":"</html>"
},
pair:"'"
}
};
Postdata: Only safari and Firefox.
Download postEditor (mootools).
Blog