-$(document).ready(function(){function a(a){$("#errorConfirmModal").remove(),$("#page-wrapper").append('<div class="modal fade" id="errorConfirmModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">'+language["javascript.error.title"]+'</h4></div><div class="modal-body"></div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#errorConfirmModal").find(".modal-body").text(a),$("#errorConfirmModal").modal({show:!0})}!function(){var t=void 0;$("span[delete-confirm]").unbind("click"),$("span[delete-confirm]").on("click",function(e){return e.preventDefault(),t=$(this),$("#dataConfirmModal").remove(),$("body").append('<div class="modal fade" id="dataConfirmModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">'+language["javascript.confirm"]+'</h4></div><div class="modal-body"></div><div class="modal-footer"><a class="btn btn-primary" id="dataConfirmOK">OK</a><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#dataConfirmModal").find(".modal-body").text(t.attr("delete-confirm")),$("#dataConfirmOK").unbind("click"),$("#dataConfirmOK").on("click",function(e){e.preventDefault(),$("#dataConfirmModal").modal("hide");var i=void 0,d=t.attr("delete-id");if(d){if(t.hasClass("deleteDomain"))i="deleteDomain";else if(t.hasClass("deleteRecord"))i="deleteRecord";else if(t.hasClass("deleteSec"))i="deleteSec";else{if(!t.hasClass("deleteUser"))return a(language["javascript.error"]),!1;i="deleteUser"}$.ajax({url:"index.php?page=action",data:{action:i,dataID:d},type:"post",success:function(e){if("success"==e){if(t.parent().parent().parent().parent().hasClass("dataTable")){var i=t.parent().parent().closest("tr").get(0),d=$(".dataTable").dataTable();d.fnDeleteRow(d.fnGetPosition(i))}t.parent().parent().remove()}else a(language["javascript.error"])}})}else a(language["javascript.error"]);return!1}),$("#dataConfirmModal").modal({show:!0}),!1})}(),function(){$("#requestApiKey").unbind("click"),$("#requestApiKey").on("click",function(){$.ajax({url:"index.php?page=action",data:{action:"requestApiKey",dataID:1},type:"post",success:function(t){"failure"==t?a(language["javascript.error"]):$("#apiKey").text(t)}})})}(),function(){$("span[toggle-id]").unbind("click"),$("span[toggle-id]").on("click",function(t){t.preventDefault();var e=$(this),i=void 0,d=e.attr("toggle-id");if(d){if(e.hasClass("toggleDomain"))i="toggleDomain";else if(e.hasClass("toggleRecord"))i="toggleRecord";else if(e.hasClass("toggleSec"))i="toggleSec";else{if(!e.hasClass("toggleUser"))return a(language["javascript.error"]),!1;i="toggleUser"}$.ajax({url:"index.php?page=action",data:{action:i,dataID:d},type:"post",success:function(t){"success"==t?e.hasClass("fa-square-o")?(e.removeClass("fa-square-o").addClass("fa-check-square-o"),e.tooltip("hide").attr("data-original-title",e.attr("data-disable-message")).tooltip("fixTitle").tooltip("show"),e.parent().parent().children().first().next().find("span.badge").remove()):e.hasClass("fa-check-square-o")?(e.removeClass("fa-check-square-o").addClass("fa-square-o"),e.tooltip("hide").attr("data-original-title",e.attr("data-enable-message")).tooltip("fixTitle").tooltip("show"),e.parent().parent().children().first().next().prepend('<span class="badge badge-red">'+language["domain.disabled"]+"</span> ")):a(language["javascript.error"]):a(language["javascript.error"])}})}else a(language["javascript.error"]);return!1})}(),function(){$(".dataTable").each(function(){var a=$(this),t=[],e=void 0,i=void 0,d=[],o=void 0;if(e=a.attr("data-sort")){var s=e.split(",");s.forEach(function(a){"asc"==a||"desc"==a?i=a.toString():d=[parseInt(a)]})}else i="asc",d=[0];if(e=a.attr("data-dontsort")){var s=e.split(",");s.forEach(function(a){t.push(parseInt(a))})}e=a.attr("data-length"),o=e&&0!=e?parseInt(a.attr("data-length")):20,a.dataTable({oLanguage:{sEmptyTable:language["datatable.empty"],oPaginate:{sFirst:language["datatable.first"],sPrevious:language["datatable.previous"],sNext:language["datatable.next"],sLast:language["datatable.last"]}},aoColumnDefs:[{bSortable:!1,aTargets:t}],aaSorting:[[d,i]],bFilter:!1,bInfo:!1,iDisplayLength:o,bLengthChange:!1,sPaginationType:"full_numbers"}),$(".dataTables_wrapper .sOption").wrapAll('<div class="sOption_wrapper"></div>'),$(".dataTables_wrapper .pagin").wrapAll('<div class="sOption_wrapper"></div>')})}(),function(){$("#type").unbind("keyup keydown keypress change"),$("#type").on("keyup keydown keypress change",function(){var a=$.trim($(this).val());switch($("dl#aux").find("dt").text("Prio"),$("dl#weight").find("dt").text("weight"),$("dl#port").find("dt").text("port"),$("dl#data").find("dt").text("Data"),$("dl#aux").hide(),$("dl#weight").hide(),$("dl#port").hide(),$("dl#data").hide(),a){case"A":case"AAAA":case"CNAME":case"TXT":case"NS":case"PTR":$("dl#data").show();break;case"DS":$("dl#aux").show(),$("dl#weight").show(),$("dl#port").show(),$("dl#data").show(),$("dl#aux").find("dt").text("Key-ID"),$("dl#weight").find("dt").text("Algorithm"),$("dl#port").find("dt").text("Digest Type"),$("dl#data").find("dt").text("Digest");break;case"TLSA":$("dl#aux").show(),$("dl#weight").show(),$("dl#port").show(),$("dl#data").show(),$("dl#aux").find("dt").text("Usage"),$("dl#weight").find("dt").text("Selector"),$("dl#port").find("dt").text("Hash Type"),$("dl#data").find("dt").text("Hash");break;case"MX":$("dl#aux").show(),$("dl#data").show();break;case"SRV":$("dl#aux").show(),$("dl#weight").show(),$("dl#port").show(),$("dl#data").show()}})}(),function(){$("#export").unbind("click"),$("#export").on("click",function(){console.log("click");var a=$(this),t=a.attr("export-id");$.ajax({url:"index.php?page=action",data:{action:"export",dataID:t},type:"post",success:function(a){console.log(a),"failure"==a||($("#exportModal").remove(),$("#page-wrapper").append('<div class="modal fade" id="exportModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">Zone File Export</h4></div><div class="modal-body"><textarea id="exportTextarea" style="width: 569px; height: 552px;">'+a+'</textarea></div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#exportModal").modal({show:!0}),setTimeout(function(){$("#exportTextarea").focus()},700))}})})}(),function(){$("#import").unbind("click"),$("#import").on("click",function(){var t=$(this),e=t.attr("import-id");$("#importModal").remove(),$("#page-wrapper").append('<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">Zone File Import</h4></div><div class="modal-body">'+(e?"":'<input type="text" id="importOrigin" value="" placeholder="example.com." style="width: 100%;"/>')+'<textarea id="importTextarea" style="width: 569px; height: 552px;"></textarea></div><div class="modal-footer"><button class="btn" id="importSubmit" aria-hidden="true">OK</button><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#importModal").modal({show:!0}),setTimeout(function(){$("#importTextarea").focus()},700),$("#importSubmit").unbind("click"),$("#importSubmit").on("click",function(){var t=$("#importModal").find(".modal-body").find("#importOrigin").val(),i=$("#importModal").find(".modal-body").find("#importTextarea").val();$.ajax({url:"index.php?page=action",data:{action:"import",dataID:e?e:0,origin:t?t:"",zone:i},type:"post",success:function(t){$("#importModal").modal("hide"),"failure"==t?a(language["javascript.error"]):e?$(location).attr("href","index.php?page=RecordList&id="+e):$(location).attr("href","index.php?page=DomainList")}})})})}(),function(){$("#side-menu").metisMenu()}()}),$(window).load(function(){!function(){$(window).bind("load resize",function(){topOffset=50,width=this.window.innerWidth>0?this.window.innerWidth:this.screen.width,width<768?($("div.navbar-collapse").addClass("collapse"),topOffset=100):$("div.navbar-collapse").removeClass("collapse"),height=(this.window.innerHeight>0?this.window.innerHeight:this.screen.height)-1,height-=topOffset,height<1&&(height=1),height>topOffset&&$("#page-wrapper").css("min-height",height+"px")})}(),function(){$(".ttips").tooltip()}()});
\ No newline at end of file
+$(document).ready(function(){function a(a){$("#errorConfirmModal").remove(),$("#page-wrapper").append('<div class="modal fade" id="errorConfirmModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">'+language["javascript.error.title"]+'</h4></div><div class="modal-body"></div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#errorConfirmModal").find(".modal-body").text(a),$("#errorConfirmModal").modal({show:!0})}!function(){var t=void 0;$("span[delete-confirm]").unbind("click"),$("span[delete-confirm]").on("click",function(e){return e.preventDefault(),t=$(this),$("#dataConfirmModal").remove(),$("body").append('<div class="modal fade" id="dataConfirmModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">'+language["javascript.confirm"]+'</h4></div><div class="modal-body"></div><div class="modal-footer"><a class="btn btn-primary" id="dataConfirmOK">OK</a><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#dataConfirmModal").find(".modal-body").text(t.attr("delete-confirm")),$("#dataConfirmOK").unbind("click"),$("#dataConfirmOK").on("click",function(e){e.preventDefault(),$("#dataConfirmModal").modal("hide");var i=void 0,d=t.attr("delete-id");if(d){if(t.hasClass("deleteDomain"))i="deleteDomain";else if(t.hasClass("deleteRecord"))i="deleteRecord";else if(t.hasClass("deleteSec"))i="deleteSec";else{if(!t.hasClass("deleteUser"))return a(language["javascript.error"]),!1;i="deleteUser"}$.ajax({url:"index.php?page=action",data:{action:i,dataID:d},type:"post",success:function(e){if("success"==e){if(t.parent().parent().parent().parent().hasClass("dataTable")){var i=t.parent().parent().closest("tr").get(0),d=$(".dataTable").dataTable();d.fnDeleteRow(d.fnGetPosition(i))}t.parent().parent().remove()}else a(language["javascript.error"])}})}else a(language["javascript.error"]);return!1}),$("#dataConfirmModal").modal({show:!0}),!1})}(),function(){$("#requestApiKey").unbind("click"),$("#requestApiKey").on("click",function(){$.ajax({url:"index.php?page=action",data:{action:"requestApiKey",dataID:1},type:"post",success:function(t){"failure"==t?a(language["javascript.error"]):$("#apiKey").text(t)}})})}(),function(){$("span[toggle-id]").unbind("click"),$("span[toggle-id]").on("click",function(t){t.preventDefault();var e=$(this),i=void 0,d=e.attr("toggle-id");if(d){if(e.hasClass("toggleDomain"))i="toggleDomain";else if(e.hasClass("toggleRecord"))i="toggleRecord";else if(e.hasClass("toggleSec"))i="toggleSec";else{if(!e.hasClass("toggleUser"))return a(language["javascript.error"]),!1;i="toggleUser"}$.ajax({url:"index.php?page=action",data:{action:i,dataID:d},type:"post",success:function(t){"success"==t?e.hasClass("fa-square-o")?(e.removeClass("fa-square-o").addClass("fa-check-square-o"),e.tooltip("hide").attr("data-original-title",e.attr("data-disable-message")).tooltip("fixTitle").tooltip("show"),e.parent().parent().children().first().next().find("span.badge").remove()):e.hasClass("fa-check-square-o")?(e.removeClass("fa-check-square-o").addClass("fa-square-o"),e.tooltip("hide").attr("data-original-title",e.attr("data-enable-message")).tooltip("fixTitle").tooltip("show"),e.parent().parent().children().first().next().prepend('<span class="badge badge-red">'+language["domain.disabled"]+"</span> ")):a(language["javascript.error"]):a(language["javascript.error"])}})}else a(language["javascript.error"]);return!1})}(),function(){$(".ttips").each(function(){$(this).tooltip()})}(),function(){$(".dataTable").each(function(){var a=$(this),t=[],e=void 0,i=void 0,d=[],o=void 0;if(e=a.attr("data-sort")){var s=e.split(",");s.forEach(function(a){"asc"==a||"desc"==a?i=a.toString():d=[parseInt(a)]})}else i="asc",d=[0];if(e=a.attr("data-dontsort")){var s=e.split(",");s.forEach(function(a){t.push(parseInt(a))})}e=a.attr("data-length"),o=e&&0!=e?parseInt(a.attr("data-length")):20,a.dataTable({oLanguage:{sEmptyTable:language["datatable.empty"],oPaginate:{sFirst:language["datatable.first"],sPrevious:language["datatable.previous"],sNext:language["datatable.next"],sLast:language["datatable.last"]}},aoColumnDefs:[{bSortable:!1,aTargets:t}],aaSorting:[[d,i]],bFilter:!1,bInfo:!1,iDisplayLength:o,bLengthChange:!1,sPaginationType:"full_numbers"}),$(".dataTables_wrapper .sOption").wrapAll('<div class="sOption_wrapper"></div>'),$(".dataTables_wrapper .pagin").wrapAll('<div class="sOption_wrapper"></div>')})}(),function(){$("#type").unbind("keyup keydown keypress change"),$("#type").on("keyup keydown keypress change",function(){var a=$.trim($(this).val());switch($("dl#aux").find("dt").text("Prio"),$("dl#weight").find("dt").text("weight"),$("dl#port").find("dt").text("port"),$("dl#data").find("dt").text("Data"),$("dl#aux").hide(),$("dl#weight").hide(),$("dl#port").hide(),$("dl#data").hide(),a){case"A":case"AAAA":case"CNAME":case"TXT":case"NS":case"PTR":$("dl#data").show();break;case"DS":$("dl#aux").show(),$("dl#weight").show(),$("dl#port").show(),$("dl#data").show(),$("dl#aux").find("dt").text("Key-ID"),$("dl#weight").find("dt").text("Algorithm"),$("dl#port").find("dt").text("Digest Type"),$("dl#data").find("dt").text("Digest");break;case"TLSA":$("dl#aux").show(),$("dl#weight").show(),$("dl#port").show(),$("dl#data").show(),$("dl#aux").find("dt").text("Usage"),$("dl#weight").find("dt").text("Selector"),$("dl#port").find("dt").text("Hash Type"),$("dl#data").find("dt").text("Hash");break;case"MX":$("dl#aux").show(),$("dl#data").show();break;case"SRV":$("dl#aux").show(),$("dl#weight").show(),$("dl#port").show(),$("dl#data").show()}})}(),function(){$("#export").unbind("click"),$("#export").on("click",function(){console.log("click");var a=$(this),t=a.attr("export-id");$.ajax({url:"index.php?page=action",data:{action:"export",dataID:t},type:"post",success:function(a){console.log(a),"failure"==a||($("#exportModal").remove(),$("#page-wrapper").append('<div class="modal fade" id="exportModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">Zone File Export</h4></div><div class="modal-body"><textarea id="exportTextarea" style="width: 569px; height: 552px;">'+a+'</textarea></div><div class="modal-footer"><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#exportModal").modal({show:!0}),setTimeout(function(){$("#exportTextarea").focus()},700))}})})}(),function(){$("#import").unbind("click"),$("#import").on("click",function(){var t=$(this),e=t.attr("import-id");$("#importModal").remove(),$("#page-wrapper").append('<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true" ><i class="fa fa-times-circle"></i></button><h4 class="modal-title">Zone File Import</h4></div><div class="modal-body">'+(e?"":'<input type="text" id="importOrigin" value="" placeholder="example.com." style="width: 100%;"/>')+'<textarea id="importTextarea" style="width: 569px; height: 552px;"></textarea></div><div class="modal-footer"><button class="btn" id="importSubmit" aria-hidden="true">OK</button><button class="btn" data-dismiss="modal" aria-hidden="true">'+language["javascript.close"]+"</button></div></div></div></div>"),$("#importModal").modal({show:!0}),setTimeout(function(){$("#importTextarea").focus()},700),$("#importSubmit").unbind("click"),$("#importSubmit").on("click",function(){var t=$("#importModal").find(".modal-body").find("#importOrigin").val(),i=$("#importModal").find(".modal-body").find("#importTextarea").val();$.ajax({url:"index.php?page=action",data:{action:"import",dataID:e?e:0,origin:t?t:"",zone:i},type:"post",success:function(t){$("#importModal").modal("hide"),"failure"==t?a(language["javascript.error"]):e?$(location).attr("href","index.php?page=RecordList&id="+e):$(location).attr("href","index.php?page=DomainList")}})})})}(),function(){$("#side-menu").metisMenu()}()}),$(window).load(function(){!function(){$(window).bind("load resize",function(){topOffset=50,width=this.window.innerWidth>0?this.window.innerWidth:this.screen.width,width<768?($("div.navbar-collapse").addClass("collapse"),topOffset=100):$("div.navbar-collapse").removeClass("collapse"),height=(this.window.innerHeight>0?this.window.innerHeight:this.screen.height)-1,height-=topOffset,height<1&&(height=1),height>topOffset&&$("#page-wrapper").css("min-height",height+"px")})}()});
\ No newline at end of file