thredded 0.13.8 → 0.14.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
  SHA1:
3
- metadata.gz: 712f8e0bccae4bcd386951317b89503e31a5dcef
4
- data.tar.gz: 0db45d234f940f664860838350cf2cbe7af87396
3
+ metadata.gz: 8ca544efca243747b5f8b3d11c65c5376999c016
4
+ data.tar.gz: 6d08bb441e304681531bee3977d32d66e9854f60
5
5
  SHA512:
6
- metadata.gz: ae7f38026017692d243acc9330ed99c635ac9552196f61c327e27a51ba610fcfb969a330bf1f5d6c709380daa8e509a4f77738f10c86ed3fb89e9085e9be70d9
7
- data.tar.gz: e136a1ef05ef63e65c55f62664edeb8303b4aa0dfc7e185a5286543784f373f82a7ba6972750ae6f5e8590de2186efc10f5c08b3b8df99214b7bf92331bbd2ba
6
+ metadata.gz: d1601695337ccb89d4c2f2b058f183d22ae33eef5381c1165a3368ef93ab72915f232224a9d8c394c9c8cbeac46931b01be9be3c9af556731b8fe0fa2469381c
7
+ data.tar.gz: c25c917fed02ad08cd38e88dad77990c76f21165d04a7c684efe8431c5bb12b8d1ed37742550268dd16a3e8795a41c28e0d9f5af98451ac9dd6bbdbff172bfc0
data/README.md CHANGED
@@ -98,7 +98,7 @@ Then, see the rest of this Readme for more information about using and customizi
98
98
  Add the gem to your Gemfile:
99
99
 
100
100
  ```ruby
101
- gem 'thredded', '~> 0.13.8'
101
+ gem 'thredded', '~> 0.14.0'
102
102
  ```
103
103
 
104
104
  Add the Thredded [initializer] to your parent app by running the install generator.
@@ -381,7 +381,7 @@ change_column_default :thredded_user_preferences, :auto_follow_topics, 1
381
381
  ## I18n
382
382
 
383
383
  Thredded is mostly internationalized. It is currently available in English, Brazilian Portuguese, Chinese (Simplified),
384
- Polish, Russian, French, and Spanish.
384
+ German, Polish, Russian, French, and Spanish.
385
385
  We welcome PRs adding support for new languages.
386
386
 
387
387
  Here are the steps to ensure the best support for your language if it isn't English:
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 16c0-1.104.896-2 2-2s2 .896 2 2c0 .738-.404 1.376-1 1.723v2.277h-2v-2.277c-.596-.347-1-.985-1-1.723zm11-6v14h-18v-14h3v-4c0-3.313 2.687-6 6-6s6 2.687 6 6v4h3zm-13 0h8v-4c0-2.206-1.795-4-4-4s-4 1.794-4 4v4zm11 2h-14v10h14v-10z"/></svg>
@@ -49,11 +49,20 @@
49
49
  font-size: 0.875em;
50
50
  }
51
51
 
