Class CmsCodeMirrorScriptLoader

java.lang.Object
org.opencms.acacia.client.widgets.code.CmsCodeMirrorScriptLoader

public class CmsCodeMirrorScriptLoader extends Object
Helper class that asynchronously loads all the necessary scripts and stylesheets for the CodeMirror editor widget, and executes a callback at the end.

Scripts are loaded (unless they've already been loaded before) with the async=false option, which causes them to be executed in order, and a special dummy script is loaded at the end to execute the callback.

  • Constructor Details

  • Method Details

    • load

      public void load(Runnable callback)
      Asynchronously loads all scripts / stylesheets and calls the given callback at the end.
      Parameters:
      callback - the callback to execute after script loading
    • load

      public void load(String path)
      Loads the script from the given path (which is treated as relative to the CodeMirror base URI.
      Parameters:
      path - the path to load the script from