Sha256: 43e656dce91f8e374c211c464f78bf0aa898f0cea850fa25755757ab1566344e

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

module Refinery
  module Wymeditor
    class Engine < ::Rails::Engine
      extend Refinery::Engine

      isolate_namespace Refinery
      engine_name :refinery_wymeditor

      # set the manifests and assets to be precompiled
      config.to_prepare do
        Rails.application.config.assets.precompile += %w(
          wymeditor.css
          theme.css
          wymeditor/lang/*
          wymeditor/skins/refinery/*
          wymeditor/skins/refinery/**/*
          refinery/wymeditor.js
        )
      end

      before_inclusion do
        Refinery::Plugin.register do |plugin|
          plugin.pathname = root
          plugin.name = "refinerycms_wymeditor"
          plugin.hide_from_menu = true
          plugin.menu_match = %r{refinery/wymeditor}
        end
      end

      config.after_initialize do
        Refinery.register_engine Refinery::Wymeditor
      end

      after_inclusion do
        %w(wymeditor wymeditor/skins/refinery/skin).each do |stylesheet|
          Refinery::Core.config.register_visual_editor_stylesheet stylesheet
        end

        %W(refinery/wymeditor wymeditor/lang/#{::I18n.locale} wymeditor/skins/refinery/skin).each do |javascript|
          Refinery::Core.config.register_visual_editor_javascript javascript
        end

        Refinery::Pages.config.friendly_id_reserved_words << 'wymiframe'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
refinerycms-wymeditor-2.1.0 lib/refinery/wymeditor/engine.rb
refinerycms-wymeditor-2.0.0 lib/refinery/wymeditor/engine.rb