Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Init CJS with insertion of localstorage
window.localStorage.setItem('customjs',
window.JSON.stringify({
"config": {
"enable":true,
"include":"/jquery/1.11.0/jquery.min.js",
"extra":"//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/highlight.min.js"
},
"source":"data:text/javascript;base64,JCgnaGVhZCcpLmFwcGVuZCgnPGxpbmsgcmVsPSJzdHlsZXNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyIgaHJlZj0iLy9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvaGlnaGxpZ2h0LmpzLzkuMi4wL3N0eWxlcy9kZWZhdWx0Lm1pbi5jc3MiPicpOwoKJChkb2N1bWVudCkuY2xpY2soZnVuY3Rpb24oZXZlbnQpewogICAgdmFyIGhsanNTZWxlY3RvciA9ICdwcmUnOwogICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKICAgICAgICBpZigkKGRvY3VtZW50KS5oYXMoaGxqc1NlbGVjdG9yKS5sZW5ndGggPiAwKSB7CiAgICAgICAgICAgIHZhciBjb2RlQmxvY2tTZWxlY3RvciA9IGhsanNTZWxlY3RvciArICcgY29kZSc7CiAgICAgICAgICAgIGlmKCQoZG9jdW1lbnQpLmhhcyhjb2RlQmxvY2tTZWxlY3RvcikubGVuZ3RoID4gMCkgewogICAgICAgICAgICAgICAgaGxqc1NlbGVjdG9yID0gY29kZUJsb2NrU2VsZWN0b3I7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgJChobGpzU2VsZWN0b3IpLmVhY2goZnVuY3Rpb24gKGksIGJsb2NrKSB7CiAgICAgICAgICAgICAgICBobGpzLmhpZ2hsaWdodEJsb2NrKGJsb2NrKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfSwgMjAwKTsKfSk7Cg=="
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.