Git Product home page Git Product logo

bbcodeditor's Introduction

BBCodeditor - 1.2

Warning! I'm not a professional javascript developer so this project may have some bugs and probably it will take time to fix them on my own.

Installation

  1. You must include in your page the necessary file(s) of jQuery and Bootstrap These files must be included in the header tag
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.css">

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
  1. Add the following code to your header tag (before it closes)
<head>
  <!-- ... -->
  <link rel="stylesheet" href="../dist/jquery.editor.css">
   <link rel="stylesheet" href="../dist/inc/pickr/themes/monolith.min.css">
</head>
  1. Add the code to your body tag (in the bottom of it)
<!-- Editor -->
<script src="../dist/inc/pickr/pickr.es5.min.js"></script>
<script src="../dist/inc/inputmask/jquery.inputmask.js"></script>
<script src="../dist/lang/en_EN.js"></script>
<script src="../dist/icons/font-awesome-5.js"></script>
<script src="../dist/jquery.editor.js"></script>
<!-- Editor -->

Usage

Create a div in your body tag add an id to it and call the bbcodeditor function.

Example:
<div id="example-editor"></div>

And now add to the body tag after the jquery.editor.js file the following html (javascript) code:

<script>
$(function() {
  $('#example-editor').bbcodeditor({
    defaultValue: "", // This option must be included whenever the editor is called (it can be left empty) !important
    content_class: "example-editor-content" // This "option" is optional but you must call it if you want the get the value of the content area (editor)
  });
});
</script>

Documentation

For the documentation please check the documentation.html in the examples folder!

Default Options

{
  lang: 'en-EN',
  icons: 'font-awesome-5',
  height: 200,
  minHeight: 100,
  maxHeight: 400,
  button_class: 'btn btn-primary',
  content_class: '', 
  includedButtons: [
  ['bold', 'italic', 'underline'], ['strikethrough', 'supperscript', 'subscript'], ['font-name', 'font-size', 'color'], ['unordered-list', 'ordered-list', 'align'], ['link', 'image', 'media'], ['misc', 'advcode', 'table']
  ],
  advcodeLanguages: ['General Code', 'HTML', 'CSS', 'Javascript', 'PHP', 'XML', 'JSON', 'SQL', 'Ruby', 'Python', 'Java', 'C', 'C#', 'C++', 'Lua', 'Markdown', 'Yaml'],
  enableTextareaResize: true,
  colorPickerDefaultColor: '#3498DB',
  colorPickerSwatches: [
    'rgba(52, 152, 219, 1)',
    'rgba(46, 204, 113, 1)',
    'rgba(26, 188, 156, 1)',
    'rgba(234, 76, 136, 1)',
    'rgba(155, 89, 182, 1)',
    'rgba(241, 196, 15, 1)',
    'rgba(243, 156, 18, 1)',
    'rgba(231, 76, 60, 1)',
    'rgba(236, 240, 241, 1)',
    'rgba(189, 195, 199, 1)',
    'rgba(149, 165, 166, 1)',
    'rgba(127, 140, 141, 1)',
    'rgba(52, 73, 94, 1)',
    'rgba(44, 62, 80, 1)'
  ],
  enableImageUpload: false,
  imageUploadUrl: "",
  imageUploadType: "POST",
  uploadFileName: "filename",
  uploadFile: "bbcodeditor-image-upload",
  uploadFileTokenName: "_token",
  uploadFileToken: "",
  includedMiscItems: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'code', 'linebreak'],
  previewRequestUrl: "",
  previewRequestType: "GET",
  customRequestToken: false,
  previewRequestTokenName: "_token",
  previewRequestToken: ""
}

Contributions

Updates to the insertText function by Paul. (Discord Tag: Paul.#0933)

Language Files By

  • French by MaximeMichaud
  • Hungarian and English by MrAnonymusz
  • Dutch by Paul. (Discord Tag: Paul.#0933)
  • Spanish by Aco (Discord Tag: Aco#7598)
  • Italian by Nexgan (Discord Tag: Nexgan#4788)
  • Chinese by Xu_wznln (Discord Tag: Xu_wznln#7001)

The Following Plugins Were Used

  1. Inputmask by RobinHerbots
  2. Pickr by Simonwep
  3. PrismJS by PrismLibrary

bbcodeditor's People

Contributors

mranonymusz avatar maximemichaud avatar acodev avatar

Watchers

James Cloos avatar

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.