../Window(s) webview/Folder.htt explainedHome
Folder.htt explained
The folder.htt in 98 and Me, copied and explained, you can use accesskeys (Alt + key) to navigate for recent browsers:
 
Windows 98
<!-- 
 * This file was automatically generated by Microsoft Internet Explorer 4.0 
 * using the file %THISDIRPATH%\folder.htt (if customized) or
 * %TEMPLATEDIR%\folder.htt (if not customized).
 -->

<html>
    <style>
        body		{font: 8pt/10pt verdana; margin: 0} /* The document body, including all texts */
        #FileList	{position: absolute; left: 30%; width: 70%; height: 100%} /* The Icon area, usually change the size attributes */
        #Media	{margin-left: 15px} /*The mediaplayer */
        #Panel	{position: absolute; width: 30%; height: 100%; overflow: auto} /* The info panel on the left, there is also some inline scripting linked to it in the body */
        #PieChart	{width: 100px; height: 50px; margin-top: 10px} /* The Pie chart for drives, only in My computer so quite useless here */
        #Thumbnail	{width: 160px; height: 160px; margin-top: 0px} /* The Thumbnail for image/html preview */
        #Status	{margin-left: 15px} /* The status text (Generating preview...) */
        #Brand	{position: absolute; left: 30%; width: 70%; height: 100%; overflow: auto} /* The status text (Generating preview...) */
        p		{margin-left: 15px; margin-top: 15px; margin-right: 15px} /* All paragraphs */
        p.Title	{font: 16pt; font-weight: bold; margin-top: 5px} /* The Folder Title */
        p.LogoLine	{margin-left: 0; margin-top: -5px; margin-right: 0; margin-bottom: 20px} /* The colored line, there is also some inline scripting linked to it in the body */
        p.Warning	{font-weight: bold; color: red} /* The warning messages, only in windows/system folders so useless here */
        p.Links	{margin-top: 5px} /* Links but to really change them use: A {} */
        a.Command	{font-weight: bold} 
        div.Release	{width: 160px; text-align: right; background: buttonface; padding: 0px, 8px, 4px, 8px}
    </style>

    <head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
        <!-- allow references to any resources you might add to the folder -->
        <!-- (a "webbot" is a special wrapper for FrontPage compatibility) -->
        <!-- webbot bot="HTMLMarkup" tag="base" startspan -->
        <base href="%THISDIRPATH%\">
        <!-- webbot bot="HTMLMarkup" endspan -->

        <script language="JavaScript">
            // Some words/sentences used in the script.
            var L_Prompt_Text    = "Select an item to view its description.";
            var L_Multiple_Text    = " items selected.";
            var L_Size_Text        = "Size : ";
            var L_FileSize_Text    = "Total File Size: ";
            var L_Delimiter_Text    = ",";
            var L_Bytes_Text    = " bytes";
            var L_Attributes_Text    = "Attributes";
            var L_Codes_Text    = "RHSaCE"; // suppress the Archive flag
            var L_ReadOnly_Text     = "Read-only";
            var L_Hidden_Text    = "Hidden";
            var L_System_Text    = "System";
            var L_Archive_Text    = "Archive";
            var L_Compressed_Text    = "Compressed";
            var L_Encrypted_Text    = "Encrypted";
            var L_NoAttributes_Text = "(normal)";
            var L_Properties_Text    = "P&roperties";
            var timer        = 0;
            var wantMedia        = false; // Media file preview, cool, but may hinder media file manipulation

            function FixSize() {
                // This function handles fixed panel sizing and collapsing when the window resizes
                var threshold    = 400; // Minimum size before the Panel is hidden and the minibanner shown
                var miniHeight    = 32; // MiniBanner height for scripting, if you change this also change it in the document body
                var ch        = document.body.clientHeight;
                var cw        = document.body.clientWidth;

                if (cw < threshold) { // If the window size is < to the threshold:
                    document.all.Panel.style.visibility = "hidden"; // Hide the panel,
                    document.all.MiniBanner.style.visibility = "visible"; // Show the MiniBanner,
                    document.all.FileList.style.top = miniHeight; // Change the top and left position of the FileList
                    document.all.FileList.style.pixelLeft = 0;
                } else {
                    document.all.MiniBanner.style.visibility = "hidden"; // Hide the MiniBanner
                    document.all.Panel.style.visibility = "visible"; // Show the Panel
                    document.all.FileList.style.top = 0; // Change the top and left position of the FileList
                    document.all.FileList.style.pixelLeft = document.all.Panel.style.pixelWidth; 
                }
                document.all.FileList.style.pixelWidth = cw - document.all.FileList.style.pixelLeft; // This happens at any time to set the height and width of the FileList
                document.all.FileList.style.pixelHeight = ch - document.all.FileList.style.pixelTop;
            }

            function FormatNumber(n) { // This function replaces the point by a coma for a number
                var t = "";
                var i, j = 0;
                for (i = n.length - 1; i >= 0; i--) {
                    t = n.charAt(i) + t;
                    if (i && ((++j % 3) == 0))
                        t = L_Delimiter_Text + t;
                }
                return t;
            }

            function Properties() { // This function calls the properties window, by calling the associated verb (L_Properties_Text var)
                FileList.SelectedItems().Item(0).InvokeVerb(L_Properties_Text);
            }

            function Init() {
                // As Ms says: call our FixSize() function whenever the window gets resized
                window.onresize = FixSize;
                FixSize();
                Info.innerHTML = L_Prompt_Text;
            }
        </script>

        <script language="JavaScript" for="FileList" event="SelectionChanged">
            // This script updates the left info panel when you select icons
            var fldr = FileList.Folder;
            var items;
            var name;
            var data;
            var text;
            var title;
            var size = 0;
            var i;

            // Cancel any pending status message
            if (timer) {
                window.clearTimeout(timer);
                timer = 0;
            }

            // Erase any visible thumbnail since the selection changed
            document.all.Thumbnail.style.display = "none";
            document.all.Status.style.display = "none";

            // stop & destroy any media player
            if (wantMedia)
                document.all.Media.innerHTML = "";

            data = FileList.SelectedItems().Count; // Counting the selected files
            if (data == 0) {
                // nothing selected? Just use the prompt text.
                Info.innerHTML = L_Prompt_Text;
                return;
            }
            else if (data > 1) { 
                // More than one item selected?
                text = data + L_Multiple_Text + "<br>";
                if (data <= 100) { // If there is less than 100 items selected
                    for (i = 0; i < data; i++)
                        size += FileList.SelectedItems().Item(i).Size; // Total size
                    if (size)
                        text += "<br>" + L_FileSize_Text + FormatNumber(size.toString()) + L_Bytes_Text + "<br>"; //Formatting size
                    if (data <= 16) //If there is less than 16 item selected (you can change that):
                        for (i = 0; i < data; i++)
                            text += "<br>" + FileList.SelectedItems().Item(i).Name; //Display the 16 names
                }
                Info.innerHTML = text; //And display into the Info panel
                return; //Stoping the function
            }
 
            //Only one item selected
            items = FileList.SelectedItems().Item(0); // "items" is the FolderItem object of the item selected

            //Getting the files's:
            // name
            name = fldr.GetDetailsOf(items, 0);
            text = "<b>" + name + "</b>";

            // type
            data = fldr.GetDetailsOf(items, 2);
            if (data)
                text += "<br>" + data;

            // date
            data = fldr.GetDetailsOf(items, 3);
            if (data)
                text += "<br><br>" + fldr.GetDetailsOf(null, 3) + ":<br>" + data;

            // size
            size = FileList.SelectedItems().Item(0).Size;
            if (size && size < 1000) // If size < 1000, display in bytes
                text += "<br><br>" + L_Size_Text + size + L_Bytes_Text;
            else {
                data = fldr.GetDetailsOf(items, 1); //Using another way to get the size
                if (data) //If we succeed
                    text += "<br><br>" + fldr.GetDetailsOf(null, 1) + ": " + data; // Using a null value in GetdetailsOf gets the type of data we want (ex: "Size :")
                                else if (size)
                    text += "<br><br>" + L_Size_Text + FormatNumber(size.toString()) + L_Bytes_Text; // Using default method, and formatting size.
            }

            // extra details?
            for (i = 4; i < 10; i++) { // Starting with 4 (the file attributes), going to 10
                title = fldr.GetDetailsOf(null, i);
                if (!title) // If we don't get something, breaking the loop
                    break;
                data = fldr.GetDetailsOf(items, i); 
                if (title == L_Attributes_Text) { //Else, if we have the attributes
                    var code;
                    var s = "";

                    text += "<br><br>" + title.link("JavaScript:onClick=Properties()") + ": "; //This is a link to more properties
                    for (i = 0; i < 6; i++) {
                        code = L_Codes_Text.charAt(i);
                        if (data.indexOf(code) > -1) { //Trying to extract the file attributes
                            if (s)
                                s += ", ";
                            if (i == 0)
                                s += L_ReadOnly_Text;
                            else if (i == 1)
                                s += L_Hidden_Text;
                            else if (i == 2)
                                s += L_System_Text;
                            else if (i == 3)
                                s += L_Archive_Text;
                            else if (i == 4)
                                s += L_Compressed_Text;
                            else if (i == 5)
                                s += L_Encrypted_Text;
                        }
                    }
                    if (!s)
                        s = L_NoAttributes_Text; //No special attributes, using default.
                    text += s;
                }
                else if (data)
                    text += "<br><br>" + title + ":<br>" + data; //Couldn't get anything
            }

            // tip?
            data = fldr.GetDetailsOf(items, -1); // Infotip is -1
            if (data && data != name) { //If so, processing...
                var start;
                var end;
                var theLink;
                var a;

                // parse lines for Office files without breaking links below
                a = data.split("\n");
                data = a.join("<br>\n");

                // look for embedded links
                text += "<br><br>";
                start = data.indexOf("http://");
                if (start < 0)
                    start = data.indexOf("file://");
                if (start < 0)
                    text += data;
                else {
                    end = data.indexOf(" ", start);
                    if (end < 0)
                        end = data.length;
                    if (start > 0)
                        text += data.substring(0, start - 1);
                    theLink = data.substring(start, end);
                    text += theLink.link(theLink);
                    if (end < data.length)
                        text += data.substring(end + 1, data.length);
                }
            }

            // Tada! Replace Info with the new text
            Info.innerHTML = text;

            if (wantMedia && size) { //If we enabled wantMedia
                // show media preview or thumbnail based on file extension
                ext = name.substring(name.lastIndexOf(".") + 1, name.length); // Getting file's extension
                ext = ext.toLowerCase();        
                if (ext == 'avi' || ext == 'mov' || ext == 'qt' || ext == 'mpe' || ext == 'mpeg' || ext == 'mpg') {
                    // show a movie player
                    document.all.Media.innerHTML = '<object ID="Player" style="width: 160px; height: 148px" 
                        classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A><param name="FileName" value="' + items.Path + 
                            '"><param name=ShowDisplay value=0><param name=BorderStyle value=0></object>';
                } else if (ext == 'aif' || ext == 'aifc' || ext == 'aiff' || ext == 'au' || ext == 'mid' || ext == 'rmi' 
                	|| ext == 'snd' || ext == 'wav') {
                    // show a sound player
                    document.all.Media.innerHTML = '<object ID="Player" style="width: 160px; height: 28px" 
                        classid=clsid:05589FA1-C356-11CE-BF01-00AA0055595A><param name="FileName" value="' + items.Path +
                            '"><param name=ShowDisplay value=0></center></object>'
                }
            }

            // Try to generate a new thumbnail asynchronously, and delay the status message one second
            if (size && (size < 10000000) && Thumbnail.displayFile(items.Path))
                timer = window.setTimeout('document.all.Status.style.display = ""', 1000);
        </script>

        <script language="JavaScript" for="Thumbnail" event="OnThumbnailReady">
            // when a valid thumbnail has been generated, display it
            window.clearTimeout(timer);
            timer = 0;
            document.all.Status.style.display = "none";
            if (document.all.Thumbnail.haveThumbnail() && document.all.Media.innerHTML == "")
                document.all.Thumbnail.style.display = "";
        </script>
    </head>

    <body scroll=no onload="Init()">
    <!-- This is the main body. No scrollbars, and an Init() function on load. -->

        <!-- start mini banner -->
        <div ID="MiniBanner" style="visibility: hidden; position: absolute; width: 100%; height: 32px; background: window"><!-- The Minibanner inline style -->
            <!-- using a table with nowrap to prevent word wrapping -->
            <table><tr><td nowrap>
                <p class=Title style="margin-top: 0">
                <!--webbot bot="HTMLMarkup" startspan alt="<B><I>Web View Folder Title</I></B> " -->
                %THISDIRNAME%
                <!--webbot bot="HTMLMarkup" endspan -->
            </td></tr></table>
        </div>
        <!-- end mini banner -->

        <!-- start left info panel -->
        <div id=Panel style="background: white URL(file://%TEMPLATEDIR%/wvleft.bmp) no-repeat"> <!-- The Panel inline style, change the background here. -->
            <p>
            <!-- The folder icon -->
            <object classid="clsid:E5DF9D10-3B52-11D1-83E8-00A0C90DC849" width=32 height=32> 
                <param name="scale" value="100">
            </object>

            <p class=Title>
            <!-- The folder title, %THISDIRNAME% gets replaced -->
            <!--webbot bot="HTMLMarkup" startspan alt="<B><I>Web View Folder Title</I></B> " -->
            %THISDIRNAME%
            <!--webbot bot="HTMLMarkup" endspan -->
            
            <!-- The colored logoline, change the path and size here. -->
            <p class=LogoLine>
            <img src="%TEMPLATEDIR%/wvline.gif" width=100% height=1px>
            
            <p>
            <span id=Info>
            </span>

            <!-- As: MS says: HERE'S A GOOD PLACE TO ADD A FEW LINKS OF YOUR OWN, just remove the comments around them (<!-- -->) -->
            <!-- (examples commented out)
                <p>
                <br>
                <a href="http://www.mylink1.com/">Custom Link 1</a>
                <p class=Links>
                <a href="http://www.mylink2.com/">Custom Link 2</a>
            -->

            <p>
            <!-- this is the thumbnail viewer control -->
            <object id=Thumbnail classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92" style="display: none">
            </object>

            <!-- this is the status message that pops up during thumbnail generation -->
            <div id=Status style="display: none">
                Generating preview...
            </div>
            
            <p>
            <!-- this contains any ActiveMovie control created later -->
            <div id=Media>
            </div>
            
        </div>
        <!-- end left info panel -->

        <!-- this is the standard FileList control (Icon area) -->
        <!-- webbot bot="HTMLMarkup" startspan -->
        <object id=FileList border=0 tabindex=1 classid="clsid:1820FED0-473E-11D0-A96C-00C04FD705A2">
        </object>
        <!-- webbot bot="HTMLMarkup" endspan -->

    </body>
