Sha256: 3d22afb4b64e30b15b87c58b08a58db334be0d8556c399d1bce0004f93f81d1f

Contents?: true

Size: 1.25 KB

Versions: 32

Compression:

Stored size: 1.25 KB

Contents

(() => {
  if (!window.CMS) window.CMS = {};
  const CMS = window.CMS;

  // TODO(glebm): Use the battle-tested universal onPageLoad code and enable Turbolinks+async in the demo app.
  // See: https://gist.github.com/glebm/2496daf445877055447a6fac46509d9a
  const isTurbolinks = 'Turbolinks' in window && window.Turbolinks.supported;
  if (isTurbolinks) {
    document.addEventListener('turbolinks:load', () => {
      window.CMS.init();
    });
    document.addEventListener('turbolinks:before-cache', () => {
      window.CMS.dispose();
    });
  } else {
    document.addEventListener('DOMContentLoaded', () => {
      window.CMS.init();
    });
  }

  CMS.init = () => {
    CMS.current_path = window.location.pathname;
    CMS.slugify();
    CMS.codemirror.init();
    CMS.wysiwyg.init();
    CMS.sortableList.init();
    CMS.timepicker.init();
    CMS.pageFragments();
    CMS.categories();
    CMS.files.init();
    CMS.fileLinks();
    CMS.fileUpload.init();
    CMS.diff();
  };

  CMS.dispose = () => {
    CMS.codemirror.dispose();
    CMS.wysiwyg.dispose();
    CMS.files.dispose();
    CMS.fileUpload.dispose();
    CMS.sortableList.dispose();
    CMS.timepicker.dispose();
  };

  CMS.getLocale = () => document.querySelector('meta[name="cms-locale"]').content;
})();

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
comfortable_media_surfer-3.0.0 app/assets/javascripts/comfy/admin/cms/base.js
occams-1.1.0 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.8 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.7.3 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.7.2 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.7.1 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.7 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.6.1 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.6 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.5 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.4 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.3 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.2 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.1 app/assets/javascripts/occams/admin/cms/base.js
occams-1.0.0 app/assets/javascripts/occams/admin/cms/base.js
comfortable_mexican_sofa-2.0.19 app/assets/javascripts/comfy/admin/cms/base.js
PixelForce_ETS-0.0.2 app/assets/javascripts/comfy/admin/cms/base.js
PixelForce_ETS-0.0.1 app/assets/javascripts/comfy/admin/cms/base.js
kcyEtsTest2-0.0.4 app/assets/javascripts/comfy/admin/cms/base.js
kcyEtsTest2-0.0.3 app/assets/javascripts/comfy/admin/cms/base.js