activeadmin_medium_editor 0.2.9 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d552424d2bffd4166c766a96cadebcf1dd6f718690fde2c8da62777dcc367dc3
4
- data.tar.gz: 5c66ee3bee3e8acfea0d3d65d0957c7a26b2a1e6c1b7082c93246726a398d742
3
+ metadata.gz: 70b89f5d37a245c0674fc6fba8cce276d69e5b39acc7960151de15391e77e56c
4
+ data.tar.gz: 3d8ed42fd7e4686b92c7c053f7e9110f816da02eb808260ec23e3ef2a5d61851
5
5
  SHA512:
6
- metadata.gz: a184a28f68f2165e017d1628ec287c902d77ab67d61162a6572d7560280012ceb18c09191b08bf056bf742f4ee37baa813e909da9238943d610aaa312d512c0e
7
- data.tar.gz: 2ae2e169cec0e803a8ffcee88af9e5bf8478218e65a0f1f58d9b3eb33dbaeee2bdbf145d99b8910a8b67447b371fb3c936ea4f624f251da591a70fb4d713c493
6
+ metadata.gz: 139278385699438e815bca93391d7d96490aaf473c9473fa9b4fcd65a83fdfa283c68b5ea356539317d1e0ab0210876dc8ee4f4352a962470b9ad3dfdfed0e04
7
+ data.tar.gz: 865cfa8743dc55616d823fb94dad1063b0610acbe4b18de9f1ea4ff620016fea0c6b2385dcc886dd08490605afd1316c3404f09e03a5abfc4553feab444ffb53
data/README.md CHANGED
@@ -1,16 +1,26 @@
1
- # Active Admin Medium Editor [![Gem Version](https://badge.fury.io/rb/activeadmin_medium_editor.svg)](https://badge.fury.io/rb/activeadmin_medium_editor) [![CircleCI](https://circleci.com/gh/blocknotes/activeadmin_medium_editor.svg?style=svg)](https://circleci.com/gh/blocknotes/activeadmin_medium_editor)
1
+ # Active Admin Medium Editor
2
+ [![gem version](https://badge.fury.io/rb/activeadmin_medium_editor.svg)](https://badge.fury.io/rb/activeadmin_medium_editor)
3
+ [![Gem downloads](https://badgen.net/rubygems/dt/activeadmin_medium_editor)](https://rubygems.org/gems/activeadmin_medium_editor)
4
+ [![linters](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/linters.yml)
5
+ [![specs Rails 6.1](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails61.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails61.yml)
6
+ [![specs Rails 7.0](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails70.yml/badge.svg)](https://github.com/blocknotes/activeadmin_medium_editor/actions/workflows/specs_rails70.yml)
2
7
 
3
8
  An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-editor), a compact and clean WYSIWYG editor.
4
9
 
5
- ![screenshot](screenshot.png)
10
+ **IMPORTANT NOTICE**: while I like the Medium Editor idea of having floating buttons, it looks like that they are slow to release new stable versions. Some editor bugs are related to this problem unfortunately.
11
+
12
+ ![screenshot](extra/screenshot.png)
6
13
 
7
14
  ## Usage
15
+
8
16
  - After the installation, select some text in the editor
9
17
  - A pop-up menu is shown with the available buttons
10
18
  - Click on a button and the effect will be applied to the selected text
11
19
 
12
20
  ## Install
13
- - After installing Active Admin, add to your Gemfile: `gem 'activeadmin_medium_editor'` (and execute *bundle*)
21
+
22
+ - After installing Active Admin, add to your Gemfile: `gem 'activeadmin_medium_editor'`
23
+ - Add also a SASS/SCSS gem to your Gemfile (ex. `gem 'sassc'`)
14
24
  - Add at the end of your Active Admin styles (_app/assets/stylesheets/active_admin.scss_):
15
25
  ```scss
16
26
  @import 'activeadmin/medium_editor/medium_editor';
@@ -27,7 +37,7 @@ An Active Admin plugin to use [medium-editor](https://github.com/yabwe/medium-ed
27
37
 
28
38
  > Why 2 separated scripts/styles? In this way you can include a different version of *medium-editor* if you like
29
39
 
30
- > **UPDATE FROM VERSION < 2.8**: please change your _app/assets/stylesheets/active_admin.scss_ using the new import lines above
40
+ > **UPDATE FROM VERSION < 0.2.8**: please change your _app/assets/stylesheets/active_admin.scss_ using the new import lines above
31
41
 
32
42
  ## Examples
33
43
 
@@ -54,14 +64,21 @@ f.input :description, as: :medium_editor, input_html: { data: { options: { toolb
54
64
 
55
65
  For details about the buttons' effect please refer to medium-editor documentation.
56
66
 
67
+ ## Changelog
68
+
69
+ The changelog is available [here](CHANGELOG.md).
70
+
57
71
  ## Do you like it? Star it!
58
- If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
59
72
 
60
- Take a look at [other Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source) that I made if you are curious.
73
+ If you use this component just star it. A developer is more motivated to improve a project when there is some interest. My other [Active Admin components](https://github.com/blocknotes?utf8=✓&tab=repositories&q=activeadmin&type=source).
74
+
75
+ Or consider offering me a coffee, it's a small thing but it is greatly appreciated: [about me](https://www.blocknot.es/about-me).
61
76
 
62
77
  ## Contributors
63
- - [Mattia Roccoberton](http://blocknot.es): author
78
+
79
+ - [Mattia Roccoberton](https://blocknot.es): author
64
80
  - The good guys that opened issues and pull requests from time to time
65
81
 
66
82
  ## License
83
+
67
84
  The gem is available as open-source under the terms of the [MIT](LICENSE.txt).
data/Rakefile CHANGED
@@ -1,3 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
+
5
+ begin
6
+ require 'rspec/core/rake_task'
7
+
8
+ RSpec::Core::RakeTask.new(:spec) do |t|
9
+ # t.ruby_opts = %w[-w]
10
+ t.rspec_opts = ['--color', '--format documentation']
11
+ end
12
+
13
+ task default: :spec
14
+ rescue LoadError
15
+ puts '! LoadError: no RSpec available'
16
+ end
@@ -1,18 +1,20 @@
1
- function initMediumEditors() {
2
- $('.medium-editor').each(function () {
3
- if (!$(this).hasClass('medium-editor--active')) {
4
- var options = {};
5
- options = $.extend({}, options, $(this).data('options'));
6
- new MediumEditor($(this), options);
7
- $(this).addClass('medium-editor--active');
8
- }
9
- });
10
- }
1
+ (function () {
2
+ 'use strict'
11
3
 
12
- $(document).on('has_many_add:after', function () {
13
- initMediumEditors();
14
- });
4
+ // --- functions -------------------------------------------------------------
5
+ function initMediumEditors() {
6
+ $('[data-aa-medium-editor]').each(function () {
7
+ if (!$(this).hasClass('medium-editor--active')) {
8
+ let options = {}
9
+ options = $.extend({}, options, $(this).data('options'))
10
+ new MediumEditor($(this), options)
11
+ $(this).addClass('medium-editor--active')
12
+ }
13
+ })
14
+ }
15
15
 
16
- $(document).ready(function () {
17
- initMediumEditors();
18
- });
16
+ // --- events ----------------------------------------------------------------
17
+ $(document).ready(initMediumEditors)
18
+ $(document).on('has_many_add:after', '.has_many_container', initMediumEditors)
19
+ $(document).on('turbolinks:load', initMediumEditors)
20
+ })()
@@ -2,6 +2,7 @@
2
2
 
3
3
  module ActiveAdmin
4
4
  module MediumEditor
5
- VERSION = '0.2.9'
5
+ VERSION = '1.0.0'
6
+ MEDIUM_VERSION = '5.23.3'
6
7
  end
7
8
  end
@@ -4,7 +4,7 @@ module Formtastic
4
4
  module Inputs
5
5
  class MediumEditorInput < Formtastic::Inputs::TextInput
6
6
  def input_html_options
7
- super.merge(class: 'medium-editor')
7
+ super.merge('data-aa-medium-editor': '1')
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_medium_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-04 00:00:00.000000000 Z
11
+ date: 2022-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeadmin
@@ -25,131 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: activestorage
28
+ name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 6.0.3.2
33
+ version: '2.4'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 6.0.3.2
41
- - !ruby/object:Gem::Dependency
42
- name: capybara
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: 3.33.0
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: 3.33.0
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.13.1
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.13.1
69
- - !ruby/object:Gem::Dependency
70
- name: puma
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 4.3.5
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 4.3.5
83
- - !ruby/object:Gem::Dependency
84
- name: rspec_junit_formatter
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.4.1
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.4.1
97
- - !ruby/object:Gem::Dependency
98
- name: rspec-rails
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 4.0.1
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 4.0.1
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 0.90.0
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: 0.90.0
125
- - !ruby/object:Gem::Dependency
126
- name: selenium-webdriver
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 3.142.7
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 3.142.7
139
- - !ruby/object:Gem::Dependency
140
- name: sqlite3
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 1.4.2
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 1.4.2
40
+ version: '2.4'
153
41
  description: An Active Admin plugin to use Medium Editor
154
42
  email: mat@blocknot.es
155
43
  executables: []
@@ -188,7 +76,11 @@ files:
188
76
  homepage: https://github.com/blocknotes/activeadmin_medium_editor
189
77
  licenses:
190
78
  - MIT
191
- metadata: {}
79
+ metadata:
80
+ homepage_uri: https://github.com/blocknotes/activeadmin_medium_editor
81
+ changelog_uri: https://github.com/blocknotes/activeadmin_medium_editor/blob/master/CHANGELOG.md
82
+ source_code_uri: https://github.com/blocknotes/activeadmin_medium_editor
83
+ rubygems_mfa_required: 'true'
192
84
  post_install_message:
193
85
  rdoc_options: []
194
86
  require_paths:
@@ -197,14 +89,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
89
  requirements:
198
90
  - - ">="
199
91
  - !ruby/object:Gem::Version
200
- version: '0'
92
+ version: 2.6.0
201
93
  required_rubygems_version: !ruby/object:Gem::Requirement
202
94
  requirements:
203
95
  - - ">="
204
96
  - !ruby/object:Gem::Version
205
97
  version: '0'
206
98
  requirements: []
207
- rubygems_version: 3.0.3
99
+ rubygems_version: 3.1.6
208
100
  signing_key:
209
101
  specification_version: 4
210
102
  summary: medium-editor for ActiveAdmin