Merge pull request #79 from ivanfilippov/scriptroot_fix

Scriptroot fix
This commit is contained in:
Khanh Ngo 2016-07-07 13:09:59 +07:00 committed by GitHub
commit 92d43f10b1
8 changed files with 14 additions and 12 deletions

View File

@ -97,7 +97,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-flat btn-default pull-left"
data-dismiss="modal">Close</button>
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', '/admin/history');location.reload();">Clear
<button type="button" class="btn btn-flat btn-danger" onclick="applyChanges('', $SCRIPT_ROOT + '/admin/history');location.reload();">Clear
History</button>
</div>
</div>

View File

@ -91,7 +91,7 @@
modal.find('.modal-body p').text(info);
modal.find('#button_revoke_confirm').click(function() {
var postdata = {'action': 'revoke_user_privielges', 'data': username}
applyChanges(postdata, '/admin/manageuser');
applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser');
modal.modal('hide');
})
modal.modal('show');
@ -104,7 +104,7 @@
modal.find('.modal-body p').text(info);
modal.find('#button_delete_confirm').click(function() {
var postdata = {'action': 'delete_user', 'data': username}
applyChanges(postdata, '/admin/manageuser', false, true);
applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser', false, true);
modal.modal('hide');
})
modal.modal('show');
@ -128,7 +128,7 @@
'is_admin' : is_admin
}
};
applyChanges(postdata, '/admin/manageuser');
applyChanges(postdata, $SCRIPT_ROOT + '/admin/manageuser');
});
</script>
{% endblock %}

View File

@ -76,14 +76,14 @@
});
$(document.body).on('click', '.setting-toggle-button', function() {
var setting = $(this).prop('id');
applyChanges('','/admin/setting/' + setting + '/toggle', false, true)
applyChanges('', $SCRIPT_ROOT + '/admin/setting/' + setting + '/toggle', false, true)
});
$(document.body).on('click', '.setting-save-button', function() {
var setting = $(this).prop('id');
var value = $(this).parents('tr').find('#value')[0].value;
var postdata = {'value': value};
applyChanges(postdata, '/admin/setting/' + setting + '/edit', false, true)
applyChanges(postdata, $SCRIPT_ROOT + '/admin/setting/' + setting + '/edit', false, true)
});
</script>
{% endblock %}

View File

@ -163,7 +163,9 @@
</footer>
</div>
<!-- ./wrapper -->
<script type="text/javascript">
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
</script>
{% block scripts %}
<!-- jQuery 2.2.0 -->
<script src="{{ url_for('static', filename='adminlte2/plugins/jQuery/jQuery-2.2.0.min.js') }}"></script>

View File

@ -240,7 +240,7 @@
});
$(document.body).on("click", ".button_dnssec", function() {
var domain = $(this).prop('id');
getdnssec('/domain/' + domain + '/dnssec');
getdnssec($SCRIPT_ROOT + '/domain/' + domain + '/dnssec');
});
</script>
{% endblock %}

View File

@ -204,7 +204,7 @@
modal.find('.modal-body p').text(info);
modal.find('#button_apply_confirm').click(function() {
var data = getTableData(table);
applyChanges(data, '/domain/' + domain + '/apply', true);
applyChanges(data, $SCRIPT_ROOT + '/domain/' + domain + '/apply', true);
modal.modal('hide');
})
modal.modal('show');
@ -253,7 +253,7 @@
//handle update_from_master button
$(document.body).on("click", ".button_update_from_master", function (e) {
var domain = $(this).prop('id');
applyChanges({'domain': domain}, '/domain/' + domain + '/update');
applyChanges({'domain': domain}, $SCRIPT_ROOT + '/domain/' + domain + '/update');
});
{% if record_helper_setting %}

View File

@ -108,7 +108,7 @@ $('.dyndns_on_demand_toggle').on('ifToggled', function(event) {
'value' : is_checked
}
};
applyChanges(postdata, '/domain/' + domain + '/managesetting', true);
applyChanges(postdata, $SCRIPT_ROOT + '/domain/' + domain + '/managesetting', true);
});
// handle deletion of user

View File

@ -165,7 +165,7 @@
'enable_otp' : enable_otp
}
};
applyChanges(postdata, '/user/profile');
applyChanges(postdata, $SCRIPT_ROOT + '/user/profile');
location.reload();
});
</script>