Created
June 24, 2016 18:15
-
-
Save lucassouza1/26167930af9e8ad0ca33723bc3bea6ae to your computer and use it in GitHub Desktop.
Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Parameters</title> | |
<style> | |
body { | |
display: flex; | |
flex-direction: column; | |
font-family: monospace; | |
} | |
div, textarea { | |
border: 1px solid #333; | |
flex: 1; | |
font: inherit; | |
margin: 8px; | |
padding: 8px; | |
overflow-wrap: break-word; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Parameters</h1> | |
<textarea onkeyup="parse()"></textarea> | |
<div></div> | |
<script> | |
function parse() { | |
document.querySelector('div').innerText = document.querySelector('textarea').value | |
.split('&') | |
.filter(x => !x.endsWith('active=0')) | |
.map(x => (/.*:(.*=.+)/).exec(x)) | |
.filter(x => x) | |
.map(x => x[1]) | |
.filter(x => (/^[^:]+$/).test(x)) | |
.join('\n'); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment