User:Mejrs/lighttable

From Old School RuneScape Wiki
Jump to: navigation, search

===Description=== This is a modified version of [[MediaWiki:Gadget-highlightTable-core.js]]. It allows lighttables to light cells individually. ===Setting up=== Open your JavaScript console in your browser (shift-F4 in Firefox). Run this to clear the effects of the active lightttable script (it doesn't remove the reset button, ignore it): <code>$(".ht-reset").parent().remove(); $("tr").removeClass().off(); </code> [[User:Mejrs/lighttable.js|...then run this JavaScript]] === Example 1 === {| class="wikitable lighttable individual" ! header 1 ! header 2 ! header 3 |- | r1c1 | r1c2 | r1c3 |- | r2c1 | r2c2 | r2c1 |- | r3c1 | r3c2 | r3c3 |- | r4c1 | r4c2 | r4c3 |- | r5c1 | r5c2 | r5c3 |- | r6c1 | r6c2 | r6c3 |} === Actual example 2 === {| class="wikitable lighttable individual" |+Master clue rewards |- | {{plink|Flaming sword enchantment}} | {{plink|Elemental impetus}} | {{plink|Golden thread}} | {{plink|Box of clue scrolls}} | {{plink|Hobby unicorn (white)}} | {{plink|Hobby unicorn (black)}} |- | {{plink|Pyjama top}} | {{plink|Pyjama bottoms}} | {{plink|Pyjama slippers}} | {{plink|Heavy chest}} | {{plink|Bag of clues}} | {{plink|Ring of coins}} |- | {{plink|Ring of trees}} | {{plink|Round glasses (black)}} | {{plink|Round glasses (blue)}} | {{plink|Round glasses (green)}} | {{plink|Stylish glasses (black)}} | {{plink|Stylish glasses (blue)}} |- | {{plink|Stylish glasses (green)}} | {{plink|Half-moon spectacles (black)}} | {{plink|Half-moon spectacles (blue)}} | {{plink|Half-moon spectacles (green)}} | {{plink|Adamant dragon mask}} | {{plink|Rune dragon mask}} |- | {{plink|Dragonstone dragon mask}} | {{plink|Onyx dragon mask}} | {{plink|Hydrix dragon mask}} | {{plink|Gilded boater}} | {{plink|Gilded cavalier}} | {{plink|Samurai kasa}} |- | {{plink|Reaper ornament kit}} | {{plink|Soul ornament kit}} | {{plink|Tuxedo jacket}} | {{plink|Tuxedo trousers}} | {{plink|Tuxedo shoes}} | {{plink|Tuxedo gloves}} |- | {{plink|Tuxedo cravat}} | {{plink|Evening bolero}} | {{plink|Evening dipped skirt}} | {{plink|Evening shoes}} | {{plink|Evening gloves}} | {{plink|Evening masquerade mask}} |- | {{plink|Heated tea flask}} | {{plink|Elemental battlestaff}} | {{plink|Pack yak mask}} | {{plink|Sack of effigies}} | {{plink|Backstab cape}} | {{plink|Shadow dye}} |- | {{plink|Barrows dye}} | {{plink|Ice dye}} | {{plink|Third Age dye}} | {{plink|Blood dye}} | {{plink|Second-Age full helm}} | {{plink|Second-Age platebody}} |- | {{plink|Second-Age platelegs}} | {{plink|Second-Age sword}} | {{plink|Second-Age mage mask}} | {{plink|Second-Age robe top}} | {{plink|Second-Age robe bottom}} | {{plink|Second-Age staff}} |- | {{plink|Second-Age range coif}} | {{plink|Second-Age range top}} | {{plink|Second-Age range legs}} | {{plink|Second-Age bow}} | {{plink|Orlando Smith's hat}} | class="nohighlight"|(Empty cell) |} ===Lighttable Documentation === Lighttables are tables where the rows can be clicked to mark/unmark them. The mark status is stored in the browser's local storage and will persist until it is cleared. Lighttable is not compatible with: * Alternation - alternation overrides lighttable colours, not recommended to be used together * Colours - colours override lighttable colours, avoid using together * N/A - N/A overrides lighttable colours, be careful when using together It notably is compatible with sortable (and autosort) tables, and will preserve the correct highlights over reloads, even when the table is sorted before clicking. {| style="width:100%;" | <pre>{| class="wikitable lighttable" |+ alternating rows ! header 1 ! header 2 ! header 3 |- | r1c1 | r1c2 | r1c3 |- | r2c1 | r2c2 | r2c1 |- | r3c1 | r3c2 | r3c3 |- | r4c1 | r4c2 | r4c3 |- | r5c1 | r5c2 | r5c3 |- | r6c1 | r6c2 | r6c3 |}</pre> | style="padding-left:1em;" | {| class="wikitable lighttable" |+ alternating rows ! header 1 ! header 2 ! header 3 |- | r1c1 | r1c2 | r1c3 |- | r2c1 | r2c2 | r2c1 |- | r3c1 | r3c2 | r3c3 |- | r4c1 | r4c2 | r4c3 |- | r5c1 | r5c2 | r5c3 |- | r6c1 | r6c2 | r6c3 |} |} To highlight individual cells, add <code>class="individual"</code> to the table class. A cell can be excluded from highlighting by adding <code>class="nohighlight"</code> to that cell. {| style="width:100%;" | <pre>{| class="wikitable lighttable individual" |+ table | r1c1 | r1c2 | r1c3 |- | r2c1 | class="nohighlight" | not highlight-able | r2c3 |- | r3c1 | r3c2 | r3c3 |}</pre> | style="padding-left:1em;" | {| class="wikitable lighttable individual" |+ table | r1c1 | r1c2 | r1c3 |- | r2c1 | class="nohighlight" | not highlight-able | r2c3 |- | r3c1 | r3c2 | r3c3 |} |} ;Related: Checklists can be created with the <code>checklist</code> class in combination with lighttable, in a div element. This can be simplified by using [[Template:Checklist]]. {| style="width:100%;" |style="width:50%;"| <pre><div class="lighttable checklist"> * bullet 1 * bullet 2 * bullet 3 </div></pre> | style="padding-left:1em;" | <div class="lighttable checklist"> * bullet 1 * bullet 2 * bullet 3 </div> |- | <pre>{{checklist| * bullet 10 * bullet 20 * bullet 30 }}</pre> | style="padding-left:1em;" | {{checklist| * bullet 10 * bullet 20 * bullet 30 }} |} ===Regular lighttables will also still work fine === {| class="wikitable lighttable" ! Boss ! Feat ! Title |- | [[File:Barry.png|link=Araxxi]] [[Araxxi]] | [[Friendly Neighbour]] | {{TitleAnchor|t=the Araxyte|c=#2A7F2D|loc=s}} |- | [[File:Dharok's helm.png|link=Barrows]] [[Barrows]] | [[Barrowed Time]] | {{TitleAnchor|t=Graverobber|c=#595730|loc=p}} |- | [[File:Dharok bobblehead.png|link=Rise of the Six]] [[Rise of the Six]] | [[Family Affair]] | {{TitleAnchor|t=Banisher of Shadows|c=#451D44|loc=s|,=c}} |- | [[File:Ellie.png|link=Chaos elemental]] [[Chaos elemental]] | [[Chaos Theory (achievement)|Chaos Theory]] | {{TitleAnchor|t=cHaOs|c=#936F84|loc=p}} |- | [[File:Commander Miniana.png|link=Commander Zilyana]] [[Commander Zilyana]] | [[Keeper of the Faith]] | {{TitleAnchor|t=Finesse of the Icyene|c=#C2A155|loc=s|,=c}} |- | [[File:Corporeal Puppy.png|link=Corporeal beast]] [[Corporeal beast]] | [[Out of Body experience]] | {{TitleAnchor|t=Dark Core|c=#41394C|loc=p}} |- | [[File:Prime hatchling.png|link=Dagannoth Kings]] [[Dagannoth Kings]] | [[Long live the Kings!]] | {{TitleAnchor|t=Bukalla's Heir|c=#474341|loc=p}} |- | [[File:Bisdi.png]] [[Dragonkin Laboratory]] | [[Dragonkin Swag]] | {{TitleAnchor|t=Black Stone|c=#6c3ab7|loc=p}} |- | [[File:General Awwdor.png|link=General Graardor]] [[General Graardor]] | [[Five-Star General]] | {{TitleAnchor|t=Strength of Ourgs|c=#6B7732|loc=s|,=c}} |- | [[File:Molly (pet) icon.png|link=Giant mole]] [[Giant mole]] | [[Can you dig it?]] | {{TitleAnchor|t=of the Underground|c=#7C5025|loc=s}} |- | [[File:Greg.png|link=Gregorovic]] [[Gregorovic]] | [[Game Over]] | {{TitleAnchor|t=the Faceless One|c=#C8CDD7|loc=s}} |- | [[File:Lilwyr.png|link=Helwyr]] [[Helwyr]] | [[Once the hunter, now the hunted]] | {{TitleAnchor|t=Shapeshifter|c=#1F449C|loc=p}} |- | [[File:Kalphite Grubling.png|link=Kalphite King]] [[Kalphite King]] | [[Exiled (achievement)|Exiled]] | {{TitleAnchor|t=the Kingslayer|c=#AC4C22|loc=s}} |- | [[File:Kalphite Grublet.png|link=Kalphite Queen]] [[Kalphite Queen]] | [[Checkmate]] | {{TitleAnchor|t=the Queenslayer|c=#79B050|loc=s}} |- | [[File:King Black Dragonling.png|link=King Black Dragon]] [[King Black Dragon]] | [[How to shame your Dragon]] | {{TitleAnchor|t=the Last Rider|c=#3C3C3C|loc=s}} |- | [[File:Chick'arra.png|link=Kree'arra]] [[Kree'arra]] | [[Light as a feather]] | {{TitleAnchor|t=Swiftness of the Aviansie|,=c|c=#C8CADC|loc=s}} |- | [[File:K'ril Tinyroth.png|link=K'ril Tsutsaroth]] [[K'ril Tsutsaroth]] | [[Whale Food]] | {{TitleAnchor|t=Brawn of a Tsutsaroth|c=#801A21|loc=s|,=c}} |- | [[File:Legio Primulus.png|Legiones]] [[Legiones]] | [[We are legion]] | {{TitleAnchor|t=Legio|c=#27BDC2|loc=p}} |- | [[File:Lil' Tuzzy.png|link=Liberation of Mazcab]] [[Liberation of Mazcab]] | [[Liberated]] | {{TitleAnchor|t=the Liberator|c=#D0844A|loc=s}} |- | [[File:The Minister.png|link=The Magister]] [[The Magister]] | [[Superior Successor]] | {{TitleAnchor|t=of the Crossing|c=#937ED0|loc=s}} |- | [[File:Nexterminator.png|link=Nex]] [[Nex]] | [[Prison Break (feat)|Prison Break]] | {{TitleAnchor|t=Tenacity of Zarytes|,=c|c=#AA44AA|loc=s}} |- | [[File:Reeves.png|link=Nex: Angel of Death]] [[Nex: Angel of Death]] | [[Fallen Angel]] | {{TitleAnchor|t=of the Praesul|c=#AA44AA|loc=s}} |- | [[File:Queen Black Dragonling.png|link=Queen Black Dragon]] [[Queen Black Dragon]] | [[Blackout]] | {{TitleAnchor|t=the Experiment|c=#3C3C3C|loc=s}} |- | [[File:Ambi.png|link=The Shadow Reef]] [[The Shadow Reef]] | [[The Shadow Thief]] | {{TitleAnchor|t=the Ambassador|c=#00DDFF|loc=s|link=The Ambassador (title)}} |- | [[File:Solly.png|link=Solak]] [[Solak]] | [[So-lacking in drops]] | {{TitleAnchor|t=the Guardian of the Grove|c=#42eef4|loc=s}} |- | [[File:Tess.png|link=Telos]] [[Telos]] | [[Party Anima]] | {{TitleAnchor|t=the Dormant|c=#36827E|loc=s}} |- | [[File:Kuroryu.png|link=Seiryu the Azure Serpent]] [[Temple of Aminishi]] | [[Raiders of the Lost Arc]] | {{TitleAnchor|t=Acolyte of Seiryu|,=c|c=#96C8FF|loc=s}} |- | [[File:Ava (pet) icon.png|link=Twin Furies]] [[Twin Furies]] | [[Heart to Heart]] | {{TitleAnchor|t=the Lone Fury|c=#E6591A|loc=s}} |- | [[File:Shrimpy.png|link=Fight Kiln]] [[Fight Kiln|TzHaar]] | [[First rule of fight caves]] | {{TitleAnchor|t=Kal-Haar-Xil|c=#E6591A|loc=p}} |- | [[File:Rawrvek.png|link=Vindicta]] [[Vindicta|Vindicta & Gorvek]] | [[Revenge is sweet]] | {{TitleAnchor|t=the Dragonrider|c=#1369AD|loc=s}} |- | [[File:Vitalis (pet) icon.png|link=Vorago]] [[Vorago]] | [[Hard as a rock]] | {{TitleAnchor|t=of Omens|c=#95884D|loc=s}} |}