JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script>
<!-- ugly hack -->
<div id="data" style="display:none;">-2145995947 MinMaxDam 1 Secondary
-2144486452 Thorns 15 Secondary
-2138793846 DexInt V Secondary
-2138183307 MinDam 7 Secondary
-2135462520 LightningResist 0.1 Legendary
-2131762116 PoisonD 2 Fast
-2124005782 DamageBonusPoison 1 Legendary
-2121970945 Regen 15 Secondary
-2114783997 Skill_Monk_Wayof100Fists 1
-2114783996 Skill_Monk_Wayof100Fists 2
-2114783995 Skill_Monk_Wayof100Fists 3
-2114783994 Skill_Monk_Wayof100Fists 4
-2114783993 Skill_Monk_Wayof100Fists 5
-2114783992 Skill_Monk_Wayof100Fists 6
-2114783991 Skill_Monk_Wayof100Fists 7
-2114783990 Skill_Monk_Wayof100Fists 8
-2107609951 Dex 8 Secondary
-2106694432 Skill_Wizard_ShockPulse 1
-2106694431 Skill_Wizard_ShockPulse 2
-2106694430 Skill_Wizard_ShockPulse 3
-2106694429 Skill_Wizard_ShockPulse 4
-2106694428 Skill_Wizard_ShockPulse 5
-2106694427 Skill_Wizard_ShockPulse 6
-2106694426 Skill_Wizard_ShockPulse 7
-2106694425 Skill_Wizard_ShockPulse 8
-2100110576 DR 2 Secondary
-2099275863 SpiritHeals 10
-2092626723 PoisonD 3 Fast
-2090456320 PrimaryAttribute_Str 5 Legendary
-2089077377 ArcaneResist III
-2089063220 ArcaneResist VII
-2089061042 ArcaneResist XII
-2088677743 DamageBonusHoly 4 Legendary
-2082601897 MinDam 10
-2082601896 MinDam 11
-2082601895 MinDam 12
-2082601894 MinDam 13
-2082601893 MinDam 14
-2080147913 IntVit VIII Secondary
-2067035827 DexVit VIII Secondary
-2064957999 DefenseMissile 10
-2064957998 DefenseMissile 11
-2064957997 DefenseMissile 12
-2060064773 DamageBonusLightning 6 Legendary
-2059320357 Skill_WitchDoctor_PoisonDart 1
-2059320356 Skill_WitchDoctor_PoisonDart 2
-2059320355 Skill_WitchDoctor_PoisonDart 3
-2059320354 Skill_WitchDoctor_PoisonDart 4
-2059320353 Skill_WitchDoctor_PoisonDart 5
-2059320352 Skill_WitchDoctor_PoisonDart 6
-2059320351 Skill_WitchDoctor_PoisonDart 7
-2059320350 Skill_WitchDoctor_PoisonDart 8
-2058758229...
CSS
table {
margin: 5px;
}
td {
padding: 3px;
}
JavaScript
$(function() {
var raw_data = $("#data").text();
var dict = {};
_.each(raw_data.split("\n"), function(v) {
var l = v.split(' ');
dict[l[0]] = l;
});
$("#doit").click(function() {
var raw_code = $("#code").val();
var between_colons = raw_code.split(":");
var raw_name = between_colons[17];
raw_name = raw_name.substr(3, raw_name.length - 6);
$("#itemname").text(raw_name);
$("#properties").html('');
var properties = between_colons[3].split(",");
for (var i=0; i<properties.length; ++i) {
var content;
if (!(properties[i] in dict))
content = "unknown property";
else {
content = _.map(dict[properties[i]], function(d) { return "<td>"+d+"</td>"; }).join(" ");
}
$("#properties").append($("<tr>" + content + "</tr>"));
}
});
});