ordars_rails_editor 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fbf145086f8e6b153689793f57f6bcf299a1088b5cfafc10d1ca11ce0768fa7
4
- data.tar.gz: e637103d4e12538c591029ebe39ad8721f3b6ba52658ccd0859cf6b86ea78ff5
3
+ metadata.gz: a060d2201b603cd54b82d17c345c70c09b65d2baf559bcd0b886e1a7a0c6218e
4
+ data.tar.gz: 12339d0edefa0ff04dd550ab5a589ae2c5ea5676bba9c91a1d7cceb40ab0007b
5
5
  SHA512:
6
- metadata.gz: 9f8790e29a6543e7c25a0a78f1dfc890809f4f6f5c43d8442e69cca722681250b73aa68fcd69d691104a342ee950f160cb3fb2a3716abe88b3f2e9f1612bcde1
7
- data.tar.gz: 435fde6dd8843bea2001ac1c9b6f49d8f8a08398cf67526829fd33f39283a68518003eb805cfb4467a7b5e3161e0df58c6f00bd53ffa50ab17ef5d6fa61aac96
6
+ metadata.gz: dad9ca5e40ba35e39c6e57e810be6f4ae046dd5e9c55515cee43c7db670f1bf5302b6e69d29051b6abdf6e1ed0d197e1a78c9fa90765385fe6c7063c25c877c2
7
+ data.tar.gz: 2ad656c5c291ecb737f4db1d5a493d5c4cad9a47ac0fcfcad7cd113cc4abe42c895cb5c9772e2a0b6430ccc61e687bc99e47bd59820352f79d7e234237ae7b66
@@ -16,12 +16,13 @@ module OrdarsRailsEditor
16
16
  # attach_name: 첨부 file_id hidden input 이름 (예: "attachment_file_ids[]")
17
17
  # max_images: / max_videos: / max_mb: 첨부 한도 표시·게이지 기준
18
18
  # attach: false 면 하단 첨부 패널 없이 본문 에디터만
19
+ # image: false 면 툴바 「이미지 본문 삽입」 버튼 숨김 (예: 이메일 — dataURL 이미지는 Gmail 이 차단)
19
20
  # id: 에디터 루트 DOM id (기본 자동 생성)
20
21
  #
21
22
  # ⚠저장 시 서버에서 반드시 OrdarsRailsEditor::Sanitizer.clean 을 통과시킬 것.
22
23
  def ore_editor(name:, content: nil, placeholder: "내용을 입력하세요", upload_url: nil,
23
24
  attach_name: nil, max_images: nil, max_videos: nil, max_mb: nil,
24
- attach: true, id: nil)
25
+ attach: true, image: true, id: nil)
25
26
  render partial: "ordars_rails_editor/editor", locals: {
26
27
  input_name: name,
27
28
  content: content.to_s,
@@ -32,6 +33,7 @@ module OrdarsRailsEditor
32
33
  max_videos: max_videos || OrdarsRailsEditor.default_max_videos,
33
34
  max_mb: max_mb || OrdarsRailsEditor.default_max_total_mb,
34
35
  show_attach: attach,
36
+ show_image: image,
35
37
  editor_id: id || "ore-editor-#{SecureRandom.hex(4)}"
36
38
  }
37
39
  end
@@ -49,8 +49,10 @@
49
49
  <button type="button" class="ore-btn" data-cmd="alignCenter" data-tip="가운데 정렬"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 6h18M6 10h12M3 14h18M6 18h12"/></svg></button>
50
50
  <button type="button" class="ore-btn" data-cmd="alignRight" data-tip="오른쪽 정렬"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 6h18M9 10h12M3 14h18M9 18h12"/></svg></button>
51
51
  <button type="button" class="ore-btn" data-cmd="alignJustify" data-tip="양쪽 정렬"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 6h18M3 10h18M3 14h18M3 18h18"/></svg></button>
52
- <span class="ore-sep"></span>
53
- <button type="button" class="ore-btn ore-imgbtn" data-tip="이미지 본문 삽입"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg></button>
52
+ <% if show_image %>
53
+ <span class="ore-sep"></span>
54
+ <button type="button" class="ore-btn ore-imgbtn" data-tip="이미지 본문 삽입"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg></button>
55
+ <% end %>
54
56
  <span class="ore-tail">
55
57
  <button type="button" class="ore-btn" data-cmd="undo" data-tip="실행 취소 (Ctrl+Z)"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 14L4 9l5-5"/><path d="M4 9h10a6 6 0 010 12h-3"/></svg></button>
56
58
  <button type="button" class="ore-btn" data-cmd="redo" data-tip="다시 실행 (Ctrl+Y)"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 14l5-5-5-5"/><path d="M20 9H10a6 6 0 000 12h3"/></svg></button>
@@ -10,8 +10,10 @@ module OrdarsRailsEditor
10
10
  #
11
11
  # style 속성은 통째 허용하지 않고 «속성 단위»로 거른다(color/background-color/font-size/text-align).
12
12
  module Sanitizer
13
- ALLOWED_TAGS = %w[p br strong b em i s del u code pre blockquote ul ol li h1 h2 h3 hr a img span].freeze
14
- ALLOWED_ATTRIBUTES = %w[href target rel src alt width height style data-file-id].freeze
13
+ # ⚠에디터 서식과 «한 쌍» mark=형광펜(Highlight), data-color=Highlight 속성(0.1.1 에서 누락 실사고:
14
+ # 형광펜 적용 글이 저장 조용히 벗겨짐).
15
+ ALLOWED_TAGS = %w[p br strong b em i s del u code pre blockquote ul ol li h1 h2 h3 hr a img span mark].freeze
16
+ ALLOWED_ATTRIBUTES = %w[href target rel src alt width height style data-file-id data-color].freeze
15
17
  ALLOWED_STYLE_PROPS = %w[color background-color font-size text-align].freeze
16
18
  ALLOWED_URI_SCHEMES = %w[http https mailto tel].freeze
17
19
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OrdarsRailsEditor
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ordars_rails_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs