OSDN Git Service

[add] : JS scripts
authorhayao <shun819.mail@gmail.com>
Mon, 31 Aug 2020 06:35:57 +0000 (15:35 +0900)
committerhayao <shun819.mail@gmail.com>
Mon, 31 Aug 2020 06:35:57 +0000 (15:35 +0900)
index.php
main.js

index 0744640..3ff87be 100644 (file)
--- a/index.php
+++ b/index.php
@@ -4,6 +4,7 @@
         <title>AlterISO3 ビルドオプション ジェネレータ</title>
         <link rel="stylesheet" href="mobile.css" media="screen and (max-width:480px)">
         <link rel="stylesheet" href="pc.css" media="screen and (min-width:480px)">
+        <script type="text/javascript" src="main.js"></script>
     </head>
     <body>
         <header>
@@ -23,7 +24,7 @@
                     有効
                 </label>
                 <label for="plymouth_disable">
-                    <input type="radio" name="plymouth" value="enable" id="plymouth_disable">
+                    <input type="radio" name="plymouth" value="disable" id="plymouth_disable">
                     無効
                 </label>
                 <!-- Plymouth ここまで-->
                 <input type="password" name="password" placeholder="alter">
                 <!-- ユーザー ここまで-->
 
+                <input type="button" value="生成" onClick="startgen()">
+
+                <h3>実行結果</h3>
+                <textarea id="output" disabled></textarea>
+
 
             </form>
         </main>
diff --git a/main.js b/main.js
index e69de29..f633ea7 100644 (file)
--- a/main.js
+++ b/main.js
@@ -0,0 +1,22 @@
+var ARGUMENTS = ""
+
+function getPlymouth(){
+    var IsPlymouth = document.getElementsByName("plymouth");
+    for(var i = 0; i < IsPlymouth.length; i++){
+        if(IsPlymouth[i].checked) {
+            if ( IsPlymouth[i].value = "enable") {
+                ARGUMENTS = ARGUMENTS + "-b";
+            }
+        }
+    }
+}
+
+function startgen() {
+    // 初期化
+    ARGUMENTS = ""
+
+    getPlymouth();
+    
+    // 出力
+    document.getElementById('output').innerHTML = ARGUMENTS;
+}
\ No newline at end of file