function add_controls()
{
    /*
     * Add controls to page.
     */
    var d = document.createElement("div");
    d.setAttribute("id", "controls");
    d.innerHTML = 'ESP-8266 (esp-webui) \
        UPLOAD: <input type="file" id="upf">\
        more todo\
        ';
    document.documentElement.appendChild(d);
    var uploader = document.getElementById("upf");
    uploader.addEventListener("change", trigger_upload);
    
    // Add special buttons to items
    var anchors = document.getElementsByTagName("a");
    for (var i= anchors.length - 1; i>=0; i--) {
        var a = anchors[i];
        var parent = a.parentNode;
        // Check parent, should be class "d" or "f" for dir or files.
        var is_dir = parent.classList.contains("d");
        var is_file = parent.classList.contains("f");
        if (is_dir || is_file) {
            var btn = document.createElement("a");
            // 0x2026 = horizonal ellipsis.
            var file_icon = String.fromCodePoint(0x2026);
            var folder_icon = String.fromCodePoint(0x2026);
            btn.textContent = is_dir ? folder_icon : file_icon;
            btn.classList.add("actionsbut");
            btn.classList.add(is_dir ? "d" : "f");
            btn.setAttribute("href", a.href);
            btn.setAttribute("title", "Actions for this object...");
            btn.addEventListener("click", trigger_popup);
            parent.appendChild(btn);
        }
    }
}
// UI Javascript code. Loaded with defer.
UI Javascript code. Loaded with defer.
UI Javascript code . Loaded with defer .
function add_controls()
{
    var d = document.createElement("div");
    d.setAttribute("id", "controls");
    d.innerHTML = 'ESP-8266 (esp-webui) \
        UPLOAD: <input type="file" id="upf">\
        more todo\
        ';
    document.documentElement.appendChild(d);
    var uploader = document.getElementById("upf");
    uploader.addEventListener("change", trigger_upload);
    var anchors = document.getElementsByTagName("a");
    for (var i= anchors.length - 1; i>=0; i--) {
        var a = anchors[i];
        var parent = a.parentNode;
        var is_dir = parent.classList.contains("d");
        var is_file = parent.classList.contains("f");
        if (is_dir || is_file) {
            var btn = document.createElement("a");
            var file_icon = String.fromCodePoint(0x2026);
            var folder_icon = String.fromCodePoint(0x2026);
            btn.textContent = is_dir ? folder_icon : file_icon;
            btn.classList.add("actionsbut");
            btn.classList.add(is_dir ? "d" : "f");
            btn.setAttribute("href", a.href);
            btn.setAttribute("title", "Actions for this object...");
            btn.addEventListener("click", trigger_popup);
            parent.appendChild(btn);
        }
    }
}
function add_controls ( ) { var d = document . createElement ( "div" ) ; d . setAttribute ( "id" , "controls" ) ; d . innerHTML = 'ESP-8266 (esp-webui) \
        UPLOAD: <input type="file" id="upf">\
        more todo\
        ' ; document . documentElement . appendChild ( d ) ; var uploader = document . getElementById ( "upf" ) ; uploader . addEventListener ( "change" , trigger_upload ) ; var anchors = document . getElementsByTagName ( "a" ) ; for ( var i = anchors . length - 1 ; i >= 0 ; i -- ) { var a = anchors [ i ] ; var parent = a . parentNode ; var is_dir = parent . classList . contains ( "d" ) ; var is_file = parent . classList . contains ( "f" ) ; if ( is_dir || is_file ) { var btn = document . createElement ( "a" ) ; var file_icon = String . fromCodePoint ( 0x2026 ) ; var folder_icon = String . fromCodePoint ( 0x2026 ) ; btn . textContent = is_dir ? folder_icon : file_icon ; btn . classList . add ( "actionsbut" ) ; btn . classList . add ( is_dir ? "d" : "f" ) ; btn . setAttribute ( "href" , a . href ) ; btn . setAttribute ( "title" , "Actions for this object..." ) ; btn . addEventListener ( "click" , trigger_popup ) ; parent . appendChild ( btn ) ; } } }
UI Javascript code.
UI Javascript code .
/*
     * Add controls to page.
     */ // Add special buttons to items // Check parent, should be class "d" or "f" for dir or files. // 0x2026 = horizonal ellipsis.