Subversion Repositories DevTools

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

var displaymode="always"
var noteVisibility="hidden"

function initfunction(){
        var ie=document.all && !window.opera
        var dom=document.getElementById
        iebody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
        objref=(dom)? document.getElementById("notebox") : document.all.notebox
        var scroll_top=(ie)? iebody.scrollTop : window.pageYOffset
        var docwidth=(ie)? iebody.clientWidth : window.innerWidth
        docheight=(ie)? iebody.clientHeight: window.innerHeight
        var objwidth=objref.offsetWidth
        objheight=objref.offsetHeight
        if(docheight > 650) {
                docheight=650
        }
        objref.style.left=docwidth/2-objwidth/2+"px"
        objref.style.top=scroll_top+docheight/2-objheight/2+"px"
        objref.style.visibility=noteVisibility
}

function showHideNote() {
        if(noteVisibility == "visible") {
                noteVisibility="hidden"
        }
        else {
                noteVisibility="visible"
        }
        objref.style.visibility=noteVisibility
}

function saveNote() {
        document.forms["noteManagerForm"].submit()
}

function saveBlankNote() {
        document.getElementById("noteboxcontents").value = ""
        document.forms["noteManagerForm"].submit()
}

//Mainline
if (parseInt(displaymode)!=NaN){
        if (window.addEventListener)
                window.addEventListener("load", initfunction, false)
        else if (window.attachEvent)
                window.attachEvent("onload", initfunction)
        else if (document.getElementById)
                window.onload=initfunction
}