Skip to content

Instantly share code, notes, and snippets.

@awartoft
Created November 7, 2012 16:26
Show Gist options
  • Save awartoft/4032622 to your computer and use it in GitHub Desktop.
Save awartoft/4032622 to your computer and use it in GitHub Desktop.
show: function()
{
var domains = this.grid.getSelectedDomains();
var first = undefined, size = 0;
for (var i in domains) {
if (domains.hasOwnProperty(i) && typeof(i) !== 'function') {
if (first == undefined) {
first = domains[i];
}
// increment
size += 1;
}
}
if (size != 1) {
this.titleNode.innerHTML = 'Raw whois information';
this.containerNode.innerHTML = 'You must only specify a single domain to view the raw whois information.';
this.inherited(arguments);
} else {
// show the loading modal
this.loadingModal.show();
xhr.get({
url: '/api/domain/whois/' + first,
handleAs: 'json',
load: lang.hitch(this, function(data) {
if (data.whois == null) {
data.whois = 'An error occurred';
}
this.containerNode.innerHTML = '<pre>' + data.whois + '</pre>';
this.inherited(arguments);
console.log(this.loadingModal.hide());
})
});
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment