../Msgboard/General customization/Edit webview - file sizeHome
NoNameNeeded - 09 Aug. 2007 - 13:25:

Edit webview - file size

I found a folder.htt "creator" on a site but completely changed it to look more like Windows Vistas Shellstyle.
http://img407.imageshack.us/img407/6441/zwischenablage01py8.jpg

Now the problem is that the file size isn't shown correctly.
I can either display it in KB (which I don't want) or in MB:
MB would be ok, but the problem is that it only shows the size without a comma, i.e. if the file ist smaller than 1MB it only shows "0MB" or if the file is larger than 1MB it shows "1MB" instead of "1,35MB" (as you can see in the screenshot)

This is the code:

<!-- Customized Folder.htt file ---------->
<!-- For this folder view to work properly, calc.html must be in the same folder -->
<!-- and the component JSFileView.ocx must be registered. -->

<html>
<head>
<body style="color: #000; background: #FFF

url(d:windowswebvistaseite10.bmp) no-repeat bottom left; margin: 0;"

onload="Loader()" scroll="no" onload="Init()" link="black" >
<title></title>



<script language="VBScript">
Dim HFL, HShow, HBoth, WinWide, PercTop, PercBot, BooMaxed, Q2,

BooActive

Sub Loader()
BooMaxed = False
BooActive = True
Q2 = Chr(34)
End Sub
Sub FileList_SelectionChanged()
Dim fsel, sdate, sz, sp, sFolPath, BooFil, typ, app,
On Error Resume Next
If FileList.SelectedItems().Count = 1 Then
fsel = FileList.Selecteditems().item(0)
sFolPath = "%THISDIRPATH%"
If (Right(sFolPath, 1) <> "") Then sFolPath = sFolPath & ""
sFolPath = sFolPath & fsel
sdate = FileList.Selecteditems().item(0).modifydate
typ = FileList.Selecteditems().item(0).type

sz = FileList.SelectedItems().Item(0).Size;
if (size && size < 1000)
text += "" + L_Size_Text + size + L_Bytes_Text;
else {data = fldr.GetDetailsOf(items, 1);
if (data)
text += "" + fldr.GetDetailsOf(null, 1) + ": " + data;
else if (size)
text += "" + L_Size_Text + FormatNumber(size.toString())

+ L_Bytes_Text;
}
lab.innerhtml = fsel
dat.innerhtml = sdate
dad.innerhtml = "Änderungsdatum: "
siz.innerhtml = "Größe: "
sis.innerhtml = sz
art.innerhtml = typ
var L_Size_Text = "Size : ";
var L_Bytes_Text = " bytes";
Else
lab.innerhtml = ""
dat.innerhtml = ""
siz.innerhtml = ""
dad.innerhtml = ""
sis.innerhtml = ""
art.innerhtml = ""
End If
End Sub

</script>
<style type="text/css">
<!--
a:link { text-decoration:none }
a:visited { text-decoration:none }
a:hover { text-decoration:none }
a:active { text-decoration:none }
a:focus { text-decoration:none }
-->
</style>

</head><p class="text1">










<span style="position: absolute; bottom: 0px; left: 0px;">
</span>



<param name="scale" value="100">
<tr>

<td id="mainwin" valign="top" border=0>
<object id="FileList" width="100%" height="80%"

hspace=0 vspace=0

classid="clsid:1820FED0-473E-11D0-A96C-00C04FD705A2"><param

name="NoClientEdge" value="true"></object>


</td>
</tr>



<span style="position: absolute; top: 30px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Anwend XP
</span>
<span style="position: absolute; top: 50px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Computer
</span>
<span style="position: absolute; top: 70px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Files XP
</span>
<span style="position: absolute; top: 90px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
System32
</span>
<span style="position: absolute; top: 110px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Windows
</span>
<span style="position: absolute; top: 130px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Programme
</span>

<div style="position: absolute; bottom: 15px; left: 225px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="dat"></Label>
</div>

<div style="position: absolute; bottom: 15px; left: 120px;">
<font face="Segoe UI" size=2>
<font color="#6D7B8D">
<Label id="dad"></Label>
</div>

<div style="position: absolute; bottom: 35px; left: 182px;">
<font face="Segoe UI" size=2>
<font color="#6D7B8D">
<Label id="siz"></Label>
</div>

<div style="position: absolute; bottom: 35px; left: 225px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="sis"></Label>
</div>

<div style="position: absolute; bottom: 60px; left: 120px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="art"></Label>
</div>

<div style="position: absolute; bottom: 80px; left: 120px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="lab"></Label>
</div>



<font face="Segoe UI" size=1>



</font>

</body>
</html>
 
09 Aug. 2007 - 13:28 NoNameNeeded
Sorry, the above code is the wrong one (I already tried something there that didn't work out).

This is the real code:

<!-- Customized Folder.htt file ---------->
<!-- For this folder view to work properly, calc.html must be in the same folder -->
<!-- and the component JSFileView.ocx must be registered. -->

<html>
<head>
<body style="color: #000; background: #FFF url(d:windowswebvistaseite10.bmp) no-repeat bottom left; margin: 0;" onload="Loader()" scroll="no" onload="Init()" link="black" >
<title></title>
<script language="VBScript">
Dim HFL, HShow, HBoth, WinWide, PercTop, PercBot, BooMaxed, Q2, BooActive

Sub Loader()
BooMaxed = False
BooActive = True
Q2 = Chr(34)
End Sub
Sub FileList_SelectionChanged()
Dim fsel, sdate, sz, sp, sFolPath, BooFil, typ, app
On Error Resume Next
If FileList.SelectedItems().Count = 1 Then
fsel = FileList.Selecteditems().item(0)
sFolPath = "%THISDIRPATH%"
If (Right(sFolPath, 1) <> "") Then sFolPath = sFolPath & ""
sFolPath = sFolPath & fsel
sdate = FileList.Selecteditems().item(0).modifydate
typ = FileList.Selecteditems().item(0).type
sz = FileList.Selecteditems().item(0).size
sz = (sz 1048576) & "MB"
lab.innerhtml = fsel
dat.innerhtml = sdate
dad.innerhtml = "Änderungsdatum: "
siz.innerhtml = "Größe: "
sis.innerhtml = sz
art.innerhtml = typ
Else
lab.innerhtml = ""
dat.innerhtml = ""
siz.innerhtml = ""
dad.innerhtml = ""
sis.innerhtml = ""
art.innerhtml = ""
End If
End Sub

</script>
<style type="text/css">
<!--
a:link { text-decoration:none }
a:visited { text-decoration:none }
a:hover { text-decoration:none }
a:active { text-decoration:none }
a:focus { text-decoration:none }
-->
</style>

</head><p class="text1">










<span style="position: absolute; bottom: 0px; left: 0px;">
</span>



<param name="scale" value="100">
<tr>

<td id="mainwin" valign="top" border=0>
<object id="FileList" width="100%" height="80%" hspace=0 vspace=0 classid="clsid:1820FED0-473E-11D0-A96C-00C04FD705A2"></object>


</td>
</tr>



<span style="position: absolute; top: 30px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Anwend XP
</span>
<span style="position: absolute; top: 50px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Computer
</span>
<span style="position: absolute; top: 70px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Files XP
</span>
<span style="position: absolute; top: 90px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
System32
</span>
<span style="position: absolute; top: 110px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Windows
</span>
<span style="position: absolute; top: 130px; left: 3px;">

<font face="Segoe UI" size=2>
<font color="#000000">
Programme
</span>

<div style="position: absolute; bottom: 15px; left: 225px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="dat"></Label>
</div>

<div style="position: absolute; bottom: 15px; left: 120px;">
<font face="Segoe UI" size=2>
<font color="#6D7B8D">
<Label id="dad"></Label>
</div>

<div style="position: absolute; bottom: 35px; left: 182px;">
<font face="Segoe UI" size=2>
<font color="#6D7B8D">
<Label id="siz"></Label>
</div>

<div style="position: absolute; bottom: 35px; left: 225px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="sis"></Label>
</div>

<div style="position: absolute; bottom: 60px; left: 120px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="art"></Label>
</div>

<div style="position: absolute; bottom: 80px; left: 120px;">
<font face="Segoe UI" size=2>
<font color="#000000">
<Label id="lab"></Label>
</div>



<font face="Segoe UI" size=1>



</font>

</body>
</html>
 
10 Aug. 2007 - 00:15 DiosDePyro
Would it be possible to take the kb number and do some math on it to turn it into MB?
 
10 Aug. 2007 - 00:43 NoNameNeeded
I don't know...
But I don't think it's possible.
 
Please log-in to post.
You need to be logged in to post. To log-in, or to register an account go -there.
 
Options
Login | Help | Profile | User list | Display last  
 days 


../Msgboard/General customization/Edit webview - file sizeTop