A minimum featured textarea
femto is a simple and minimum textarea upgrade library. It only add the following features but the file size is small (9.6 kB) and well tested (passed 211 tests).
Ctrl + Z
and Ctrl + Shift + Z
Tab
Shift + Tab
femto can be used as a bookmarklet and then you can enable to use features of femto anywhere. Because github does not allow me to paste bookmarklet as a link. You need to make the bookmarklet as your self. The following is a code of the bookmarklet. Use it with your own responsibility.
javascript:(function(){var s=document.createElement('script');s.src='http://goo.gl/NHDBkx';s.onload=function(){console.log('Loaded');Femto.transformAll();};document.body.appendChild(s);})();
Copy extracted files into js directory like
+ www
+ index.html
+ js
+ femto-0.3.1.js
Write index.html as
<!DOCTYPE html>
<html>
<body>
<textarea id="femto"></textarea>
<script src="js/femto-0.3.1.js"></script>
<script>
// or your can use $(function(){});
window.onload = function() {
var textarea, options;
options = {};
textarea = document.getElementById("femto");
textarea = Femto.transform(textarea, options);
};
</script>
</body>
</html>
caretaker
-- true
to enable Undo / Redo featureindent
-- true
to enable Indent / Auto indent featureexpandTab
-- true
to use continuous spaces instead of tab stringindentLevel
-- the number of space for a single indentYou can check the test result at femto Travis-ci or try with your browser at Test.
You can read an API documentation at femto API documentation
MIT License
© 2012-2014 Alisue, hashnote.net