관리-도구
편집 파일: CrushFTP.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <head> <script type="text/javascript" src="file:///System/Library/WidgetResources/AppleClasses/AppleInfoButton.js"></script> <script type="text/javascript" src="file:///System/Library/WidgetResources/AppleClasses/AppleAnimator.js"></script> <script type="text/javascript" src="file:///System/Library/WidgetResources/AppleClasses/AppleButton.js"></script> <script type="text/javascript"> var flipper; var transFader; var startSize; var glassButton; if (window.widget) { widget.onhide = onHide; widget.onshow = onShow; } function onHide() { window.widget.setPreferenceForKey(document.getElementById("CrushFTP_URL").value, widget.identifier+"CrushFTP_URL"); window.widget.setPreferenceForKey(window.innerWidth, widget.identifier+"width"); window.widget.setPreferenceForKey(window.innerHeight, widget.identifier+"height"); } function onShow() { if (widget.preferenceForKey(widget.identifier+"CrushFTP_URL")) { window.resizeTo(widget.preferenceForKey(widget.identifier+"width"), widget.preferenceForKey(widget.identifier+"height")); setTimeout('doUpdate()',500); } else { window.widget.setPreferenceForKey("http://127.0.0.1:8080/WebInterface/login.html?username=webstatistics&password=webstatistics", widget.identifier+"CrushFTP_URL"); window.widget.setPreferenceForKey(window.innerWidth, widget.identifier+"width"); window.widget.setPreferenceForKey(window.innerHeight, widget.identifier+"height"); setTimeout('doUpdate()',500); } } function showBack(event) { if (window.widget) { widget.prepareForTransition("ToBack"); } document.getElementById("front").style.display = "none"; document.getElementById("back").style.display = "block"; if (widget.preferenceForKey(widget.identifier+"CrushFTP_URL")) document.getElementById("CrushFTP_URL").value = widget.preferenceForKey(widget.identifier+"CrushFTP_URL"); if (window.widget) { setTimeout("widget.performTransition()", 0); } } function showFront(event) { doUpdate(); selectedTD = document.getElementById("serverInfoTD"); setTimeout("selectTab('serverInfoTD');",500); if (window.widget) { window.widget.prepareForTransition("ToFront"); } document.getElementById("back").style.display = "none"; document.getElementById("front").style.display = "block"; if (window.widget) { setTimeout("window.widget.performTransition()", 0); } } function setup() { flipper = new AppleInfoButton(document.getElementById("flipper"), document.getElementById("front"), "white", "white", showBack); glassButton = new AppleGlassButton(document.getElementById("doneButton"), "Done", showFront); document.getElementById("resize").addEventListener("mousedown", resizeWidget, false); } function resizeWidget(event) { document.addEventListener("mousemove", changeSize, true); document.addEventListener("mouseup", changeSizeDone, true); startSize = { x: (window.innerWidth - event.x), y: (window.innerHeight - event.y) }; event.stopPropagation();event.preventDefault(); } function changeSize(event) { window.resizeTo(event.x + startSize.x, event.y + startSize.y); event.stopPropagation();event.preventDefault(); } function changeSizeDone(event) { document.removeEventListener("mousemove", changeSize, true); document.removeEventListener("mouseup", changeSizeDone, true); event.stopPropagation();event.preventDefault(); } function selectTab(id) { var obj = document.getElementById(id); changeDiv(id.substring(0,id.length-2),'resultDiv'); selectedTD.bgColor='#F8C070'; selectedTD=obj; obj.bgColor='#F8A050'; } function changeDiv(src, dest) { document.getElementById(dest).innerHTML = document.getElementById(src).innerHTML; } var curNode; function startHover(obj) { tooltip(obj.childNodes[obj.childNodes.length-2]); } function endHover(obj) { exit(); } var offsetx = 12; var offsety = 8; var tooltipDiv = null; var ie5 = (document.getElementById && document.all); var ns6 = (document.getElementById && !document.all); var ua = navigator.userAgent.toLowerCase(); var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0); function getmouseposition(e) { if(document.getElementById) { var iebody=(document.compatMode && document.compatMode != 'BackCompat') ? document.documentElement : document.body; pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset); pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset); mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false; mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false; if (tooltipDiv != null) { tooltipDiv.style.left = (mousex+pagex+offsetx-(tooltipDiv.clientWidth/2)-10) + 'px'; tooltipDiv.style.top = (mousey+pagey+offsety) + 'px'; } } } function tooltip(tip) { if (tooltipDiv != null) tooltipDiv.style.display = 'none'; tooltipDiv = tip; tooltipDiv.style.display = 'block'; document.onmousemove = getmouseposition; } function exit() { if (tooltipDiv != null) tooltipDiv.style.display = 'none'; } function doUpdate() { if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); //firefox else if (window.ActiveXObject) xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); //ie xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { var now = new Date().getTime(); var s = xmlhttp.responseText; var loc = 0; var results = document.getElementById("resultDiv").innerHTML; var selectedDiv = results.substring(results.indexOf("\""),results.indexOf("\"",results.indexOf("\"")+1)); while (s.indexOf("<!-- start div -->",loc) >= 0) { var start = s.indexOf("<!-- start div -->",loc)+"<!-- start div -->".length; var end = s.indexOf("<!-- end div -->",start); var divHTML = s.substring(start,end); var startId = divHTML.indexOf("id=")+4; var endId = divHTML.indexOf("\"",startId); var divId = divHTML.substring(startId,endId); divHTML = divHTML.substring(divHTML.indexOf(">")+1,divHTML.lastIndexOf("</")); document.getElementById(divId).innerHTML = divHTML; if (divId == selectedDiv) document.getElementById("resultDiv").innerHTML = divHTML; loc = end; } setTimeout('doUpdate()',300000);//refresh every 10 minutes } } xmlhttp.open("GET", widget.preferenceForKey(widget.identifier+"CrushFTP_URL") +"../" , true); xmlhttp.send(""); } </script> <style type="text/css"> body { font-family: "Lucida Grande"; background-color: #BBBBBB; margin: 0px; border: 5px solid orange; } #resize { -apple-dashboard-region: dashboard-region(control rectangle); position: absolute; height: 12px; width: 12px; bottom: 2px; right: 2px; background: url(/System/Library/WidgetResources/resize.png) no-repeat center center; z-index: 20; } #flipper { -apple-dashboard-region: dashboard-region(control rectangle); position: absolute; height: 12px; width: 12px; top: 8px; left: 8px; z-index: 30; } #back { background-color: #BBBBBB; display: none; margin: 20px; } </style> </head> <body onload="setup();"> <div id="front"> <div id="pathdivcontainer"> </div> <div id="contentDiv"> <center> <table cellpadding="3"> <tr> <td id="serverInfoTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8A050">Server Info</td> <script>selectedTD = document.getElementById("serverInfoTD");</script> <td id="recentUsersTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8C070">Recent Users</td> <td id="recentUploadsTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8C070">Recent Uploads</td> <td id="recentDownloadsTD" onclick="selectTab(this.id);" onMouseOver="if (!window.widget) this.style.cursor = 'hand';if (!window.widget) this.style.cursor = 'pointer'; " bgColor="#F8C070">Recent Downloads</td> </tr> </table> <table cellspacing="0" cellpadding="0"> <tr> <td> <div id="resultDiv"> </div> </td> </tr> </table> </center> </div> <div style="width: 1px; height: 1px; display: none; position: absolute; visibility: hidden;" id="serverInfo"><A name="serverInfo"></A></div> <div style="width: 1px; height: 1px; display: none; position: absolute; visibility: hidden;" id="recentUsers"><A name="recentUsers"></A></div> <div style="width: 1px; height: 1px; display: none; position: absolute; visibility: hidden;" id="recentUploads"><A name="recentUploads"></A></div> <div style="width: 1px; height: 1px; display: none; position: absolute; visibility: hidden;" id="recentDownloads"><A name="recentDownloads"></A></div> <div id="resize"></div> <div id="flipper"></div> </div> <div id="back"> <center> <div id='doneButton'></div> CrushFTP WebInterface URL<br/> <input type="text" id="CrushFTP_URL" size="50" value="http://webstatistics:webstatistics@127.0.0.1:8080/"/><br/> <font size="-1"> <div align="left"> Fill in the URL to the CrushFTP server's WebInterface. Speficy a username and password as part of the URL.<br/> Example: http://user:pass@your_server_ip:server_port/<br/> The default port for the WebInterface is port 8080, but if you have changed it...specify the proper port.<br/> <b>Leaving the settings at their default will work properly with the WebStatistics plugin as long as you have it enabled.</b><br/> <br/> <br/> If you ever notice the hovering over items not working, simply hover your mouse out of the widget, and back in to re-enable it.<br/> </div> </font> </center> </div> </body> </html>