Klipfolio Inc. Copyright © 2002-2009 Klipfolio Inc. support@klipfolio.com http://www.klipfolio.com/ Disk Monitor Op8Soa/a6dP+mnfU0vote1V6a0vT3kaa5seBURMua++dx28I5Vi9N001xhoKtEfHhN0mRFv3gu0Pbhym1vPgt1z90ZC6SKI1tts2APBbaZVtopCgmTKzLgFzso98vWo/KsViDWotIHRNRv7YOeEIKa6KegiaaNYoJbbgDA9zwvM= 2.0 hard-drive-monitor-50289 2009.01.13 Monitor your drives with this system monitor. Information is updated every 15 minutes, or by manual refresh. hard drive disk monitor space size capacity http://www.klipfolio.com http://www.serence.com/serence_klips/pics/drive-monitor/disk_monitor_icon.png http://www.serence.com/serence_klips/pics/drive-monitor/disk_monitor_banner.gif http://www.serence.com/serence_klips/disk-monitor.klip extended 15 true ca -- Getting drive information... No information to display. = 1000) { freeSpace = freeSpace / 1024; counter++; } var freeSpaceUnits = determineUnits(counter); counter = 0; while(capacity >= 1000) { capacity = capacity / 1024; counter++; } var capacityUnits = determineUnits(counter); // Construct the food for this entry food += "" + j + "" + driveIcon + ""; food += "" + g_url + drivePct + ".png" + roundNumber(usedPct) + "%"; food += "" + roundNumber(usedPct) + "% Used"; food += "" + roundNumber(freeSpace) + " " + freeSpaceUnits + ""; food += "" + roundNumber(freeSpace) + " " + freeSpaceUnits + " Free"; food += "" + roundNumber(capacity) + " " + capacityUnits + ""; food += "file:///" + drives[j] + "/"; g_DriveList += drives[j]; } // for Engines.KlipFood.process(food); if(g_DriveList != oldDriveList) { updateListControl(); updateVisibility(); savePrefs(); } } return true; } function onRefresh() { if (KFVersionOutOfDate ()) return false; var success = getDriveInfo(); // Remove any drives that weren't refreshed - they aren't there any more Items.purge(); // Sort the items alphabetically by drive letter Items.sort(compareItems); // Make sure the user can't delete or dim (visit) the data. var i = 0; for(i = 0; i < Items.length; i++) { Items[i].canvisit = false; Items[i].candelete = false; } return success; } function updateListControl() { g_ListControl.clear(); var driveList = g_DriveList.split(":"); var prefValue; var j = 0; for(j = 0; j < (driveList.length - 1); j++) { g_ListControl.addItem(driveList[j] + ":"); prefValue = Prefs.getPref("LC-" + driveList[j] + ":"); if(prefValue == "checked") { g_ListControl.setState(j, true); } else if(prefValue == "unchecked") { g_ListControl.setState(j, false); } else { // Set the control to checked by default. g_ListControl.setState(j, true); } } } function updateVisibility() { // The order of the list controls matches the list of drives for(var i = 0; i < Items.length; i++) { // If the box is checked, don't hide the item. // If the box is not checked, hide the item. Items[i].hidden = !g_ListControl.getState(i); } } function compareItems( item1, item2 ) { var drive1 = item1.getData("label").charAt(0); var drive2 = item2.getData("label").charAt(0); if (drive1 < drive2) { return -1; } else if (drive1 == drive2) { return 0; } else { return 1; } } function determineUnits(count) { var units = ""; switch(count) { case 0: // bytes (?) units = "bytes"; break; case 1: // kilobytes units = "KB"; break; case 2: // megabytes units = "MB"; break; case 3: // gigabytes units = "GB"; break; case 4: // terrabytes (!) units = "TB"; break; } return units; } function roundNumber(oldNum) { // This function returns a string var newNum = Math.round(oldNum * 100) / 100 + ""; if(newNum.lastIndexOf(".") == -1) { // The number has no decimal place in it, so add ".00" newNum += ".00"; } else if(newNum.lastIndexOf(".") == (newNum.length - 2)) { // The number has one digit after the decimal, so add a "0" newNum += "0"; } return newNum; } function KFVersionOutOfDate () { // check to see if this version of KlipFolio is out of date if (KlipFolio == null || KlipFolio.build <= 5892) { var introText = "" + "" + "KlipFolio verison 4 is required to run this Klip. Click here to download the latest version." + "http://www.klipfolio.com/inkf-beta" + "welcome_message" + "" + ""; var introStyle = "introitem {type:item; definition: 'introtext,introlink,introiid';}" + "introtext {itemcol:1; noterow:1; wrap:true; notelabel:false;}" + "introlink {type:link;}" + "introiid {key:override}"; Engines.KlipFood.stylesheet = introStyle; Engines.KlipFood.process (introText); Engines.KlipFood.stylesheet = "@import klip"; g_outofdate = true; return true; } g_outofdate = false; return false; } ]]>