Sha256: cd792ff11e68c5e81fb72246fe37b2788b668c392ee1130fd4eacb0668145117
Contents?: true
Size: 1.36 KB
Versions: 13
Compression:
Stored size: 1.36 KB
Contents
# frozen_string_literal: true require 'rails_admin/config/fields/types/text' module RailsAdmin module Config module Fields module Types class CodeMirror < Text # Register field type for the type loader RailsAdmin::Config::Fields::Types.register(self) # Pass the theme and mode for Codemirror register_instance_option :config do { mode: 'css', theme: 'night', } end register_instance_option :version do '5.46.0' end # Pass the location of the theme and mode for Codemirror register_instance_option :assets do { mode: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/#{version}/mode/css/css.min.js", theme: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/#{version}/theme/night.min.css", } end register_instance_option :js_location do "https://cdnjs.cloudflare.com/ajax/libs/codemirror/#{version}/codemirror.min.js" end register_instance_option :css_location do "https://cdnjs.cloudflare.com/ajax/libs/codemirror/#{version}/codemirror.min.css" end register_instance_option :partial do :form_code_mirror end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems