2018-06-04 00:06:17 +08:00
|
|
|
(function (global, document) {
|
2018-06-24 10:01:21 +08:00
|
|
|
"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;
|
|
|
|
|
2018-12-20 13:48:43 +08:00
|
|
|
global.domainDelete(data.domains[data.cd].domain, function(success) {
|
2018-06-24 10:01:21 +08:00
|
|
|
if (success) {
|
|
|
|
document.location = global.origin + "/dashboard";
|
|
|
|
}
|
2018-06-04 00:06:17 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-04-14 09:02:40 +08:00
|
|
|
// Clears all comments in a domain.
|
|
|
|
global.domainClearHandler = function() {
|
|
|
|
var data = global.dashboard.$data;
|
|
|
|
|
|
|
|
global.domainClear(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"
|
2018-12-20 13:48:43 +08:00
|
|
|
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"
|
2018-12-20 13:48:43 +08:00
|
|
|
global.domainUpdate(data.domains[data.cd])
|
2018-06-04 00:06:17 +08:00
|
|
|
document.location.hash = "#modal-close";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-20 13:48:43 +08:00
|
|
|
} (window.commento, document));
|