Latest Neocron News and Information
- New test server patch #561 has been released to Vedeena
Difference between revisions of "Metadata:Mapping/Map.js"
From Neocron Wiki
(Brammers changed the content model of the page Metadata:Mapping/Map.js from "wikitext" to "JavaScript") Tag: content model change |
|||
(35 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | /* NC-Wiki Jquery File - Do not delete! */ | + | /* NC-Wiki Jquery File - Do not delete! (c) 2017 - Tech Haven Network */ |
− | $ | + | $(document).ready(function($) |
{ | { | ||
− | if ( | + | // Add functions and stuff here |
− | { | + | |
− | + | // NC-Wiki map - enabled the plugin | |
− | } | + | $('img.ncwiki_map').maphilight( |
+ | { | ||
+ | fill: true, | ||
+ | fillColor: '00446A', | ||
+ | fillOpacity: 0.3, | ||
+ | stroke: true, | ||
+ | strokeColor: '00446A', | ||
+ | strokeOpacity: 1, | ||
+ | strokeWidth: 2, | ||
+ | fade: true, | ||
+ | alwaysOn: false | ||
+ | }); | ||
+ | |||
+ | // Function to hide unsed map key elements | ||
+ | // Dont hide map on the Template:Mapkey page | ||
+ | // Otherwise you cannot preview it! | ||
+ | if (wgPageName.substr(0,15)!='Template:Mapkey') | ||
+ | { | ||
+ | // Ok find the map key elemetns | ||
+ | $('li.map_key').each(function () | ||
+ | { | ||
+ | // Get the classnames out | ||
+ | classnames=$(this).attr('class').split(" "); | ||
+ | |||
+ | for (var i=0; i<classnames.length; i++) | ||
+ | { | ||
+ | // Is a class ending in _key ? | ||
+ | |||
+ | if ((classnames[i]!='map_key') && | ||
+ | (classnames[i].substring(classnames[i].length-4,classnames[i].length)=='_key')) | ||
+ | { | ||
+ | // Ok got the clasname lets see if it's being shown on the map | ||
+ | myclass=classnames[i].substring(0,classnames[i].length-4); | ||
+ | if ($('area.'+myclass).length==0) | ||
+ | { | ||
+ | // Not found anything - so hide it on the map | ||
+ | $('li.'+myclass+'_key').hide(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | // End of mapkey functions | ||
+ | |||
}); | }); |