User:Documentalist/ObjectBrowser.js

//importArticle({type: "script", article:"User:Documentalist/Objects.js"});

var Objects = new Array; Objects[0] = { id: 'xx003043', image_url: "http://static1.wikia.nocookie.net/__cb20121005185408/elderscrolls/images/a/a2/Clay.png", name: "Clay", display_name: 'Clay', value: "1", weight: "0.10", acquisition: "Nature", application: "" }; Objects[1] = { id: "xx005A69", image_url: "http://static2.wikia.nocookie.net/__cb20121011205540/elderscrolls/images/1/15/Glass.png", name: "Glass", display_name: "Glass", value: "5", weight: "1.00", acquisition: "Shops", application: "" }; Objects[2] = { id: "xx00303F", image_url: "http://static2.wikia.nocookie.net/__cb20121005185025/elderscrolls/images/b/b0/Goat_horns.png", name: "Goat Horns", display_name: "Goat Horns", value: "5", weight: "1.00", acquisition: "Shops",    application: ""}; Objects[3] = { id: "xx003011", image_file: "Hinge.png", name: "Hinge",                        display_name: "Hinge", value: "4", weight: "0.50", acquisition: "Smithing", application: ""}; Objects[4] = { id: "xx003035", image_file: "Iron_fittings.png", name: "Iron Fittings",                display_name: "Iron Fittings", value: "4", weight: "1.00", acquisition: "Smithing", application: ""}; Objects[5] = { id: "xx003012", image_file: "Lock.png", name: "Lock",                         display_name: "Lock", value: "10", weight: "0.50", acquisition: "Smithing", application: ""}; Objects[6] = { id: "xx00300F", image_file: "Nails.png", name: "Nails",                        display_name: "Nails", value: "1", weight: "0.10", acquisition: "Smithing", application: ""}; Objects[7] = { id: "xx00306C", image_file: "http://static3.wikia.nocookie.net/__cb20121005185027/elderscrolls/images/e/e9/Quarried_stone.png", name: "Quarried Stone",               display_name: "Quarried Stone", value: "2", weight: "1.00", acquisition: "Nature",   application: ""}; Objects[8] = { id: "xx00300E", image_file: "", name: "Sawn Log",                     display_name: "Sawn Log", value: "10", weight:   "-", acquisition: "Shops",    application: ""}; Objects[9] = { id: "xx005A68", image_file: "Hearthfire_Straw.png", name: "Straw",                        display_name: "Straw", value: "1", weight: "1.00", acquisition: "Shops",    application: ""}; var ObjectBrowser = document.getElementById("ObjectBrowser"); var ShowValue = true; var ShowWeight = true; /**/ function FormatId(id) { console.log("Begin of FormatId("+ id +")."); if (id.substr(0, 2) == 'xx') { return 'xx' + id.substr(2) + ' '; } return '' + id + ' '; } /**/ function SetShowValue(v) { console.log("Begin of SetShowValue("+ v +")."); ShowValue = v; ShowObjects; console.log("End of SetShowValue."); } /**/ function SetShowWeight(v) { console.log("Begin of SetShowWeight("+ v +")."); ShowWeight = v; ShowObjects; console.log("End of SetShowWeight."); } /*-- 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 --*/ function ShowObjects{ console.log("Begin of ShowObjects."); ObjectBrowser.style.backgroundColor = "#101010"; var HTML = ""; /*2. Row control.*/

/*3. Column control.*/ var ButtonDiv = '\n'; /*3.1. Column hide.*/ HTML += '\n'; { var State = ""; HTML += ButtonDiv; if (!ShowValue) State = 'disabled'; HTML += 'Hide Value\n'; HTML += '\n'; } { var State = ""; HTML += ButtonDiv; if (!ShowWeight) State = 'disabled'; HTML += 'Hide Weight\n'; HTML += '\n'; } HTML += '\n'; /*3.2. Column show.*/ HTML += '\n'; { var State = ""; HTML += ButtonDiv; if (ShowValue) State = 'disabled'; HTML += 'Show Value</BUTTON>\n'; HTML += '</DIV>\n'; } { var State = ""; HTML += ButtonDiv; if (ShowWeight) State = 'disabled'; HTML += 'Show Weight</BUTTON>\n'; HTML += '</DIV>\n'; } HTML += '</DIV>\n'; /*3.3. Column sort.*/ /*3.4. Column reverse.*/

/*4. Table*/ HTML += ' "; ObjectBrowser.innerHTML = HTML;  console.log("End of ShowObjects."); }

/*---*/ if (typeof ObjectBrowser != "undefined") { ShowObjects; }