var quill;   // Expose as global so people can easily try out the API

$(document).ready(function() {
  quill = new Quill('#editor', {
    modules: {
      'toolbar': { container: '#toolbar' },
      'image-tooltip': true,
      'link-tooltip': true
    },
    theme: 'snow'
  });

  $('.quill-wrapper').tooltip({ trigger: 'manual' });
  var tooltipTimer = setTimeout(function() {
    $('.quill-wrapper').tooltip('show');
  }, 2500);

  quill.once('selection-change', function(hasFocus) {
    $('#editor').toggleClass('focus', hasFocus);
    // Hack for inability to scroll on mobile
    if (/mobile/i.test(navigator.userAgent)) {
      $('#editor').css('height', quill.root.scrollHeight + 30)   // 30 for padding
    }
    $('.quill-wrapper').tooltip('destroy');
    clearTimeout(tooltipTimer);
  });
});

$(document).ready(function() {
  var editor = new Quill('#editor', {
    modules: {
      'toolbar': { container: '#toolbar' },
      'image-tooltip': true,
      'link-tooltip': true
    },
    theme: 'snow'
  });

  $('.quill-wrapper').tooltip({ trigger: 'manual' });
  var tooltipTimer = setTimeout(function() {
    $('.quill-wrapper').tooltip('show');
  }, 2500);

  editor.once('selection-change', function(hasFocus) {
    $('#editor').toggleClass('focus', hasFocus);
    // Hack for inability to scroll on mobile
    if (/mobile/i.test(navigator.userAgent)) {
      $('#editor').css('height', editor.root.scrollHeight + 30)   // 30 for padding
    }
    $('.quill-wrapper').tooltip('destroy');
    clearTimeout(tooltipTimer);
  });
});

--- 
+++ 
@@ -1,7 +1,5 @@
-var quill;   // Expose as global so people can easily try out the API
-
 $(document).ready(function() {
-  quill = new Quill('#editor', {
+  var editor = new Quill('#editor', {
     modules: {
       'toolbar': { container: '#toolbar' },
       'image-tooltip': true,
@@ -15,11 +13,11 @@
     $('.quill-wrapper').tooltip('show');
   }, 2500);
 
-  quill.once('selection-change', function(hasFocus) {
+  editor.once('selection-change', function(hasFocus) {
     $('#editor').toggleClass('focus', hasFocus);
     // Hack for inability to scroll on mobile
     if (/mobile/i.test(navigator.userAgent)) {
-      $('#editor').css('height', quill.root.scrollHeight + 30)   // 30 for padding
+      $('#editor').css('height', editor.root.scrollHeight + 30)   // 30 for padding
     }
     $('.quill-wrapper').tooltip('destroy');
     clearTimeout(tooltipTimer);
Make quill editor variable global

So visitors can easily try out the API
