Created
April 30, 2010 01:26
-
-
Save satyr/384566 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<body style="width:160%; height:160%"> | |
<div id="bespin" class="bespin" style="width:80%; height:80%"></div> | |
<script> | |
function onBespinLoad(){ | |
var div = document.getElementById("bespin"); | |
var editor = div.bespin.editor; | |
// fix | |
if(location.search) | |
editor.textView.textInput.domNode.setAttribute('style', ( | |
'position: absolute; z-index: -9999; '+ | |
'width: 0; height: 0; margin: 0; border-width: 0')); | |
editor.focus = false; | |
scrollTo(1, 1); | |
editor.focus = true; | |
var ok = scrollX === 1 && scrollY === 1; | |
if(ok){ | |
editor.focus = false; | |
scrollTo(1e4, 1e4); | |
editor.focus = true; | |
var rect = div.getBoundingClientRect(); | |
ok = rect.top >= 0 && rect.left >= 0; | |
} | |
document.title = editor.value = ok ? 'OK' : 'NG'; | |
} | |
</script> | |
<script src="BespinEmbedded.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment