Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<script src="/s/pasteclick.js"></script>
<style> a {color:white;} </style>
</head>
<body class='hljs' id="body" onload="initPaste();"><pre id="code">################################################################################
<body class='hljs' id="body" onload="initPaste();"><pre id="code" class="codeType();">
################################################################################
###### ######
### ###
# _ _ _ _ #
Expand Down
8 changes: 7 additions & 1 deletion assets/s/pasteclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ function getPastePre(){
function highlightPre(pastePre){
hljs.highlightBlock(document.body);
hljs.highlightBlock(pastePre);
}
}
function initPaste(){
inPastePre = getPastePre();
highlightPre(inPastePre);
}
function codeType(){
if(window.location.hash){
var lang = window.location.hash.substr(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a listener to call this, adding the #language won't change the language highlighting, look at how changestyle works:

window.addEventListener("hashchange", changeStyle, false);
to call the function when it changes.

}
return lang;
}