Remove inline js (#16308)
* Removed inline onclick javascript Signed-off-by: Nikkolai Fernandez <nikkolaifernandez14@gmail.com>
This commit is contained in:
parent
28436399dd
commit
aa8c4a773c
10
js/export.js
10
js/export.js
@ -1042,4 +1042,14 @@ AJAX.registerOnload('export.js', function () {
|
||||
e.preventDefault();
|
||||
setSelectOptions(false);
|
||||
});
|
||||
|
||||
$('#buttonGo').on('click', function () {
|
||||
var timeLimit = parseInt($(this).attr('data-exec-time-limit'));
|
||||
|
||||
// If the time limit set is zero,
|
||||
// then time out won't occur so no need to check for time out.
|
||||
if (timeLimit > 0) {
|
||||
Export.checkTimeOut(timeLimit);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -5,4 +5,9 @@ AJAX.registerOnload('export_output.js', function () {
|
||||
$('#export_refresh_form').trigger('submit');
|
||||
}
|
||||
});
|
||||
|
||||
$('#export_refresh_btn').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#export_refresh_form').trigger('submit');
|
||||
});
|
||||
});
|
||||
|
||||
@ -923,6 +923,11 @@ $(function () {
|
||||
*/
|
||||
$(document).on('click', 'a.ajax.add_anchor, a.ajax.edit_anchor', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
if ($(this).hasClass('add_anchor')) {
|
||||
$.datepicker.initialized = false;
|
||||
}
|
||||
|
||||
var type = $(this).attr('href').substr(0, $(this).attr('href').indexOf('&'));
|
||||
if (type.indexOf('routine') !== -1) {
|
||||
type = 'routine';
|
||||
|
||||
@ -600,7 +600,7 @@ class Export
|
||||
$html .= $back_button;
|
||||
$refreshButton = '<form id="export_refresh_form" method="POST" action="'
|
||||
. Url::getFromRoute('/export') . '" class="disableAjax">';
|
||||
$refreshButton .= '[ <a class="disableAjax" onclick="$(this).parent().submit()">' . __('Refresh') . '</a> ]';
|
||||
$refreshButton .= '[ <a class="disableAjax" id="export_refresh_btn">' . __('Refresh') . '</a> ]';
|
||||
foreach ($_POST as $name => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $val) {
|
||||
|
||||
@ -100,7 +100,7 @@
|
||||
<legend>{% trans %}New{% context %}Create new event{% endtrans %}</legend>
|
||||
<div class="wrap">
|
||||
{% if has_privilege %}
|
||||
<a class="ajax add_anchor" href="{{ url('/database/events', {'db': db, 'add_item': true}) }}" onclick="$.datepicker.initialized = false;">
|
||||
<a class="ajax add_anchor" href="{{ url('/database/events', {'db': db, 'add_item': true}) }}">
|
||||
{{ get_icon('b_event_add') }}
|
||||
{% trans 'Add event' %}
|
||||
</a>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<legend>{% trans %}New{% context %}Create new routine{% endtrans %}</legend>
|
||||
<div class='wrap'>
|
||||
{% if has_privilege %}
|
||||
<a class="ajax add_anchor" href="{{ url('/database/routines', {'db': db, 'table': table, 'add_item': true}) }}" onclick="$.datepicker.initialized = false;">
|
||||
<a class="ajax add_anchor" href="{{ url('/database/routines', {'db': db, 'table': table, 'add_item': true}) }}">
|
||||
{{ get_icon('b_routine_add') }}
|
||||
{% trans 'Add routine' %}
|
||||
</a>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<legend>{% trans %}New{% context %}Create new trigger{% endtrans %}</legend>
|
||||
<div class='wrap'>
|
||||
{% if has_privilege %}
|
||||
<a class="ajax add_anchor" href="{{ url('/database/triggers', {'db': db, 'table': table, 'add_item': true}) }}" onclick="$.datepicker.initialized = false;">
|
||||
<a class="ajax add_anchor" href="{{ url('/database/triggers', {'db': db, 'table': table, 'add_item': true}) }}">
|
||||
{{ get_icon('b_trigger_add') }}
|
||||
{% trans 'Add trigger' %}
|
||||
</a>
|
||||
|
||||
@ -419,8 +419,6 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="exportoptions justify-content-end" id="submit">
|
||||
<input id="buttonGo" class="btn btn-primary" type="submit" value="{% trans 'Go' %}"
|
||||
{#- If the time limit set is zero, then time out won't occur so no need to check for time out. -#}
|
||||
{%- if exec_time_limit > 0 %} onclick="Export.checkTimeOut({{ exec_time_limit }})"{% endif %}>
|
||||
<input id="buttonGo" class="btn btn-primary" type="submit" value="{% trans 'Go' %}" data-exec-time-limit="{{ exec_time_limit }}">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user