cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="header">
  <a href="https://www.codox.io" target="_blank">
   <img id="logo" src="https://www.codox.io/assets/img/wave.svg" alt="">
    </a>
  <span>
      Real-time coediting demo in Quill.JS
    </span>
</div>

<div class="editors">
  <div class="codox-styles">
    <div id="codox-notify"> </div>
  </div>
  <div class="quillEditor">
    <div id="quillEditor1"> </div>
  </div>
  <div class="quillEditor">
    <div id="quillEditor2"> </div>
  </div>
</div>
            
          
!
            
              .editors {
  display: flex;
  justify-content: space-around;
}

.header {
  width: 400px;
  margin-left: auto;
  margin-right: auto;
  display: block;
  margin-bottom: 30px;
  font-size: 1.25rem;
  line-height: 1.5rem;
}

a {
  width: 100px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

#logo {
  height: 65px;
  text-align: center;
}

            
          
!
            
              function guid() {
  var rand4 = function() {
    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
  };
  return (
    rand4() +
    rand4() +
    "-" +
    rand4() +
    "-" +
    rand4() +
    "-" +
    rand4() +
    "-" +
    rand4() +
    rand4() +
    rand4()
  );
}

var sessionId = guid();

window.onload = function() {
  //create two quilljs editors
  var fonts = ["sofia", "slabo", "roboto", "inconsolata", "ubuntu"];

  var options = {
    modules: {
      formula: false,
      syntax: false,

      history: {
        maxStack: 500,
        userOnly: true
      },
      toolbar: [
        [{ font: fonts }, { size: [] }],
        ["bold", "italic", "underline", "strike"],
        [{ color: [] }, { background: [] }],
        [{ script: "super" }, { script: "sub" }],
        [{ header: "1" }, { header: "2" }, "blockquote", "code-block"],
        [
          { list: "ordered" },
          { list: "bullet" },
          { indent: "-1" },
          { indent: "+1" }
        ],
        ["direction", { align: [] }],
        ["link", "image", "video", "formula"],
        ["clean"]
      ]
    },
    theme: "snow",
    debug: "off"
  };

  var editor1 = new Quill(document.getElementById("quillEditor1"), options);
  var editor2 = new Quill(document.getElementById("quillEditor2"), options);

  /**************************************
   * ADD THIS AFTER YOU CREATED A QUILL INSTANCE
   ******************************************/
  //coediting configuration
  var config = {};
  config.editorInstance = editor1;
  config.sessionId = sessionId;
  config.username = "pam";
  config.app = "quilljs";
  config.domain = "https://127.0.0.1:9000";
  config.apiKey = "cdea225b-01cc-4b01-9f97-c3cea40d3f5c"; // this is your actual API Key

  let c1 = new Codox();
  c1.initialize(config);

  //For the demo we are going to add a second instance on the
  //same page
  var config2 = Object.assign({}, config, {
    username: "jim",
    editorInstance: editor2
  });

  let c2 = new Codox();
  c2.initialize(config2);
};

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console