GithubHelp home page GithubHelp logo

stoick001 / panagram.js Goto Github PK

View Code? Open in Web Editor NEW
59.0 4.0 10.0 197 KB

2kb Vanilla JavaScript rich text editor, that you can fully customize

Home Page: https://panagram.herokuapp.com/

License: MIT License

HTML 8.03% JavaScript 85.32% CSS 6.64%
javascript editor rich-text-editor

panagram.js's Introduction

Panagram.js

Panagram.js is an extra small (2kb) rich text editor build in pure JavaScript, with no dependencies.

Live Demo: https://panagram.herokuapp.com/

Setup

Enabling Panagram.js is very easy, you just need to follow these two simple steps:

include it from a dist/ folder

  <script src="dist/Panagram.min.js"></script>

or

nmp install --save panagram

initialize Panagram.js with init()

Panagram.init({
   // one of the pre built controls, required
  controls: 'defaultControls',

  // <HTMLElement> in which you want to put controls, required
  ctrElement: document.getElementById('controls'),

  // <HTMLElement> for rich text output, required
  outElement: document.getElementById('output'),
});

Custom controls

You can add your custom controls in config.js file. You can add to an existing set or create your own. If you do create your own share it so that other people can use it.

Quick rundown or different properties:

  1. icon - this is how you choose to represent your control
  2. title - is an as it name says a title
  3. state - is used if a command is in a list of possible commands and does not need any additional data
  4. formatBlock - is used if a command is not in a list of possible commands
  5. extra - is used if a command is in a list of possible commands and does need additional data. Extra MUST return that additional data
  6. short - used for toggling active class on element with keyboard shortcuts

panagram.js's People

Contributors

stoick001 avatar cjrutherford avatar

Stargazers

André Philip avatar Sam Butler avatar Jaron Wanderley avatar Mark Essel avatar Nuri avatar  avatar Théophile Choutri avatar Ben P avatar Peter Cooper avatar  avatar OMKAR AGRAWAL avatar Xingming Cao avatar Dalibor Malić avatar Arthur Fanti avatar Enver Bahar avatar Yann Doy avatar Divine avatar Simon Van Casteren avatar Simone Cogno avatar Jacob Slusser avatar Viggo Gao avatar  avatar  avatar Gunvant Sarpate avatar Cheerio avatar David Ye avatar Mohammed Sadiq avatar  avatar stephen avatar  avatar Angel Calderaro avatar Davi Teodoro avatar Derrick Heinemann avatar Greg Miller avatar Peter Brinck avatar zernie avatar Casey Robinson avatar steve avatar Nicolas Zamarreno avatar Brownell Chalstrom avatar Alexander Psiuk avatar Arthur Vaverko avatar William Lim avatar Dino Reić avatar Daniel Geymayer avatar  avatar Yoann Cerda avatar Martin K. avatar Darryl Walker avatar Jim Cummins avatar Yohan Jang avatar John Datserakis avatar Andreas Elia avatar Michael Burton avatar  avatar  avatar Vincent Tang avatar scarfa avatar  avatar

Watchers

André Philip avatar James Cloos avatar  avatar  avatar

panagram.js's Issues

Keyboard shortcuts bring up browser panels/windows

Awesome editor! I hope I can contribute to it one day when I start learning js.

Concerning the issue. When I press the shortcut Ctrl+B then bold is toggled but bookmark side panel is also activated. Same happens with Ctrl+I, which brings up page info, Ctrl+U opens page source.

Changes could be made to prevent the browser from activating those shortcuts when the editor is in focus.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.