Difference between revisions of "Metadata:Mapping/Map.js"

From Neocron Wiki
Jump to: navigation, search
m
(Brammers changed the content model of the page Metadata:Mapping/Map.js from "wikitext" to "JavaScript")
Tag: content model change
 
(28 intermediate revisions by the same user 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 */
  
$kjq(document).ready(function($)
+
$(document).ready(function($)
 
{
 
{
// Add functions and stuff here
+
// Add functions and stuff here
  
// NC-Wiki map
+
// NC-Wiki map - enabled the plugin
$('.ncwiki_map').maphilight(
+
$('img.ncwiki_map').maphilight(
{fill: true,
+
{
fillColor: '00446A',
+
fill: true,
fillOpacity: 0.2,
+
fillColor: '00446A',
stroke: true,
+
fillOpacity: 0.3,
strokeColor: '00446A',
+
stroke: true,
strokeOpacity: 1,
+
strokeColor: '00446A',
strokeWidth: 2,
+
strokeOpacity: 1,
fade: true,
+
strokeWidth: 2,
alwaysOn: false});
+
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
  
// End of functions
 
 
});
 
});

Latest revision as of 23:35, 27 August 2017

Sorry you do not have permissions to view this page.