Use correct loading mode of Bootstrap-Markdown

data-provide="markdown-editable" is intended for inline editing of page
content à la contenteditable. When this is applied to a textarea, the
editor is loaded only after the user clicks on the field. This behavior
breaks focus and is incompatible with keyboard navigation.
This commit is contained in:
Andrew Kvalheim 2020-04-04 21:48:31 -07:00 committed by Henne Vogelsang
parent 0646e41a82
commit ce59c37ff6
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
15 changed files with 19 additions and 19 deletions

View file

@ -17,7 +17,7 @@
input_html: { class: 'form-control',
id: 'registration-period-end-datepicker' }
= f.input :description, hint: markdown_hint,
input_html: { rows: 2, data: { provide: 'markdown-editable' } }
input_html: { rows: 2, data: { provide: 'markdown' } }
- if cfp.cfp_type == 'events'
= f.input :enable_registrations, as: :boolean,
hint: 'Allow submitters to request registration?'

View file

@ -9,7 +9,7 @@
= semantic_form_for(@conference, url: admin_conference_path(@conference.short_title), html: {multipart: true}) do |f|
= f.input :title, hint: "The full title of the conference, e.g. 'openSUSE Conference 2014'"
= f.input :short_title, hint: "A short title, e.g. 'oSC14', to be used in URLs"
= f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :description, hint: markdown_hint('A description of the conference.'), input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :color, hint: 'The color will be used eg for the dashboard.', input_html: {size: 6, type: 'color'}
= f.label 'Conference Logo'
%br

View file

@ -11,7 +11,7 @@
= semantic_form_for(@lodging, url: (@lodging.new_record? ? admin_conference_lodgings_path : admin_conference_lodging_path(@conference.short_title, @lodging))) do |f|
= f.input :name, input_html: { autofocus: true}
= f.input :website_link, input_html: { type: :url }
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint
- if @lodging.picture?
= image_tag @lodging.picture.thumb.url
= f.input :picture

View file

@ -2,11 +2,11 @@
= f.inputs name: 'Organization details' do
= f.input :name, as: :string, required: true
= f.input :description, as: :text,
input_html: { rows: 10, data: { provide: 'markdown-editable' } },
input_html: { rows: 10, data: { provide: 'markdown' } },
hint: markdown_hint,
placeholder: 'Decribe about your organization...'
= f.input :code_of_conduct, as: :text,
input_html: { rows: 10, data: { provide: 'markdown-editable' } },
input_html: { rows: 10, data: { provide: 'markdown' } },
hint: markdown_hint,
placeholder: 'Rules governing behavior and dispute resolution...'
= image_tag f.object.picture.thumb.url if f.object.picture?

View file

@ -9,7 +9,7 @@
.col-md-8
= semantic_form_for(@resource, :url => (@resource.new_record? ? admin_conference_resources_path : admin_conference_resource_path(@conference.short_title, @resource))) do |f|
= f.input :name, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :used
= f.input :quantity
%p.text-right

View file

@ -10,7 +10,7 @@
.col-md-8
= semantic_form_for(@sponsor, url: (@sponsor.new_record? ? admin_conference_sponsors_path : admin_conference_sponsor_path(@conference.short_title, @sponsor))) do |f|
= f.input :name, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint
= image_tag f.object.picture.thumb.url if f.object.picture?
= f.input :picture
= f.input :website_url

View file

@ -10,7 +10,7 @@
.col-md-8
= semantic_form_for(@ticket, url: (@ticket.new_record? ? admin_conference_tickets_path : admin_conference_ticket_path(@conference.short_title, @ticket))) do |f|
= f.input :title, input_html: { autofocus: true }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }
= f.input :price
= f.input :price_currency, as: :select, class: 'form-control', collection: ['USD', 'EUR', 'GBP', 'INR', 'CNY', 'CHF'], include_blank: false
= f.input :registration_ticket, hint: 'A registration ticket is with which user register for the conference.'

View file