52
- .thredded--messageboard--meta {
52
+ .thredded--messageboard--meta--icon {
53
+ @extend %thredded--icon;
54
+ opacity: 0.8;
55
+ width: 1rem;
56
+ height: 1rem;
57
+ }
58
+
59
+ .thredded--messageboard--meta--counts {
53
60
  @extend %thredded--heading;
54
61
  color: $thredded-secondary-text-color;
55
62
  display: inline-block;
63
+ font-size: inherit;
56
64
  font-weight: normal;
65
+ margin-bottom: 0;
57
66
  vertical-align: baseline;
58
67
  }
59
68
 
@@ -47,7 +47,7 @@ module Thredded
47
47
  def messageboard_params
48
48
  params
49
49
  .require(:messageboard)
50
- .permit(:name, :description, :messageboard_group_id)
50
+ .permit(:name, :description, :messageboard_group_id, :locked)
51
51
  end
52
52
  end
53
53
  end
@@ -2,6 +2,10 @@
2
2
 
3
3
  module Thredded
4
4
  class EmailNotifier
5
+ def initialize
6
+ fail 'Please set Thredded.email_from in config/initializers/thredded.rb' if Thredded.email_from.blank?
7
+ end
8
+
5
9
  def human_name
6
10
  I18n.t('thredded.email_notifier.by_email')
7
11
  end
@@ -11,11 +15,11 @@ module Thredded
11
15
  end
12
16
 
13
17
  def new_post(post, users)
14
- PostMailer.post_notification(post.id, users.map(&:email)).deliver_now
18
+ Thredded::PostMailer.post_notification(post.id, users.map(&:email)).deliver_now
15
19
  end
16
20
 
17
21
  def new_private_post(post, users)
18
- PrivateTopicMailer.message_notification(post.id, users.map(&:email)).deliver_now
22
+ Thredded::PrivateTopicMailer.message_notification(post.id, users.map(&:email)).deliver_now
19
23
  end
20
24
  end
21
25
  end
@@ -37,7 +37,9 @@ module Thredded
37
37
  end
38
38
 
39
39
  def post?
40
- @user.thredded_admin? || @user.thredded_can_write_messageboards.include?(@messageboard)
40
+ @user.thredded_admin? ||
41
+ (!@messageboard.locked? || moderate?) &&
42
+ @user.thredded_can_write_messageboards.include?(@messageboard)
41
43
  end
42
44
 
43
45
  def moderate?
@@ -26,7 +26,11 @@ module Thredded
26
26
  end
27
27
 
28
28
  def create?
29
- @user.thredded_admin? || !@post.postable.locked? && messageboard_policy.post?
29
+ @user.thredded_admin? ||
30
+ !@post.postable.locked? &&
31
+ # Users are allowed to post in unlocked topics of a locked messageboard
32
+ # only if they would be allowed to post if the messageboard wasn't locked.
33
+ @user.thredded_can_write_messageboards.include?(@post.messageboard)
30
34
  end
31
35
 
32
36
  def read?
@@ -13,6 +13,12 @@
13
13
  <%= f.collection_select :messageboard_group_id, Thredded::MessageboardGroup.all, :id, :name,
14
14
  include_blank: t('thredded.messageboard.form.no_group') %>
15
15
  </li>
16
+ <li>
17
+ <%= f.label :locked do %>
18
+ <%= f.check_box :locked %> <%= t 'thredded.messageboard.form.locked_label' %>
19
+ <% end %>
20
+ </li>
21
+
16
22
  <li>
17
23
  <%= f.submit @messageboard.persisted? ? t('thredded.messageboard.update') : t('thredded.messageboard.create'),
18
24
  class: 'thredded--form--submit',
@@ -3,11 +3,7 @@
3
3
  <%= link_to messageboard_topics_path(messageboard), class: 'thredded--messageboard' do %>
4
4
  <header class="thredded--messageboard--header">
5
5
  <h2 class="thredded--messageboard--title"><%= messageboard.name %></h2>
6
- <h3 class="thredded--messageboard--meta">
7
- <%= t 'thredded.messageboard.topics_and_posts_counts',
8
- topics_count: number_with_delimiter(messageboard.topics_count),
9
- posts_count: number_with_delimiter(messageboard.posts_count) %>
10
- </h3>
6
+ <%= render 'thredded/messageboards/messageboard_meta', messageboard: messageboard %>
11
7
  </header>
12
8
 
13
9
  <p class="thredded--messageboard--description"><%= messageboard.description %></p>
@@ -0,0 +1,13 @@
1
+ <div class="thredded--messageboard--meta">
2
+ <% if messageboard.locked? %>
3
+ <span class="thredded--messageboard--meta--locked"
4
+ title="<%= t('thredded.messageboard.form.locked_notice') %>">
5
+ <%= inline_svg('thredded/lock.svg', class: 'thredded--messageboard--meta--icon') %>
6
+ </span>
7
+ <% end %>
8
+ <h3 class="thredded--messageboard--meta--counts">
9
+ <%= t 'thredded.messageboard.topics_and_posts_counts',
10
+ topics_count: number_with_delimiter(messageboard.topics_count),
11
+ posts_count: number_with_delimiter(messageboard.posts_count) %>
12
+ </h3>
13
+ </div>
data/bin/rubocop ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ #
5
+ # This file was generated by Bundler.
6
+ #
7
+ # The application 'rubocop' is installed as part of a gem, and
8
+ # this file is here to facilitate running it.
9
+ #
10
+
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
+
15
+ require 'rubygems'
16
+ require 'bundler/setup'
17
+
18
+ load Gem.bin_path('rubocop', 'rubocop')
@@ -0,0 +1,249 @@
1
+ ---
2
+ de:
3
+ thredded:
4
+ content_moderation_states:
5
+ content_blocked_notice: Blockiert
6
+ content_blocked_notice_with_record_html: Blockiert von %{moderator} %{time_ago}
7
+ email_notifier:
8
+ by_email: Per E-mail
9
+ emails:
10
+ message_notification:
11
+ html:
12
+ email_sent_reason_html: >-
13
+ Sie erhalten diese E-Mail, da %{user} Sie zu einer privaten Diskussion hinzugefügt hat, “<a href="%{post_url}">%{topic_title}</a>”.
14
+ post_lead_html: 'Eine neue Nachricht von %{user} in <a href="%{post_url}">“%{topic_title}”</a>:'
15
+ unsubscribe_instructions_html: :thredded.emails.post_notification.html.unsubscribe_instructions_html
16
+ subject: Neue Nachricht von %{user} in “%{topic_title}”
17
+ text:
18
+ email_sent_reason: |-
19
+ Sie erhalten diese E-Mail, da %{user} Sie zu einer privaten Diskussion
20
+ “%{topic_title}” hinzugefügt hat.
21
+
22
+ Klicken sie hier um die Diskussion zu sehen:
23
+ %{post_url}
24
+ post_lead: Neue Nachricht von %{user} in “%{topic_title}”
25
+ unsubscribe_instructions: :thredded.emails.post_notification.text.unsubscribe_instructions
26
+ post_notification:
27
+ html:
28
+ email_sent_reason_html: 'Sie erhalten diese E-Mail, da Sie der folgenden Diskussion folgen: “<a href="%{post_url}">%{topic_title}</a>”.'
29
+ post_lead_html: '%{user} <a href="%{post_url}">schrieb in “%{topic_title}”</a>:'
30
+ unsubscribe_instructions_html: >-
31
+ Um keine weiteren E-Mails zu erhalten, ändern Sie hier ihre <a href="%{preferences_url}">Benachrichtigungseinstellungen</a>.
32
+ subject: Ein neuer Beitrag in “%{topic_title}”
33
+ text:
34
+ email_sent_reason: |-
35
+ Sie erhalten diese E-Mail, da Sie der folgenden Diskussion
36
+ “%{topic_title}” folgen.
37
+
38
+ Klicken sie hier um die Diskussion zu sehen:
39
+ %{post_url}
40
+ post_lead: "%{user} schrieb in “%{topic_title}”:"
41
+ unsubscribe_instructions: |-
42
+ Um keine weiteren E-Mails zu erhalten, ändern Sie hier ihre Benachrichtigungseinstellungen:
43
+ %{unsubscribe_url}
44
+ errors:
45
+ login_required: Bitte zuerst anmelden
46
+ not_authorized: Du hast keinen Zugriff auf diese Seite
47
+ private_topic_create_denied: Du bist nicht autorisiert, private Unterhaltungen zu erstellen
48
+ private_topic_not_found: Diese private Unterhaltung existiert nicht
49
+ form:
50
+ create_btn_submitting: Erstellen...
51
+ preview: Vorschau
52
+ update: Änderungen übernehmen
53
+ update_btn_submitting: Änderungen übernehmen...
54
+ messageboard:
55
+ create: Erstelle ein neues Forum
56
+ form:
57
+ create_btn_submitting: :thredded.form.create_btn_submitting
58
+ description_label: Beschreibung
59
+ locked_label: Geschlossen
60
+ locked_notice: Dieses Forum ist geschlossen. Nur Moderatoren können hier neue Beiträge erstellen.
61
+ messageboard_group_id_label: Gruppe
62
+ no_group: Keine Gruppe
63
+ title_label: Name
64
+ update_btn_submitting: :thredded.form.update_btn_submitting
65
+ index:
66
+ page_title: Forum
67
+ last_updated_by_html: Letzter Beitrag %{time_ago} <cite>von %{user}</cite>
68
+ topics_and_posts_counts: "%{topics_count} Diskussionen / %{posts_count} Beiträge"
69
+ update: :thredded.form.update
70
+ updated_notice: Das Forum wurde aktualisiert
71
+ messageboard_group:
72
+ create: Erstelle eine neue Gruppe
73
+ form:
74
+ create_btn_submitting: :thredded.form.create_btn_submitting
75
+ saved: Die Gruppe %{name} wurde erstellt
76
+ moderation:
77
+ approve_btn: Erlauben
78
+ block_btn: Blockieren
79
+ moderation_state:
80
+ name: Moderationsstatus
81
+ pending:
82
+ empty:
83
+ content: Alle Beiträge wurden moderiert
84
+ title: Gute Arbeit!
85
+ post_approved_html: Beitrag wurde von %{moderator} %{time_ago} erlaubt
86
+ post_blocked_html: Beitrag wurde von %{moderator} %{time_ago} blockiert
87
+ post_deleted_notice: Dieser Beitrag wurde gelöscht
88
+ posts_content_changed_since_moderation_html: >-
89
+ Der Beitrag <a href="%{post_url}">post's</a> wurde in seinem Inhalt geändert. Unten wird der ursprüngliche
90
+ Beitrag angezeigt.
91
+ search_users:
92
+ form_label: Benutzer suchen
93
+ form_placeholder: :thredded.moderation.search_users.form_label
94
+ no_results_message: Keine Nutzer mit dem Inhalt %{query} gefunden
95
+ results_message: Nutzer mit dem Inhalt %{query} gefunden
96
+ user:
97
+ name: Benutzer
98
+ nav:
99
+ all_messageboards: Forenübersicht
100
+ edit_messageboard: Forum bearbeiten
101
+ edit_post: Beitrag bearbeiten
102
+ edit_private_topic: :thredded.nav.edit_topic
103
+ edit_topic: Bearbeiten
104
+ mark_all_read: Alles als gelesen markieren
105
+ moderation: Verwaltung
106
+ moderation_activity: Aktivität
107
+ moderation_history: Verlauf
108
+ moderation_pending: Ausstehend
109
+ moderation_users: Nutzer
110
+ private_topics: Private Unterhaltungen
111
+ settings: Benachrichtigungseinstellungen
112
+ null_user_name: Gelöschte Nutzer
113
+ posts:
114
+ delete: Beitrag gelöscht
115
+ delete_confirm: Bist du sicher, dass du diesen Beitrag löschen willst?
116
+ deleted_notice: Dein Beitrag wurde gelöscht
117
+ edit: :thredded.nav.edit_post
118
+ form:
119
+ content_label: Inhalt
120
+ create_btn: Beitrag erstellen
121
+ create_btn_submitting: Beitragen...
122
+ title_label: Erstelle einen neuen Beitrag
123
+ update_btn: Beitrag ändern
124
+ update_btn_submitting: :thredded.form.update_btn_submitting
125
+ pending_moderation_notice: Dein Beitrag wird veröffentlicht, sobald ein Moderator ihn angeschaut hat.
126
+ quote_btn: Zitat
127
+ preferences:
128
+ edit:
129
+ page_title: :thredded.nav.settings
130
+ form:
131
+ auto_follow_topics:
132
+ hint: Automatisch allen neuen Diskussionen folgen. Das Ändern dieser Einstellung wird alle Foren betreffen.
133
+ label: Allen Diskussionen folgen
134
+ follow_topics_on_mention:
135
+ hint: 'Wenn dich jemand mit deinem Nutzernamen erwähnt (eg: @sam) wirst du dem Beitrag folgen.'
136
+ label: Allen Diskussionen folgen, in denen du erwähnt wurdest
137
+ messageboard_auto_follow_topics:
138
+ hint: >-
139
+ Folge automatisch allen neuen Diskussionen in diesem Forum. Dies überschreibt die jeweiligen Einstellungen
140
+ weiter oben.
141
+ label: Folge allen neuen Diskussionen
142
+ messageboard_follow_topics_on_mention:
143
+ hint: 'Wenn jemand deinen Nutzernamen (eg: @sam) in diesem Forum erwähnt, wirst du der Diskussion folgen.'
144
+ label: :thredded.preferences.form.follow_topics_on_mention.label
145
+ messageboard_notifications_for_followed_topics:
146
+ label: :thredded.preferences.form.notifications_for_followed_topics.label
147
+ notifications_for_followed_topics:
148
+ label: Benachrichtigung für Diskussionen, denen du folgst
149
+ notifications_for_private_topics:
150
+ label: Benachrichtigung für private Unterhaltungen
151
+ submit_btn: Einstellungen bearbeiten
152
+ update_btn_submitting: :thredded.form.update_btn_submitting
153
+ global_preferences_title: Allgemeine Einstellungen
154
+ messageboard_preferences_nav_title: Forum bearbeiten
155
+ messageboard_preferences_title_html: Einstellungen für <em>%{messageboard}</em>
156
+ updated_notice: Deine Einstellungen sind jetzt gültig
157
+ private_posts:
158
+ form:
159
+ content_label: Nachricht
160
+ create_btn: Nchricht senden
161
+ create_btn_submitting: Senden...
162
+ update_btn_submitting: :thredded.form.update_btn_submitting
163
+ private_topics:
164
+ create: :thredded.private_topics.form.create_btn
165
+ edit: Bearbeiten
166
+ errors:
167
+ user_ids_length: Bitte nenne mindestens einen anderen Nutzer
168
+ form:
169
+ content_label: :thredded.private_posts.form.content_label
170
+ create_btn: :thredded.private_posts.form.create_btn
171
+ create_btn_submitting: :thredded.private_posts.form.create_btn_submitting
172
+ title_label: :thredded.topics.form.title_label
173
+ title_placeholder_new: Nenne das Thema der Unterhaltung
174
+ title_placeholder_start: Starte eine neue Unterhaltung
175
+ update_btn: Aktualisieren
176
+ update_btn_submitting: :thredded.private_posts.form.update_btn_submitting
177
+ users_label: Teilnehmer
178
+ users_placeholder: Lade Nutzer ein, an dieser Unterhaltung teilzunehmen
179
+ no_private_topics:
180
+ create_btn: Starte deine erste private Unterhaltung
181
+ title: Du hast keine privaten Nachrichten
182
+ updated_notice: Überschrift bearbeitet
183
+ recent_activity: Letzte Aktivität
184
+ search:
185
+ form:
186
+ btn_submit: :thredded.search.form.label
187
+ label: Suche
188
+ placeholder: Foren durchsuchen
189
+ time_ago: 'vor %{time} '
190
+ topics:
191
+ create: :thredded.topics.form.create_btn
192
+ delete_confirm: >-
193
+ Bist du sicher, dass du diese Diskussion endgültig löschen möchtest? Dies kann nicht rückgängig gemacht
194
+ werden.
195
+ delete_topic: Diskussion löschen
196
+ deleted_notice: Diskussion gelöscht
197
+ edit: Diskussion bearbeiten
198
+ follow: Folge dieser Diskussion
199
+ followed_by: 'gefolgt von:'
200
+ followed_by_noone: Die Diskussion wird von Niemandem verfolgt
201
+ followed_notice: Du folgst der Diskussion
202
+ following:
203
+ auto: Du folgst dieser Diskussion, da automatisches Folgen aktiviert ist
204
+ manual: Du folgst dieser Diskussion
205
+ mentioned: Du folgst dieser Diskussion, da du in ihr erwähnt wurdest
206
+ posted: Du folgst dieser Diskussion, da du diese kommentiert hast
207
+ form:
208
+ categories_placeholder: Kategorien
209
+ content_label: :thredded.posts.form.content_label
210
+ create_btn: Erstelle eine neue Diskussion
211
+ messageboard_label: Forum
212
+ title_label: Titel
213
+ title_placeholder: :thredded.topics.form.title_label
214
+ title_placeholder_start: Starte eine neue Diskussion
215
+ update_btn: Beitrag bearbeiten
216
+ locked:
217
+ label: Gesperrt
218
+ message: Der Beitrag wurde von einem Moderator gesperrt
219
+ mark_as_unread: Als ungelesen markieren
220
+ not_following: Du folgst dieser Diskussion nicht
221
+ search:
222
+ no_results_in_messageboard_message_html: Deine Suche nach <q>%{query}</q> in %{messageboard} hat keine Ergebnisse
223
+ erzielt
224
+ no_results_message_html: Deine Suche nach <q>%{query}</q> erzielte keine Treffer
225
+ page_title: Suchergebnisse
226
+ results_in_messageboard_message_html: Suchergebnisse für <q>%{query}</q> in %{messageboard}
227
+ results_message_html: Suchergebnisse für <q>%{query}</q>
228
+ search_in_all_messageboards_btn: Suche überall
229
+ started_by_html: Gestartet %{time_ago} von %{user}
230
+ sticky:
231
+ label: Angepinnt
232
+ unfollow: Nich mehr folgen
233
+ unfollowed_notice: Du folgst der Diskussion nicht mehr
234
+ updated_notice: Beitrag aktualisiert
235
+ users:
236
+ currently_online: Zurzeit Online
237
+ last_active_html: Zuletzt aktiv %{time_ago}
238
+ posted_in_topic_html: Hochgeladen in %{topic_link}
239
+ posts_count:
240
+ one: Einmalig hochgeladen
241
+ other: "%{count} -mal hochgeladen"
242
+ recent_activity: :thredded.recent_activity
243
+ started_topic_html: "%{topic_link} gestartet"
244
+ started_topics_count:
245
+ one: Eine Diskussion gestartet
246
+ other: "%{count} Diskussionen gestartet"
247
+ user_posted_in_topic_html: "%{user_link} hochgeladen in %{topic_link}"
248
+ user_since_html: Nutzer seit %{time_ago}
249
+ user_started_topic_html: "%{user_link} hat %{topic_link} gestartet"
@@ -55,6 +55,8 @@ en:
55
55
  form:
56
56
  create_btn_submitting: :thredded.form.create_btn_submitting
57
57
  description_label: Description
58
+ locked_label: Locked
59
+ locked_notice: This messageboard is locked. Only moderators can create new topics here.
58
60
  messageboard_group_id_label: Messageboard group
59
61
  no_group: No Group
60
62
  title_label: Name
@@ -57,6 +57,8 @@ es:
57
57
  form:
58
58
  create_btn_submitting: :thredded.form.create_btn_submitting
59
59
  description_label: Descripción
60
+ locked_label: Bloqueado
61
+ locked_notice: Este mensaje está bloqueado. Solo los moderadores pueden crear nuevos temas aquí.
60
62
  messageboard_group_id_label: grupo messageboard
61
63
  no_group: Sin grupo
62
64
  title_label: Nombre
@@ -55,6 +55,8 @@ fr:
55
55
  form:
56
56
  create_btn_submitting: :thredded.form.create_btn_submitting
57
57
  description_label: Description
58
+ locked_label: Verrouillé
59
+ locked_notice: Ce message est verrouillé. Seuls les modérateurs peuvent créer de nouveaux sujets ici.
58
60
  messageboard_group_id_label: Groupe de la catégorie
59
61
  no_group: Pas de groupe
60
62
  title_label: Nom
@@ -55,6 +55,8 @@ pl:
55
55
  form:
56
56
  create_btn_submitting: :thredded.form.create_btn_submitting
57
57
  description_label: Opis
58
+ locked_label: Zablokowany
59
+ locked_notice: Ta wiadomość jest zablokowana. Tylko moderatorzy mogą tworzyć nowe tematy tutaj.
58
60
  messageboard_group_id_label: messageboard grupa
59
61
  no_group: Brak grupy
60
62
  title_label: Nazwa
@@ -56,6 +56,9 @@ pt-BR:
56
56
  form:
57
57
  create_btn_submitting: :thredded.form.create_btn_submitting
58
58
  description_label: Descrição
59
+ locked_label: Trancado
60
+ locked_notice: Este quadro de mensagens está bloqueado. Somente os moderadores podem criar novos tópicos
61
+ aqui.
59
62
  messageboard_group_id_label: grupo messageboard
60
63
  no_group: Sem Grupo
61
64
  title_label: Nome
@@ -54,6 +54,8 @@ ru:
54
54
  form:
55
55
  create_btn_submitting: :thredded.form.create_btn_submitting
56
56
  description_label: Описание
57
+ locked_label: Заблокировать
58
+ locked_notice: Этот форум заблокирован. Только модераторы могут создавать новые темы здесь.
57
59
  messageboard_group_id_label: Выбрать группу
58
60
  no_group: Не группировать
59
61
  title_label: Название форума
@@ -52,6 +52,8 @@ zh-CN:
52
52
  form:
53
53
  create_btn_submitting: :thredded.form.create_btn_submitting
54
54
  description_label: 描述
55
+ locked_label: 锁定
56
+ locked_notice: 这个消息板被锁定。只有版主可以在这里创建新的主题。
55
57
  messageboard_group_id_label: 板块分组
56
58
  no_group: 没有分组
57
59
  title_label: 名称
@@ -44,6 +44,7 @@ class CreateThredded < Thredded::BaseMigration
44
44
  t.references :last_topic, index: false
45
45
  t.references :messageboard_group, index: false
46
46
  t.timestamps null: false
47
+ t.boolean :locked, null: false, default: false
47
48
  t.index [:messageboard_group_id], name: :index_thredded_messageboards_on_messageboard_group_id
48
49
  t.index [:slug], name: :index_thredded_messageboards_on_slug
49
50
  end
@@ -140,7 +141,7 @@ class CreateThredded < Thredded::BaseMigration
140
141
  order: { moderation_state_changed_at: :desc },
141
142
  name: :index_thredded_user_details_for_moderations
142
143
  t.index %i[latest_activity_at], name: :index_thredded_user_details_on_latest_activity_at
143
- t.index %i[user_id], name: :index_thredded_user_details_on_user_id
144
+ t.index %i[user_id], name: :index_thredded_user_details_on_user_id, unique: true
144
145
  end
145
146
 
146
147
  create_table :thredded_messageboard_users do |t|
@@ -162,7 +163,7 @@ class CreateThredded < Thredded::BaseMigration
162
163
  t.boolean :follow_topics_on_mention, default: true, null: false
163
164
  t.boolean :auto_follow_topics, default: false, null: false
164
165
  t.timestamps null: false
165
- t.index [:user_id], name: :index_thredded_user_preferences_on_user_id
166
+ t.index [:user_id], name: :index_thredded_user_preferences_on_user_id, unique: true
166
167
  end
167
168
 
168
169
  create_table :thredded_user_messageboard_preferences do |t|
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thredded/base_migration'
4
+
5
+ class UpgradeThreddedV013ToV014 < Thredded::BaseMigration
6
+ def change
7
+ add_column :thredded_messageboards, :locked, :boolean, null: false, default: false
8
+ remove_index :thredded_user_details,
9
+ name: :index_thredded_user_details_on_user_id
10
+ add_index :thredded_user_details,
11
+ :user_id,
12
+ name: :index_thredded_user_details_on_user_id,
13
+ unique: true
14
+ remove_index :thredded_user_preferences,
15
+ name: :index_thredded_user_preferences_on_user_id
16
+ add_index :thredded_user_preferences,
17
+ :user_id,
18
+ name: :index_thredded_user_preferences_on_user_id,
19
+ unique: true
20
+ end
21
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thredded
4
- VERSION = '0.13.8'
4
+ VERSION = '0.14.0'
5
5
  end
@@ -1,2 +1,2 @@
1
- /** https://unpkg.com/textcomplete@0.14.3/dist/textcomplete.min.js **/
2
- !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),s=(function(e){e&&e.__esModule}(o),function(){function e(t,n,i){r(this,e),this.data=t,this.term=n,this.strategy=i}return i(e,[{key:"replace",value:function(e,t){var n=this.strategy.replace(this.data);if(null!==n){Array.isArray(n)&&(t=n[1]+t,n=n[0]);var r=this.strategy.matchText(e);if(r)return n=n.replace(/\$&/g,r[0]).replace(/\$(\d)/g,function(e,t){return r[parseInt(t,10)]}),[[e.slice(0,r.index),n,e.slice(r.index+r[0].length)].join(""),t]}}},{key:"render",value:function(){return this.strategy.template(this.data,this.term)}}]),e}());t.default=s},function(e){"use strict";function t(){}function n(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function r(){this._events=new t,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,o="~";Object.create&&(t.prototype=Object.create(null),(new t).__proto__||(o=!1)),r.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)i.call(e,t)&&n.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},r.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,u=new Array(s);i<s;i++)u[i]=r[i].fn;return u},r.prototype.emit=function(e,t,n,r,i,s){var u=o?o+e:e;if(!this._events[u])return!1;var a,l,c=this._events[u],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,s),!0}for(l=1,a=new Array(h-1);l<h;l++)a[l-1]=arguments[l];c.fn.apply(c.context,a)}else{var f,d=c.length;for(l=0;l<d;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,r);break;default:if(!a)for(f=1,a=new Array(h-1);f<h;f++)a[f-1]=arguments[f];c[l].fn.apply(c[l].context,a)}}return!0},r.prototype.on=function(e,t,r){var i=new n(t,r||this),s=o?o+e:e;return this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):(this._events[s]=i,this._eventsCount++),this},r.prototype.once=function(e,t,r){var i=new n(t,r||this,!0),s=o?o+e:e;return this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):(this._events[s]=i,this._eventsCount++),this},r.prototype.removeListener=function(e,n,r,i){var s=o?o+e:e;if(!this._events[s])return this;if(!n)return 0==--this._eventsCount?this._events=new t:delete this._events[s],this;var u=this._events[s];if(u.fn)u.fn!==n||i&&!u.once||r&&u.context!==r||(0==--this._eventsCount?this._events=new t:delete this._events[s]);else{for(var a=0,l=[],c=u.length;a<c;a++)(u[a].fn!==n||i&&!u[a].once||r&&u[a].context!==r)&&l.push(u[a]);l.length?this._events[s]=1===l.length?l[0]:l:0==--this._eventsCount?this._events=new t:delete this._events[s]}return this},r.prototype.removeAllListeners=function(e){var n;return e?(n=o?o+e:e,this._events[n]&&(0==--this._eventsCount?this._events=new t:delete this._events[n])):(this._events=new t,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=o,r.EventEmitter=r,e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(10),u=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(t){r(this,e),this.props=t,this.cache=t.cache?{}:null}return o(e,[{key:"destroy",value:function(){return this.cache=null,this}},{key:"buildQuery",value:function(e){if("function"==typeof this.props.context){var t=this.props.context(e);if("string"==typeof t)e=t;else if(!t)return null}var n=this.matchText(e);return n?new u.default(this,n[this.index],n):null}},{key:"search",value:function(e,t,n){this.cache?this.searchWithCache(e,t,n):this.props.search(e,t,n)}},{key:"replace",value:function(e){return this.props.replace(e)}},{key:"searchWithCache",value:function(e,t,n){var r=this;this.cache&&this.cache[e]?t(this.cache[e]):this.props.search(e,function(n){r.cache&&(r.cache[e]=n),t(n)},n)}},{key:"matchText",value:function(e){return"function"==typeof this.match?this.match(e):e.match(this.match)}},{key:"match",get:function(){return this.props.match}},{key:"index",get:function(){return"number"==typeof this.props.index?this.props.index:2}},{key:"template",get:function(){return this.props.template||i}}]),e}();t.default=a},function(e,t){"use strict";function n(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.defaultView,i=n.documentElement,o={top:t.top+r.pageYOffset,left:t.left+r.pageXOffset};return i&&(o.top-=i.clientTop,o.left-=i.clientLeft),o}function r(e){return e>=o&&e<=s}function i(e){var t=window.getComputedStyle(e);if(r(t.lineHeight.charCodeAt(0)))return r(t.lineHeight.charCodeAt(t.lineHeight.length-1))?parseFloat(t.lineHeight)*parseFloat(t.fontSize):parseFloat(t.lineHeight);var n=document.body;if(!n)return 0;var i=document.createElement(e.nodeName);i.innerHTML="&nbsp;",i.style.fontSize=t.fontSize,i.style.fontFamily=t.fontFamily,n.appendChild(i);var o=i.offsetHeight;return n.removeChild(i),o}Object.defineProperty(t,"__esModule",{value:!0}),t.calculateElementOffset=n,t.getLineHeightPx=i;var o=(t.createCustomEvent=function(){return"function"==typeof window.CustomEvent?function(e,t){return new document.defaultView.CustomEvent(e,{cancelable:t&&t.cancelable||!1,detail:t&&t.detail||void 0})}:function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,t&&t.cancelable||!1,t&&t.detail||void 0),n}}(),"0".charCodeAt(0)),s="9".charCodeAt(0)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),c=n(3),h=n(0),f=(r(h),function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),u(t,[{key:"destroy",value:function(){return this}},{key:"applySearchResult",value:function(){throw new Error("Not implemented.")}},{key:"getCursorOffset",value:function(){throw new Error("Not implemented.")}},{key:"getBeforeCursor",value:function(){throw new Error("Not implemented.")}},{key:"emitMoveEvent",value:function(e){var t=(0,c.createCustomEvent)("move",{cancelable:!0,detail:{code:e}});return this.emit("move",t),t}},{key:"emitEnterEvent",value:function(){var e=(0,c.createCustomEvent)("enter",{cancelable:!0});return this.emit("enter",e),e}},{key:"emitChangeEvent",value:function(){var e=(0,c.createCustomEvent)("change",{detail:{beforeCursor:this.getBeforeCursor()}});return this.emit("change",e),e}},{key:"emitEscEvent",value:function(){var e=(0,c.createCustomEvent)("esc",{cancelable:!0});return this.emit("esc",e),e}},{key:"getCode",value:function(e){return 9===e.keyCode?"ENTER":13===e.keyCode?"ENTER":27===e.keyCode?"ESC":38===e.keyCode?"UP":40===e.keyCode?"DOWN":78===e.keyCode&&e.ctrlKey?"DOWN":80===e.keyCode&&e.ctrlKey?"UP":"OTHER"}}]),t}(l.default));t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),c=n(11),h=r(c),f=n(0),d=(r(f),n(3)),p="dropdown-menu textcomplete-dropdown",v=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.shown=!1,n.items=[],n.footer=e.footer,n.header=e.header,n.maxCount=e.maxCount||10,n.el.className=e.className||p,n.rotate=!e.hasOwnProperty("rotate")||e.rotate,n.placement=e.placement;var r=e.style;return r&&Object.keys(r).forEach(function(e){n.el.style[e]=r[e]}),n}return s(t,e),u(t,null,[{key:"createElement",value:function(){var e=document.createElement("ul"),t=e.style;t.display="none",t.position="absolute",t.zIndex="10000";var n=document.body;return n&&n.appendChild(e),e}}]),u(t,[{key:"destroy",value:function(){var e=this.el.parentNode;return e&&e.removeChild(this.el),this.clear()._el=null,this}},{key:"render",value:function(e,t){var n=(0,d.createCustomEvent)("render",{cancelable:!0});if(this.emit("render",n),n.defaultPrevented)return this;var r=e.map(function(e){return e.data}),i=e.slice(0,this.maxCount||e.length).map(function(e){return new h.default(e)});return this.clear().setStrategyId(e[0]).renderEdge(r,"header").append(i).renderEdge(r,"footer").setOffset(t).show(),this.emit("rendered",(0,d.createCustomEvent)("rendered")),this}},{key:"deactivate",value:function(){return this.hide().clear()}},{key:"select",value:function(e){var t={searchResult:e.searchResult},n=(0,d.createCustomEvent)("select",{cancelable:!0,detail:t});return this.emit("select",n),n.defaultPrevented?this:(this.deactivate(),this.emit("selected",(0,d.createCustomEvent)("selected",{detail:t})),this)}},{key:"up",value:function(e){return this.shown?this.moveActiveItem("prev",e):this}},{key:"down",value:function(e){return this.shown?this.moveActiveItem("next",e):this}},{key:"getActiveItem",value:function(){return this.items.find(function(e){return e.active})}},{key:"append",value:function(e){var t=this,n=document.createDocumentFragment();return e.forEach(function(e){t.items.push(e),e.appended(t),n.appendChild(e.el)}),this.el.appendChild(n),this}},{key:"setOffset",value:function(e){if(e.left?this.el.style.left=e.left+"px":e.right&&(this.el.style.right=e.right+"px"),this.isPlacementTop()){var t=document.documentElement;t&&(this.el.style.bottom=t.clientHeight-e.top+e.lineHeight+"px")}else this.el.style.top=e.top+"px";return this}},{key:"show",value:function(){if(!this.shown){var e=(0,d.createCustomEvent)("show",{cancelable:!0});if(this.emit("show",e),e.defaultPrevented)return this;this.el.style.display="block",this.shown=!0,this.emit("shown",(0,d.createCustomEvent)("shown"))}return this}},{key:"hide",value:function(){if(this.shown){var e=(0,d.createCustomEvent)("hide",{cancelable:!0});if(this.emit("hide",e),e.defaultPrevented)return this;this.el.style.display="none",this.shown=!1,this.emit("hidden",(0,d.createCustomEvent)("hidden"))}return this}},{key:"clear",value:function(){return this.el.innerHTML="",this.items.forEach(function(e){return e.destroy()}),this.items=[],this}},{key:"moveActiveItem",value:function(e,t){var n=this.getActiveItem(),r=void 0;return r=n?n[e]:"next"===e?this.items[0]:this.items[this.items.length-1],r&&(r.activate(),t.preventDefault()),this}},{key:"setStrategyId",value:function(e){var t=e&&e.strategy.props.id;return t?this.el.setAttribute("data-strategy",t):this.el.removeAttribute("data-strategy"),this}},{key:"renderEdge",value:function(e,t){var n=("header"===t?this.header:this.footer)||"",r="function"==typeof n?n(e):n,i=document.createElement("li");return i.classList.add("textcomplete-"+t),i.innerHTML=r,this.el.appendChild(i),this}},{key:"isPlacementTop",value:function(){return"top"===this.placement}},{key:"el",get:function(){return this._el||(this._el=t.createElement()),this._el}}]),t}(l.default);t.default=v},function(e,t,n){"use strict";(function(e){function t(e){return e&&e.__esModule?e:{default:e}}var r=n(8),i=t(r),o=n(12),s=t(o),u=void 0;u=e.Textcomplete&&e.Textcomplete.editors?e.Textcomplete.editors:{},u.Textarea=s.default,e.Textcomplete=i.default,e.Textcomplete.editors=u}).call(t,n(7))},function(e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(9),l=r(a),c=n(4),h=(r(c),n(5)),f=r(h),d=n(2),p=r(d),v=n(0),y=(r(v),n(1)),m=r(y),g=["handleChange","handleEnter","handleEsc","handleHit","handleMove","handleSelect"],b=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.completer=new l.default,r.isQueryInFlight=!1,r.nextPendingQuery=null,r.dropdown=new f.default(n.dropdown||{}),r.editor=e,r.options=n,g.forEach(function(e){r[e]=r[e].bind(r)}),r.startListening(),r}return s(t,e),u(t,[{key:"destroy",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.completer.destroy(),this.dropdown.destroy(),e&&this.editor.destroy(),this.stopListening(),this}},{key:"register",value:function(e){var t=this;return e.forEach(function(e){t.completer.registerStrategy(new p.default(e))}),this}},{key:"trigger",value:function(e){return this.isQueryInFlight?this.nextPendingQuery=e:(this.isQueryInFlight=!0,this.nextPendingQuery=null,this.completer.run(e)),this}},{key:"handleHit",value:function(e){var t=e.searchResults;t.length?this.dropdown.render(t,this.editor.getCursorOffset()):this.dropdown.deactivate(),this.isQueryInFlight=!1,null!==this.nextPendingQuery&&this.trigger(this.nextPendingQuery)}},{key:"handleMove",value:function(e){"UP"===e.detail.code?this.dropdown.up(e):this.dropdown.down(e)}},{key:"handleEnter",value:function(e){var t=this.dropdown.getActiveItem();t?(this.dropdown.select(t),e.preventDefault()):this.dropdown.deactivate()}},{key:"handleEsc",value:function(e){this.dropdown.shown&&(this.dropdown.deactivate(),e.preventDefault())}},{key:"handleChange",value:function(e){null!=e.detail.beforeCursor?this.trigger(e.detail.beforeCursor):this.dropdown.deactivate()}},{key:"handleSelect",value:function(e){this.emit("select",e),e.defaultPrevented||this.editor.applySearchResult(e.detail.searchResult)}},{key:"startListening",value:function(){var e=this;this.editor.on("move",this.handleMove).on("enter",this.handleEnter).on("esc",this.handleEsc).on("change",this.handleChange),this.dropdown.on("select",this.handleSelect),["show","shown","render","rendered","selected","hidden","hide"].forEach(function(t){e.dropdown.on(t,function(){return e.emit(t)})}),this.completer.on("hit",this.handleHit)}},{key:"stopListening",value:function(){this.completer.removeAllListeners(),this.dropdown.removeAllListeners(),this.editor.removeListener("move",this.handleMove).removeListener("enter",this.handleEnter).removeListener("esc",this.handleEsc).removeListener("change",this.handleChange)}}]),t}(m.default);t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),c=n(2),h=(r(c),n(0)),f=(r(h),["handleQueryResult"]),d=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.strategies=[],f.forEach(function(t){e[t]=e[t].bind(e)}),e}return s(t,e),u(t,[{key:"destroy",value:function(){return this.strategies.forEach(function(e){return e.destroy()}),this}},{key:"registerStrategy",value:function(e){return this.strategies.push(e),this}},{key:"run",value:function(e){var t=this.extractQuery(e);t?t.execute(this.handleQueryResult):this.handleQueryResult([])}},{key:"extractQuery",value:function(e){for(var t=0;t<this.strategies.length;t++){var n=this.strategies[t].buildQuery(e);if(n)return n}return null}},{key:"handleQueryResult",value:function(e){this.emit("hit",{searchResults:e})}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),a=n(2),l=(r(a),function(){function e(t,n,r){i(this,e),this.strategy=t,this.term=n,this.match=r}return o(e,[{key:"execute",value:function(e){var t=this;this.strategy.search(this.term,function(n){e(n.map(function(e){return new u.default(e,t.term,t.strategy)}))},this.match)}}]),e}());t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.CLASS_NAME=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(5),u=(r(s),n(0)),a=(r(u),t.CLASS_NAME="textcomplete-item"),l=a+" active",c=["onClick","onMouseover"],h=function(){function e(t){var n=this;i(this,e),this.searchResult=t,this.active=!1,c.forEach(function(e){n[e]=n[e].bind(n)})}return o(e,[{key:"destroy",value:function(){this.el.removeEventListener("mousedown",this.onClick,!1),this.el.removeEventListener("mouseover",this.onMouseover,!1),this.el.removeEventListener("touchstart",this.onClick,!1),this._el=null}},{key:"appended",value:function(e){this.dropdown=e,this.siblings=e.items,this.index=this.siblings.length-1}},{key:"activate",value:function(){if(!this.active){var e=this.dropdown.getActiveItem();e&&e.deactivate(),this.active=!0,this.el.className=l}return this}},{key:"deactivate",value:function(){return this.active&&(this.active=!1,this.el.className=a),this}},{key:"onClick",value:function(e){e.preventDefault(),this.dropdown.select(this)}},{key:"onMouseover",value:function(){this.activate()}},{key:"el",get:function(){if(this._el)return this._el;var e=document.createElement("li");e.className=this.active?l:a;var t=document.createElement("a");return t.innerHTML=this.searchResult.render(),e.appendChild(t),this._el=e,e.addEventListener("mousedown",this.onClick),e.addEventListener("mouseover",this.onMouseover),e.addEventListener("touchstart",this.onClick),e}},{key:"next",get:function(){var e=void 0;if(this.index===this.siblings.length-1){if(!this.dropdown.rotate)return null;e=0}else e=this.index+1;return this.siblings[e]}},{key:"prev",get:function(){var e=void 0;if(0===this.index){if(!this.dropdown.rotate)return null;e=this.siblings.length-1}else e=this.index-1;return this.siblings[e]}}]),e}();t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},l=n(13),c=r(l),h=n(4),f=r(h),d=n(3),p=n(0),v=(r(p),n(14)),y=["onInput","onKeydown"],m=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.el=e,y.forEach(function(e){n[e]=n[e].bind(n)}),n.startListening(),n}return s(t,e),u(t,[{key:"destroy",value:function(){return a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this.stopListening(),this.el=null,this}},{key:"applySearchResult",value:function(e){var t=this.getBeforeCursor();if(null!=t){var n=e.replace(t,this.getAfterCursor());this.el.focus(),Array.isArray(n)&&((0,c.default)(this.el,n[0],n[1]),this.el.dispatchEvent(new Event("input")))}}},{key:"getCursorOffset",value:function(){var e=(0,d.calculateElementOffset)(this.el),t=this.getElScroll(),n=this.getCursorPosition(),r=(0,d.getLineHeightPx)(this.el),i=e.top-t.top+n.top+r,o=e.left-t.left+n.left;return"rtl"!==this.el.dir?{top:i,left:o,lineHeight:r}:{top:i,right:document.documentElement?document.documentElement.clientWidth-o:0,lineHeight:r}}},{key:"getBeforeCursor",value:function(){return this.el.selectionStart!==this.el.selectionEnd?null:this.el.value.substring(0,this.el.selectionEnd)}},{key:"getAfterCursor",value:function(){return this.el.value.substring(this.el.selectionEnd)}},{key:"getElScroll",value:function(){return{top:this.el.scrollTop,left:this.el.scrollLeft}}},{key:"getCursorPosition",value:function(){return v(this.el,this.el.selectionEnd)}},{key:"onInput",value:function(){this.emitChangeEvent()}},{key:"onKeydown",value:function(e){var t=this.getCode(e),n=void 0;"UP"===t||"DOWN"===t?n=this.emitMoveEvent(t):"ENTER"===t?n=this.emitEnterEvent():"ESC"===t&&(n=this.emitEscEvent()),n&&n.defaultPrevented&&e.preventDefault()}},{key:"startListening",value:function(){this.el.addEventListener("input",this.onInput),this.el.addEventListener("keydown",this.onKeydown)}},{key:"stopListening",value:function(){this.el.removeEventListener("input",this.onInput),this.el.removeEventListener("keydown",this.onKeydown)}}]),t}(f.default);t.default=m},function(e,t){"use strict";function n(){if("undefined"!=typeof Event)return new Event("input",{bubbles:!0,cancelable:!0});var e=document.createEvent("Event");return e.initEvent("input",!0,!0),e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var i=e.value,o=t+(r||""),s=document.activeElement,u=0,a=0;i[u]===o[u];)u++;for(;i[i.length-a-1]===o[o.length-a-1];)a++;u=Math.min(u,Math.min(i.length,o.length)-a),e.setSelectionRange(u,i.length-a);var l=o.substring(u,o.length-a);return e.focus(),document.execCommand("insertText",!1,l)||(e.value=o,e.dispatchEvent(n())),e.setSelectionRange(t.length,t.length),s&&s.focus(),e}},function(e){!function(){function t(e,t,o){if(!r)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var s=o&&o.debug||!1;if(s){var u=document.querySelector("#input-textarea-caret-position-mirror-div");u&&u.parentNode.removeChild(u)}var a=document.createElement("div");a.id="input-textarea-caret-position-mirror-div",document.body.appendChild(a);var l=a.style,c=window.getComputedStyle?getComputedStyle(e):e.currentStyle;l.whiteSpace="pre-wrap","INPUT"!==e.nodeName&&(l.wordWrap="break-word"),l.position="absolute",s||(l.visibility="hidden"),n.forEach(function(e){l[e]=c[e]}),i?e.scrollHeight>parseInt(c.height)&&(l.overflowY="scroll"):l.overflow="hidden",a.textContent=e.value.substring(0,t),"INPUT"===e.nodeName&&(a.textContent=a.textContent.replace(/\s/g," "));var h=document.createElement("span");h.textContent=e.value.substring(t)||".",a.appendChild(h);var f={top:h.offsetTop+parseInt(c.borderTopWidth),left:h.offsetLeft+parseInt(c.borderLeftWidth)};return s?h.style.backgroundColor="#aaa":document.body.removeChild(a),f}var n=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],r="undefined"!=typeof window,i=r&&null!=window.mozInnerScreenX;void 0!==e&&void 0!==e.exports?e.exports=t:r&&(window.getCaretCoordinates=t)}()}]);
1
+ /** https://unpkg.com/textcomplete@0.14.5/dist/textcomplete.min.js **/
2
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),s=(function(e){e&&e.__esModule}(o),function(){function e(t,n,i){r(this,e),this.data=t,this.term=n,this.strategy=i}return i(e,[{key:"replace",value:function(e,t){var n=this.strategy.replace(this.data);if(null!==n){Array.isArray(n)&&(t=n[1]+t,n=n[0]);var r=this.strategy.matchText(e);if(r)return n=n.replace(/\$&/g,r[0]).replace(/\$(\d)/g,function(e,t){return r[parseInt(t,10)]}),[[e.slice(0,r.index),n,e.slice(r.index+r[0].length)].join(""),t]}}},{key:"render",value:function(){return this.strategy.template(this.data,this.term)}}]),e}());t.default=s},function(e){"use strict";function t(){}function n(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function r(){this._events=new t,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,o="~";Object.create&&(t.prototype=Object.create(null),(new t).__proto__||(o=!1)),r.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)i.call(e,t)&&n.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},r.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,s=r.length,u=new Array(s);i<s;i++)u[i]=r[i].fn;return u},r.prototype.emit=function(e,t,n,r,i,s){var u=o?o+e:e;if(!this._events[u])return!1;var a,l,c=this._events[u],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,s),!0}for(l=1,a=new Array(h-1);l<h;l++)a[l-1]=arguments[l];c.fn.apply(c.context,a)}else{var f,d=c.length;for(l=0;l<d;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,r);break;default:if(!a)for(f=1,a=new Array(h-1);f<h;f++)a[f-1]=arguments[f];c[l].fn.apply(c[l].context,a)}}return!0},r.prototype.on=function(e,t,r){var i=new n(t,r||this),s=o?o+e:e;return this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):(this._events[s]=i,this._eventsCount++),this},r.prototype.once=function(e,t,r){var i=new n(t,r||this,!0),s=o?o+e:e;return this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],i]:this._events[s].push(i):(this._events[s]=i,this._eventsCount++),this},r.prototype.removeListener=function(e,n,r,i){var s=o?o+e:e;if(!this._events[s])return this;if(!n)return 0==--this._eventsCount?this._events=new t:delete this._events[s],this;var u=this._events[s];if(u.fn)u.fn!==n||i&&!u.once||r&&u.context!==r||(0==--this._eventsCount?this._events=new t:delete this._events[s]);else{for(var a=0,l=[],c=u.length;a<c;a++)(u[a].fn!==n||i&&!u[a].once||r&&u[a].context!==r)&&l.push(u[a]);l.length?this._events[s]=1===l.length?l[0]:l:0==--this._eventsCount?this._events=new t:delete this._events[s]}return this},r.prototype.removeAllListeners=function(e){var n;return e?(n=o?o+e:e,this._events[n]&&(0==--this._eventsCount?this._events=new t:delete this._events[n])):(this._events=new t,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=o,r.EventEmitter=r,e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return e}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(10),u=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(t){r(this,e),this.props=t,this.cache=t.cache?{}:null}return o(e,[{key:"destroy",value:function(){return this.cache=null,this}},{key:"buildQuery",value:function(e){if("function"==typeof this.props.context){var t=this.props.context(e);if("string"==typeof t)e=t;else if(!t)return null}var n=this.matchText(e);return n?new u.default(this,n[this.index],n):null}},{key:"search",value:function(e,t,n){this.cache?this.searchWithCache(e,t,n):this.props.search(e,t,n)}},{key:"replace",value:function(e){return this.props.replace(e)}},{key:"searchWithCache",value:function(e,t,n){var r=this;this.cache&&this.cache[e]?t(this.cache[e]):this.props.search(e,function(n){r.cache&&(r.cache[e]=n),t(n)},n)}},{key:"matchText",value:function(e){return"function"==typeof this.match?this.match(e):e.match(this.match)}},{key:"match",get:function(){return this.props.match}},{key:"index",get:function(){return"number"==typeof this.props.index?this.props.index:2}},{key:"template",get:function(){return this.props.template||i}}]),e}();t.default=a},function(e,t){"use strict";function n(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.defaultView,i=n.documentElement,o={top:t.top+r.pageYOffset,left:t.left+r.pageXOffset};return i&&(o.top-=i.clientTop,o.left-=i.clientLeft),o}function r(e){return e>=o&&e<=s}function i(e){var t=window.getComputedStyle(e);if(r(t.lineHeight.charCodeAt(0)))return r(t.lineHeight.charCodeAt(t.lineHeight.length-1))?parseFloat(t.lineHeight)*parseFloat(t.fontSize):parseFloat(t.lineHeight);var n=document.body;if(!n)return 0;var i=document.createElement(e.nodeName);i.innerHTML="&nbsp;",i.style.fontSize=t.fontSize,i.style.fontFamily=t.fontFamily,n.appendChild(i);var o=i.offsetHeight;return n.removeChild(i),o}Object.defineProperty(t,"__esModule",{value:!0}),t.calculateElementOffset=n,t.getLineHeightPx=i;var o=(t.createCustomEvent=function(){return"function"==typeof window.CustomEvent?function(e,t){return new document.defaultView.CustomEvent(e,{cancelable:t&&t.cancelable||!1,detail:t&&t.detail||void 0})}:function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,t&&t.cancelable||!1,t&&t.detail||void 0),n}}(),"0".charCodeAt(0)),s="9".charCodeAt(0)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),c=n(3),h=n(0),f=(r(h),function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),u(t,[{key:"destroy",value:function(){return this}},{key:"applySearchResult",value:function(){throw new Error("Not implemented.")}},{key:"getCursorOffset",value:function(){throw new Error("Not implemented.")}},{key:"getBeforeCursor",value:function(){throw new Error("Not implemented.")}},{key:"emitMoveEvent",value:function(e){var t=(0,c.createCustomEvent)("move",{cancelable:!0,detail:{code:e}});return this.emit("move",t),t}},{key:"emitEnterEvent",value:function(){var e=(0,c.createCustomEvent)("enter",{cancelable:!0});return this.emit("enter",e),e}},{key:"emitChangeEvent",value:function(){var e=(0,c.createCustomEvent)("change",{detail:{beforeCursor:this.getBeforeCursor()}});return this.emit("change",e),e}},{key:"emitEscEvent",value:function(){var e=(0,c.createCustomEvent)("esc",{cancelable:!0});return this.emit("esc",e),e}},{key:"getCode",value:function(e){return 9===e.keyCode?"ENTER":13===e.keyCode?"ENTER":27===e.keyCode?"ESC":38===e.keyCode?"UP":40===e.keyCode?"DOWN":78===e.keyCode&&e.ctrlKey?"DOWN":80===e.keyCode&&e.ctrlKey?"UP":"OTHER"}}]),t}(l.default));t.default=f},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),c=n(11),h=r(c),f=n(0),d=(r(f),n(3)),p="dropdown-menu textcomplete-dropdown",v=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.shown=!1,n.items=[],n.activeItem=null,n.footer=e.footer,n.header=e.header,n.maxCount=e.maxCount||10,n.el.className=e.className||p,n.rotate=!e.hasOwnProperty("rotate")||e.rotate,n.placement=e.placement;var r=e.style;return r&&Object.keys(r).forEach(function(e){n.el.style[e]=r[e]}),n}return s(t,e),u(t,null,[{key:"createElement",value:function(){var e=document.createElement("ul"),t=e.style;t.display="none",t.position="absolute",t.zIndex="10000";var n=document.body;return n&&n.appendChild(e),e}}]),u(t,[{key:"destroy",value:function(){var e=this.el.parentNode;return e&&e.removeChild(this.el),this.clear()._el=null,this}},{key:"render",value:function(e,t){var n=(0,d.createCustomEvent)("render",{cancelable:!0});if(this.emit("render",n),n.defaultPrevented)return this;var r=e.map(function(e){return e.data}),i=e.slice(0,this.maxCount||e.length).map(function(e){return new h.default(e)});return this.clear().setStrategyId(e[0]).renderEdge(r,"header").append(i).renderEdge(r,"footer").setOffset(t).show(),this.emit("rendered",(0,d.createCustomEvent)("rendered")),this}},{key:"deactivate",value:function(){return this.hide().clear()}},{key:"select",value:function(e){var t={searchResult:e.searchResult},n=(0,d.createCustomEvent)("select",{cancelable:!0,detail:t});return this.emit("select",n),n.defaultPrevented?this:(this.deactivate(),this.emit("selected",(0,d.createCustomEvent)("selected",{detail:t})),this)}},{key:"up",value:function(e){return this.shown?this.moveActiveItem("prev",e):this}},{key:"down",value:function(e){return this.shown?this.moveActiveItem("next",e):this}},{key:"getActiveItem",value:function(){return this.activeItem}},{key:"append",value:function(e){var t=this,n=document.createDocumentFragment();return e.forEach(function(e){t.items.push(e),e.appended(t),n.appendChild(e.el)}),this.el.appendChild(n),this}},{key:"setOffset",value:function(e){if(e.left?this.el.style.left=e.left+"px":e.right&&(this.el.style.right=e.right+"px"),this.isPlacementTop()){var t=document.documentElement;t&&(this.el.style.bottom=t.clientHeight-e.top+e.lineHeight+"px")}else this.el.style.top=e.top+"px";return this}},{key:"show",value:function(){if(!this.shown){var e=(0,d.createCustomEvent)("show",{cancelable:!0});if(this.emit("show",e),e.defaultPrevented)return this;this.el.style.display="block",this.shown=!0,this.emit("shown",(0,d.createCustomEvent)("shown"))}return this}},{key:"hide",value:function(){if(this.shown){var e=(0,d.createCustomEvent)("hide",{cancelable:!0});if(this.emit("hide",e),e.defaultPrevented)return this;this.el.style.display="none",this.shown=!1,this.emit("hidden",(0,d.createCustomEvent)("hidden"))}return this}},{key:"clear",value:function(){return this.el.innerHTML="",this.items.forEach(function(e){return e.destroy()}),this.items=[],this}},{key:"moveActiveItem",value:function(e,t){var n="next"===e?this.activeItem?this.activeItem.next:this.items[0]:this.activeItem?this.activeItem.prev:this.items[this.items.length-1];return n&&(n.activate(),t.preventDefault()),this}},{key:"setStrategyId",value:function(e){var t=e&&e.strategy.props.id;return t?this.el.setAttribute("data-strategy",t):this.el.removeAttribute("data-strategy"),this}},{key:"renderEdge",value:function(e,t){var n=("header"===t?this.header:this.footer)||"",r="function"==typeof n?n(e):n,i=document.createElement("li");return i.classList.add("textcomplete-"+t),i.innerHTML=r,this.el.appendChild(i),this}},{key:"isPlacementTop",value:function(){return"top"===this.placement}},{key:"el",get:function(){return this._el||(this._el=t.createElement()),this._el}}]),t}(l.default);t.default=v},function(e,t,n){"use strict";(function(e){function t(e){return e&&e.__esModule?e:{default:e}}var r=n(8),i=t(r),o=n(12),s=t(o),u=void 0;u=e.Textcomplete&&e.Textcomplete.editors?e.Textcomplete.editors:{},u.Textarea=s.default,e.Textcomplete=i.default,e.Textcomplete.editors=u}).call(t,n(7))},function(e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(9),l=r(a),c=n(4),h=(r(c),n(5)),f=r(h),d=n(2),p=r(d),v=n(0),y=(r(v),n(1)),m=r(y),g=["handleChange","handleEnter","handleEsc","handleHit","handleMove","handleSelect"],b=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.completer=new l.default,r.isQueryInFlight=!1,r.nextPendingQuery=null,r.dropdown=new f.default(n.dropdown||{}),r.editor=e,r.options=n,g.forEach(function(e){r[e]=r[e].bind(r)}),r.startListening(),r}return s(t,e),u(t,[{key:"destroy",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.completer.destroy(),this.dropdown.destroy(),e&&this.editor.destroy(),this.stopListening(),this}},{key:"register",value:function(e){var t=this;return e.forEach(function(e){t.completer.registerStrategy(new p.default(e))}),this}},{key:"trigger",value:function(e){return this.isQueryInFlight?this.nextPendingQuery=e:(this.isQueryInFlight=!0,this.nextPendingQuery=null,this.completer.run(e)),this}},{key:"handleHit",value:function(e){var t=e.searchResults;t.length?this.dropdown.render(t,this.editor.getCursorOffset()):this.dropdown.deactivate(),this.isQueryInFlight=!1,null!==this.nextPendingQuery&&this.trigger(this.nextPendingQuery)}},{key:"handleMove",value:function(e){"UP"===e.detail.code?this.dropdown.up(e):this.dropdown.down(e)}},{key:"handleEnter",value:function(e){var t=this.dropdown.getActiveItem();t?(this.dropdown.select(t),e.preventDefault()):this.dropdown.deactivate()}},{key:"handleEsc",value:function(e){this.dropdown.shown&&(this.dropdown.deactivate(),e.preventDefault())}},{key:"handleChange",value:function(e){null!=e.detail.beforeCursor?this.trigger(e.detail.beforeCursor):this.dropdown.deactivate()}},{key:"handleSelect",value:function(e){this.emit("select",e),e.defaultPrevented||this.editor.applySearchResult(e.detail.searchResult)}},{key:"startListening",value:function(){var e=this;this.editor.on("move",this.handleMove).on("enter",this.handleEnter).on("esc",this.handleEsc).on("change",this.handleChange),this.dropdown.on("select",this.handleSelect),["show","shown","render","rendered","selected","hidden","hide"].forEach(function(t){e.dropdown.on(t,function(){return e.emit(t)})}),this.completer.on("hit",this.handleHit)}},{key:"stopListening",value:function(){this.completer.removeAllListeners(),this.dropdown.removeAllListeners(),this.editor.removeListener("move",this.handleMove).removeListener("enter",this.handleEnter).removeListener("esc",this.handleEsc).removeListener("change",this.handleChange)}}]),t}(m.default);t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=r(a),c=n(2),h=(r(c),n(0)),f=(r(h),["handleQueryResult"]),d=function(e){function t(){i(this,t);var e=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.strategies=[],f.forEach(function(t){e[t]=e[t].bind(e)}),e}return s(t,e),u(t,[{key:"destroy",value:function(){return this.strategies.forEach(function(e){return e.destroy()}),this}},{key:"registerStrategy",value:function(e){return this.strategies.push(e),this}},{key:"run",value:function(e){var t=this.extractQuery(e);t?t.execute(this.handleQueryResult):this.handleQueryResult([])}},{key:"extractQuery",value:function(e){for(var t=0;t<this.strategies.length;t++){var n=this.strategies[t].buildQuery(e);if(n)return n}return null}},{key:"handleQueryResult",value:function(e){this.emit("hit",{searchResults:e})}}]),t}(l.default);t.default=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),a=n(2),l=(r(a),function(){function e(t,n,r){i(this,e),this.strategy=t,this.term=n,this.match=r}return o(e,[{key:"execute",value:function(e){var t=this;this.strategy.search(this.term,function(n){e(n.map(function(e){return new u.default(e,t.term,t.strategy)}))},this.match)}}]),e}());t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.CLASS_NAME=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(5),u=(r(s),n(0)),a=(r(u),t.CLASS_NAME="textcomplete-item"),l=a+" active",c=["onClick","onMouseover"],h=function(){function e(t){var n=this;i(this,e),this.searchResult=t,this.active=!1,c.forEach(function(e){n[e]=n[e].bind(n)})}return o(e,[{key:"destroy",value:function(){this.el.removeEventListener("mousedown",this.onClick,!1),this.el.removeEventListener("mouseover",this.onMouseover,!1),this.el.removeEventListener("touchstart",this.onClick,!1),this.active&&(this.dropdown.activeItem=null),this._el=null}},{key:"appended",value:function(e){this.dropdown=e,this.siblings=e.items,this.index=this.siblings.length-1}},{key:"activate",value:function(){if(!this.active){var e=this.dropdown.getActiveItem();e&&e.deactivate(),this.dropdown.activeItem=this,this.active=!0,this.el.className=l}return this}},{key:"deactivate",value:function(){return this.active&&(this.active=!1,this.el.className=a,this.dropdown.activeItem=null),this}},{key:"onClick",value:function(e){e.preventDefault(),this.dropdown.select(this)}},{key:"onMouseover",value:function(){this.activate()}},{key:"el",get:function(){if(this._el)return this._el;var e=document.createElement("li");e.className=this.active?l:a;var t=document.createElement("a");return t.innerHTML=this.searchResult.render(),e.appendChild(t),this._el=e,e.addEventListener("mousedown",this.onClick),e.addEventListener("mouseover",this.onMouseover),e.addEventListener("touchstart",this.onClick),e}},{key:"next",get:function(){var e=void 0;if(this.index===this.siblings.length-1){if(!this.dropdown.rotate)return null;e=0}else e=this.index+1;return this.siblings[e]}},{key:"prev",get:function(){var e=void 0;if(0===this.index){if(!this.dropdown.rotate)return null;e=this.siblings.length-1}else e=this.index-1;return this.siblings[e]}}]),e}();t.default=h},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var s=i.get;if(void 0!==s)return s.call(r)},l=n(13),c=r(l),h=n(4),f=r(h),d=n(3),p=n(0),v=(r(p),n(14)),y=["onInput","onKeydown"],m=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.el=e,y.forEach(function(e){n[e]=n[e].bind(n)}),n.startListening(),n}return s(t,e),u(t,[{key:"destroy",value:function(){return a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this),this.stopListening(),this.el=null,this}},{key:"applySearchResult",value:function(e){var t=this.getBeforeCursor();if(null!=t){var n=e.replace(t,this.getAfterCursor());this.el.focus(),Array.isArray(n)&&((0,c.default)(this.el,n[0],n[1]),this.el.dispatchEvent(new Event("input")))}}},{key:"getCursorOffset",value:function(){var e=(0,d.calculateElementOffset)(this.el),t=this.getElScroll(),n=this.getCursorPosition(),r=(0,d.getLineHeightPx)(this.el),i=e.top-t.top+n.top+r,o=e.left-t.left+n.left;return"rtl"!==this.el.dir?{top:i,left:o,lineHeight:r}:{top:i,right:document.documentElement?document.documentElement.clientWidth-o:0,lineHeight:r}}},{key:"getBeforeCursor",value:function(){return this.el.selectionStart!==this.el.selectionEnd?null:this.el.value.substring(0,this.el.selectionEnd)}},{key:"getAfterCursor",value:function(){return this.el.value.substring(this.el.selectionEnd)}},{key:"getElScroll",value:function(){return{top:this.el.scrollTop,left:this.el.scrollLeft}}},{key:"getCursorPosition",value:function(){return v(this.el,this.el.selectionEnd)}},{key:"onInput",value:function(){this.emitChangeEvent()}},{key:"onKeydown",value:function(e){var t=this.getCode(e),n=void 0;"UP"===t||"DOWN"===t?n=this.emitMoveEvent(t):"ENTER"===t?n=this.emitEnterEvent():"ESC"===t&&(n=this.emitEscEvent()),n&&n.defaultPrevented&&e.preventDefault()}},{key:"startListening",value:function(){this.el.addEventListener("input",this.onInput),this.el.addEventListener("keydown",this.onKeydown)}},{key:"stopListening",value:function(){this.el.removeEventListener("input",this.onInput),this.el.removeEventListener("keydown",this.onKeydown)}}]),t}(f.default);t.default=m},function(e,t){"use strict";function n(){if("undefined"!=typeof Event)return new Event("input",{bubbles:!0,cancelable:!0});var e=document.createEvent("Event");return e.initEvent("input",!0,!0),e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){for(var i=e.value,o=t+(r||""),s=document.activeElement,u=0,a=0;u<i.length&&u<o.length&&i[u]===o[u];)u++;for(;i.length-a-1>=0&&o.length-a-1>=0&&i[i.length-a-1]===o[o.length-a-1];)a++;u=Math.min(u,Math.min(i.length,o.length)-a),e.setSelectionRange(u,i.length-a);var l=o.substring(u,o.length-a);return e.focus(),document.execCommand("insertText",!1,l)||(e.value=o,e.dispatchEvent(n())),e.setSelectionRange(t.length,t.length),s&&s.focus(),e}},function(e){!function(){function t(e,t,o){if(!r)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var s=o&&o.debug||!1;if(s){var u=document.querySelector("#input-textarea-caret-position-mirror-div");u&&u.parentNode.removeChild(u)}var a=document.createElement("div");a.id="input-textarea-caret-position-mirror-div",document.body.appendChild(a);var l=a.style,c=window.getComputedStyle?getComputedStyle(e):e.currentStyle;l.whiteSpace="pre-wrap","INPUT"!==e.nodeName&&(l.wordWrap="break-word"),l.position="absolute",s||(l.visibility="hidden"),n.forEach(function(e){l[e]=c[e]}),i?e.scrollHeight>parseInt(c.height)&&(l.overflowY="scroll"):l.overflow="hidden",a.textContent=e.value.substring(0,t),"INPUT"===e.nodeName&&(a.textContent=a.textContent.replace(/\s/g," "));var h=document.createElement("span");h.textContent=e.value.substring(t)||".",a.appendChild(h);var f={top:h.offsetTop+parseInt(c.borderTopWidth),left:h.offsetLeft+parseInt(c.borderLeftWidth)};return s?h.style.backgroundColor="#aaa":document.body.removeChild(a),f}var n=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],r="undefined"!=typeof window,i=r&&null!=window.mozInnerScreenX;void 0!==e&&void 0!==e.exports?e.exports=t:r&&(window.getCaretCoordinates=t)}()}]);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.8
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-15 00:00:00.000000000 Z
12
+ date: 2017-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pundit
@@ -673,6 +673,7 @@ files:
673
673
  - app/assets/images/favicons/wikipedia.png
674
674
  - app/assets/images/thredded/breadcrumb-chevron.svg
675
675
  - app/assets/images/thredded/follow.svg
676
+ - app/assets/images/thredded/lock.svg
676
677
  - app/assets/images/thredded/moderation.svg
677
678
  - app/assets/images/thredded/private-messages.svg
678
679
  - app/assets/images/thredded/settings.svg
@@ -872,6 +873,7 @@ files:
872
873
  - app/views/thredded/messageboard_groups/new.html.erb
873
874
  - app/views/thredded/messageboards/_form.html.erb
874
875
  - app/views/thredded/messageboards/_messageboard.html.erb
876
+ - app/views/thredded/messageboards/_messageboard_meta.html.erb
875
877
  - app/views/thredded/messageboards/edit.html.erb
876
878
  - app/views/thredded/messageboards/index.html.erb
877
879
  - app/views/thredded/messageboards/new.html.erb
@@ -968,9 +970,10 @@ files:
968
970
  - app/views/thredded/users/_link.html.erb
969
971
  - app/views/thredded/users/_post.html.erb
970
972
  - app/views/thredded/users/_posts.html.erb
971
- - bin/create_migration_fixture
972
973
  - bin/rails
974
+ - bin/rubocop
973
975
  - config/i18n-tasks.yml
