Module: Testimonials::Widget

Defined in:
lib/testimonials/widget.rb

Overview

Serves the self-contained browser widget. The JavaScript is plain ES (no framework, no build step) and injects its own widget styles, so it drops into any Rails app regardless of its CSS or JS setup. The code is served by the engine instead of the host's asset pipeline, and it lives under lib/ so a host that does run a pipeline never ingests it either.

Constant Summary collapse

SOURCE =
File.expand_path('widget.js', __dir__)
DASHBOARD_SOURCE =
File.expand_path('dashboard.js', __dir__)
DASHBOARD_STYLESHEET_SOURCE =
File.expand_path('dashboard.css', __dir__)
RTL_LANGUAGES =

Right-to-left scripts, so the form renders mirrored for those locales. Matched on the language subtag, so region variants ("ar-EG") count too.

%w[ar arc ckb dv fa ha he ks ku ps sd ug ur yi].freeze

Class Method Summary collapse