mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Removed the last inline scripts.
This commit is contained in:
parent
1c7c3bf2c5
commit
3ee8b26ddf
4 changed files with 20 additions and 2 deletions
|
@ -0,0 +1,8 @@
|
|||
import {Controller} from "@hotwired/stimulus";
|
||||
|
||||
export default class extends Controller
|
||||
{
|
||||
download(event) {
|
||||
this.element.href = document.getElementById('pdf_preview').data
|
||||
}
|
||||
}
|
10
assets/controllers/pages/u2f_register_controller.js
Normal file
10
assets/controllers/pages/u2f_register_controller.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import {Controller} from "@hotwired/stimulus";
|
||||
|
||||
export default class extends Controller
|
||||
{
|
||||
connect() {
|
||||
this.element.onclick = function() {
|
||||
window.u2fauth.register();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -99,7 +99,7 @@
|
|||
{% if pdf_data %}
|
||||
<div class="row">
|
||||
<div class="col-sm-9 offset-sm-3">
|
||||
<a data-turbo="false" class="btn btn-secondary" href="#" onclick="this.href = document.getElementById('pdf_preview').data" download="{{ filename ?? '' }}">
|
||||
<a data-turbo="false" class="btn btn-secondary" href="#" {{ stimulus_controller('pages/label_download_btn')}} {{ stimulus_action('pages/label_download_btn', 'download')}} download="{{ filename ?? '' }}">
|
||||
{% trans %}label_generator.download{% endtrans %}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<input type="text" class="form-control " name="keyName" id="keyName" placeholder="{{ 'r_u2f_two_factor.name'|trans }}"/>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<button type="button" class="btn btn-success" onclick="u2fauth.register()">{% trans %}tfa_u2f.add_key.add_button{% endtrans %}</button>
|
||||
<button type="button" class="btn btn-success" {{ stimulus_controller('pages/u2f_register') }}>{% trans %}tfa_u2f.add_key.add_button{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="u2fpressbutton" style="display: none;" class="text-center h4">{{ 'r_u2f_two_factor.pressbutton'|trans }}</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue