Commit 0284917c authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove inline JS in links

Changes these to use unobtrusive JS
parent 80c57bf6
...@@ -96,7 +96,7 @@ a { ...@@ -96,7 +96,7 @@ a {
} }
.error-nav { .error-nav {
padding: 0; padding: $gl-padding 0 0;
text-align: center; text-align: center;
li { li {
......
- submit_btn_css ||= 'btn btn-link btn-remove btn-sm' - submit_btn_css ||= 'btn btn-link btn-remove btn-sm'
= form_tag admin_application_path(application) do = form_tag admin_application_path(application) do
%input{ :name => "_method", :type => "hidden", :value => "delete" }/ %input{ :name => "_method", :type => "hidden", :value => "delete" }/
= submit_tag 'Destroy', onclick: "return confirm('Are you sure?')", class: submit_btn_css = submit_tag 'Destroy', class: submit_btn_css, data: { confirm: _('Are you sure?') }
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
= form_tag path do = form_tag path do
%input{ :name => "_method", :type => "hidden", :value => "delete" }/ %input{ :name => "_method", :type => "hidden", :value => "delete" }/
= submit_tag _('Revoke'), onclick: "return confirm('#{_('Are you sure?')}')", class: 'btn btn-remove btn-sm' = submit_tag _('Revoke'), class: 'btn btn-remove btn-sm', data: { confirm: _('Are you sure?') }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
= message = message
%p %p
= s_('403|Please contact your GitLab administrator to get permission.') = s_('403|Please contact your GitLab administrator to get permission.')
.action-container.js-go-back{ style: 'display: none' } .action-container.js-go-back{ hidden: true }
%a{ href: 'javascript:history.back()', class: 'btn btn-success' } %button{ type: 'button', class: 'btn btn-success' }
= s_('Go Back') = s_('Go Back')
= render "errors/footer" = render "errors/footer"
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
var goBackElement = document.querySelector('.js-go-back'); var goBackElement = document.querySelector('.js-go-back');
if (goBackElement && history.length > 1) { if (goBackElement && history.length > 1) {
goBackElement.style.display = 'block'; goBackElement.removeAttribute('hidden');
goBackElement.querySelector('button').addEventListener('click', function() {
history.back();
});
} }
}()); }());
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
= s_('AccessTokens|It cannot be used to access any other data.') = s_('AccessTokens|It cannot be used to access any other data.')
.col-lg-8.feed-token-reset .col-lg-8.feed-token-reset
= label_tag :feed_token, s_('AccessTokens|Feed token'), class: "label-bold" = label_tag :feed_token, s_('AccessTokens|Feed token'), class: "label-bold"
= text_field_tag :feed_token, current_user.feed_token, class: 'form-control', readonly: true, onclick: 'this.select()' = text_field_tag :feed_token, current_user.feed_token, class: 'form-control js-select-on-focus', readonly: true
%p.form-text.text-muted %p.form-text.text-muted
- reset_link = link_to s_('AccessTokens|reset it'), [:reset, :feed_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any RSS or calendar URLs currently in use will stop working.') } - reset_link = link_to s_('AccessTokens|reset it'), [:reset, :feed_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any RSS or calendar URLs currently in use will stop working.') }
- reset_message = s_('AccessTokens|Keep this token secret. Anyone who gets ahold of it can read activity and issue RSS feeds or your calendar feed as if they were you. You should %{link_reset_it} if that ever happens.') % { link_reset_it: reset_link } - reset_message = s_('AccessTokens|Keep this token secret. Anyone who gets ahold of it can read activity and issue RSS feeds or your calendar feed as if they were you. You should %{link_reset_it} if that ever happens.') % { link_reset_it: reset_link }
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
= s_('AccessTokens|It cannot be used to access any other data.') = s_('AccessTokens|It cannot be used to access any other data.')
.col-lg-8.incoming-email-token-reset .col-lg-8.incoming-email-token-reset
= label_tag :incoming_email_token, s_('AccessTokens|Incoming email token'), class: "label-bold" = label_tag :incoming_email_token, s_('AccessTokens|Incoming email token'), class: "label-bold"
= text_field_tag :incoming_email_token, current_user.incoming_email_token, class: 'form-control', readonly: true, onclick: 'this.select()' = text_field_tag :incoming_email_token, current_user.incoming_email_token, class: 'form-control js-select-on-focus', readonly: true
%p.form-text.text-muted %p.form-text.text-muted
- reset_link = link_to s_('AccessTokens|reset it'), [:reset, :incoming_email_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any issue email addresses currently in use will stop working.') } - reset_link = link_to s_('AccessTokens|reset it'), [:reset, :incoming_email_token, :profile], method: :put, data: { confirm: s_('AccessTokens|Are you sure? Any issue email addresses currently in use will stop working.') }
- reset_message = s_('AccessTokens|Keep this token secret. Anyone who gets ahold of it can create issues as if they were you. You should %{link_reset_it} if that ever happens.') % { link_reset_it: reset_link } - reset_message = s_('AccessTokens|Keep this token secret. Anyone who gets ahold of it can create issues as if they were you. You should %{link_reset_it} if that ever happens.') % { link_reset_it: reset_link }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment