-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Unique Toolbar Button IDs #8995
Merged
jywarren
merged 3 commits into
publiclab:main
from
noi5e:feature/add-toolbar-button-IDs
Jan 12, 2021
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<div class="btn-toolbar" style="margin-bottom:8px;"> | ||
|
||
<div class="dropdown mr-2"> | ||
<div class="d-md-none d-lg-inline"> | ||
<a class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" href="#" > | ||
|
@@ -13,28 +12,66 @@ | |
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- defined in application_helper.rb --> | ||
<% toolbar_element_id = get_toolbar_element_id(location, local_assigns[:reply_to], local_assigns[:comment_id]) %> | ||
<div class="btn-group mr-2 "> | ||
<a data-toggle="tooltip" title="Bold" data-placement="bottom" class="btn btn-outline-secondary btn-sm " onClick="$E.bold()"><i class="fa fa-bold" ></i></a> | ||
<a data-toggle="tooltip" title="Italic" data-placement="bottom" class="btn btn-outline-secondary btn-sm " onClick="$E.italic()"><i class="fa fa-italic" ></i></a> | ||
<a data-toggle="tooltip" title="Header" data-placement="bottom" class="btn btn-outline-secondary btn-sm " onClick="$E.h2()"><b><span class="d-md-none d-lg-inline"><i class="fa fa-header"></i></span></b></a> | ||
<a aria-label="Make a link" data-toggle="tooltip" title="Make a link" data-placement="bottom" class="btn btn-outline-secondary btn-sm" href="javascript:void(0)" onClick="$E.link()"><i class="fa fa-link"></i></a> | ||
<a aria-label="Upload an image" data-toggle="tooltip" title="Upload an image" data-placement="bottom" class="btn btn-outline-secondary btn-sm"> | ||
<% dropzone_small_id = '' %> | ||
<% case location | ||
when :main %> | ||
<% dropzone_small_id = 'main' %> | ||
<% when :reply %> | ||
<% dropzone_small_id = 'reply-' + local_assigns[:reply_to].to_s %> | ||
<% when :edit %> | ||
<% dropzone_small_id = 'edit-' + comment_id %> | ||
<% when :responses %> | ||
<% dropzone_small_id = 'responses' %> | ||
<% end %> | ||
<div id="dropzone-small-<%= dropzone_small_id %>" class="dropzone"> | ||
<a | ||
id="bold-button-<%= toolbar_element_id %>" | ||
data-toggle="tooltip" | ||
title="Bold" | ||
data-placement="bottom" | ||
class="bold-button btn btn-outline-secondary btn-sm" | ||
onClick="$E.bold()" | ||
> | ||
<i class="fa fa-bold" ></i> | ||
</a> | ||
<a | ||
id="italic-button-<%= toolbar_element_id %>" | ||
data-toggle="tooltip" | ||
title="Italic" | ||
data-placement="bottom" | ||
class="italic-button btn btn-outline-secondary btn-sm" | ||
onClick="$E.italic()" | ||
> | ||
<i class="fa fa-italic" ></i> | ||
</a> | ||
<a | ||
id="header-button-<%= toolbar_element_id %>" | ||
data-toggle="tooltip" | ||
title="Header" | ||
data-placement="bottom" | ||
class="header-button btn btn-outline-secondary btn-sm" | ||
onClick="$E.h2()" | ||
> | ||
<b> | ||
<span class="d-md-none d-lg-inline"> | ||
<i class="fa fa-header"></i> | ||
</span> | ||
</b> | ||
</a> | ||
<a | ||
id="link-button-<%= toolbar_element_id %>" | ||
aria-label="Make a link" | ||
data-toggle="tooltip" | ||
title="Make a link" | ||
data-placement="bottom" | ||
class="link-button btn btn-outline-secondary btn-sm" href="javascript:void(0)" | ||
onClick="$E.link()" | ||
> | ||
<i class="fa fa-link"></i> | ||
</a> | ||
<a | ||
id="image-upload-button-<%= toolbar_element_id %>" | ||
aria-label="Upload an image" | ||
data-toggle="tooltip" | ||
title="Upload an image" | ||
data-placement="bottom" | ||
class="upload-button btn btn-outline-secondary btn-sm" | ||
> | ||
<div id="dropzone-small-<%= toolbar_element_id %>" class="dropzone"> | ||
<span id="create_prompt" class="prompt"> | ||
<label class="" for="fileinput-button-<%= dropzone_small_id %>" style="margin-bottom: 0;"> | ||
<input id="fileinput-button-<%= dropzone_small_id %>" class="fileinput" type="file" name="image[photo]" accept="image/*" style="display:none;" /> | ||
<label class="" for="fileinput-button-<%= toolbar_element_id %>" style="margin-bottom: 0;"> | ||
<input id="fileinput-button-<%= toolbar_element_id %>" class="fileinput" type="file" name="image[photo]" accept="image/*" style="display:none;" /> | ||
<i class="fa fa-image"></i> | ||
<span class="d-md-none"> | ||
<i class="fa fa-upload"></i> | ||
|
@@ -46,12 +83,40 @@ | |
</div> | ||
|
||
<div class="btn-group mr-2 "> | ||
<a data-toggle="tooltip" title="Save" data-placement="bottom" onClick="$E.save()" class="btn btn-outline-secondary btn-sm"><i class="fa fa-save"></i></a> | ||
<a data-toggle="tooltip" title="Recover" data-placement="bottom" onClick="$E.recover()" class="btn btn-outline-secondary btn-sm">Recover</a> | ||
<a | ||
id="save-button-<%= toolbar_element_id %>" | ||
data-toggle="tooltip" | ||
title="Save" | ||
data-placement="bottom" | ||
onClick="$E.save()" | ||
class="save-button btn btn-outline-secondary btn-sm" | ||
> | ||
<i class="fa fa-save"></i> | ||
</a> | ||
<a | ||
id="recover-button-<%= toolbar_element_id %>" | ||
data-toggle="tooltip" | ||
title="Recover" | ||
data-placement="bottom" | ||
onClick="$E.recover()" | ||
class="recover-button btn btn-outline-secondary btn-sm" | ||
> | ||
Recover | ||
</a> | ||
</div> | ||
|
||
<div class="btn-group"> | ||
<a aria-label="Help" data-toggle="tooltip" title="Help" data-placement="bottom" class="btn btn-outline-secondary btn-sm" target="_blank" href="/wiki/authoring-help"><i class="fa fa-question-circle" ></i></a> | ||
<a | ||
id="help-button-<%= toolbar_element_id %>" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. appreciate the formatting work here. Thanks! |
||
aria-label="Help" | ||
data-toggle="tooltip" | ||
title="Help" | ||
data-placement="bottom" | ||
class="help-button btn btn-outline-secondary btn-sm" | ||
target="_blank" | ||
href="/wiki/authoring-help" | ||
> | ||
<i class="fa fa-question-circle"></i> | ||
</a> | ||
</div> | ||
|
||
</div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the comment here, these can be tough to trace! There is the ability to make view-specific helpers like
editor_helper.rb
but often if they only contain a few lines, it can make them harder to find!