commento/frontend/js/dashboard-danger.js

44 lines
987 B
JavaScript
Raw Normal View History

2018-06-04 00:06:17 +08:00
(function (global, document) {
"use strict";
2018-06-04 00:06:17 +08:00
// Opens the danger zone.
global.dangerOpen = function() {
$(".view").hide();
$("#danger-view").show();
};
// Deletes a domain.
global.domainDeleteHandler = function() {
var data = global.dashboard.$data;
global.domainDelete(data.domains[data.cd].domain, function(success) {
if (success) {
document.location = global.origin + "/dashboard";
}
2018-06-04 00:06:17 +08:00
});
}
// Freezes a domain.
global.domainFreezeHandler = function() {
var data = global.dashboard.$data;
data.domains[data.cd].state = "frozen"
global.domainUpdate(data.domains[data.cd])
2018-06-04 00:06:17 +08:00
document.location.hash = "#modal-close";
}
// Unfreezes a domain.
global.domainUnfreezeHandler = function() {
var data = global.dashboard.$data;
data.domains[data.cd].state = "unfrozen"
global.domainUpdate(data.domains[data.cd])
2018-06-04 00:06:17 +08:00
document.location.hash = "#modal-close";
}
} (window.commento, document));