</html>

Windows Me
<!--
 * Copyright 1999 Microsoft Corporation.  All rights reserved.
 -->
<html> <!-- Add dir="Rtr", to invert the webview (Info Panel goes to the Right) -->
    <head>
        <meta http-equiv="content-type" content="text/html; charset=Windows-1252">
    </head>
    <style>
        body        {margin: 0; font: menu; color: black} /* The document body, including all texts */
        #Panel      {position: absolute; width: 200px; height: 100%; visibility: hidden} /* The info panel on the left, there is also some inline scripting linked to it in the body */
        #Corner     {padding-left: 12px; padding-right: 0px; padding-top: 11px} /* Corner position */
        #FolderIcon {width: 32px; height: 32px} /* The folder icon, change thing along with the param scale in the body */
        #FolderName {margin-top: 8px; font: 13pt/13pt menu; font-weight: bold} /* The folder title or name */
        #LogoLine   {width: 100%; height: 2px; margin-top: 4px; vertical-align: top} /* The blue line, change the source in the document body */
        #Details    {padding-left: 12px; padding-right: 0px; margin-top: 8px} /* Selected item(s) details */
        #Locked     {vertical-align: baseline}
        #Preview    {} /* The "Generating preview..." text and the Media players are written in this */
        .Movie      {width: 176px; height: 136px} /* Movie player */
        .Sound      {width: 176px; height: 46px} /* Sound player */
        .Divider    {width: 100%; color: #C0C0C0; height: 1px} /* A line (hr) divider */
        #Thumbnail  {width: 120px; height: 120px} /* The Thumbnail for image/html preview */
        .Legend     {margin-left: 8px; margin-right: 0px} /* The drive Pie chart legend */
        #FileList   {position: absolute; width: 0; height: 100%; border: 0} /* The Icon area, usually change the size attributes */
        p           {margin-top: 12px} /* All paragraphs */
        p.Half      {margin-top: 4px} 
        p.Button    {margin-top: 8px} /* The Synchronize button margins */
        button      {font: 8pt Tahoma; margin-left: 12px; margin-right: 0px} /* The Synchronize button */
        .Message    {margin: -4px; margin-right: 0; padding: 3px; background: infobackground; color: infotext; border: 1px solid lightgrey} /* The message */
        #CSCPlusMin {width: 17px} /* The plus and min buttons */
        #CSCText    {}
        #CSCDetail  {}
        #CSCButton  {}
    </style>

    <script>

        // THIS SCRIPT IS COMMON FOR ALL CUSTOM WEB VIEWS

        // Some words/sentences used in the script.
        var L_Prompt_Text         = "Select an item to view its description.";
        var L_Empty_Text          = "There are no items to show in this folder.";
        var L_Multiple_Text       = " items selected.";
        var L_Size_Text           = "Size: ";
        var L_FileSize_Text       = "Total File Size: ";
        var L_Delimiter_Text      = ",";
        var L_Bytes_Text          = " bytes";
        var L_Today_Text          = "Today at";
        var L_Yesterday_Text      = "Yesterday at";
        var L_Preview_Text        = "Generating preview...";
        var L_TotalSize_Text      = "Capacity: ";
        var L_UsedSpace_Text      = "Used: ";
        var L_FreeSpace_Text      = "Free: ";
        var L_Attributes_Text     = "Attributes";
        var L_Codes_Text          = "RHSaCE"; // suppress the Archive flag
        var L_ReadOnly_Text       = "Read-only";
        var L_Hidden_Text         = "Hidden";
        var L_System_Text         = "System";
        var L_Archive_Text        = "Archive";
        var L_Compressed_Text     = "Compressed";
        var L_Encrypted_Text      = "Encrypted";
        var L_NoAttributes_Text   = "(normal)";
        var L_SeeAlso_Text        = "See also:";
        var L_UsedSpaceTitle_Text = "Used Space";
        var L_FreeSpaceTitle_Text = "Free Space";
        var L_Colon_Text          = ": ";
        var gAttributeNames       = new Array(L_ReadOnly_Text, L_Hidden_Text, L_System_Text, L_Archive_Text, L_Compressed_Text, L_Encrypted_Text);
        var gIntroText            = "";
        var gTimer                = 0;
        var gDoBlends             = false && (navigator.cpuClass != "Alpha" && screen.colorDepth > 8); // If you have a cool comp, the info will popup in a blended style.
        var gPlusCold             = "<img id=CSCBmp align=middle src=pluscold.gif>"; // The Plus and Minus image codes
        var gPlusHot              = "<img id=CSCBmp align=middle src=plushot.gif>";
        var gMinusCold            = "<img id=CSCBmp align=middle src=mincold.gif>";
        var gMinusHot             = "<img id=CSCBmp align=middle src=minhot.gif>";
        var gToday;
        var gYesterday;
        var gFolderPath           = "";
        var gFoundAuthor          = false;

        function FormatDetail(label, data) { // This function Formats the details to prevent the panel from being too large
            var s;
            if (label.length + data.length > 32)
                s = "<p>" + label + L_Colon_Text + "<br>" + data;
            else
                s = "<p>" + label + L_Colon_Text + data;
            return s;
        }

        function SanatizeString(data) { // This function Formats the details to prevent html from being shown
          var re = /</g;
          var s = data.replace( re, "<");
          re = />/g;
          s = s.replace( re, ">");

          return s;
        }

        function ShowInfo() {
            // updates the left info panel when you select icons
            var item;
            var name;
            var data;
            var text;
            var title;
            var size = 0;
            var i;

            if (gDoBlends) { // The blending function
                Panel.filters.blendTrans.Stop();
                Panel.filters.blendTrans.Apply();
            }

            // kill any preview
            Preview.innerHTML = "";
            Preview.style.display = "none";
            Thumbnail.style.display = "none";

            data = FileList.SelectedItems().Count; // Counting the selected files
            if (data == 0) // nothing selected? go to NoneSelected()
                text = NoneSelected(); 
            else if (data > 1) // More than one item selected? go to ManySelected()
                text = ManySelected(data);
            else { //Only one item selected.
                item = FileList.SelectedItems().Item(0);

                //Getting the files's:
                // name
                name = FileList.Folder.GetDetailsOf(item, 0);
                if (!name)
                    name = item.Name;
                text = "<b>" + SanatizeString(name) + "</b>";
                if (false && IsFileLocked(FileList.Folder.GetDetailsOf(item, 4))) //File is locked
                    text += "  <img id=Locked src='res://webview.dll/Locked.gif'>";

                // type
                data = FileList.Folder.GetDetailsOf(item, 2);
                if (data)
                    text += "<br>" + data;

                // date
                text += HandleDate(item); // Go there

                // size
                text += HandleSize(item); // Go there

                // extra details?
                gFoundAuthor = false;
                for (i = 4; i < 10; i++) { // Starting with 4 (the file attributes), going to 10
                    title = FileList.Folder.GetDetailsOf(null, i);
                    if (!title) //If we don't get something, breaking the loop
                        break;
                    data = FileList.Folder.GetDetailsOf(item, i);
                    if (title == L_Attributes_Text) // Else, if we have the attributes
                    {
                        if ( !item.IsFolder ) // Item is not a folder
                            text += "<p>" + title + L_Colon_Text + FormatAttributes(data);
                    }
                    else if (data) { // There is other data
                        var safeData = SanatizeString(data);
                        if (title == "Author") { //An autor
                            gFoundAuthor = true;
                            text += "<p>" + title + L_Colon_Text + "<a href='mailto:" + safeData + "'>" + safeData + "</a>";
                        } else //Something else
                            text += FormatDetail(title, safeData);
                    }
                }

                Info.innerHTML = text;  // errors may be generated if the thumbnail or media preview controls
                                        // are not available. So, we "flush" the text before that

                // try to generate a new thumbnail or media preview
                if (item.Size)
                    if (Thumbnail.displayFile(item.Path))
                        gTimer = window.setTimeout('Preview.innerHTML = "<br>" + L_Preview_Text; Preview.style.display = ""', 1000);
                    else
                    {
                        ext = GetFileExtension(item.Path); // Getting file's extension
                        if (IsMovieFile(ext)) // It's a movie, writing movie player code, go there.
                        {
                            Preview.innerHTML = '<p>' +
                                '<object ID=MediaPlayer class=Movie classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">' +
                                    '<param name="ShowDisplay" value=false>'+
                                    '<param name="AutoPlay" value="false">' +
                                '</object>';
                            MediaPlayer.EnableContextMenu = false;
                            MediaPlayer.Open(item.Path);
                        }
                        else if (IsSoundFile(ext)) // It's a sound file, writing sound player code, go there.
                        {
                            Preview.innerHTML = '<p>' +
                                '<object  ID=MediaPlayer class=Sound classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">' +
                                    '<param name="ShowDisplay" value="false">'+
                                    '<param name="AutoPlay" value="false">' +
                                '</object>';
                            MediaPlayer.EnableContextMenu = false;
                            MediaPlayer.Open(item.Path);
                        }

                        if (Preview.innerHTML != "") // There is a preview, showing Preview div
                            Preview.style.display = "";
                    }
            }
            // replace Info with the new text
            Info.innerHTML = text;
            if (gDoBlends)
                Panel.filters.blendTrans.Play();
        }

        function FormatNumber(n) { // This function replaces the point by a coma for a number
            var s = "";
            var i, j = 0;
            for (i = n.length - 1; i >= 0; i--) {
                s = n.charAt(i) + s;
                if (i && ((++j % 3) == 0))
                    s = L_Delimiter_Text + s;
            }
            return s;
        }

        function HandleSize(item) {// This function handles the file size
            var s = "";
            var size = item.Size;
            if (size && size >= 0 && size < 1000) If size < 1000, display in bytes
                s = "<p>" + L_Size_Text + size + L_Bytes_Text;
            else {
                var data = FileList.Folder.GetDetailsOf(item, 1); //Using another way to get the size
                if (data) //If we succeed
                    s = "<p>" + FileList.Folder.GetDetailsOf(null, 1) + L_Colon_Text + data; // Using a null value in GetdetailsOf gets the type of data we want (ex: "Size :")
                else if (size)
                    s = "<p>" + L_Size_Text + FormatNumber(size.toString()) + L_Bytes_Text; // Using default method, and formatting size.
            }
            return s;
        }

        function HandleDate(item) { // This function handles the file's last modified date
            var s = "";
            var data = FileList.Folder.GetDetailsOf(item, 3); // Getting the date
            if (data) // If there is a date
                s = "<p>" + FileList.Folder.GetDetailsOf(null, 3) + L_Colon_Text + data;
            return s;
        }

        function FormatAttributes(data) { // This function formats the file's attributes
            var s = "";
            var code;
            for (i = 0; i < L_Codes_Text.length; i++) {
                code = L_Codes_Text.charAt(i);
                if (data.indexOf(code) > -1) {
                    if (s)
                        s += ", ";
                    s += gAttributeNames[i];
                }
            }
            if (!s)
                s = L_NoAttributes_Text;
            return s;
        }

        function FormatComment(data) { // This function formats the file's comments
            var s = "";
            if (data) {
                data = SanatizeString( data );
                var start;
                var end;
                var theLink;
                var a = data.split("\n");
                var L_Author_Text = "Author: ";

                // look for a contact
                for (var i in a) {
                    start = a[i].indexOf(L_Author_Text);
                    if (start < 0)
                        continue;
                    if (gFoundAuthor) // already in Details column
                        a[i] = "";
                    else {
                        start += L_Author_Text.length;
                        end = a[i].length;
                        theLink = data.substring(start, end);
                        a[i] = L_Author_Text + "<a href='mailto:" + theLink + "'>" + theLink + "</a>";
                    }
                }

                // parse lines for Office files without breaking links below
                data = a.join("<br>\n");
                // look for embedded links
                start = data.indexOf("http://");
                if (start < 0)
                    start = data.indexOf("file://");
                if (start < 0)
                    s += data;
                else {
                    end = data.indexOf(" ", start);
                    if (end < 0)
                        end = data.length;
                    if (start > 0)
                        s += data.substring(0, start - 1);
                    theLink = data.substring(start, end);
                    s += theLink.link(theLink);
                    if (end < data.length)
                        s += data.substring(end + 1, data.length);
                }
            }
            return s;
        }

        function GetFileExtension(name) { // This function gets the file's extention
            var ext = name.substring(name.lastIndexOf(".") + 1, name.length);
            return ext.toLowerCase();        
        }

        function IsMovieFile(ext) { // This function checks if the file is a movie
            // disabled, comment (//) the following line to enable it
            return false;

            var types = ",asf,avi,wmv,wvx,m1v,mov,mp2,mpa,mpe,mpeg,mpg,mpv2,qt,asx,";
            var temp = ","+ext+",";
            return types.indexOf(temp) > -1;
        }

        function IsSoundFile(ext) { // This function checks if the file is a sound file
            // disabled, comment (//) the following line to enable it
            return false;

            var types = ",aif,aiff,au,mid,midi,rmi,snd,wav,mp3,m3u,wma,";
            var temp = ","+ext+",";
            return types.indexOf(temp) > -1;
        }

        function IsFileLocked(name) { // This function checks if the file is locked
            return (name.indexOf(L_Codes_Text.charAt(0)) > -1);
        }

        function GetMessage() { // Return the folder message
            var s = "";
            return (s) ? "<p><div class=Message>" + s + "</div>" : "";
        }

        function CSCFolderStatus() { // This function gets the status of the folder (offline/online)
            return FileList.Folder.OfflineStatus;
        }

        function CSCSynchronize() { // This function synchronizes the folder content with it's online content
            FileList.Folder.Synchronize();
        }

        function CSCGetStatusText(status) // This function gets the status text of the folder
        {
            var s = "";
            var L_Online_Text                   = "This folder is <b>Online</b>.";
            var L_Offline_Text                  = "This folder is <b>Offline</b>.";
            var L_ServerAvailable_Text          = "This folder is <b>Offline</b>, but now you can synchronize.";
            var L_DirtyCache_Text               = "This folder is <b>Online</b>, but out of date.";

            switch(status)
            {
            case 0:
                s = L_Online_Text;
                break;
            case 1:
                s = L_Offline_Text;
                break;
            case 2:
                s = L_ServerAvailable_Text;
                break;
            case 3:
                s = L_DirtyCache_Text;
                break;
            }
            return s; // Returning an integer between 0 and 3
        }

        function CSCGetStatusDetail(status) // This function converts the integer to a sentence
        {
            var s = "";
            var L_OnlineExpand_Text            = "You can make files in this folder available when you are " +
			    "disconnected from the network by selecting the file and clicking on Make Available Offline in the File menu.";
            var L_OfflineExpand_Text           = "Any changes you make while offline will need to be synchronized +
			    "the next time you connect to the network.";
            var L_ServerAvailableExpand_Text   = "The server that hosts this folder has become available again.";
            var L_DirtyCacheExpand_Text        = "Changes you made while working offline have not been synchronized yet.";
            switch(status)
            {
            case 0:
                s = L_OnlineExpand_Text;
                break;
            case 1:
                s = L_OfflineExpand_Text;
                break;
            case 2:
                s = L_ServerAvailableExpand_Text;
                break;
            case 3:
                s = L_DirtyCacheExpand_Text;
                break;
            }
            return s;
        }

        function CSCGetStatusButton(status) // This function writes the Synchronize button if necessary
        {
            var s = "";
            var L_SynchronizeButton_Text        = "<p class=Button><button onclick='CSCSynchronize()'>Synchronize</button>";
            if ((status == 2) || (status == 3))
            {
                s = L_SynchronizeButton_Text;
            }
            return s;
        }

        function CSCShowStatusInfo(expand) // This function formats the folder status
        {
//            var status = CSCFolderStatus();  Doesn't work on downlevel webview (IE4), so commenting out. 
              //If you are using Me, move the comment (//) to the next line.
            var status = -1;
            
            if (status >= 0)
            {
                var fIsHot = (CSCText.style.color == document.linkColor);

                CSCText.innerHTML = CSCGetStatusText(status); // This is the Plus/Minus script
                if (expand)
                {
                    CSCText.innerHTML += "<br>";
                    if (fIsHot)                        
                        CSCPlusMin.innerHTML = gMinusHot;
                    else
                        CSCPlusMin.innerHTML = gMinusCold;
                    CSCDetail.innerHTML = CSCGetStatusDetail(status) + "<br>";
                    if (document.dir == "rtl")
                        CSCDetail.style.marginRight = document.body.clientWidth - (CSCText.offsetLeft + CSCText.offsetWidth);
                    else
                        CSCDetail.style.marginLeft = CSCText.offsetLeft;
                    CSCDetail.style.display = "";
                }
                else
                {
                    if (fIsHot)
                        CSCPlusMin.innerHTML = gPlusHot;
                    else
                        CSCPlusMin.innerHTML = gPlusCold;
                    CSCDetail.style.display = "none";
                }
                var cscButton = CSCGetStatusButton(status);
                if (cscButton.length > 0)
                {
                    CSCButton.innerHTML = cscButton;
                    CSCButton.style.display = ""
                }
                else
                {
                    CSCButton.style.display = "none"
                }
                CSC.style.display = "";
            }
            else
            {
                CSC.style.display = "none";
            }
        }

        // All these are for the Plus/Minus script
        function CSCShowExpandedStatus(expand)
        {
            CSCShowStatusInfo(true);
        }

        function CSCShowFoldedStatus(expand)
        {
            CSCShowStatusInfo(false);
        }

        function IsCSCStatusExpanded()
        {
            return ((CSCPlusMin.innerHTML.indexOf("mincold.gif") != -1) ||
                    (CSCPlusMin.innerHTML.indexOf("minhot.gif") != -1));

        }

        function IsCSCStatusFolded()
        {
            return ((CSCPlusMin.innerHTML.indexOf("pluscold.gif") != -1) ||
                    (CSCPlusMin.innerHTML.indexOf("plushot.gif") != -1));
        }

        function CSCShowStatus()
        {
            if (IsCSCStatusExpanded())
            {
                CSCShowExpandedStatus();
            }
            else    // Default to folded status
            {
                CSCShowFoldedStatus();
            }
        }

        function CSCShowStatus_FoldExpand_Toggle()
        {
            if (IsCSCStatusExpanded())
            {
                CSCShowFoldedStatus();
            }
            else if(IsCSCStatusFolded())
            {
                CSCShowExpandedStatus();
            }
        }

        function CSC_MouseOver()
        {
            if (CSCText.style.cursor == "hand")
                return;

            if (IsCSCStatusExpanded())
                CSCPlusMin.innerHTML = gMinusHot;
            else
                CSCPlusMin.innerHTML = gPlusHot;
            CSCText.style.color = document.linkColor;
            CSCPlusMin.style.cursor = "hand";
            CSCText.style.cursor = "hand";
        }

        function CSC_MouseOut()
        {
            if (CSCText.style.cursor == "auto")
                return;

            if (element = window.event.toElement)
            {
                idCursor = element.id;
                if (idCursor == "CSCDiv" ||
                    idCursor == "CSCText" ||
                    idCursor == "CSCPlusMin" ||
                    idCursor == "CSCBmp")
                {
                    return;
                }
            }

            if (IsCSCStatusExpanded())
                CSCPlusMin.innerHTML = gMinusCold;
            else
                CSCPlusMin.innerHTML = gPlusCold;
            CSCText.style.color = "black";
            CSCPlusMin.style.cursor = "auto";
            CSCText.style.cursor = "auto";
        }

        function NoneSelected() { // This function handles what happens if no item is selected
            // Uncomment the following for some more info, if you are using Me
		    //var s = gIntroText + (FileList.Folder.Items().Count ? L_Prompt_Text : L_Empty_Text);
            var s = gIntroText + L_Prompt_Text;

            s += GetMessage(); // Go there

            if (false || gFolderPath.length == 3) { // true allows all subfolders to show the pie chart
                drive = gFolderPath.substring(0, 3); // Getting the drive name
                if (Thumbnail.displayFile(drive)) { // If we can show the Pie chart
                    if (gFolderPath.length == 3)
                        s += "<p><br>" + L_TotalSize_Text + Thumbnail.totalSpace + "<p>"; //Writing the total space
                    else
                        s += "<p><br>" + drive.link(drive) + "<p><p>" + L_TotalSize_Text + Thumbnail.totalSpace;
                    s += "<p><table class=Legend width=12 height=12 border=1 ";
                    if (document.dir == "rtl")
                        s += "align=right";
                    else
                        s += "align=left";
                    s += " bgcolor=threedface bordercolordark=black bordercolorlight=black><tr><td title=\"";
                    s += L_UsedSpaceTitle_Text;
                    s += "\"></td></tr></table> " + L_UsedSpace_Text + Thumbnail.usedSpace; //Writing the used space
                    s += "<p><table class=Legend width=12 height=12 border=1 ";
                    if (document.dir == "rtl")
                        s += "align=right";
                    else
                        s += "align=left";
                    s += " bgcolor=threedhighlight bordercolordark=black bordercolorlight=black><tr><td title=\"";
                    s += L_FreeSpaceTitle_Text;
                    s += "\"></td></tr></table> " + L_FreeSpace_Text + Thumbnail.freeSpace; //Writing the free space
                    Thumbnail.style.display = ""; // Displaying...
                }
            }
            return s;
        }

        function ManySelected(items) { // This function handles what happens if more than one item are selected
            var s = items + L_Multiple_Text + "<p>";
            var size = 0;
            if (items <= 100) { // If there is less than 100 items selected
                for (var i = 0; i < items; i++) {
                    var itemsize = FileList.SelectedItems().Item(i).Size // Total size
                    if (itemsize < 0)
                        size += (itemsize + 4294967296);
                    else
                        size += itemsize;
                }
                if (size)
                    s += L_FileSize_Text + FormatNumber(size.toString()) + L_Bytes_Text + "<p>";
                if (items <= 16) //If there is less than 16 item selected (you can change that):
                    for (i = 0; i < items; i++)
                        s += SanatizeString(FileList.SelectedItems().Item(i).Name) + "<br>"; //Display the 16 names
            }
            return s;
        }

        // EVENTS

        function Resize() { 
        // This function handles fixed panel sizing and collapsing when the window resizes
            if (document.body.clientWidth < Panel.style.pixelWidth * 2) { // If the window size is < to twice the size of the Panel:
                Panel.style.visibility = "hidden"; // Hide the Panel
                FileList.style.pixelLeft = 0; // Change the left position and width of the FileList
                FileList.style.pixelWidth = document.body.clientWidth;
            } else {
                Panel.style.visibility = "visible"; // Show the Panel
                if (document.dir == "rtl") { // If document is set to right align (here), inverting webview.
                    FileList.style.pixelLeft = 0;
                } else {
                    FileList.style.pixelLeft = Panel.style.pixelWidth;
                }
                FileList.style.pixelWidth = document.body.clientWidth - Panel.style.pixelWidth; // This happens at any time to set the width of the FileList
            }
        }

        function ThumbnailReady() { // This function handles what happens when the Thumbnail is ready
            window.clearTimeout(gTimer);
            Preview.innerHTML = "";
            Preview.style.display = "none";
            if (Thumbnail.haveThumbnail())
                Thumbnail.style.display = "";
        }

        // INITIALIZATION

        function Initialize(introText) { // This function handles what happens when the folder is loaded for the first time
            gIntroText = introText;
            gFolderPath = Info.innerHTML;

            Thumbnail.style.display = "none";

            CSCShowStatus();
            
            Info.innerHTML = NoneSelected();

            // Fix styles
            var L_SystemFont1_Text = "MS Sans Serif";
            var L_SystemFont2_Text = "MS Shell Dlg";
            var L_SystemFont_Text = "Tahoma, Verdana";
            var tr = document.body.createTextRange();
            if (navigator.cpuClass != "Alpha") {
                tr.collapse();
                var actualFont = tr.queryCommandValue("FontName");
                if (actualFont == L_SystemFont1_Text || actualFont == L_SystemFont2_Text)
                    document.body.style.fontFamily = L_SystemFont_Text;
            } else
                document.body.style.fontFamily = L_SystemFont_Text;

            // Init relative dates
            gToday = new Date();
            gToday = gToday.toLocaleString();
            gToday = gToday.substring(0, gToday.indexOf(' '));
            gYesterday = new Date(Date.parse(gToday) - (1000 * 60 * 60 * 24));
            gYesterday = gYesterday.toLocaleString();
            gYesterday = gYesterday.substring(0, gYesterday.indexOf(' '));

            // Call the Resize() function whenever the window gets resized
            window.onresize = Resize;
        }

        function OnWebviewLinkEnter( aLink ) // Changes the status bar according to links
        {
            if( aLink.title )
            {
                window.status = aLink.title;
            }
            else
            {
                window.status = "";
            }
            return true;
        }

        function OnWebviewLinkExit()
        {
            window.status = "";
            return false;
        }

        function errorHandler() { 
            return true;    // Don't show the default error message box
        }

        function Load() { // This function is called on load, and forwards to other initialization functions.

            Panel.style.overflow = "auto";
            window.onerror = errorHandler;
            Initialize("");
            Resize();
        }

        function StopMediaPlayer() // This function stops the media player
        {
            if (Preview.innerHTML != "")
            {
                //MediaPlayer.Stop();
            }
        }
    </script>

    <script for="Thumbnail" event="OnThumbnailReady"> // Launches the ThumbnailReady() function when a thumbnail is ready
        ThumbnailReady();
    </script>

    <script for="FileList" event="SelectionChanged"> // Launches the ShowInfo() function when the selection changed
        window.clearTimeout(gTimer);
        gTimer = window.setTimeout("ShowInfo()", gDoBlends ? 500 : 0); // need actual double-click time
    </script>

    <script for="FileList" event="VerbInvoked"> // What happens when a verb is called
        // If the user immediately double-clicks the file, we would get
        // a selection changed event immediately followed by the VerbInvoked
        // event and we would not have had enough time to create the MediaPlayer
        // in the SelectionChanged event handler. So, we delay handling this
        // event a little bit
        window.setTimeout("StopMediaPlayer()", 500);
    </script>

    <script for="FileList" event="BeginDrag"> // What happens when a file is dragged
        window.setTimeout("StopMediaPlayer()", 500);
    </script>

    <script for="WVLink" event="onmouseover"> // OnMouseOver/Out for Links
        return OnWebviewLinkEnter( this );
    </script>

    <script for="WVLink" event="onfocus">
        return OnWebviewLinkEnter( this );
    </script>

    <script for="WVLink" event="onmouseout">
        return OnWebviewLinkExit();
    </script>

    <script for="WVLink" event="onblur">
        return OnWebviewLinkExit();
    </script>
        
    <body scroll=no onload=Load()>
    <!-- This is the main body. No scrollbars, and an Init() function on load. -->
    
        <!-- start left info panel -->
        <div id=Panel style="background: white URL(file://%TEMPLATEDIR%/wvleft.gif) no-repeat left top"> <!-- The Panel inline style, change the background here. -->
            <div id=Corner>
                <!-- The folder icon -->
                <object id=FolderIcon classid="clsid:E5DF9D10-3B52-11D1-83E8-00A0C90DC849" tabIndex=-1>
                    <param name="scale" value=100>
                </object>
                <br>
                <!-- The folder title, %THISDIRNAME% gets replaced -->
                <div id=FolderName>
                    %THISDIRNAME%
                </div>
            </div>
            <!-- The colored logoline, change the path here. -->
            <img id=LogoLine src="file://%TEMPLATEDIR%/wvline.gif">
            <!-- The file details -->
            <div id=Details>
                <span id=CSC>
                    <div id=CSCDiv tabIndex=2 onmouseover="CSC_MouseOver()" onmouseout="CSC_MouseOut()" 
					    onclick="CSCShowStatus_FoldExpand_Toggle()" onkeypress="CSCShowStatus_FoldExpand_Toggle()">
                    <span id=CSCPlusMin>
                    </span>
                    <span id=CSCText>
                    </span>
                    <br>
                    </div>
                    <div id=CSCDetail>
                    </div>
                    <span id=CSCButton>
                    </span>
                    <hr CLASS=Divider NOSHADE>
                </span>
                <span id=Info>
                    %THISDIRPATH%
                </span>
                <!-- The Preview zone -->
                <div id=Preview style="display: none">
                </div>
                <br>

                <!-- The Thumbnail/Pie chart -->
                <object id=Thumbnail classid="clsid:1D2B4F40-1F10-11D1-9E88-00C04FDCAB92" tabIndex=-1>
                </object>
                <label id=ThumbnailLabel for="Thumbnail" style="display: none">
                </label>

            </div>
        </div>
        <!-- end left info panel -->
		
        <!-- this is the standard FileList control (Icon area) -->
        <object id=FileList classid="clsid:1820FED0-473E-11D0-A96C-00C04FD705A2" tabIndex=1>
        </object>
		
    
    </body>
</html>

Related
Top

xhtml 1.1