Skip to content

Commit 3c51845

Browse files
committed
allow loading of data via query string
1 parent 3bd1535 commit 3c51845

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

index.html

+22-1
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,31 @@
541541
e.stack && errlog(e.stack);
542542
}
543543
}
544+
545+
function getQSParams() {
546+
return window.location.search
547+
.substr(1)
548+
.split('&')
549+
.reduce(function(result, item) {
550+
var parts = item.split('=');
551+
result[parts[0]] = decodeURIComponent(parts[1]);
552+
return result;
553+
}, { });
554+
}
555+
556+
function checkUrl() {
557+
var params = getQSParams();
558+
559+
// Accept base64 data
560+
if (params['base64'] !== undefined) {
561+
document.getElementById("data").value = params['base64'];
562+
parseBase64();
563+
}
564+
};
544565
</script>
545566
</head>
546567

547-
<body id="home">
568+
<body id="home" onload="checkUrl()">
548569
<a href="https://github.com/sugendran/msgpack-visualizer"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
549570
<div id="header">
550571
<h1>

0 commit comments

Comments
 (0)