0
0

Added URL redirect support directly in management panel

Added buttons that automatically redirects the user to the corresponding URL, in a new page.
Modified css and javascript accordingly.
This commit is contained in:
Bryan Pedini
2019-07-25 03:01:16 +02:00
parent 66e0f51b70
commit 035bfe0101
3 changed files with 14 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ function insertNewURL() {
div.appendChild ( document.createElement ( 'text' ) );
div.appendChild ( document.createElement ( 'div' ) );
div.childNodes [ 1 ].classList.add ( "urlId" );
div.childNodes [ 1 ].innerHTML = response [ 'last_insert' ];
div.childNodes [ 1 ].innerHTML = "<button onclick=\"window.open('" + script_name + "/go/" + response [ 'last_insert' ] + "', '_blank');\">" + response [ 'last_insert' ] + "</button>";
div.appendChild ( document.createElement ( 'text' ) );
div.appendChild ( document.createElement ( 'input' ) );
div.childNodes [ 3 ].type = 'text';
@@ -58,7 +58,7 @@ function insertNewURL() {
}
function editURL(node) {
var url = node.childNodes[3].value;
var url_id = node.childNodes[1].innerHTML
var url_id = node.childNodes[1].childNodes[0].innerHTML;
var xhr = new XMLHttpRequest ( );
xhr.open ( "POST", 'edit', true );
xhr.onreadystatechange = function ( ) {