Merhaba div içine js kodlarını alma



"use strict";


var oGameTree   = null;
var nMenuHeight = 150;

function LoadMenu(sActive)
{


    function AddMenuItem(sLink, sTitle, bActive)
    {
        var TabPanel = oMenuTabs;

        var DivTab                      = document.createElement("div");
        DivTab.style.transitionProperty = "width,height,background,margin,border,padding";
        DivTab.style.transitionDuration = ".25s";

        DivTab.style.float   = "left";
        DivTab.style.height  = "100%";
        DivTab.style.margin  = "0px";
        DivTab.style.padding = "0px";

      
        DivTab.appendChild(NewTab);
        TabPanel.appendChild(DivTab);
    }

}




function LoadMainDiv()
{
    var oDiv = document.createElement("div");
    oDiv.id             = "divId";
    oDiv.style.position = "absolute";
    oDiv.style.left     = "0px";
    oDiv.style.top      = nMenuHeight + "px";
    oDiv.style.width    = "100px";
    oDiv.style.height   = "100px";
    oDiv.tabIndex       = -1;
    oDiv.onfocus        = BodyFocus;

    document.body.appendChild(oDiv);
}

function LoadGameTree()
{
    oGameTree = GoBoardApi.Create_GameTree();
    
    GoBoardApi.Create_BoardCommentsButtonsNavigator(oGameTree, "divId");
    GoBoardApi.Focus(oGameTree);
    window.onresize();
}


function BodyFocus()
{
    if (oGameTree)
        GoBoardApi.Focus(oGameTree);
}

window.onresize = function()
{
    var oMainDiv = document.getElementById("divId");
    if (oMainDiv)
    {
        oMainDiv.style.width = window.innerWidth + "px";
        oMainDiv.style.height = (window.innerHeight - nMenuHeight) + "px";
    }

    var oMenuUl = document.getElementById("menuId");
    if (oMenuUl)
    {
        oMenuUl.style.width = (window.innerWidth - 2) + "px";
    }

    if (oGameTree)
        GoBoardApi.Update_Size(oGameTree);
};

function OnDocumentReady(sActive)
{
    LoadMenu(sActive);
    LoadMainDiv();
    LoadGameTree();
    window.onresize();
}

function OnDocumentReadyPresentation(aSlides)
{
    LoadMenu("Intro");
    LoadMainDiv();
    LoadGameTreePresentation(aSlides);
    window.onresize();
}

function OnDocumentReadyProblems()
{
    LoadMenu("Problems");
}

function OnDocumentReadyWPPlugin()
{
    LoadMenu("WordPress");
}

function Decode_Base64_UrlSafe(sInput)
{
    sInput = sInput.replace(new RegExp("~", 'g'), '+');
    sInput = sInput.replace(new RegExp("-", 'g'), '/');
    sInput = sInput.replace(new RegExp("_", 'g'), '=');
    return atob(sInput);
}

function Decode_UTF8(sUtf8Text)
{
    var sString = "";
    var nPos = 0;
    var nCharCode1 = 0, nCharCode2 = 0, nCharCode3 = 0;

    var nLen = sUtf8Text.length;
    while (nPos < nLen)
    {
        nCharCode1 = sUtf8Text.charCodeAt(nPos);

        if (nCharCode1 < 128)
        {
            sString += String.fromCharCode(nCharCode1);
            nPos++;
        }
        else if((nCharCode1 > 191) && (nCharCode1 < 224))
        {
            nCharCode2 = sUtf8Text.charCodeAt(nPos + 1);
            sString += String.fromCharCode(((nCharCode1 & 31) << 6) | (nCharCode2 & 63));
            nPos += 2;
        }
        else
        {
            nCharCode2 = sUtf8Text.charCodeAt(nPos + 1);
            nCharCode3 = sUtf8Text.charCodeAt(nPos + 2);
            sString += String.fromCharCode(((nCharCode1 & 15) << 12) | ((nCharCode2 & 63) << 6) | (nCharCode3 & 63));
            nPos += 3;
        }
    }

    return sString;
}