You can subscribe to this list here.
2001 |
Jan
(13) |
Feb
(24) |
Mar
(23) |
Apr
(11) |
May
(18) |
Jun
(90) |
Jul
(29) |
Aug
(26) |
Sep
(37) |
Oct
(10) |
Nov
(31) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(45) |
Feb
(18) |
Mar
(12) |
Apr
(7) |
May
(10) |
Jun
(62) |
Jul
(8) |
Aug
(40) |
Sep
(41) |
Oct
(43) |
Nov
(29) |
Dec
(36) |
2003 |
Jan
(25) |
Feb
(9) |
Mar
(11) |
Apr
(13) |
May
(19) |
Jun
(19) |
Jul
(11) |
Aug
(4) |
Sep
(109) |
Oct
(73) |
Nov
(69) |
Dec
(21) |
2004 |
Jan
(21) |
Feb
(33) |
Mar
(31) |
Apr
(25) |
May
(33) |
Jun
(42) |
Jul
(47) |
Aug
(12) |
Sep
(41) |
Oct
(47) |
Nov
(30) |
Dec
(19) |
2005 |
Jan
(6) |
Feb
(23) |
Mar
(21) |
Apr
(26) |
May
(21) |
Jun
(16) |
Jul
(17) |
Aug
(7) |
Sep
(8) |
Oct
(13) |
Nov
(7) |
Dec
(10) |
2006 |
Jan
(10) |
Feb
(3) |
Mar
|
Apr
(2) |
May
|
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(4) |
2007 |
Jan
(2) |
Feb
(3) |
Mar
(2) |
Apr
|
May
(1) |
Jun
(6) |
Jul
(6) |
Aug
(8) |
Sep
(3) |
Oct
(21) |
Nov
(4) |
Dec
(6) |
2008 |
Jan
(11) |
Feb
(28) |
Mar
(26) |
Apr
(9) |
May
(2) |
Jun
(10) |
Jul
(1) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(4) |
Feb
(10) |
Mar
(1) |
Apr
(24) |
May
(22) |
Jun
(18) |
Jul
(15) |
Aug
(21) |
Sep
(4) |
Oct
(7) |
Nov
(6) |
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
(13) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
(4) |
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
|
2011 |
Jan
(18) |
Feb
(2) |
Mar
(23) |
Apr
(4) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
|
Nov
(5) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(31) |
Apr
(3) |
May
|
Jun
(2) |
Jul
(6) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
(7) |
2014 |
Jan
|
Feb
(1) |
Mar
(9) |
Apr
(4) |
May
(7) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(4) |
Dec
|
2016 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Luis M. R. <lui...@gm...> - 2007-12-26 16:30:19
|
El Monday, 24 December del 2007 a las 09:46:26PM, Jamie Cameron escribió: > On 24/Dec/2007 09:42 Luis Miguel R. wrote .. > > Hi all, I have a feature request for "Custom commands" module, > > the only thing I miss is that I can not categorize this custom > > commands into sections and mayble a title section, this is all > > many need to create a "custom" webmin module for programs not > > supported directly by any actual webmin module, access rights can be > > given based on sections or directly on custom commands (like now). > > > > Regards and sorry for my bad english. > > There is actually a way you could do something like this already, by > cloning the Custom Commands module as follows : > > 1) Go to the Webmin Configuration module, and click on Webmin Modules. > 2) Select the 'Clone' tab. > 3) From the 'Module to clone' menu select 'Custom Commands' > 4) In the 'Cloned module name' box, enter a category name as you suggested. > 5) Change 'Reset configuration to default?' to 'Yes'. > 6) Click 'Clone Module'. > > You can now go to this new module and create your own custom commands. > This module can be assigned to Webmin users separately from the original > 'Custom Commands' module, and can have the allowed commands independently > configured. This actually solve my "problem", thanks! Regards. |
From: Jamie C. <jca...@we...> - 2007-12-25 05:46:35
|
On 24/Dec/2007 09:42 Luis Miguel R. wrote .. > Hi all, I have a feature request for "Custom commands" module, > the only thing I miss is that I can not categorize this custom > commands into sections and mayble a title section, this is all > many need to create a "custom" webmin module for programs not > supported directly by any actual webmin module, access rights can be > given based on sections or directly on custom commands (like now). > > Regards and sorry for my bad english. There is actually a way you could do something like this already, by cloning the Custom Commands module as follows : 1) Go to the Webmin Configuration module, and click on Webmin Modules. 2) Select the 'Clone' tab. 3) From the 'Module to clone' menu select 'Custom Commands' 4) In the 'Cloned module name' box, enter a category name as you suggested. 5) Change 'Reset configuration to default?' to 'Yes'. 6) Click 'Clone Module'. You can now go to this new module and create your own custom commands. This module can be assigned to Webmin users separately from the original 'Custom Commands' module, and can have the allowed commands independently configured. - Jamie |
From: Luis M. R. <lui...@gm...> - 2007-12-24 17:45:07
|
Hi all, I have a feature request for "Custom commands" module, the only thing I miss is that I can not categorize this custom commands into sections and mayble a title section, this is all many need to create a "custom" webmin module for programs not supported directly by any actual webmin module, access rights can be given based on sections or directly on custom commands (like now). Regards and sorry for my bad english. |
From: Jamie C. <jca...@we...> - 2007-12-18 18:58:03
|
Hi Webmin users, I am just about to release Webmin 1.390 and Usermin 1.320, but before I do I've created two pre-release versions that contain all the features that will be official release. You can download them from http://www.webmin.com/devel.html , or check out the change logs at http://www.webmin.com/changes-1.389.html and http://www.webmin.com/uchanges-1.319.html . The biggest new features are the LDAP Server module in Webmin, and many Read Mail module tweaks in Usermin. Let me know if you find any problems! - Jamie |
From: Jamie C. <jca...@we...> - 2007-12-18 18:50:43
|
On 18/Dec/2007 04:59 Bill Moyers wrote .. > Hello, I am trying to get a command-line utility to import a large number > of domains into webmin. Looking at the create-domain.pl program in the > webmin virtual-server/ directory, it doesn't look like it has the > functionality to import a domain as does import.cgi in the same directory. > Is this the case? If so, is there a command-line utility that can? I > couldn't find one. If there is none I guess I can try to turn import.cgi > into a command-line program. Hi Bill, At the moment, there is no command-line import program unfortunately. I suppose you could fake it by writing a script that uses wget to call http://yourserver:10000/virtual-server/import.cgi with the correct params, or you could write your own import-domain.pl . If you do go the latter route, I'd be happy to include it in the standard Virtualmin package.. - Jamie |
From: Bill M. <bm...@ud...> - 2007-12-18 13:00:07
|
Hello, I am trying to get a command-line utility to import a large number of domains into webmin. Looking at the create-domain.pl program in the webmin virtual-server/ directory, it doesn't look like it has the functionality to import a domain as does import.cgi in the same directory. Is this the case? If so, is there a command-line utility that can? I couldn't find one. If there is none I guess I can try to turn import.cgi into a command-line program. Thanks, Bill |
From: Jamie C. <jca...@we...> - 2007-11-12 22:33:10
|
On 11/Nov/2007 23:27 Cl=E9ment VERET wrote .. > 2007/11/9, Jamie Cameron <jca...@we...>: > > Hi Cl=E9ment, > > > > That is a good patch .. but I'm worried about how it will perform > > on non-Redhat RPM-based systems like SuSE and Mandrake, and even old > > Redhat systems before they started using system-auth . > > On _every_ redhat compliant system this patch will work. I tested it > at work where we have a patchwork of redhat distributions (from Fedora > Core 3 to RHEL 5, through Red Hat 7.2 and CentOS 3/4/5). > > I cannot be affirmative concerning Mandrake and SuSE... I don't really > know how this distributions work about their authentication. > > Is there somebody who has the ability to test it ? > > > Is it possible > > to have a pam.d/webmin file that somehow falls back to the old behavior > > in cases like these? > > I know PAM very well and I'm not sure this is possible... But I'm > gonna have a try... Let me know if you get anywhere with this. If not, a fallback would be to use this PAM config only on Redhat-based systems, determined at the time Webmin is installed in the RPM %post script. - Jamie |
From: <cle...@gm...> - 2007-11-12 07:27:57
|
2007/11/9, Jamie Cameron <jca...@we...>: > Hi Cl=E9ment, > > That is a good patch .. but I'm worried about how it will perform > on non-Redhat RPM-based systems like SuSE and Mandrake, and even old > Redhat systems before they started using system-auth . On _every_ redhat compliant system this patch will work. I tested it at work where we have a patchwork of redhat distributions (from Fedora Core 3 to RHEL 5, through Red Hat 7.2 and CentOS 3/4/5). I cannot be affirmative concerning Mandrake and SuSE... I don't really know how this distributions work about their authentication. Is there somebody who has the ability to test it ? > Is it possible > to have a pam.d/webmin file that somehow falls back to the old behavior > in cases like these? I know PAM very well and I'm not sure this is possible... But I'm gonna have a try... --=20 Cl=E9ment V=E9ret |
From: Jamie C. <jca...@we...> - 2007-11-09 17:43:08
|
Hi Cl=E9ment, That is a good patch .. but I'm worried about how it will perform on non-Redhat RPM-based systems like SuSE and Mandrake, and even old Redhat systems before they started using system-auth . Is it possible to have a pam.d/webmin file that somehow falls back to the old behavior in cases like these? - Jamie On 9/Nov/2007 03:09 Cl=E9ment VERET wrote .. > Hi everyone, I'm back :). > > Just a little suggestion for the redhat-compliant systems. In the > /etc/pam.d/webmin, replace the classic : > auth required pam_unix.so etc.... > > By the more conventionnal : > auth include system-auth > > This allows Webmin on redhat-compliant system to authenticate users > upon the Directory chosen by the administrator (so local, LDAP, NIS, > etc...) instead of systematically authenticate upon local /etc/passwd > base. > > See the joined patch. > > I'm conscious that authentication is a sensible part of the system so > I can imagine it will be hard to include to Webmin. But maybe it can > help ;). > -- > Cl=E9ment V=E9ret |
From: <cle...@gm...> - 2007-11-09 11:09:31
|
Hi everyone, I'm back :). Just a little suggestion for the redhat-compliant systems. In the /etc/pam.d/webmin, replace the classic : auth required pam_unix.so etc.... By the more conventionnal : auth include system-auth This allows Webmin on redhat-compliant system to authenticate users upon the Directory chosen by the administrator (so local, LDAP, NIS, etc...) instead of systematically authenticate upon local /etc/passwd base. See the joined patch. I'm conscious that authentication is a sensible part of the system so I can imagine it will be hard to include to Webmin. But maybe it can help ;). --=20 Cl=E9ment V=E9ret |
From: Jamie C. <jca...@we...> - 2007-10-30 05:53:54
|
Sorry, I must have missed your email .. I'll check for it in my inbox or list archives now. On 29/Oct/2007 09:41 Jean-Christophe Dubois wrote .. > Hello Jamie, > > As I read that you are planning a new release in a week or two, is this my > proposed patch for a slider of any interrest? > > Regards > > JC > > On Thursday 25 October 2007 20:59:34 Jean-Christophe Dubois wrote: > > Hello Jamie, > > > > So here is a slightly modified version. > > > > This one works in Lynx (without javascript or even graphic at all) and > > firefox/konqueror. In lynx it degrades to a field only form and I expect it > > to do the same on browser without "getElementById" (but I have no idea > > which ones don't provide this support). I have also disabled javascript > > support in firefox and it does degrade to the field only version in such > > case. > > > > Let me know what you think of it. |
From: Jean-Christophe D. <jc...@tr...> - 2007-10-29 16:40:39
|
Hello Jamie, As I read that you are planning a new release in a week or two, is this my proposed patch for a slider of any interrest? Regards JC On Thursday 25 October 2007 20:59:34 Jean-Christophe Dubois wrote: > Hello Jamie, > > So here is a slightly modified version. > > This one works in Lynx (without javascript or even graphic at all) and > firefox/konqueror. In lynx it degrades to a field only form and I expect it > to do the same on browser without "getElementById" (but I have no idea > which ones don't provide this support). I have also disabled javascript > support in firefox and it does degrade to the field only version in such > case. > > Let me know what you think of it. > > JC > |
From: Jamie C. <jca...@we...> - 2007-10-29 16:32:10
|
On 29/Oct/2007 03:20 Cl=E9ment VERET wrote .. > 2007/10/28, Jamie Cameron <jca...@we...>: > > > This is my first Webmin patch so this is probably a little crappy. I'm > > > sorry about that. > > Excellent, your patch applied perfectly and looks good. I will include it > > in the next Webmin release, with some small changes to re-factor the try_cmd > > function and other duplicated code. > > In fact, I just had a little problem with permissions (cgi files > created by the patch were not in 0755 mode...). > > When will the next version of Webmin be released ? I plan to release in a week or two.. - Jamie |
From: <cle...@gm...> - 2007-10-29 10:27:17
|
2007/10/28, Jamie Cameron <jca...@we...>: > > This is my first Webmin patch so this is probably a little crappy. I'm > > sorry about that. > Excellent, your patch applied perfectly and looks good. I will include it > in the next Webmin release, with some small changes to re-factor the try_= cmd > function and other duplicated code. In fact, I just had a little problem with permissions (cgi files created by the patch were not in 0755 mode...). When will the next version of Webmin be released ? --=20 Cl=E9ment V=E9ret |
From: Jamie C. <jca...@we...> - 2007-10-28 22:29:22
|
On 27/Oct/2007 14:01 Cl=E9ment VERET wrote .. > Hi everyone, > > I just writed a little patch in order to add to buttons to the Webmin > BIND8 interface when editing a master zone. > > This add a "Freeze the zone" and an "Unfreeze the zone" button, in > order to launch the "rndc freeze ZONE" or "rndc thaw ZONE". Those > actions are imperative when you need to update manually a DDNS zone. > > This is my first Webmin patch so this is probably a little crappy. I'm > sorry about that. > > Hope it can help. > > P.S. : the patch applies directly to Webmin 1.37 source. Excellent, your patch applied perfectly and looks good. I will include it in the next Webmin release, with some small changes to re-factor the try_cmd function and other duplicated code. - Jamie |
From: <cle...@gm...> - 2007-10-27 21:01:37
|
Hi everyone, I just writed a little patch in order to add to buttons to the Webmin BIND8 interface when editing a master zone. This add a "Freeze the zone" and an "Unfreeze the zone" button, in order to launch the "rndc freeze ZONE" or "rndc thaw ZONE". Those actions are imperative when you need to update manually a DDNS zone. This is my first Webmin patch so this is probably a little crappy. I'm sorry about that. Hope it can help. P.S. : the patch applies directly to Webmin 1.37 source. --=20 Cl=E9ment V=E9ret |
From: Jean-Christophe D. <jc...@tr...> - 2007-10-25 18:59:15
|
Hello Jamie, So here is a slightly modified version. This one works in Lynx (without javascript or even graphic at all) and firefox/konqueror. In lynx it degrades to a field only form and I expect it to do the same on browser without "getElementById" (but I have no idea which ones don't provide this support). I have also disabled javascript support in firefox and it does degrade to the field only version in such case. Let me know what you think of it. JC diff -urN webmin.org/fdisk/edit_hdparm.cgi webmin/fdisk/edit_hdparm.cgi --- webmin.org/fdisk/edit_hdparm.cgi 2007-10-17 15:41:33.000000000 +0200 +++ webmin/fdisk/edit_hdparm.cgi 2007-10-25 20:12:07.000000000 +0200 @@ -31,6 +31,13 @@ } print( +"<script type=\"text/javascript\" src=\"range.js\"></script> +<script type=\"text/javascript\" src=\"timer.js\"></script> +<script type=\"text/javascript\" src=\"slider.js\"></script> +<link type=\"text/css\" rel=\"StyleSheet\" href=\"winclassic.css\" />"); + + +print( "<form action=apply_hdparm.cgi><table border cols=1 width=\"100%\"><input type=hidden name=drive value=", $d -> { 'device' }, ">", "<tr ", $tb, ">", "<td><b>", $text{ 'hdparm_label' }, "</b></td>", @@ -52,7 +59,51 @@ "<td>", &l_radio( $text{ 'hdparm_conf_r' }, 'r', @yesno ), "</td>", "<td>", &l_radio( $text{ 'hdparm_conf_P' }, 'P', @yesno ), "</td>", "</tr><tr>", - "<td>", &hlink( "<b>". $text{ 'hdparm_conf_S' }. "</b>", "S" ), " ", &p_entry( "S", 6, $hdparm{ 'S' } ), "</td>", + "<td>", &hlink( "<b>". $text{ 'hdparm_conf_S' }. "</b>", "S" ), "</td>", "<td>", &p_slider( "S", 0, 251, 0), +"<script type=\"text/javascript\"> + +var sliderEl = document.getElementById ? + document.getElementById(\"S-slider\") : null; +var inputEl = document.forms[0][\"S\"]; + +var s = new Slider(sliderEl, inputEl); + +function format_time(t_sec) { + + if ( t_sec >= 3600 ) { + var t_hour = (t_sec - (t_sec % 3600))/3600; + return t_hour + \" hours \" + format_time(t_sec % 3600); + } else if ( t_sec >= 60 ){ + var t_min = (t_sec - (t_sec % 60))/60; + return t_min + \" minutes \" + format_time(t_sec % 60);; + } else if ( t_sec > 0 ){ + return t_sec + \" seconds \"; + } else { + return \" \"; + } +}; + +s.onchange = function () { + var flag = s.getValue(); + var t_sec = 0; + if (flag < 241) { + t_sec = flag * 5; + } else { + t_sec = (flag -240) * 30 * 60; + } + + if (t_sec == 0) { + document.getElementById(\"S-text-id\").value = \"always on\"; + } else { + document.getElementById(\"S-text-id\").value = format_time(t_sec); + } +}; + +s.setValue(0); +s.setMinimum(0); +s.setMaximum(251); + +</script></td>", "</tr>", "</table><table>", "<tr><td>", &l_radio( $text{ 'hdparm_conf_c' }, 'c', ( "0", $text{ 'hdparm_disable' }, "1", $text{ 'hdparm_enable' }, "3", $text{ 'hdparm_enable_special' } ) ), "</td></tr>", @@ -90,11 +141,24 @@ return $out; } +sub p_slider +{ + my ( $name, $min, $max, $default ) = @_; + local $out; + + $out .= "<div class=\"slider\" id=\"". $name ."-slider\" tabIndex=\"1\">"; + $out .= "<input class=\"slider-input\" id=\"".$name."-slider-input\""; + $out .= " name=\"".$name."\"/></div></td><td>"; + $out .= "<input type=text name=\"".$name."-text\" id=\"".$name."-text-id\" readonly value=\"This field is not used\" >"; + + return $out; +} + sub p_entry { my ( $name, $size, $value ) = @_; - $size ? return "</td> <td><input name=". $name. " size=". $size." value=\"". $value."\">" : return "</td> <td><input name=". $name. " value=\"". $value."\">"; + $size ? return "</td> <td><input name=\"". $name. "\" id=\"". $name. "-id\" size=". $size." value=\"". $value."\">" : return "</td> <td><input name=\"". $name. "\" id=\"". $name. "-id\" value=\"". $value."\">"; } sub p_select_wdl diff -urN webmin.org/fdisk/range.js webmin/fdisk/range.js --- webmin.org/fdisk/range.js 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/range.js 2007-10-18 09:34:03.000000000 +0200 @@ -0,0 +1,132 @@ +/*----------------------------------------------------------------------------\ +| Range Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Used to model the data used when working with sliders, scrollbars and | +| progress bars. Based on the ideas of the javax.swing.BoundedRangeModel | +| interface defined by Sun for Java; http://java.sun.com/products/jfc/ | +| swingdoc-api-1.0.3/com/sun/java/swing/BoundedRangeModel.html | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2005, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2005-10-27 | Use Math.round instead of Math.floor | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + + +function Range() { + this._value = 0; + this._minimum = 0; + this._maximum = 100; + this._extent = 0; + + this._isChanging = false; +} + +Range.prototype.setValue = function (value) { + value = Math.round(parseFloat(value)); + if (isNaN(value)) return; + if (this._value != value) { + if (value + this._extent > this._maximum) + this._value = this._maximum - this._extent; + else if (value < this._minimum) + this._value = this._minimum; + else + this._value = value; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getValue = function () { + return this._value; +}; + +Range.prototype.setExtent = function (extent) { + if (this._extent != extent) { + if (extent < 0) + this._extent = 0; + else if (this._value + extent > this._maximum) + this._extent = this._maximum - this._value; + else + this._extent = extent; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getExtent = function () { + return this._extent; +}; + +Range.prototype.setMinimum = function (minimum) { + if (this._minimum != minimum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._minimum = minimum; + + if (minimum > this._value) + this.setValue(minimum); + if (minimum > this._maximum) { + this._extent = 0; + this.setMaximum(minimum); + this.setValue(minimum) + } + if (minimum + this._extent > this._maximum) + this._extent = this._maximum - this._minimum; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMinimum = function () { + return this._minimum; +}; + +Range.prototype.setMaximum = function (maximum) { + if (this._maximum != maximum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._maximum = maximum; + + if (maximum < this._value) + this.setValue(maximum - this._extent); + if (maximum < this._minimum) { + this._extent = 0; + this.setMinimum(maximum); + this.setValue(this._maximum); + } + if (maximum < this._minimum + this._extent) + this._extent = this._maximum - this._minimum; + if (maximum < this._value + this._extent) + this._extent = this._maximum - this._value; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMaximum = function () { + return this._maximum; +}; diff -urN webmin.org/fdisk/slider.js webmin/fdisk/slider.js --- webmin.org/fdisk/slider.js 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/slider.js 2007-10-18 09:34:49.000000000 +0200 @@ -0,0 +1,489 @@ +/*----------------------------------------------------------------------------\ +| Slider 1.02 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| A slider control that degrades to an input control for non supported | +| browsers. | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2003, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| Dependencies: timer.js - an OO abstraction of timers | +| range.js - provides the data model for the slider | +| winclassic.css or any other css file describing the look | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2003-03-27 | Added a test in the constructor for missing oElement arg | +| 2003-11-27 | Only use mousewheel when focused | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +Slider.isSupported = typeof document.createElement != "undefined" && + typeof document.documentElement != "undefined" && + typeof document.documentElement.offsetWidth == "number"; + + +function Slider(oElement, oInput, sOrientation) { + if (!oElement) return; + this._orientation = sOrientation || "horizontal"; + this._range = new Range(); + this._range.setExtent(0); + this._blockIncrement = 10; + this._unitIncrement = 1; + this._timer = new Timer(100); + + + if (Slider.isSupported && oElement) { + + this.document = oElement.ownerDocument || oElement.document; + + this.element = oElement; + this.element.slider = this; + this.element.unselectable = "on"; + + // add class name tag to class name + this.element.className = this._orientation + " " + this.classNameTag + " " + this.element.className; + + // create line + this.line = this.document.createElement("DIV"); + this.line.className = "line"; + this.line.unselectable = "on"; + this.line.appendChild(this.document.createElement("DIV")); + this.element.appendChild(this.line); + + // create handle + this.handle = this.document.createElement("DIV"); + this.handle.className = "handle"; + this.handle.unselectable = "on"; + this.handle.appendChild(this.document.createElement("DIV")); + this.handle.firstChild.appendChild( + this.document.createTextNode(String.fromCharCode(160))); + this.element.appendChild(this.handle); + } + + this.input = oInput; + + // events + var oThis = this; + this._range.onchange = function () { + oThis.recalculate(); + if (typeof oThis.onchange == "function") + oThis.onchange(); + }; + + if (Slider.isSupported && oElement) { + this.element.onfocus = Slider.eventHandlers.onfocus; + this.element.onblur = Slider.eventHandlers.onblur; + this.element.onmousedown = Slider.eventHandlers.onmousedown; + this.element.onmouseover = Slider.eventHandlers.onmouseover; + this.element.onmouseout = Slider.eventHandlers.onmouseout; + this.element.onkeydown = Slider.eventHandlers.onkeydown; + this.element.onkeypress = Slider.eventHandlers.onkeypress; + this.element.onmousewheel = Slider.eventHandlers.onmousewheel; + this.handle.onselectstart = + this.element.onselectstart = function () { return false; }; + + this._timer.ontimer = function () { + oThis.ontimer(); + }; + + // extra recalculate for ie + window.setTimeout(function() { + oThis.recalculate(); + }, 1); + } + else { + this.input.onchange = function (e) { + oThis.setValue(oThis.input.value); + }; + } +} + +Slider.eventHandlers = { + + // helpers to make events a bit easier + getEvent: function (e, el) { + if (!e) { + if (el) + e = el.document.parentWindow.event; + else + e = window.event; + } + if (!e.srcElement) { + var el = e.target; + while (el != null && el.nodeType != 1) + el = el.parentNode; + e.srcElement = el; + } + if (typeof e.offsetX == "undefined") { + e.offsetX = e.layerX; + e.offsetY = e.layerY; + } + + return e; + }, + + getDocument: function (e) { + if (e.target) + return e.target.ownerDocument; + return e.srcElement.document; + }, + + getSlider: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.slider == null) { + el = el.parentNode; + } + if (el) + return el.slider; + return null; + }, + + getLine: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.className != "line") { + el = el.parentNode; + } + return el; + }, + + getHandle: function (e) { + var el = e.target || e.srcElement; + var re = /handle/; + while (el != null && !re.test(el.className)) { + el = el.parentNode; + } + return el; + }, + // end helpers + + onfocus: function (e) { + var s = this.slider; + s._focused = true; + s.handle.className = "handle hover"; + }, + + onblur: function (e) { + var s = this.slider + s._focused = false; + s.handle.className = "handle"; + }, + + onmouseover: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle) + s.handle.className = "handle hover"; + }, + + onmouseout: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle && !s._focused) + s.handle.className = "handle"; + }, + + onmousedown: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s.element.focus) + s.element.focus(); + + Slider._currentInstance = s; + var doc = s.document; + + if (doc.addEventListener) { + doc.addEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.addEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.attachEvent) { + doc.attachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.attachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.attachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.setCapture(); + } + + if (Slider.eventHandlers.getHandle(e)) { // start drag + Slider._sliderDragData = { + screenX: e.screenX, + screenY: e.screenY, + dx: e.screenX - s.handle.offsetLeft, + dy: e.screenY - s.handle.offsetTop, + startValue: s.getValue(), + slider: s + }; + } + else { + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + s._increasing = null; + s.ontimer(); + } + }, + + onmousemove: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + + if (Slider._sliderDragData) { // drag + var s = Slider._sliderDragData.slider; + + var boundSize = s.getMaximum() - s.getMinimum(); + var size, pos, reset; + + if (s._orientation == "horizontal") { + size = s.element.offsetWidth - s.handle.offsetWidth; + pos = e.screenX - Slider._sliderDragData.dx; + reset = Math.abs(e.screenY - Slider._sliderDragData.screenY) > 100; + } + else { + size = s.element.offsetHeight - s.handle.offsetHeight; + pos = s.element.offsetHeight - s.handle.offsetHeight - + (e.screenY - Slider._sliderDragData.dy); + reset = Math.abs(e.screenX - Slider._sliderDragData.screenX) > 100; + } + s.setValue(reset ? Slider._sliderDragData.startValue : + s.getMinimum() + boundSize * pos / size); + return false; + } + else { + var s = Slider._currentInstance; + if (s != null) { + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + } + } + + }, + + onmouseup: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = Slider._currentInstance; + var doc = s.document; + if (doc.removeEventListener) { + doc.removeEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.removeEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.detachEvent) { + doc.detachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.detachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.detachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.releaseCapture(); + } + + if (Slider._sliderDragData) { // end drag + Slider._sliderDragData = null; + } + else { + s._timer.stop(); + s._increasing = null; + } + Slider._currentInstance = null; + }, + + onkeydown: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + //var s = Slider.eventHandlers.getSlider(e); + var s = this.slider; + var kc = e.keyCode; + switch (kc) { + case 33: // page up + s.setValue(s.getValue() + s.getBlockIncrement()); + break; + case 34: // page down + s.setValue(s.getValue() - s.getBlockIncrement()); + break; + case 35: // end + s.setValue(s.getOrientation() == "horizontal" ? + s.getMaximum() : + s.getMinimum()); + break; + case 36: // home + s.setValue(s.getOrientation() == "horizontal" ? + s.getMinimum() : + s.getMaximum()); + break; + case 38: // up + case 39: // right + s.setValue(s.getValue() + s.getUnitIncrement()); + break; + + case 37: // left + case 40: // down + s.setValue(s.getValue() - s.getUnitIncrement()); + break; + } + + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onkeypress: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var kc = e.keyCode; + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onmousewheel: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s._focused) { + s.setValue(s.getValue() + e.wheelDelta / 120 * s.getUnitIncrement()); + // windows inverts this on horizontal sliders. That does not + // make sense to me + return false; + } + } +}; + + + +Slider.prototype.classNameTag = "dynamic-slider-control", + +Slider.prototype.setValue = function (v) { + this._range.setValue(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getValue = function () { + return this._range.getValue(); +}; + +Slider.prototype.setMinimum = function (v) { + this._range.setMinimum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMinimum = function () { + return this._range.getMinimum(); +}; + +Slider.prototype.setMaximum = function (v) { + this._range.setMaximum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMaximum = function () { + return this._range.getMaximum(); +}; + +Slider.prototype.setUnitIncrement = function (v) { + this._unitIncrement = v; +}; + +Slider.prototype.getUnitIncrement = function () { + return this._unitIncrement; +}; + +Slider.prototype.setBlockIncrement = function (v) { + this._blockIncrement = v; +}; + +Slider.prototype.getBlockIncrement = function () { + return this._blockIncrement; +}; + +Slider.prototype.getOrientation = function () { + return this._orientation; +}; + +Slider.prototype.setOrientation = function (sOrientation) { + if (sOrientation != this._orientation) { + if (Slider.isSupported && this.element) { + // add class name tag to class name + this.element.className = this.element.className.replace(this._orientation, + sOrientation); + } + this._orientation = sOrientation; + this.recalculate(); + + } +}; + +Slider.prototype.recalculate = function() { + if (!Slider.isSupported || !this.element) return; + + var w = this.element.offsetWidth; + var h = this.element.offsetHeight; + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var lw = this.line.offsetWidth; + var lh = this.line.offsetHeight; + + // this assumes a border-box layout + + if (this._orientation == "horizontal") { + this.handle.style.left = (w - hw) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + this.handle.style.top = (h - hh) / 2 + "px"; + + this.line.style.top = (h - lh) / 2 + "px"; + this.line.style.left = hw / 2 + "px"; + //this.line.style.right = hw / 2 + "px"; + this.line.style.width = Math.max(0, w - hw - 2)+ "px"; + this.line.firstChild.style.width = Math.max(0, w - hw - 4)+ "px"; + } + else { + this.handle.style.left = (w - hw) / 2 + "px"; + this.handle.style.top = h - hh - (h - hh) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + + this.line.style.left = (w - lw) / 2 + "px"; + this.line.style.top = hh / 2 + "px"; + this.line.style.height = Math.max(0, h - hh - 2) + "px"; //hard coded border width + //this.line.style.bottom = hh / 2 + "px"; + this.line.firstChild.style.height = Math.max(0, h - hh - 4) + "px"; //hard coded border width + } +}; + +Slider.prototype.ontimer = function () { + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var hl = this.handle.offsetLeft; + var ht = this.handle.offsetTop; + + if (this._orientation == "horizontal") { + if (this._mouseX > hl + hw && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + else if (this._mouseX < hl && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + } + else { + if (this._mouseY > ht + hh && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + else if (this._mouseY < ht && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + } + + this._timer.start(); +}; diff -urN webmin.org/fdisk/timer.js webmin/fdisk/timer.js --- webmin.org/fdisk/timer.js 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/timer.js 2007-10-18 09:34:25.000000000 +0200 @@ -0,0 +1,62 @@ +/*----------------------------------------------------------------------------\ +| Timer Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Object Oriented Encapsulation of setTimeout fires ontimer when the timer | +| is triggered. Does not work in IE 5.00 | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +function Timer(nPauseTime) { + this._pauseTime = typeof nPauseTime == "undefined" ? 1000 : nPauseTime; + this._timer = null; + this._isStarted = false; +} + +Timer.prototype.start = function () { + if (this.isStarted()) + this.stop(); + var oThis = this; + this._timer = window.setTimeout(function () { + if (typeof oThis.ontimer == "function") + oThis.ontimer(); + }, this._pauseTime); + this._isStarted = false; +}; + +Timer.prototype.stop = function () { + if (this._timer != null) + window.clearTimeout(this._timer); + this._isStarted = false; +}; + +Timer.prototype.isStarted = function () { + return this._isStarted; +}; + +Timer.prototype.getPauseTime = function () { + return this._pauseTime; +}; + +Timer.prototype.setPauseTime = function (nPauseTime) { + this._pauseTime = nPauseTime; +}; diff -urN webmin.org/fdisk/winclassic.css webmin/fdisk/winclassic.css --- webmin.org/fdisk/winclassic.css 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/winclassic.css 2007-10-18 09:34:37.000000000 +0200 @@ -0,0 +1,99 @@ +.dynamic-slider-control { + position: relative; + background-color: ThreeDFace; + -moz-user-focus: normal; + -moz-user-select: none; + cursor: default; +} + +.horizontal { + width: 200px; + height: 29px; +} + +.vertical { + width: 29px; + height: 200px; +} + +.dynamic-slider-control input { + display: none; +} + +.dynamic-slider-control .handle { + position: absolute; + -moz-user-select: none; + cursor: default; + background: ThreeDFace; + border: 1px solid; + border-color: ThreeDHighlight ThreeDDarkShadow + ThreeDDarkShadow ThreeDHighlight; +} + +/* inner border */ +.dynamic-slider-control .handle div { + font-size: 1px; + border: 1px solid; + border-color: ThreeDLightShadow ThreeDShadow + ThreeDShadow ThreeDLightShadow; + + behavior: url("css/boxsizing.htc"); /* ie path bug */ + box-sizing: content-box; + -moz-box-sizing: content-box; +} + +/* inner sets size +.dynamic-slider-control.horizontal .handle { + width: 12px; + height: 22px; +} +*/ + +.dynamic-slider-control.horizontal .handle div { + width: 8px; + height: 18px; +} + +.dynamic-slider-control.horizontal .handle.hover {} + +/* inner sets size +.dynamic-slider-control.vertical .handle { + width: 22px; + height: 12px; +} +*/ + +.dynamic-slider-control.vertical .handle div { + width: 18px; + height: 8px; +} + +.dynamic-slider-control.vertical .handle.hover {} + +.dynamic-slider-control .line { + + behavior: url("css/boxsizing.htc"); /* ie path bug */ + box-sizing: content-box; + -moz-box-sizing: content-box; + + position: absolute; + font-size: 0.01mm; + overflow: hidden; + border: 1px solid; + border-color: ThreeDShadow ThreeDHighlight + ThreeDHighlight ThreeDShadow; + background: ThreeDDarkShadow; +} + +.dynamic-slider-control.vertical .line { + width: 1px; + +} + +.dynamic-slider-control.horizontal .line { + height: 1px; +} + +.dynamic-slider-control .line div { + display: none; +} |
From: Jamie C. <jca...@we...> - 2007-10-23 00:22:56
|
Hi Webmin developers, There was some discussion on the lists recently about Virtualmin plugin development and the lack of example code, so I have completely re-written the documentation to include some. It is more much more up-to-date, and covers the complete plugin API. You can find the documentation at : http://www.virtualmin.com/documentation/id,writing_virtualmin_plugins/ - Jamie |
From: Jean-Christophe D. <jc...@tr...> - 2007-10-22 07:13:15
|
Hi Jamie, On Monday 22 October 2007 08:17:02 Jamie Cameron wrote: > Hi Jean, > > That certainly looks impressive. My only concern would be how this will > degrade when accessed on a browser that doesn't support the Javascript > needed to render that slider.. Ideally it should fall back to showing the > old text field. > > Do you know if that is possible? Well it seems that Erik Arvidsson developed these sliders with this exact=20 problem in mind. In theory it is possible to degrade to a field only form i= f=20 the browser does not support the required javascript syntax (see=20 http://webfx.eae.net/dhtml/slider/slider.html for details). Now I don't know which browser to use to test this and I must confess my pa= tch=20 doesn't include the correct test to degrade transparently to the test only= =20 version. Would you have in mind a browser with a limited javascript support= I=20 could use? JC > =A0- Jamie |
From: Jamie C. <jca...@we...> - 2007-10-22 06:17:11
|
On 18/Oct/2007 01:07 Jean-Christophe Dubois wrote .. > On Thursday 18 October 2007 09:42:42 Jean-Christophe Dubois wrote: > > Hi, > > > > The input field for the "Standby timeout" is not very user friendly. Its > > value varies from 0 to 255 without any hint of what means each value. > > > > So I propose to replace this simple field with a javascript based slider > > that will describe in full word what the timeout value really is. It is > > easier to have a timeout value of "5 minutes" rather than the corresponding > > 60 field value. > > > > So I Incorporated the work of Erik Arvidsson at > > http://webfx.eae.net/dhtml/slider/slider.html. His code is under "Apache > > License, Version 2.0" so I assume there should be no problem to incorporate > > it in webmin. > > To give you an idea, I attached a snapshot of the webmin frame to this email. > Let me know what you think of it. Hi Jean, That certainly looks impressive. My only concern would be how this will degrade when accessed on a browser that doesn't support the Javascript needed to render that slider.. Ideally it should fall back to showing the old text field. Do you know if that is possible? - Jamie |
From: Jean-Christophe D. <jc...@tr...> - 2007-10-18 08:07:13
|
On Thursday 18 October 2007 09:42:42 Jean-Christophe Dubois wrote: > Hi, > > The input field for the "Standby timeout" is not very user friendly. Its > value varies from 0 to 255 without any hint of what means each value. > > So I propose to replace this simple field with a javascript based slider > that will describe in full word what the timeout value really is. It is > easier to have a timeout value of "5 minutes" rather than the corresponding > 60 field value. > > So I Incorporated the work of Erik Arvidsson at > http://webfx.eae.net/dhtml/slider/slider.html. His code is under "Apache > License, Version 2.0" so I assume there should be no problem to incorporate > it in webmin. To give you an idea, I attached a snapshot of the webmin frame to this email. Let me know what you think of it. JC > Maybe these javascript classes could be incorporated more globally in > webmin so that they become a common services and can be used by other > modules. > > Regards > > JC |
From: Jean-Christophe D. <jc...@tr...> - 2007-10-18 07:42:55
|
Hi, The input field for the "Standby timeout" is not very user friendly. Its value varies from 0 to 255 without any hint of what means each value. So I propose to replace this simple field with a javascript based slider that will describe in full word what the timeout value really is. It is easier to have a timeout value of "5 minutes" rather than the corresponding 60 field value. So I Incorporated the work of Erik Arvidsson at http://webfx.eae.net/dhtml/slider/slider.html. His code is under "Apache License, Version 2.0" so I assume there should be no problem to incorporate it in webmin. Maybe these javascript classes could be incorporated more globally in webmin so that they become a common services and can be used by other modules. Regards JC diff -urN webmin.org/fdisk/edit_hdparm.cgi webmin/fdisk/edit_hdparm.cgi --- webmin.org/fdisk/edit_hdparm.cgi 2007-10-17 15:41:33.000000000 +0200 +++ webmin/fdisk/edit_hdparm.cgi 2007-10-17 00:59:54.000000000 +0200 @@ -31,6 +31,13 @@ } print( +"<script type=\"text/javascript\" src=\"range.js\"></script> +<script type=\"text/javascript\" src=\"timer.js\"></script> +<script type=\"text/javascript\" src=\"slider.js\"></script> +<link type=\"text/css\" rel=\"StyleSheet\" href=\"winclassic.css\" />"); + + +print( "<form action=apply_hdparm.cgi><table border cols=1 width=\"100%\"><input type=hidden name=drive value=", $d -> { 'device' }, ">", "<tr ", $tb, ">", "<td><b>", $text{ 'hdparm_label' }, "</b></td>", @@ -52,7 +59,49 @@ "<td>", &l_radio( $text{ 'hdparm_conf_r' }, 'r', @yesno ), "</td>", "<td>", &l_radio( $text{ 'hdparm_conf_P' }, 'P', @yesno ), "</td>", "</tr><tr>", - "<td>", &hlink( "<b>". $text{ 'hdparm_conf_S' }. "</b>", "S" ), " ", &p_entry( "S", 6, $hdparm{ 'S' } ), "</td>", + "<td>", &hlink( "<b>". $text{ 'hdparm_conf_S' }. "</b>", "S" ), "</td>", "<td>", &p_slider( "S", 0, 251, 0), +"<script type=\"text/javascript\"> + +var s = new Slider(document.getElementById(\"S-slider\"), + document.getElementById(\"S-slider-input\")); + +function format_time(t_sec) { + + if ( t_sec >= 3600 ) { + var t_hour = (t_sec - (t_sec % 3600))/3600; + return t_hour + \" hours \" + format_time(t_sec % 3600); + } else if ( t_sec >= 60 ){ + var t_min = (t_sec - (t_sec % 60))/60; + return t_min + \" minutes \" + format_time(t_sec % 60);; + } else if ( t_sec > 0 ){ + return t_sec + \" seconds \"; + } else { + return \" \"; + } +}; + +s.onchange = function () { + var flag = s.getValue(); + var t_sec = 0; + if (flag < 241) { + t_sec = flag * 5; + } else { + t_sec = (flag -240) * 30 * 60; + } + + document.getElementById(\"S-id\").value = s.getValue(); + if (t_sec == 0) { + document.getElementById(\"S-text-id\").value = \"always on\"; + } else { + document.getElementById(\"S-text-id\").value = format_time(t_sec); + } +}; + +s.setValue(0); +s.setMinimum(0); +s.setMaximum(251); + +</script></td>", "</tr>", "</table><table>", "<tr><td>", &l_radio( $text{ 'hdparm_conf_c' }, 'c', ( "0", $text{ 'hdparm_disable' }, "1", $text{ 'hdparm_enable' }, "3", $text{ 'hdparm_enable_special' } ) ), "</td></tr>", @@ -90,11 +139,25 @@ return $out; } +sub p_slider +{ + my ( $name, $min, $max, $default ) = @_; + local $out; + + $out .= "<div class=\"slider\" id=\"". $name ."-slider\" tabIndex=\"1\">"; + $out .= "<input class=\"slider-input\" id=\"".$name."-slider-input\""; + $out .= " name=\"".$name."-slider-input\"/></div></td><td>"; + $out .= " <input type=\"hidden\" name=\"".$name."\" id=\"".$name."-id\" value=".$default." >"; + $out .= "<input type=text name=\"".$name."-text\" id=\"".$name."-text-id\" readonly value=\"default\" >"; + + return $out; +} + sub p_entry { my ( $name, $size, $value ) = @_; - $size ? return "</td> <td><input name=". $name. " size=". $size." value=\"". $value."\">" : return "</td> <td><input name=". $name. " value=\"". $value."\">"; + $size ? return "</td> <td><input name=\"". $name. "\" id=\"". $name. "-id\" size=". $size." value=\"". $value."\">" : return "</td> <td><input name=\"". $name. "\" id=\"". $name. "-id\" value=\"". $value."\">"; } sub p_select_wdl diff -urN webmin.org/fdisk/range.js webmin/fdisk/range.js --- webmin.org/fdisk/range.js 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/range.js 2007-10-18 09:34:03.000000000 +0200 @@ -0,0 +1,132 @@ +/*----------------------------------------------------------------------------\ +| Range Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Used to model the data used when working with sliders, scrollbars and | +| progress bars. Based on the ideas of the javax.swing.BoundedRangeModel | +| interface defined by Sun for Java; http://java.sun.com/products/jfc/ | +| swingdoc-api-1.0.3/com/sun/java/swing/BoundedRangeModel.html | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2005, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2005-10-27 | Use Math.round instead of Math.floor | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + + +function Range() { + this._value = 0; + this._minimum = 0; + this._maximum = 100; + this._extent = 0; + + this._isChanging = false; +} + +Range.prototype.setValue = function (value) { + value = Math.round(parseFloat(value)); + if (isNaN(value)) return; + if (this._value != value) { + if (value + this._extent > this._maximum) + this._value = this._maximum - this._extent; + else if (value < this._minimum) + this._value = this._minimum; + else + this._value = value; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getValue = function () { + return this._value; +}; + +Range.prototype.setExtent = function (extent) { + if (this._extent != extent) { + if (extent < 0) + this._extent = 0; + else if (this._value + extent > this._maximum) + this._extent = this._maximum - this._value; + else + this._extent = extent; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getExtent = function () { + return this._extent; +}; + +Range.prototype.setMinimum = function (minimum) { + if (this._minimum != minimum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._minimum = minimum; + + if (minimum > this._value) + this.setValue(minimum); + if (minimum > this._maximum) { + this._extent = 0; + this.setMaximum(minimum); + this.setValue(minimum) + } + if (minimum + this._extent > this._maximum) + this._extent = this._maximum - this._minimum; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMinimum = function () { + return this._minimum; +}; + +Range.prototype.setMaximum = function (maximum) { + if (this._maximum != maximum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._maximum = maximum; + + if (maximum < this._value) + this.setValue(maximum - this._extent); + if (maximum < this._minimum) { + this._extent = 0; + this.setMinimum(maximum); + this.setValue(this._maximum); + } + if (maximum < this._minimum + this._extent) + this._extent = this._maximum - this._minimum; + if (maximum < this._value + this._extent) + this._extent = this._maximum - this._value; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMaximum = function () { + return this._maximum; +}; diff -urN webmin.org/fdisk/slider.js webmin/fdisk/slider.js --- webmin.org/fdisk/slider.js 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/slider.js 2007-10-18 09:34:49.000000000 +0200 @@ -0,0 +1,489 @@ +/*----------------------------------------------------------------------------\ +| Slider 1.02 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| A slider control that degrades to an input control for non supported | +| browsers. | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2003, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| Dependencies: timer.js - an OO abstraction of timers | +| range.js - provides the data model for the slider | +| winclassic.css or any other css file describing the look | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2003-03-27 | Added a test in the constructor for missing oElement arg | +| 2003-11-27 | Only use mousewheel when focused | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +Slider.isSupported = typeof document.createElement != "undefined" && + typeof document.documentElement != "undefined" && + typeof document.documentElement.offsetWidth == "number"; + + +function Slider(oElement, oInput, sOrientation) { + if (!oElement) return; + this._orientation = sOrientation || "horizontal"; + this._range = new Range(); + this._range.setExtent(0); + this._blockIncrement = 10; + this._unitIncrement = 1; + this._timer = new Timer(100); + + + if (Slider.isSupported && oElement) { + + this.document = oElement.ownerDocument || oElement.document; + + this.element = oElement; + this.element.slider = this; + this.element.unselectable = "on"; + + // add class name tag to class name + this.element.className = this._orientation + " " + this.classNameTag + " " + this.element.className; + + // create line + this.line = this.document.createElement("DIV"); + this.line.className = "line"; + this.line.unselectable = "on"; + this.line.appendChild(this.document.createElement("DIV")); + this.element.appendChild(this.line); + + // create handle + this.handle = this.document.createElement("DIV"); + this.handle.className = "handle"; + this.handle.unselectable = "on"; + this.handle.appendChild(this.document.createElement("DIV")); + this.handle.firstChild.appendChild( + this.document.createTextNode(String.fromCharCode(160))); + this.element.appendChild(this.handle); + } + + this.input = oInput; + + // events + var oThis = this; + this._range.onchange = function () { + oThis.recalculate(); + if (typeof oThis.onchange == "function") + oThis.onchange(); + }; + + if (Slider.isSupported && oElement) { + this.element.onfocus = Slider.eventHandlers.onfocus; + this.element.onblur = Slider.eventHandlers.onblur; + this.element.onmousedown = Slider.eventHandlers.onmousedown; + this.element.onmouseover = Slider.eventHandlers.onmouseover; + this.element.onmouseout = Slider.eventHandlers.onmouseout; + this.element.onkeydown = Slider.eventHandlers.onkeydown; + this.element.onkeypress = Slider.eventHandlers.onkeypress; + this.element.onmousewheel = Slider.eventHandlers.onmousewheel; + this.handle.onselectstart = + this.element.onselectstart = function () { return false; }; + + this._timer.ontimer = function () { + oThis.ontimer(); + }; + + // extra recalculate for ie + window.setTimeout(function() { + oThis.recalculate(); + }, 1); + } + else { + this.input.onchange = function (e) { + oThis.setValue(oThis.input.value); + }; + } +} + +Slider.eventHandlers = { + + // helpers to make events a bit easier + getEvent: function (e, el) { + if (!e) { + if (el) + e = el.document.parentWindow.event; + else + e = window.event; + } + if (!e.srcElement) { + var el = e.target; + while (el != null && el.nodeType != 1) + el = el.parentNode; + e.srcElement = el; + } + if (typeof e.offsetX == "undefined") { + e.offsetX = e.layerX; + e.offsetY = e.layerY; + } + + return e; + }, + + getDocument: function (e) { + if (e.target) + return e.target.ownerDocument; + return e.srcElement.document; + }, + + getSlider: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.slider == null) { + el = el.parentNode; + } + if (el) + return el.slider; + return null; + }, + + getLine: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.className != "line") { + el = el.parentNode; + } + return el; + }, + + getHandle: function (e) { + var el = e.target || e.srcElement; + var re = /handle/; + while (el != null && !re.test(el.className)) { + el = el.parentNode; + } + return el; + }, + // end helpers + + onfocus: function (e) { + var s = this.slider; + s._focused = true; + s.handle.className = "handle hover"; + }, + + onblur: function (e) { + var s = this.slider + s._focused = false; + s.handle.className = "handle"; + }, + + onmouseover: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle) + s.handle.className = "handle hover"; + }, + + onmouseout: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle && !s._focused) + s.handle.className = "handle"; + }, + + onmousedown: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s.element.focus) + s.element.focus(); + + Slider._currentInstance = s; + var doc = s.document; + + if (doc.addEventListener) { + doc.addEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.addEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.attachEvent) { + doc.attachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.attachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.attachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.setCapture(); + } + + if (Slider.eventHandlers.getHandle(e)) { // start drag + Slider._sliderDragData = { + screenX: e.screenX, + screenY: e.screenY, + dx: e.screenX - s.handle.offsetLeft, + dy: e.screenY - s.handle.offsetTop, + startValue: s.getValue(), + slider: s + }; + } + else { + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + s._increasing = null; + s.ontimer(); + } + }, + + onmousemove: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + + if (Slider._sliderDragData) { // drag + var s = Slider._sliderDragData.slider; + + var boundSize = s.getMaximum() - s.getMinimum(); + var size, pos, reset; + + if (s._orientation == "horizontal") { + size = s.element.offsetWidth - s.handle.offsetWidth; + pos = e.screenX - Slider._sliderDragData.dx; + reset = Math.abs(e.screenY - Slider._sliderDragData.screenY) > 100; + } + else { + size = s.element.offsetHeight - s.handle.offsetHeight; + pos = s.element.offsetHeight - s.handle.offsetHeight - + (e.screenY - Slider._sliderDragData.dy); + reset = Math.abs(e.screenX - Slider._sliderDragData.screenX) > 100; + } + s.setValue(reset ? Slider._sliderDragData.startValue : + s.getMinimum() + boundSize * pos / size); + return false; + } + else { + var s = Slider._currentInstance; + if (s != null) { + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + } + } + + }, + + onmouseup: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = Slider._currentInstance; + var doc = s.document; + if (doc.removeEventListener) { + doc.removeEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.removeEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.detachEvent) { + doc.detachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.detachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.detachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.releaseCapture(); + } + + if (Slider._sliderDragData) { // end drag + Slider._sliderDragData = null; + } + else { + s._timer.stop(); + s._increasing = null; + } + Slider._currentInstance = null; + }, + + onkeydown: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + //var s = Slider.eventHandlers.getSlider(e); + var s = this.slider; + var kc = e.keyCode; + switch (kc) { + case 33: // page up + s.setValue(s.getValue() + s.getBlockIncrement()); + break; + case 34: // page down + s.setValue(s.getValue() - s.getBlockIncrement()); + break; + case 35: // end + s.setValue(s.getOrientation() == "horizontal" ? + s.getMaximum() : + s.getMinimum()); + break; + case 36: // home + s.setValue(s.getOrientation() == "horizontal" ? + s.getMinimum() : + s.getMaximum()); + break; + case 38: // up + case 39: // right + s.setValue(s.getValue() + s.getUnitIncrement()); + break; + + case 37: // left + case 40: // down + s.setValue(s.getValue() - s.getUnitIncrement()); + break; + } + + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onkeypress: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var kc = e.keyCode; + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onmousewheel: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s._focused) { + s.setValue(s.getValue() + e.wheelDelta / 120 * s.getUnitIncrement()); + // windows inverts this on horizontal sliders. That does not + // make sense to me + return false; + } + } +}; + + + +Slider.prototype.classNameTag = "dynamic-slider-control", + +Slider.prototype.setValue = function (v) { + this._range.setValue(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getValue = function () { + return this._range.getValue(); +}; + +Slider.prototype.setMinimum = function (v) { + this._range.setMinimum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMinimum = function () { + return this._range.getMinimum(); +}; + +Slider.prototype.setMaximum = function (v) { + this._range.setMaximum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMaximum = function () { + return this._range.getMaximum(); +}; + +Slider.prototype.setUnitIncrement = function (v) { + this._unitIncrement = v; +}; + +Slider.prototype.getUnitIncrement = function () { + return this._unitIncrement; +}; + +Slider.prototype.setBlockIncrement = function (v) { + this._blockIncrement = v; +}; + +Slider.prototype.getBlockIncrement = function () { + return this._blockIncrement; +}; + +Slider.prototype.getOrientation = function () { + return this._orientation; +}; + +Slider.prototype.setOrientation = function (sOrientation) { + if (sOrientation != this._orientation) { + if (Slider.isSupported && this.element) { + // add class name tag to class name + this.element.className = this.element.className.replace(this._orientation, + sOrientation); + } + this._orientation = sOrientation; + this.recalculate(); + + } +}; + +Slider.prototype.recalculate = function() { + if (!Slider.isSupported || !this.element) return; + + var w = this.element.offsetWidth; + var h = this.element.offsetHeight; + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var lw = this.line.offsetWidth; + var lh = this.line.offsetHeight; + + // this assumes a border-box layout + + if (this._orientation == "horizontal") { + this.handle.style.left = (w - hw) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + this.handle.style.top = (h - hh) / 2 + "px"; + + this.line.style.top = (h - lh) / 2 + "px"; + this.line.style.left = hw / 2 + "px"; + //this.line.style.right = hw / 2 + "px"; + this.line.style.width = Math.max(0, w - hw - 2)+ "px"; + this.line.firstChild.style.width = Math.max(0, w - hw - 4)+ "px"; + } + else { + this.handle.style.left = (w - hw) / 2 + "px"; + this.handle.style.top = h - hh - (h - hh) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + + this.line.style.left = (w - lw) / 2 + "px"; + this.line.style.top = hh / 2 + "px"; + this.line.style.height = Math.max(0, h - hh - 2) + "px"; //hard coded border width + //this.line.style.bottom = hh / 2 + "px"; + this.line.firstChild.style.height = Math.max(0, h - hh - 4) + "px"; //hard coded border width + } +}; + +Slider.prototype.ontimer = function () { + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var hl = this.handle.offsetLeft; + var ht = this.handle.offsetTop; + + if (this._orientation == "horizontal") { + if (this._mouseX > hl + hw && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + else if (this._mouseX < hl && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + } + else { + if (this._mouseY > ht + hh && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + else if (this._mouseY < ht && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + } + + this._timer.start(); +}; diff -urN webmin.org/fdisk/timer.js webmin/fdisk/timer.js --- webmin.org/fdisk/timer.js 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/timer.js 2007-10-18 09:34:25.000000000 +0200 @@ -0,0 +1,62 @@ +/*----------------------------------------------------------------------------\ +| Timer Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Object Oriented Encapsulation of setTimeout fires ontimer when the timer | +| is triggered. Does not work in IE 5.00 | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +function Timer(nPauseTime) { + this._pauseTime = typeof nPauseTime == "undefined" ? 1000 : nPauseTime; + this._timer = null; + this._isStarted = false; +} + +Timer.prototype.start = function () { + if (this.isStarted()) + this.stop(); + var oThis = this; + this._timer = window.setTimeout(function () { + if (typeof oThis.ontimer == "function") + oThis.ontimer(); + }, this._pauseTime); + this._isStarted = false; +}; + +Timer.prototype.stop = function () { + if (this._timer != null) + window.clearTimeout(this._timer); + this._isStarted = false; +}; + +Timer.prototype.isStarted = function () { + return this._isStarted; +}; + +Timer.prototype.getPauseTime = function () { + return this._pauseTime; +}; + +Timer.prototype.setPauseTime = function (nPauseTime) { + this._pauseTime = nPauseTime; +}; diff -urN webmin.org/fdisk/winclassic.css webmin/fdisk/winclassic.css --- webmin.org/fdisk/winclassic.css 1970-01-01 01:00:00.000000000 +0100 +++ webmin/fdisk/winclassic.css 2007-10-18 09:34:37.000000000 +0200 @@ -0,0 +1,99 @@ +.dynamic-slider-control { + position: relative; + background-color: ThreeDFace; + -moz-user-focus: normal; + -moz-user-select: none; + cursor: default; +} + +.horizontal { + width: 200px; + height: 29px; +} + +.vertical { + width: 29px; + height: 200px; +} + +.dynamic-slider-control input { + display: none; +} + +.dynamic-slider-control .handle { + position: absolute; + -moz-user-select: none; + cursor: default; + background: ThreeDFace; + border: 1px solid; + border-color: ThreeDHighlight ThreeDDarkShadow + ThreeDDarkShadow ThreeDHighlight; +} + +/* inner border */ +.dynamic-slider-control .handle div { + font-size: 1px; + border: 1px solid; + border-color: ThreeDLightShadow ThreeDShadow + ThreeDShadow ThreeDLightShadow; + + behavior: url("css/boxsizing.htc"); /* ie path bug */ + box-sizing: content-box; + -moz-box-sizing: content-box; +} + +/* inner sets size +.dynamic-slider-control.horizontal .handle { + width: 12px; + height: 22px; +} +*/ + +.dynamic-slider-control.horizontal .handle div { + width: 8px; + height: 18px; +} + +.dynamic-slider-control.horizontal .handle.hover {} + +/* inner sets size +.dynamic-slider-control.vertical .handle { + width: 22px; + height: 12px; +} +*/ + +.dynamic-slider-control.vertical .handle div { + width: 18px; + height: 8px; +} + +.dynamic-slider-control.vertical .handle.hover {} + +.dynamic-slider-control .line { + + behavior: url("css/boxsizing.htc"); /* ie path bug */ + box-sizing: content-box; + -moz-box-sizing: content-box; + + position: absolute; + font-size: 0.01mm; + overflow: hidden; + border: 1px solid; + border-color: ThreeDShadow ThreeDHighlight + ThreeDHighlight ThreeDShadow; + background: ThreeDDarkShadow; +} + +.dynamic-slider-control.vertical .line { + width: 1px; + +} + +.dynamic-slider-control.horizontal .line { + height: 1px; +} + +.dynamic-slider-control .line div { + display: none; +} |
From: Jamie C. <jca...@we...> - 2007-10-13 21:03:09
|
That's a good suggestion - I will include this patch in the next Webmin release. - Jamie On 13/Oct/2007 03:38 Jean-Christophe Dubois wrote .. > Hi, > > When you are on the edit_hdparm form, there is no mention of the disk you are > dealing with. This is not so bad when you have only one disk and most of the > time you know for which disk you are editing the parameters=B5. > > However if you have numerous disks, it doesn't hurt to remind the user which > disk it is playing with. > > This is what this patch is doing. > > JC > > --- ./fdisk/edit_hdparm.cgi.org 2007-10-11 22:04:39.000000000 +0200 > +++ ./fdisk/edit_hdparm.cgi 2007-10-12 18:32:46.000000000 +0200 > @@ -33,7 +33,7 @@ > print( > "<form action=3Dapply_hdparm.cgi><table border cols=3D1 width=3D\"100%\"><input > type=3Dhidden name=3Ddrive value=3D", $d -> { 'device' }, ">", > "<tr ", $tb, ">", > - "<td><b>", $text{ 'hdparm_label' }, "</b></td>", > + "<td><b>", $d -> { 'desc' }, " (", $d->{'device'}, "): ", > $text{ 'hdparm_label' }, "</b></td>", > "</tr><tr ", $cb, "><td>", > "<table width=3D\"100%\">", > "<tr>", |
From: Jean-Christophe D. <jc...@tr...> - 2007-10-13 10:38:48
|
Hi, When you are on the edit_hdparm form, there is no mention of the disk you a= re=20 dealing with. This is not so bad when you have only one disk and most of th= e=20 time you know for which disk you are editing the parameters=B5. However if you have numerous disks, it doesn't hurt to remind the user whic= h=20 disk it is playing with. This is what this patch is doing. JC =2D-- ./fdisk/edit_hdparm.cgi.org 2007-10-11 22:04:39.000000000 +0200 +++ ./fdisk/edit_hdparm.cgi 2007-10-12 18:32:46.000000000 +0200 @@ -33,7 +33,7 @@ print( "<form action=3Dapply_hdparm.cgi><table border cols=3D1 width=3D\"100%\"><= input=20 type=3Dhidden name=3Ddrive value=3D", $d -> { 'device' }, ">", "<tr ", $tb, ">", =2D "<td><b>", $text{ 'hdparm_label' }, "</b></td>", + "<td><b>", $d -> { 'desc' }, " (", $d->{'device'}, "): ",=20 $text{ 'hdparm_label' }, "</b></td>", "</tr><tr ", $cb, "><td>", "<table width=3D\"100%\">", "<tr>", |
From: Hugo C. <hug...@ya...> - 2007-10-12 14:27:05
|
Jamie Cameron <jca...@we...> wrote: Yeah, I find STDERR debugging with Data::Dumper to the best method in Webmin, as often you are dealing with CGIs that are hard to attach a regular debugger to. What I often do to debug perl CGI scripts, is run them over Devel::ptkdb, a debugger that allows to set breakpoints and has an easy to use interface. To open the debugger window on the right X-server, you can set the DISPLAY variable in the first BEGIN block of the CGI script (e.g. to point to the same display as where you run the browser that makes the http request). I also use a rotating one shot log to debug scripts. The rotation is important to track down a sequence of redirections. Hope this helps. Hugo --------------------------------- Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. |