@ -23,6 +23,6 @@
with
= link_to 'rooms', admin_conference_venue_rooms_path(@conference.short_title)
, if you want to select a room for the track.
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown' } }, hint: markdown_hint
= f.input :cfp_active, label: 'Allow event submitters to select this track for their proposal'
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -20,7 +20,7 @@
= f.input :email
= f.input :password if @user.new_record?
= f.input :affiliation, as: :string
= f.input :biography, input_html: { rows: 10, data: { provide: 'markdown-editable' } },
= f.input :biography, input_html: { rows: 10, data: { provide: 'markdown' } },
hint: markdown_hint
= f.actions do
= f.action :submit, button_html: {class: 'btn btn-primary'}

View file

@ -14,7 +14,7 @@
.col-md-8
= semantic_form_for(@venue, url: admin_conference_venue_path(@conference.short_title)) do |f|
= f.inputs :name, :website
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown-editable' } }, hint: markdown_hint
= f.input :description, input_html: { rows: 5, cols: 20, data: { provide: 'markdown' } }, hint: markdown_hint
= f.label 'Venue Logo'
%br
- if @venue.picture?

View file

@ -3,11 +3,11 @@
.col-md-8
= semantic_form_for(@booth, url: @url, html: { multipart: true }) do |f|
= f.input :title, as: :string, input_html: { autofocus: true }, required: true
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
= f.input :description, input_html: { rows: 5, data: { provide: 'markdown' } }, required: true,
hint: 'This field becomes public upon request acceptance'
= f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
= f.input :reasoning, input_html: { rows: 5, data: { provide: 'markdown' } }, required: true,
label: 'How it fits the conference'
= f.input :submitter_relationship, input_html: { rows: 5, data: { provide: 'markdown-editable' } }, required: true,
= f.input :submitter_relationship, input_html: { rows: 5, data: { provide: 'markdown' } }, required: true,
label: 'Submitter\'s relation',
hint: 'e.g. employee, comunity manager, etc'
= f.input :website_url

View file

@ -29,7 +29,7 @@
%span{ class: 'help-block select-help-text collapse event_difficulty_level_id', id: "#{difficulty_level.id}-help" }
= difficulty_level.description
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } },
hint: markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)')
%p

View file

@ -45,7 +45,7 @@
%span{ class: 'help-block event_event_type_id collapse', id: "#{event_type.id}-help" }
= event_type.description
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
= f.input :abstract, required: true, input_html: { rows: 5, data: { provide: 'markdown' } },
hint: markdown_hint('[Tips to improve your presentations.](http://blog.hubspot.com/blog/tabid/6307/bid/5975/10-Rules-to-Instantly-Improve-Your-Presentations.aspx)')
%p

View file

@ -15,6 +15,6 @@
= f.input :color, input_html: {size: 6, type: 'color'}, required: true
= f.input :start_date, as: :string, input_html: { id: 'registration-period-start-datepicker', start_date: @conference.start_date, end_date: @conference.end_date, readonly: 'readonly' }
= f.input :end_date, as: :string, input_html: { id: 'registration-period-end-datepicker', readonly: 'readonly' }
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown-editable' } }, required: true, hint: "This will be public #{markdown_hint}".html_safe
= f.input :relevance, input_html: {rows: 5, data: { provide: 'markdown-editable' } }, required: true, hint: "Please explain here how this track relates to the conference, how you are related to its content and why we should accept it. #{markdown_hint}".html_safe
= f.input :description, input_html: {rows: 2, data: { provide: 'markdown' } }, required: true, hint: "This will be public #{markdown_hint}".html_safe
= f.input :relevance, input_html: {rows: 5, data: { provide: 'markdown' } }, required: true, hint: "Please explain here how this track relates to the conference, how you are related to its content and why we should accept it. #{markdown_hint}".html_safe
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }

View file

@ -14,7 +14,7 @@
= link_to 'Change your avatar here', 'https://gravatar.com'
= f.input :affiliation, as: :string,
hint: 'This could be a company, a user group, or nothing at all.'
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown-editable' } },
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown' } },
hint: markdown_hint
You have used
%span#bio_length