976
+ - config/locales/de.yml
974
977
  - config/locales/en.yml
975
978
  - config/locales/es.yml
976
979
  - config/locales/fr.yml
@@ -988,6 +991,7 @@ files:
988
991
  - db/upgrade_migrations/20170125033319_upgrade_v0_9_to_v0_10.rb
989
992
  - db/upgrade_migrations/20170312131417_upgrade_thredded_v0_10_to_v0_11.rb
990
993
  - db/upgrade_migrations/20170420163138_upgrade_thredded_v0_11_to_v0_12.rb
994
+ - db/upgrade_migrations/20170811090735_upgrade_thredded_v0_13_to_v_014.rb
991
995
  - lib/generators/thredded/install/USAGE
992
996
  - lib/generators/thredded/install/install_generator.rb
993
997
  - lib/generators/thredded/install/templates/initializer.rb
@@ -1035,7 +1039,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1035
1039
  version: '0'
1036
1040
  requirements: []
1037
1041
  rubyforge_project:
1038
- rubygems_version: 2.6.14
1042
+ rubygems_version: 2.6.12
1039
1043
  signing_key:
1040
1044
  specification_version: 4
1041
1045
  summary: The best Rails forums engine ever.
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # edit constants in lib/thredded/db_tools.rb
4
- # git checkout v0.x.0 -b create-0.x-migration-fixture
5
- # bundle
6
-
7
- DIR=$(pwd)
8
-
9
- cd spec/dummy && DB=sqlite3 rails db:environment:set RAILS_ENV=development
10
- cd $DIR
11
- DB=sqlite3 rake db:drop db:create db:migrate db:miniseed_dump
12
-
13
- cd spec/dummy && DB=postgresql rails db:environment:set RAILS_ENV=development
14
- cd $DIR
15
- DB=postgresql rake db:drop db:create db:migrate db:miniseed_dump
16
-
17
- cd spec/dummy && DB=mysql2 rails db:environment:set RAILS_ENV=development
18
- cd $DIR
19
- DB=mysql2 rake db:drop db:create db:migrate db:miniseed_dump
20
-
21
- git add `pwd`/spec/migration/*.dump
22
-
23
- git commit -em "add sample data for 0.8 base for migration spec"