Regression caused by the upgrade to Webpacker 6.0 in 90cd3293e. This
caused various Javascript errors in old versions of Chrome, which
somehow resulted in the keyboard shortcut for visiting the next page
being triggered when you pressed any key.
Specifically, the mobx library (used by the TagCounter component) called
`Object.entries`, which isn't available in Chrome 49, and for some
unknown reason this triggered the buggy shortcut behavior.
`Object.entries` is supposed to be automatically polyfilled by Babel to
support old browsers, but something changed in Webpacker 6 that broke
this and I couldn't get it working again. The probable cause is that
Webpacker 6 no longer transpiles code inside ./node_modules by default,
which means that any libraries we use that use new Javascript features
won't get transpiled down to support old browsers, but even after fixing
that it still didn't work. The workaround is to just drop mobx and
preact entirely to avoid the issue.
74 lines
3.0 KiB
Plaintext
74 lines
3.0 KiB
Plaintext
<% unless CurrentUser.user.is_builder? %>
|
|
<div style="margin-bottom: 1em;">
|
|
<p>Before editing, read the <%= link_to "how to tag guide", wiki_page_path(:id => "howto:tag") %>.</p>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= render "sources/info" %>
|
|
|
|
<%= edit_form_for(post, html: { id: "form" }) do |f| %>
|
|
<%= f.input :tags_query, as: :hidden, input_html: { id: nil, name: "tags_query", value: params[:q] } %>
|
|
<%= f.input :pool_id, as: :hidden, input_html: { id: nil, name: "pool_id", value: params[:pool_id] } %>
|
|
<%= f.input :favgroup_id, as: :hidden, input_html: { id: nil, name: "favgroup_id", value: params[:favgroup_id] } %>
|
|
<%= f.input :old_tag_string, as: :hidden, input_html: { value: post.tag_string } %>
|
|
<%= f.input :old_parent_id, as: :hidden, input_html: { value: post.parent_id } %>
|
|
<%= f.input :old_source, as: :hidden, input_html: { value: post.source } %>
|
|
<%= f.input :old_rating, as: :hidden, input_html: { value: post.rating } %>
|
|
|
|
<% if post.is_rating_locked? %>
|
|
This post is rating locked.
|
|
<% else %>
|
|
<%= f.input :rating, collection: [["Explicit", "e"], ["Questionable", "q"], ["Safe", "s"]], as: :radio_buttons, boolean_style: :inline %>
|
|
<% end %>
|
|
|
|
<fieldset class="inline-fieldset post_has_embedded_notes_fieldset">
|
|
<label>Notes</label>
|
|
<%= f.input :has_embedded_notes, label: "Embed notes", as: :boolean, boolean_style: :inline, disabled: post.is_note_locked? %>
|
|
</fieldset>
|
|
|
|
<% if policy(post).can_lock_rating? || policy(post).can_lock_notes? || policy(post).can_lock_status? %>
|
|
<fieldset class="inline-fieldset post_lock_fieldset">
|
|
<label>Lock</label>
|
|
|
|
<% if policy(post).can_lock_rating? %>
|
|
<%= f.input :is_rating_locked, label: "Rating", as: :boolean, boolean_style: :inline %>
|
|
<% end %>
|
|
<% if policy(post).can_lock_notes? %>
|
|
<%= f.input :is_note_locked, label: "Notes", as: :boolean, boolean_style: :inline %>
|
|
<% end %>
|
|
<% if policy(post).can_lock_status? %>
|
|
<%= f.input :is_status_locked, label: "Status", as: :boolean, boolean_style: :inline %>
|
|
<% end %>
|
|
</fieldset>
|
|
<% end %>
|
|
|
|
<%= f.input :parent_id, label: "Parent", input_html: { size: 60 }, as: :string %>
|
|
<%= f.input :source, input_html: { size: 60 } %>
|
|
|
|
<div class="input fixed-width-container" id="tags-container">
|
|
<div class="header">
|
|
<%= f.label :tag_string, "Tags" %>
|
|
|
|
<span data-tag-counter data-for="#post_tag_string">
|
|
<span class="tag-count"></span>
|
|
<img>
|
|
</span>
|
|
<a href="javascript:void(0)">
|
|
<%= external_link_icon(id: "open-edit-dialog", "data-shortcut": "shift+e") %>
|
|
</a>
|
|
</div>
|
|
|
|
<div>
|
|
<%= f.input :tag_string, label: false, hint: "Ctrl+Enter to submit", input_html: { size: "60x5", "data-autocomplete": "tag-edit", "data-shortcut": "e", value: post.presenter.split_tag_list_text + " " } %>
|
|
</div>
|
|
|
|
<%= render "related_tags/buttons" %>
|
|
</div>
|
|
|
|
<div class="input">
|
|
<%= f.submit "Submit" %>
|
|
</div>
|
|
|
|
<%= render "related_tags/container" %>
|
|
<% end %>
|