From: "Liam McLoughlin" <hexxeh@hexxeh.net> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/gentoaster:master commit in: web/ Date: Fri, 12 Aug 2011 23:17:54 +0000 (UTC) [thread overview] Message-ID: <3dd50e713424c76cdfc709bb4f6b96be9bced1b0.hexxeh@gentoo> (raw) commit: 3dd50e713424c76cdfc709bb4f6b96be9bced1b0 Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> AuthorDate: Thu Jul 21 22:12:21 2011 +0000 Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> CommitDate: Thu Jul 21 22:12:21 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=3dd50e71 Added zonetab loading for timezone lists --- web/index.php | 147 +++++++++++++-------------------------------------------- 1 files changed, 33 insertions(+), 114 deletions(-) diff --git a/web/index.php b/web/index.php index 86b608c..181d07b 100644 --- a/web/index.php +++ b/web/index.php @@ -1,3 +1,25 @@ +<?php + define("ZONETAB", "/usr/share/zoneinfo/zone.tab"); + + $timezones = array(); + $zonetab = file(ZONETAB); + foreach ($zonetab as $buf) + { + if (substr($buf,0,1)=='#') continue; + $rec = preg_split('/\s+/',$buf); + $key = $rec[2]; + $val = $rec[2]; + $c = count($rec); + for ($i=3;$i<$c;$i++) $val.= ' '.$rec[$i]; + $timezones[$key] = $val; + ksort($timezones); + } + $timezoneOption = ""; + foreach ($timezones as $timezone => $description) + { + $timezoneOption .= "<option>".$timezone."</option>\n"; + } +?> <html> <head> <title>Gentoaster</title> @@ -23,7 +45,7 @@ </div> <div id="locale" class="step"> <h1>Locale</h1> - + <label for="locale_language">Language</label><br /> <select id="locale_language" class="required" name="language"> <option>English (UK)</option> @@ -38,36 +60,36 @@ <label for="locale_timezone">Timezone</label><br /> <select id="locale_timezone" class="required" name="timezone"> - <option>Europe/London</option> + <?php echo $timezoneOption; ?> </select> <br> </div> <div id="user" class="step"> <h1>User details</h1> - + <label for="user_username">Username</label><br /> <input id="user_username" class="required" type="text" name="username"><br> <label for="user_password">Password</label><br /> <input id="user_password" class="required" type="password" name="password"> <input id="user_confirmpassword" class="required" type="password" name="confirmpassword"><br> - + <label for="user_rootpassword">Root Password</label><br /> <input id="user_rootpassword" class="required" type="password" name="rootpassword"> <input id="user_confirmrootpassword" class="required" type="password" name="confirmrootpassword"><br> </div> <div id="network" class="step"> <h1>Network</h1> - + <label for="network_hostname">Hostname</label><br /> <input id="network_hostname" class="required" type="text" name="hostname"><br> </div> <div id="partitioning" class="step"> <h1>Partitioning</h1> - + <label for="partitioning_size">Disk size</label><br /> <input id="partitioning_size" class="required" type="text" name="size" value="4096"><br> - + <label for="">Split</label><br /><br /> <div id="partitioning_split" name="split"></div><br /><br /> <div id="partitioning_display">Not yet updated</div><br /> @@ -77,14 +99,14 @@ </div> <div id="packages" class="step"> <h1>Packages</h1> - + <label for="packages_packages">Packages list</label><br /><br /> <textarea id="packages_packages" name="packages" style="width: 680px; height: 330px;">dhcpcd</textarea> <br> </div> <div id="format" class="step submit_step"> <h1>Image format</h1> - + <label for="format_format">Output format</label><br /> <select id="format_format" class="required" name="format"> <option value="raw">Raw</option> @@ -106,109 +128,6 @@ </div> </form> </div> - <script type="text/javascript"> - $(function(){ - $("#wizard").formwizard({ - validationEnabled: true, - focusFirstInput: true, - disableUIStyles: true, - //historyEnabled: true, - validationOptions: { - rules: { - username: { - minlength: 2 - }, - password: { - minlength: 5 - }, - confirmpassword: { - minlength: 5, - equalTo: "#user_password" - }, - boot_size: { - min: 32 - }, - swap_size: { - min: 16 - }, - root_size: { - min: 3072 - }, - size: { - min: 4020 - } - }, - messages: { - username: { - minlength: "Your username must consist of at least 2 characters" - }, - password: { - minlength: "Your password must be at least 5 characters long" - }, - confirmpassword: { - minlength: "Your password must be at least 5 characters long", - equalTo: "Please enter the same password in both boxes" - }, - boot_size: { - min: "Your boot partition must be at least 32MB" - }, - swap_size: { - min: "Your swap partition must be at least 128MB" - }, - root_size: { - min: "Your root partition must be at least 3072MB" - }, - size: { - min: "Your disk image must be at least 4020MB" - } - } - } - }); - - function partitioning_update(event, ui) { - if(!ui.values) { - ui.values = ui; - } - $('.partitionrange').css('width', $('.ui-slider-range').css('left')); - var boot_size = ui.values[0]; - var swap_size = ui.values[1]-ui.values[0]; - var root_size = $("#partitioning_split").slider( "option", "max" )-ui.values[1]; - var image_size = boot_size+swap_size+root_size; - $("#partitioning_display").html("Disk image size: "+image_size+"MB<br>Boot partition size: "+boot_size+"MB<br>Swap partition size: "+swap_size+"MB<br>Root partition size: "+root_size+"MB"); - $("#partitioning_boot").attr("value", boot_size); - $("#partitioning_swap").attr("value", swap_size); - $("#partitioning_root").attr("value", root_size); - - //since it doesn't seem to redraw by itself, hacky fix! - $("#partitioning_split").slider("option", "values", $("#partitioning_split").slider("option", "values")); - } - - $("#partitioning_split").slider({ - range: true, - min: 0, - max: 4096, - values: [128, 640], - slide: partitioning_update, - change: partitioning_update, - create: function(event, ui) { - var slider = $(event.target); - var range = slider.find('.ui-slider-range'); - var newrange = $('<div />'); - newrange.appendTo(slider).addClass('ui-slider-range partitionrange').css('width', range.css('left')); - } - }); - - function update_slider() { - var new_size = $("#partitioning_size").val(); - $("#partitioning_split").slider("option", "max", new_size); - partitioning_update(null, $("#partitioning_split").slider("option", "values")); - } - - - $("#partitioning_size").change(update_slider); - - partitioning_update(null, $("#partitioning_split").slider("option", "values")); - }); - </script> + <script type="text/javascript" src=" /js/gentoaster.js"></script> </body> -</html> \ No newline at end of file +</html>
WARNING: multiple messages have this Message-ID (diff)
From: "Liam McLoughlin" <hexxeh@hexxeh.net> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/gentoaster:webui commit in: web/ Date: Sun, 24 Jul 2011 02:43:35 +0000 (UTC) [thread overview] Message-ID: <3dd50e713424c76cdfc709bb4f6b96be9bced1b0.hexxeh@gentoo> (raw) Message-ID: <20110724024335.dUSzj6altarCGS2GRu_6D6OWYZStlnTGUe_iwqYy7iQ@z> (raw) commit: 3dd50e713424c76cdfc709bb4f6b96be9bced1b0 Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> AuthorDate: Thu Jul 21 22:12:21 2011 +0000 Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> CommitDate: Thu Jul 21 22:12:21 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=3dd50e71 Added zonetab loading for timezone lists --- web/index.php | 147 +++++++++++++-------------------------------------------- 1 files changed, 33 insertions(+), 114 deletions(-) diff --git a/web/index.php b/web/index.php index 86b608c..181d07b 100644 --- a/web/index.php +++ b/web/index.php @@ -1,3 +1,25 @@ +<?php + define("ZONETAB", "/usr/share/zoneinfo/zone.tab"); + + $timezones = array(); + $zonetab = file(ZONETAB); + foreach ($zonetab as $buf) + { + if (substr($buf,0,1)=='#') continue; + $rec = preg_split('/\s+/',$buf); + $key = $rec[2]; + $val = $rec[2]; + $c = count($rec); + for ($i=3;$i<$c;$i++) $val.= ' '.$rec[$i]; + $timezones[$key] = $val; + ksort($timezones); + } + $timezoneOption = ""; + foreach ($timezones as $timezone => $description) + { + $timezoneOption .= "<option>".$timezone."</option>\n"; + } +?> <html> <head> <title>Gentoaster</title> @@ -23,7 +45,7 @@ </div> <div id="locale" class="step"> <h1>Locale</h1> - + <label for="locale_language">Language</label><br /> <select id="locale_language" class="required" name="language"> <option>English (UK)</option> @@ -38,36 +60,36 @@ <label for="locale_timezone">Timezone</label><br /> <select id="locale_timezone" class="required" name="timezone"> - <option>Europe/London</option> + <?php echo $timezoneOption; ?> </select> <br> </div> <div id="user" class="step"> <h1>User details</h1> - + <label for="user_username">Username</label><br /> <input id="user_username" class="required" type="text" name="username"><br> <label for="user_password">Password</label><br /> <input id="user_password" class="required" type="password" name="password"> <input id="user_confirmpassword" class="required" type="password" name="confirmpassword"><br> - + <label for="user_rootpassword">Root Password</label><br /> <input id="user_rootpassword" class="required" type="password" name="rootpassword"> <input id="user_confirmrootpassword" class="required" type="password" name="confirmrootpassword"><br> </div> <div id="network" class="step"> <h1>Network</h1> - + <label for="network_hostname">Hostname</label><br /> <input id="network_hostname" class="required" type="text" name="hostname"><br> </div> <div id="partitioning" class="step"> <h1>Partitioning</h1> - + <label for="partitioning_size">Disk size</label><br /> <input id="partitioning_size" class="required" type="text" name="size" value="4096"><br> - + <label for="">Split</label><br /><br /> <div id="partitioning_split" name="split"></div><br /><br /> <div id="partitioning_display">Not yet updated</div><br /> @@ -77,14 +99,14 @@ </div> <div id="packages" class="step"> <h1>Packages</h1> - + <label for="packages_packages">Packages list</label><br /><br /> <textarea id="packages_packages" name="packages" style="width: 680px; height: 330px;">dhcpcd</textarea> <br> </div> <div id="format" class="step submit_step"> <h1>Image format</h1> - + <label for="format_format">Output format</label><br /> <select id="format_format" class="required" name="format"> <option value="raw">Raw</option> @@ -106,109 +128,6 @@ </div> </form> </div> - <script type="text/javascript"> - $(function(){ - $("#wizard").formwizard({ - validationEnabled: true, - focusFirstInput: true, - disableUIStyles: true, - //historyEnabled: true, - validationOptions: { - rules: { - username: { - minlength: 2 - }, - password: { - minlength: 5 - }, - confirmpassword: { - minlength: 5, - equalTo: "#user_password" - }, - boot_size: { - min: 32 - }, - swap_size: { - min: 16 - }, - root_size: { - min: 3072 - }, - size: { - min: 4020 - } - }, - messages: { - username: { - minlength: "Your username must consist of at least 2 characters" - }, - password: { - minlength: "Your password must be at least 5 characters long" - }, - confirmpassword: { - minlength: "Your password must be at least 5 characters long", - equalTo: "Please enter the same password in both boxes" - }, - boot_size: { - min: "Your boot partition must be at least 32MB" - }, - swap_size: { - min: "Your swap partition must be at least 128MB" - }, - root_size: { - min: "Your root partition must be at least 3072MB" - }, - size: { - min: "Your disk image must be at least 4020MB" - } - } - } - }); - - function partitioning_update(event, ui) { - if(!ui.values) { - ui.values = ui; - } - $('.partitionrange').css('width', $('.ui-slider-range').css('left')); - var boot_size = ui.values[0]; - var swap_size = ui.values[1]-ui.values[0]; - var root_size = $("#partitioning_split").slider( "option", "max" )-ui.values[1]; - var image_size = boot_size+swap_size+root_size; - $("#partitioning_display").html("Disk image size: "+image_size+"MB<br>Boot partition size: "+boot_size+"MB<br>Swap partition size: "+swap_size+"MB<br>Root partition size: "+root_size+"MB"); - $("#partitioning_boot").attr("value", boot_size); - $("#partitioning_swap").attr("value", swap_size); - $("#partitioning_root").attr("value", root_size); - - //since it doesn't seem to redraw by itself, hacky fix! - $("#partitioning_split").slider("option", "values", $("#partitioning_split").slider("option", "values")); - } - - $("#partitioning_split").slider({ - range: true, - min: 0, - max: 4096, - values: [128, 640], - slide: partitioning_update, - change: partitioning_update, - create: function(event, ui) { - var slider = $(event.target); - var range = slider.find('.ui-slider-range'); - var newrange = $('<div />'); - newrange.appendTo(slider).addClass('ui-slider-range partitionrange').css('width', range.css('left')); - } - }); - - function update_slider() { - var new_size = $("#partitioning_size").val(); - $("#partitioning_split").slider("option", "max", new_size); - partitioning_update(null, $("#partitioning_split").slider("option", "values")); - } - - - $("#partitioning_size").change(update_slider); - - partitioning_update(null, $("#partitioning_split").slider("option", "values")); - }); - </script> + <script type="text/javascript" src=" /js/gentoaster.js"></script> </body> -</html> \ No newline at end of file +</html>
next reply other threads:[~2011-08-12 23:20 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-08-12 23:17 Liam McLoughlin [this message] 2011-07-24 2:43 ` [gentoo-commits] proj/gentoaster:webui commit in: web/ Liam McLoughlin -- strict thread matches above, loose matches on Subject: below -- 2011-08-19 12:55 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-08-15 2:52 Liam McLoughlin 2011-08-15 1:47 Liam McLoughlin 2011-08-15 0:25 Liam McLoughlin 2011-08-12 23:17 Liam McLoughlin 2011-08-12 23:17 Liam McLoughlin 2011-08-12 23:17 Liam McLoughlin 2011-08-12 23:17 Liam McLoughlin 2011-08-06 0:14 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:18 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-08-04 21:04 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:18 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-08-02 17:31 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-28 1:12 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-27 20:25 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-27 20:11 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin 2011-07-15 19:59 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin 2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3dd50e713424c76cdfc709bb4f6b96be9bced1b0.hexxeh@gentoo \ --to=hexxeh@hexxeh.net \ --cc=gentoo-commits@lists.gentoo.org \ --cc=gentoo-dev@lists.gentoo.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox