Difference between revisions of "User:DeletedUser010919/Sandbox5"

From Dragalia Lost Wiki
Jump to navigation Jump to search
>@DeletedUser41383047
>@DeletedUser41383047
Line 6: Line 6:
 
   });
 
   });
 
});
 
});
 +
 
var srcData;
 
var srcData;
 +
 
function load_cargo_data() {
 
function load_cargo_data() {
 
   var srcUrl = 'https://dragalialost.gamepedia.com/api.php?action=cargoquery&tables=Skills&fields=_pageName=Name,Description1=Skill1,Description2=Skill2,Description3=Skill3,HideLevel3=Hidden&where=Description1+LIKE+"%recovery%20potency%"&format=json';
 
   var srcUrl = 'https://dragalialost.gamepedia.com/api.php?action=cargoquery&tables=Skills&fields=_pageName=Name,Description1=Skill1,Description2=Skill2,Description3=Skill3,HideLevel3=Hidden&where=Description1+LIKE+"%recovery%20potency%"&format=json';
Line 18: Line 20:
 
};
 
};
  
    function populate_skill_box(skillLevel) {
+
function populate_skill_box(skillLevel) {
      var skillSelect = $("#skillSelect");
+
  var skillSelect = $("#skillSelect");
      var skillCount = srcData.length;     
+
  var skillCount = srcData.length;     
      for (var i = 0; i < skillCount; i++) {
+
  for (var i = 0; i < skillCount; i++) {
        var opt = $("<option></option>");
+
    var opt = $("<option></option>");
        opt.attr("value", srcData[i].title[skillLevel].match(/\d+/));
+
    opt.attr("value", srcData[i].title[skillLevel].match(/\d+/));
        opt.html(srcData[i].title.Name);
+
    opt.html(srcData[i].title.Name);
        skillSelect.append(opt);
+
    skillSelect.append(opt);
      }
+
  }
    }
+
};
 
 
 
 
 
 
  
 
function selectSkillLevel(skill) {
 
function selectSkillLevel(skill) {
Line 86: Line 85:
 
<p>HP: <input type="number" id="HP" class="a"></p>
 
<p>HP: <input type="number" id="HP" class="a"></p>
 
<p>STR: <input type="number" id="STR" class='a'></p>
 
<p>STR: <input type="number" id="STR" class='a'></p>
<p>Skill: <select id="skillSelect" name="skillSelect" onclick="showSkillValue()"></select>
+
<p>Skill: <select id="skillSelect" name="skillSelect" onclick="showSkillValue(), selectSkillLevel(document.getElementById("skillSelect").selectedIndex)"></select>
 
<form id="skillLevelSelect" style="display:inline;">
 
<form id="skillLevelSelect" style="display:inline;">
 
     <div id="skillLevelSelect1" style="display:inline;"></div>
 
     <div id="skillLevelSelect1" style="display:inline;"></div>

Revision as of 21:58, 29 November 2018