Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@baianat/align
Advanced tools
ES6 Text editor
<head>
<link rel="stylesheet" href="dist/css/align.css">
</head>
<body>
...
<script type="text/javascript" src="dist/js/align.js"></script>
</body>
you need an div to render editor in it.
<div class="editor"></div>
<script>
let myEditor = new Align('.editor', {
defaultText: 'Hello there I\'m Baianat\'s editor!'
});
</script>
to customize editor's styler commands, you can pass to commands key as array of commands as value.
let myEditor = new Align('.editor', {
styler: {
mode: 'default', // default or bubble
commands: ['color', 'sperator', 'fontName', 'fontSize']
}
});
list of all available commands
Command | Discription |
---|---|
color | Changes a font color for the selection or at the insertion point |
fontName | Changes the font name for the selection or at the insertion point |
fontSize | Changes the font size for the selection or at the insertion point |
bold | Toggles bold on/off for the selection or at the insertion point |
italic | Toggles italics on/off for the selection or at the insertion point |
underline | Toggles underline on/off for the selection or at the insertion point |
strikeThrough | Toggles strikethrough on/off for the selection or at the insertion point |
removeFormat | Removes all formatting from the current selection |
justifyLeft | Justifies the selection or insertion point to the left |
justifyCenter | Centers the selection or insertion point |
justifyRight | Right-justifies the selection or the insertion point |
justifyFull | Justifies the selection or insertion point |
h1 | Adds an HTML h1 tag around the line containing the current selection |
h2 | Adds an HTML h2 tag around the line containing the current selection |
blockquote | Adds an HTML blockquote tag around the line containing the current selection |
p | Adds an HTML p tag around the line containing the current selection |
pre | Adds an HTML pre tag around the line containing the current selection and highlight it's script |
addImage | Upload image add inseart it |
html | Toggles HTML on/off for all text |
sperator | Use for decorate to sperate commands |
finally to get editor's content you can use content
propertie
saveToDatabase(myEditor.content);
Copyright (c) 2017 Baianat
FAQs
ES6 text editor
The npm package @baianat/align receives a total of 5 weekly downloads. As such, @baianat/align popularity was classified as not popular.
We found that @baianat/align demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.