ФЭНДОМ


//JS

minimap_mapper_page = 'http://tibia.wikia.com/wiki/Mapper';
minimap_images = [];

minimap_images[0] = [
'http://images2.wikia.nocookie.net/tibia/en/images/9/97/Minimap_Symbols.gif',
'http://images4.wikia.nocookie.net/tibia/en/images/6/6c/Minimap_Loading.gif'
];

minimap_images[1] = [
'http://images1.wikia.nocookie.net/tibia/en/images/5/5b/Minimap_Floor_0.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/1/1d/Minimap_Floor_1.gif',
'http://images1.wikia.nocookie.net/tibia/en/images/d/da/Minimap_Floor_2.gif',
'http://images3.wikia.nocookie.net/tibia/en/images/5/51/Minimap_Floor_3.gif',
'http://images3.wikia.nocookie.net/tibia/en/images/6/6c/Minimap_Floor_4.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/6/62/Minimap_Floor_5.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/f/f3/Minimap_Floor_6.gif',
'http://images4.wikia.nocookie.net/tibia/en/images/1/16/Minimap_Floor_7.gif',
'http://images4.wikia.nocookie.net/tibia/en/images/b/b2/Minimap_Floor_8.gif',
'http://images1.wikia.nocookie.net/tibia/en/images/d/d5/Minimap_Floor_9.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/7/7e/Minimap_Floor_10.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/a/ac/Minimap_Floor_11.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/8/89/Minimap_Floor_12.gif',
'http://images1.wikia.nocookie.net/tibia/en/images/8/83/Minimap_Floor_13.gif',
'http://images2.wikia.nocookie.net/tibia/en/images/7/7d/Minimap_Floor_14.gif',
'http://images3.wikia.nocookie.net/tibia/en/images/1/10/Minimap_Floor_15.gif'
];

minimap_images[4] = [
'',
'',
'',
'',
'',
'',
'',
'http://images1.wikia.nocookie.net/tibia/en/images/6/64/Minimap_Floor_7.png',
'',
'',
'',
'',
'',
'',
'',
''
];

minimap_getVpHeight = function () { return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; };
minimap_getVpWidth = function () { return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; };
minimap_getDocHeight = function() {
  var D = document, DB = D.body, DE = D.documentElement;
  return Math.max(Math.max(DB.scrollHeight, DE.scrollHeight), Math.max(DB.offsetHeight, DE.offsetHeight), Math.max(DB.clientHeight, DE.clientHeight));
};

minimap_get_coords = function(url, varname) {
  url = unescape(url);
  if (typeof varname == 'undefined') { varname = 'coords'; }
  var pars = [], tmpp = url.split(varname + '='); tmpp.shift(); tmpp = tmpp.join('').split('&')[0];
  if (varname == 'coords') {
//0x.1x,2y.3y,4z,5zoom,6zoomm,7centermark
    if (tmpp == '' || typeof (tmpp = tmpp.split(',')).length < 3) { pars = [127, 128, 124, 128, 7, 1, 1, 1]; }
    else {
      pars[0] = parseInt(tmpp[0].split('.')[0] || 127, 10);
      pars[1] = parseInt(tmpp[0].split('.')[1] || 0, 10);
      pars[2] = parseInt(tmpp[1].split('.')[0] || 124, 10);
      pars[3] = parseInt(tmpp[1].split('.')[1] || 0, 10);
      pars[4] = parseInt(tmpp[2] || 7, 10);
      pars[5] = parseFloat(tmpp[3] || 1);
      pars[6] = parseFloat(tmpp[4] || 1);
      pars[7] = parseInt(tmpp[5] || 1, 10);
      pars[0] = (pars[0] > 130 || pars[0] < 124 ? 127 : pars[0]);
      pars[1] = (pars[1] > 255 || pars[1] < 0 ? 0 : pars[1]);
      pars[2] = (pars[2] > 129 || pars[2] < 121 ? 124 : pars[2]);
      pars[3] = (pars[3] > 255 || pars[3] < 0 ? 0 : pars[3]);
      pars[4] = (pars[4] > 15 || pars[4] < 0 ? 7 : pars[4]);
      pars[5] = (pars[5] > 8 || pars[5] < 1 ? 1 : pars[5]);
      pars[6] = (pars[6] > 1 || pars[6] < 0 ? 1 : pars[6]);
      pars[7] = (pars[7] > 1 || pars[7] < 0 ? 1 : pars[7]);
    }
  }
  else if (varname.indexOf('mark') === 0) {
//Default 0x.1x,2y.3y,4z,5icon,6link
    if (tmpp == '' || typeof (tmpp = tmpp.split(',')).length < 3) { pars = [127, 128, 124, 128, 7, 1, '']; }
    else {
      pars[0] = parseInt(tmpp[0].split('.')[0] || 127, 10);
      pars[1] = parseInt(tmpp[0].split('.')[1] || 0, 10);
      pars[2] = parseInt(tmpp[1].split('.')[0] || 124, 10);
      pars[3] = parseInt(tmpp[1].split('.')[1] || 0, 10);
      pars[4] = parseInt(tmpp[2] || 7, 10);
      pars[5] = parseInt(tmpp[3] || 1, 10);
      pars[6] = tmpp[4] || '';
      pars[0] = (pars[0] > 130 || pars[0] < 124 ? 127 : pars[0]);
      pars[1] = (pars[1] > 255 || pars[1] < 0 ? 0 : pars[1]);
      pars[2] = (pars[2] > 129 || pars[2] < 121 ? 124 : pars[2]);
      pars[3] = (pars[3] > 255 || pars[3] < 0 ? 0 : pars[3]);
      pars[4] = (pars[4] > 15 || pars[4] < 0 ? 7 : pars[4]);
      pars[5] = (pars[5] > 22 || pars[5] < 0 ? 1 : pars[5]);
    }
  }
  return pars;
};

minimap_center_div = function (em) {
  var aligner = function(ea) { if (ea.style.display == 'block') {
    var tmp = parseInt(((minimap_getVpHeight() - ea.offsetHeight) / 2)+0, 10);
    ea.style.position = 'fixed';
    ea.style.top = tmp+'px';
    if (ea.offsetTop != tmp) {
      tmp = parseInt(((minimap_getVpHeight() - ea.offsetHeight) / 2)+
            Math.max(document.body.scrollTop, document.documentElement.scrollTop), 10);
      ea.style.position = 'absolute';
      ea.style.top = tmp+'px';
    }
    ea.style.left = parseInt(((minimap_getVpWidth() - ea.offsetWidth) / 2)+
                   Math.max(document.body.scrollLeft, document.documentElement.scrollLeft), 10)+'px';
    var t = document.getElementById('minimap_blackout');
    t.style.display = 'block';
    t.style.height = minimap_getDocHeight()+'px';
  } };
  if (typeof em == 'undefined') {
    var x, tmp = document.minimap_getElementsByClassName('minimap_wp');
    for (x in tmp) { if (tmp.hasOwnProperty(x)) { aligner(tmp[x]); } }
    return;
  }
  aligner(em);
};

minimap_addeventlistener = function(obj, event, listener) {
  if (window.addEventListener) { obj.addEventListener(event, listener, false); }
  else if ( window.attachEvent ) { obj.attachEvent('on'+event, listener); }
};

minimap_drago = null; minimap_dragos = null; minimap_dragms = null;
minimap_dragstart = function (e) {
  if (!e) { return; }
  e.onmousedown = function(ev) {
    ev = (ev || window.event);
    if (!(minimap_drago = document.getElementById('minimap_imgdiv'))) { return; }
    minimap_dragms = minimap_getmxy(ev);
    minimap_dragos = {x:minimap_drago.style.left, y:minimap_drago.style.top};
    return false;
  };
};
minimap_getmxy = function (ev) { if (ev.pageX || ev.pageY) { return {x:ev.pageX, y:ev.pageY}; } return {x:ev.clientX+document.body.scrollLeft-document.body.clientLeft, y:ev.clientY+document.body.scrollTop-document.body.clientTop}; };

minimap_addeventlistener(document, 'mouseup', function (ev) {
  if (minimap_drago) {
    ev = (ev || window.event);
    var currxy = minimap_getmxy(ev);
    minimap_map_data[1] += parseInt((minimap_dragms.x -currxy.x)/minimap_map_data[5], 10);
    minimap_map_data[3] += parseInt((minimap_dragms.y -currxy.y)/minimap_map_data[5], 10);
    minimap_pos();
  }
  minimap_drago = null;
});

minimap_addeventlistener(document, 'mousemove', function (ev) {
  ev = (ev || window.event);
  var currxy = minimap_getmxy(ev);
  if (minimap_drago) {
    minimap_drago.style.left = (parseFloat(minimap_dragos.x) - (minimap_dragms.x - currxy.x))+'px';
    minimap_drago.style.top = (parseFloat(minimap_dragos.y) - (minimap_dragms.y - currxy.y))+'px';
    return false;
  } 
});

minimap_map_data = [];
minimap_map_sdata = [];

minimap_data_to_url = function (type) {
//0x.1x,2y.3y,4z,5zoom,6zoomm,7centermark
//0x.1x,2y.3y,4z,5icon,6link
  var x, ret;
  if (type === 0) {//Link
    ret = minimap_mapper_page+'?coords=';
    ret += minimap_map_data[0]+'.'+minimap_map_data[1]+','+minimap_map_data[2]+'.'+minimap_map_data[3]+','+
           minimap_map_data[4]+','+minimap_map_data[5]+','+minimap_map_data[6]+','+minimap_map_data[7];
    if (document.getElementById('minimap_marks_enabled').checked) {
      for (x in minimap_map_data) { if (minimap_map_data.hasOwnProperty(x) && typeof minimap_map_data[x] == 'object') {
        ret += '&'+x+'=';
        ret += minimap_map_data[x][0]+'.'+minimap_map_data[x][1]+','+minimap_map_data[x][2]+'.'+minimap_map_data[x][3]+
        ','+minimap_map_data[x][4]+','+minimap_map_data[x][5]+(minimap_map_data[x][6] ? ','+minimap_map_data[x][6] : '');
      } }
    }
  }
  else if (type == 1) {//Template:Minimap
    ret = '{'+'{Minimap';
    ret += '|x='+minimap_map_data[0]+'.'+minimap_map_data[1]+'|y='+minimap_map_data[2]+'.'+minimap_map_data[3]+'|z='+
           minimap_map_data[4]+'|zoom='+minimap_map_data[5]+'|zoomm='+minimap_map_data[6]+
           '|width='+(1 / minimap_map_data[5])+'|height='+(1 / minimap_map_data[5])+
           '|centermark='+(minimap_map_data[7] ? 'yes' : 0);
    if (document.getElementById('minimap_marks_enabled').checked) {
      for (x in minimap_map_data) { if (minimap_map_data.hasOwnProperty(x) && typeof minimap_map_data[x] == 'object') {
        if (minimap_map_data[4] != minimap_map_data[x][4]) { continue; }
        ret += '|'+x+'=';
        ret += minimap_map_data[x][0]+'.'+minimap_map_data[x][1]+','+minimap_map_data[x][2]+'.'+minimap_map_data[x][3]+
        ','+minimap_map_data[x][5]+','+minimap_map_data[x][6];
      } }
    }
    ret += '}'+'}';
  }
  else if (type == 2) {//Template:Minimap_Popup
    ret = '{'+'{Minimap_Popup';
    ret += '|link='+minimap_data_to_url(0).split('?', 2)[1].replace(/\s|%20/gi, '_')+'|text='+document.getElementById('minimap_tcode3').value.replace(/\s|%20/gi, '_');
    ret += '}'+'}';
  }
  else if (type == 3) {
    ret = minimap_map_data[0]+'.'+minimap_map_data[1]+','+minimap_map_data[2]+'.'+minimap_map_data[3]+','+
          minimap_map_data[4];
  }
  return ret;
};

minimap_mapper_list_click = function() {
  if (document.getElementById('minimap_loading').style.display == 'block') { return; }
  var e = document.getElementById('mapper_list');
  e = e[e.selectedIndex];
  e = unescape(e.value).split(',');
  document.getElementById('mapper_mark_remove').disabled = false;
  minimap_map_data[0] = parseInt(e[0], 10);
  minimap_map_data[1] = parseInt(e[1], 10);
  minimap_map_data[2] = parseInt(e[2], 10);
  minimap_map_data[3] = parseInt(e[3], 10);
  minimap_map_data[4] = parseInt(e[4], 10);
  minimap_pos(false);
};

minimap_trim = function(str) {
  str = str.replace(/^\s\s*/, '');
  var ws = /\s/, 
  i = str.length;
  while (ws.test(str.charAt(--i))){}
  return str.slice(0, i + 1);
};

minimap_read_cookie = function(name) {
  var i, c, cl = document.cookie.split(';');
  for(i=0;i<cl.length;i++) { c = minimap_trim(cl[i]); if (c.indexOf(name+'=') === 0) { return c.substring(name.length+1); } }
  return null;
};

minimap_write_cookie = function(name, val) {
  var date = new Date(); date.setTime(date.getTime()+(7*24*60*60*1000)); date = date.toGMTString();
  document.cookie = name+'='+val+'; expires='+date+'; path=/';
};

minimap_codes_update = function (reset_list) {
  var d, tmp;
  tmp = -1*(minimap_map_data[4] - 7);
  d = document.getElementById('minimap_current_floor');
  d.value = (tmp < 1 ? '' : '+') + tmp;
  d = document.getElementById('minimap_current_coords');
  d.value = minimap_data_to_url(3);
  if ((d = document.getElementById('minimap_tcode1')) !== null) {
    d.value = minimap_data_to_url(0);
    d = document.getElementById('minimap_tcode2');
    d.value = minimap_data_to_url(1);
    d = document.getElementById('minimap_tcode4');
    d.value = minimap_data_to_url(2);
    if (typeof reset_list == 'undefined') { reset_list = true; }
    if (reset_list) {
      d = document.getElementById('mapper_list');
      d.onchange = 'minimap_mapper_list_click();';
      minimap_addeventlistener(d, 'change', function(){minimap_mapper_list_click();});
      d.options.length = 0;
      var i = 1, newopt;
      while (minimap_map_data['mark'+i]) {
        newopt = document.createElement('option');
        d.options.add(newopt);
        newopt.innerHTML = i;
        newopt.value = escape(minimap_map_data['mark'+i].join(','));
        i++;
      }
    }
  }
};

minimap_pos_b = function(act, val) {
  if (document.getElementById('minimap_loading').style.display == 'block') { return; }
  var x;
  if (act == 'reset') {
    minimap_map_data = [];
    for (x in minimap_map_sdata) { if (minimap_map_sdata.hasOwnProperty(x)) {
      minimap_map_data[x] = (typeof minimap_map_sdata[x] == 'object' ? minimap_map_sdata[x].slice(0) : minimap_map_sdata[x]);
    } }
  }
  else if (act == 'we') { minimap_map_data[1] += val; }
  else if (act == 'ns') { minimap_map_data[3] += val; }
  else if (act == 'zoom') {
    x = minimap_map_data[5] * val; if (x > 8 || x < 1) { return; } minimap_map_data[5] = Math.round(x);
    if (minimap_map_data[5] < 1) { minimap_map_data[5] = 1; }
    while (minimap_map_data[5] != 1 && minimap_map_data[5] != 2 && minimap_map_data[5] != 4 && minimap_map_data[5] != 8) { minimap_map_data[5]--; }
  }
  else if (act == 'floor') { x = minimap_map_data[4] + val; if (x > 15 || x < 0) { return; } minimap_map_data[4] = x; }
  minimap_pos();
};


minimap_pos = function(reset_list) {
//Adjusts values out of range for x and y
  minimap_map_data[0] = minimap_map_data[0]+Math.floor(minimap_map_data[1] / 256);
  minimap_map_data[1] = minimap_map_data[1]-(Math.floor(minimap_map_data[1]/256)*256);
  minimap_map_data[2] = minimap_map_data[2]+Math.floor(minimap_map_data[3] / 256);
  minimap_map_data[3] = minimap_map_data[3]-(Math.floor(minimap_map_data[3]/256)*256);

  document.getElementById('minimap_maindiv').style.display = 'none';
  document.getElementById('minimap_loading').style.display = 'block';
  var hres, d, parss, pars = minimap_map_data;
  var tleft = Math.floor((((pars[0] - 124 - (1*(1/pars[5]))) * 256) + pars[1]) * pars[5], 10)+Math.floor(pars[5] / 2);
  var ttop = Math.floor((((pars[2] - 121- (0.75*(1/pars[5]))) * 256) + pars[3]) * pars[5], 10)+Math.floor(pars[5] / 2);
  var twidth = Math.floor(1792 * pars[5]);
  var theight = Math.floor(2304 * pars[5]);

  hres = (minimap_read_cookie('minimap_hres') == '1');
//main image
  d = document.getElementById('minimap_imgdiv');
  d.style.left = (-1*tleft)+'px';
  d.style.top = (-1*ttop)+'px';
  d.firstChild.width = twidth;
  d.firstChild.height = theight;

  hres = (hres ? (pars[5] >= 3 ? (minimap_images[4] && minimap_images[4][pars[4]] ? 4 : 1) : 1) : 1);
  if (d.firstChild.src == minimap_images[hres][pars[4]]) {
    document.getElementById('minimap_loading').style.display = 'none';
    document.getElementById('minimap_maindiv').style.display = 'block';
  }
  else { d.firstChild.src = minimap_images[hres][pars[4]]; }
//dashed lines
  if (document.getElementById('minimap_cmark_enabled').checked) {
    minimap_map_data[7] = 1;
    d = document.getElementById('minimap_vl'); d.style.display = 'block'; d.visibility = 'visible';
    d = document.getElementById('minimap_hl'); d.style.display = 'block'; d.visibility = 'visible';
    d = document.getElementById('minimap_editor_mode');
    if (!d || !d.checked) {
      parss = minimap_map_sdata;
      tleft = Math.floor((((parss[0] - 124 - (1*(1/pars[5]))) * 256) + parss[1]) * pars[5], 10)+Math.floor(pars[5] / 2);
      ttop = Math.floor((((parss[2] - 121- (0.75*(1/pars[5]))) * 256) + parss[3]) * pars[5], 10)+Math.floor(pars[5] / 2);

      d = document.getElementById('minimap_vl'); d = document.getElementById('minimap_imgdiv').appendChild(d);
      d.style.left = (tleft+256)+'px';
      d.style.top = (ttop+(wgPageName != 'Mapper' ? parseInt((384-parseInt(384*(pars[5] / parss[5]), 10))/2, 10) : 0))+'px';
      d.style.height = (wgPageName != 'Mapper' ? parseInt(384*(pars[5] / parss[5]), 10) : 384)+'px';

      d = document.getElementById('minimap_hl'); d = document.getElementById('minimap_imgdiv').appendChild(d);
      d.style.left = (tleft+(wgPageName != 'Mapper' ? parseInt((512-parseInt(512*(pars[5] / parss[5]), 10))/2, 10) : 0))+'px';
      d.style.top = (ttop+192)+'px';
      d.style.width = (wgPageName != 'Mapper' ? parseInt(512*(pars[5] / parss[5]), 10) : 512)+'px';
    }
    else {
      d = document.getElementById('minimap_vl'); d = document.getElementById('minimap_imgdiv').parentNode.appendChild(d);
      d.style.left = '256px'; d.style.top = '0px'; d.style.height = '384px';
      d = document.getElementById('minimap_hl'); d = document.getElementById('minimap_imgdiv').parentNode.appendChild(d);
      d.style.left = '0px'; d.style.top = '192px'; d.style.width = '512px';
    }
  }
  else {
    minimap_map_data[7] = 0;
    d = document.getElementById('minimap_vl'); d.style.display = 'none'; d.visibility = 'hidden';
    d = document.getElementById('minimap_hl'); d.style.display = 'none'; d.visibility = 'hidden';
  }

//marks
  var onclick_f = function() { return function() { window.open(this.href);return false; }; };
  var tmpm, i = 1, msize, mleft, mtop, newdiv;

  while ((d = document.getElementById('minimap_mark'+i)) !==  null) {
    d.style.display = 'none'; d.style.visibility = 'hidden';
    i++;
  }
  i = 1;
  while (pars['mark'+i]) {
    if (!document.getElementById('minimap_marks_enabled').checked) { break; }
    tmpm = pars['mark'+i];
    if (!(d = document.getElementById('minimap_mark'+i))) {
      newdiv = document.createElement('div');
      newdiv.setAttribute('id', 'minimap_mark'+i);
      document.getElementById('minimap_imgdiv').appendChild(newdiv);
      newdiv.style.display = 'block';
      newdiv.style.position = 'absolute';
      newdiv.style.zIndex = '1003';
      newdiv.style.overflow = 'hidden';
      newdiv.innerHTML = '<div style="position:absolute;overflow:hidden;">'+
                         '<a href=""><img src="'+minimap_images[0][0]+'" alt="" width="121" height="22" border="0" /></a>'+
                         '<div style="text-align:center;padding:0px;margin:0px;border:none;position:absolute;top:0px;left:0px;width:0px;height:0px;display:none;visibility:hidden;line-height:normal;">'+
                         '</div>';
    }
    d = document.getElementById('minimap_mark'+i);//main mark div
    if (tmpm[4] != pars[4]) { i++; continue; }
    d.style.display = 'block'; d.style.visibility = 'visible';
    msize = Math.floor(11*pars[5]*pars[6])+'px';
    d.style.left = Math.floor(((((tmpm[0] - 124) * 256) + (tmpm[1])) * pars[5]) - (5*pars[5]*pars[6]))+'px';
    d.style.top = Math.floor(((((tmpm[2] - 121) * 256) + (tmpm[3])) * pars[5]) - (5*pars[5]*pars[6]))+'px';
    d.style.width = msize; d.style.height = msize;
    d = d.firstChild;//hidder div
    mleft = Math.floor(Math.floor(((tmpm[5] == 21 ? 22 : tmpm[5])-1)/2)*11*pars[5]*pars[6]);
    mtop = Math.floor((Math.floor(((tmpm[5] == 21 ? 22 : tmpm[5]))/2) == (((tmpm[5] == 21 ? 22 : tmpm[5]))/2) ? 11 : 0)*pars[5]*pars[6]);
    d.style.left = (-1 * mleft)+'px'; d.style.top = (-1 * mtop)+'px';
    d = d.firstChild;//a link
    d.cursor = 'default'; d.onclick = 'return false;';
    d.href = '';
    if (tmpm[6] != '' && tmpm[5] != 21) {
      d.style.cursor = 'pointer';
      d.href = '/wiki/'+encodeURI(tmpm[6]);
      d.onclick = onclick_f();
    }
    if (tmpm[5] == 21) {//numeric mark
      d = d.nextSibling;
      d.style.display = 'block'; d.style.visibility = 'visible';
      d.style.left = mleft+'px'; d.style.top = mtop+'px';
      d.style.width = msize; d.style.height = msize;
      d.style.fontSize = (parseInt(msize, 10) - 2)+'px';
      d.style.lineHeight = 'normal';
      d.innerHTML = (tmpm[6] != '' ? parseInt(tmpm[6].slice(0, 2), 10) || 0 : 0);
      d = d.previousSibling;
    }
    d = d.firstChild;//image
    d.alt = tmpm[6];
    d.width = Math.floor(121*pars[5]*pars[6]);
    d.height = Math.floor(22*pars[5]*pars[6]);
    i++;
  }
  if (typeof reset_list == 'undefined') { reset_list = true; }
  minimap_codes_update(reset_list);
};

minimap_mapper_add_mark = function() {
  if (document.getElementById('minimap_loading').style.display == 'block') { return; }
  var i, m = 1;
  for (i=1; i<23; i++) { if (document.getElementById('mapper_marker_r'+i).checked) {
      m = document.getElementById('mapper_marker_r'+i).value;
      break;
  } }
  i = 1; while (minimap_map_data['mark'+i]) { i++; }
  minimap_map_data['mark'+i] = minimap_map_data.slice(0, 5);
  minimap_map_data['mark'+i][5] = m;
  minimap_map_data['mark'+i][6] = document.getElementById('mapper_optional_link').value.replace(/\s|%20/gi, '_');
  minimap_pos();
};

minimap_mapper_remove_mark = function() {
  if (document.getElementById('minimap_loading').style.display == 'block') { return; }
  var tmp, i = 1, x, o, s = document.getElementById('mapper_list');
  if (s.selectedIndex == -1) { return; }
  o = s.options[s.selectedIndex];
  document.getElementById('mapper_mark_remove').disabled = true;
  s.remove(s.selectedIndex);
  minimap_map_data = minimap_map_data.slice(0, 8);
  for (x=0;x<s.options.length;x++) { 
    tmp = unescape(s.options[x].value).split(',', 7);
    minimap_map_data['mark'+i] = [];
    minimap_map_data['mark'+i][0] = parseInt(tmp[0], 10);
    minimap_map_data['mark'+i][1] = parseInt(tmp[1], 10);
    minimap_map_data['mark'+i][2] = parseInt(tmp[2], 10);
    minimap_map_data['mark'+i][3] = parseInt(tmp[3], 10);
    minimap_map_data['mark'+i][4] = parseInt(tmp[4], 10);
    minimap_map_data['mark'+i][5] = parseInt(tmp[5], 10);
    minimap_map_data['mark'+i][6] = tmp[6];
    i++;
  }
  minimap_pos();
//0x.1x,2y.3y,4z,5zoom,6zoomm,7centermark
//0x.1x,2y.3y,4z,5icon,6link
};

minimap_load = function(el, url) {
  minimap_map_sdata = minimap_get_coords(url); minimap_map_data = minimap_get_coords(url);
  var pars = minimap_get_coords(url);
  if (wgPageName != 'Mapper') {
    try{document.getElementsByTagName('body')[0].insertBefore(el);} catch(e) {}
    if (el.style.display != 'block') {
      el.style.display = 'block';
      if (!document.getElementById('minimap_blackout')) {
        var newdiv = document.createElement('div');
        newdiv.setAttribute('id', 'minimap_blackout');
        newdiv.className = 'minimap_blackout';
        newdiv.innerHTML = ' ';
        document.getElementsByTagName('body')[0].appendChild(newdiv);
      }
    }
    var t = document.getElementById('minimap_blackout');
    t.style.display = 'block';
    t.style.height = minimap_getDocHeight()+'px';
  }

  var tmp = 
  (wgPageName != 'Mapper' ?
  '<div style=\'text-align:center;background:#3366CC;color:white;font-weight:bold;\'>TibiaWiki Map</div>'+
    '<div class="minimap_wx" onclick="document.getElementById(\'minimap_blackout\').style.display= \'none\'; var t = this, r = new RegExp(/\\bminimap_wp\\b/); while (!r.test(t.className)) { t = t.parentNode; } t.style.display = \'none\'; t.innerHTML = \' \'; return false;"> </div>'
  : '<div style="border-bottom-color:#aaaaaa;border-bottom-style:solid;border-bottom-width:1px;"><font size="+1">Mapper</font></div><br />')+
  '<div style="display:block;border:1px #3366CC solid;background-color:grey;">'+
    '<div id="minimap_loading" ><img src="'+minimap_images[0][1]+'" alt="Loading" width="512" height="384" /></div>'+
    '<div id="minimap_maindiv" style="overflow:hidden;"><div style="overflow:hidden;display:block;position:absolute;width:512px;height:384px;">'+
      '<div id="minimap_imgdiv" style="display:block;position:absolute;">'+
        '<img id="minimap_img" src="" alt="" width="" height="" />'+
        '<div id="minimap_vl" style="position:absolute;left:256px;top:0px;display:block;width:1px;height:384px;border-left:1px dashed #FFFFFF;"></div>'+
        '<div id="minimap_hl" style="position:absolute;left:0px;top:192px;display:block;width:512px;height:1px;border-top:1px dashed #FFFFFF;"></div>';
  var tmpm, i = 1;
  while (url.indexOf('mark'+i) != -1) {
    tmpm = minimap_get_coords(url, 'mark'+i);
    minimap_map_sdata['mark'+i] = tmpm.slice(0); minimap_map_data['mark'+i] = tmpm;
    tmp +=
        '<div id="minimap_mark'+i+'" style="overflow:hidden;position:absolute; z-index:1003;">'+
        '<div style="position:absolute;overflow:hidden;">'+
        '<a href=""><img src="'+minimap_images[0][0]+'" alt="" width="121" height="22" border="0" /></a>'+
        '<div style="text-align:center;padding:0px;margin:0px;border:none;position:absolute;top:0px;left:0px;width:0px;height:0px;display:none;visibility:hidden;"></div>'+
        '</div></div>'+
        '';
    i++;
  }
  tmp +=
      '</div>'+
    '</div></div>'+
  '</div>'+
  '<div style="'+(wgPageName != 'Mapper' ? 'background-color:#EEEEEE;' : '')+'"><table border="0"><tr><td style="vertical-align:top;width:46px;">'+
  '<div style="margin:2px;"><input type="button" onclick="minimap_pos_b(\'ns\', -30);" class="starn btns" value="" /><br />'+
  '<input type="button" onclick="minimap_pos_b(\'we\', -30);" class="starw btns" value="" />'+
  '<input type="button" onclick="minimap_pos_b(\'reset\');" class="starc btns" value="" />'+
  '<input type="button" onclick="minimap_pos_b(\'we\', 30);" class="stare btns" value="" /><br />'+
  '<input type="button" onclick="minimap_pos_b(\'ns\', 30);" class="stars btns" value="" />'+
  '</div>'+
  '</td><td style="vertical-align:top;width:46px;">'+
  '<div style="margin:2px;">'+
    '<input type="button" onclick="minimap_pos_b(\'zoom\', 0.5);" class="zoomm btn" value="" />'+
    '<input type="button" onclick="minimap_pos_b(\'floor\', -1);" class="floorp btn" value="" /><br />'+
    '<input type="button" onclick="minimap_pos_b(\'zoom\', 2);" class="zoomp btn" value="" />'+
    '<input type="button" onclick="minimap_pos_b(\'floor\', 1);" class="floorm btn" value="" />'+
  '</div>'+
  '</td><td style="vertical-align:top;">'+
  '<input type="checkbox" value="1" checked="checked" id="minimap_marks_enabled" onclick="minimap_pos();" />Enable marks<br />'+
  '<input type="checkbox" value="1" '+(pars[7] ? 'checked="checked" ' : '')+'id="minimap_cmark_enabled" onclick="minimap_pos();" />Center mark<br />'+
  '</td><td style="vertical-align:top;padding-left:10px;">'+
  'Current floor: <input id="minimap_current_floor" type="text" size="4" value="" readonly="readonly" onclick="this.select()" /><br />'+
  'Coords: <input id="minimap_current_coords" type="text" size="18" value="" readonly="readonly" onclick="this.select()" />'+
  '</td></tr><td> </td><td> </td><td colspan="2">'+
  '<input type="checkbox" value="1" '+(minimap_read_cookie('minimap_hres') == '1' ? 'checked="checked" ' : '')+'id="minimap_hres_enabled" onclick="minimap_write_cookie(\'minimap_hres\', (this.checked ? 1 : 0)); minimap_pos();" />Load high resolution images  '+
  (wgPageName == 'Mapper' ?
  '<input type="checkbox" value="1" '+(window.location.search.indexOf('coords=') !== -1 ? '' : 'checked="checked" ')+'id="minimap_editor_mode" onclick="minimap_pos();" />Editor mode'+
  '</td></tr></table><table border="0" style="width:512px;overflow:auto"><tr>'+
  '<td colspan="2" style="border-top:1px #333333 solid;border-bottom:1px #333333 solid;text-align:center;">Mark manager'+
  '</td></tr><tr><td coldspan="2">'+
  '<div style="font-size:80%;">'+
  '<a href="" onclick="var t = document.getElementById(\'mapper_help1\');t.style.display = (t.style.display == \'none\' ? \'\' : \'none\');return false;">Toggle Help</a><br />'+
  '<div id="mapper_help1" style="background-color:#DDDDDD;display:none;">'+
    'Select an icon<br />'+
    'Optionally write a wiki article name<br />'+
    'Use the dotted lines(Center Mark) to select where you want to add a mark<br />'+
    'Click <b>Add</b><br />'+
    'To remove a mark, select it on the list, wait the map takes you to it and click <b>Remove</b><br />'+
    'The "1" Icon is used to add marks with numbers, write a number instead of an article name'+
  '</div></div>'+
  '</td></tr></table><table><tr><td style="overflow:auto;width:270px;vertical-align:top;">'+
  '<input type="radio" value="1" checked="checked" name="mapper_markc" id="mapper_marker_r1" class="mapper_marker_r" />'+
  '<input type="radio" value="3" name="mapper_markc" id="mapper_marker_r3" class="mapper_marker_r" />'+
  '<input type="radio" value="5" name="mapper_markc" id="mapper_marker_r5" class="mapper_marker_r" />'+
  '<input type="radio" value="7" name="mapper_markc" id="mapper_marker_r7" class="mapper_marker_r" />'+
  '<input type="radio" value="9" name="mapper_markc" id="mapper_marker_r9" class="mapper_marker_r" />'+
  '<input type="radio" value="11" name="mapper_markc" id="mapper_marker_r11" class="mapper_marker_r" />'+
  '<input type="radio" value="13" name="mapper_markc" id="mapper_marker_r13" class="mapper_marker_r" />'+
  '<input type="radio" value="15" name="mapper_markc" id="mapper_marker_r15" class="mapper_marker_r" />'+
  '<input type="radio" value="17" name="mapper_markc" id="mapper_marker_r17" class="mapper_marker_r" />'+
  '<input type="radio" value="19" name="mapper_markc" id="mapper_marker_r19" class="mapper_marker_r" />'+
  '<input type="radio" value="21" name="mapper_markc" id="mapper_marker_r21" class="mapper_marker_r" />'+
  '<br /><img src="'+minimap_images[0][0]+'" width="242" height="44" /><br />'+
  '<input type="radio" value="2" name="mapper_markc" id="mapper_marker_r2" class="mapper_marker_r" />'+
  '<input type="radio" value="4" name="mapper_markc" id="mapper_marker_r4" class="mapper_marker_r" />'+
  '<input type="radio" value="6" name="mapper_markc" id="mapper_marker_r6" class="mapper_marker_r" />'+
  '<input type="radio" value="8" name="mapper_markc" id="mapper_marker_r8" class="mapper_marker_r" />'+
  '<input type="radio" value="10" name="mapper_markc" id="mapper_marker_r10" class="mapper_marker_r" />'+
  '<input type="radio" value="12" name="mapper_markc" id="mapper_marker_r12" class="mapper_marker_r" />'+
  '<input type="radio" value="14" name="mapper_markc" id="mapper_marker_r14" class="mapper_marker_r" />'+
  '<input type="radio" value="16" name="mapper_markc" id="mapper_marker_r16" class="mapper_marker_r" />'+
  '<input type="radio" value="18" name="mapper_markc" id="mapper_marker_r18" class="mapper_marker_r" />'+
  '<input type="radio" value="20" name="mapper_markc" id="mapper_marker_r20" class="mapper_marker_r" />'+
  '<input type="radio" value="22" name="mapper_markc" id="mapper_marker_r22" class="mapper_marker_r" /><br />'+
  'Optional Article: <input type="text" value="" size="15" id="mapper_optional_link" /><br />'+
  '<input type="button" value="Add" onclick="minimap_mapper_add_mark();" />'+
  '</td><td style="vertical-align:top;">'+

  '<select size="6" id="mapper_list" style="width:90px"></select>'+
  ' <input type="button" value="Remove" disabled="disabled" id="mapper_mark_remove" onclick="minimap_mapper_remove_mark();" />'+

  '</td></tr></table><table border="0" style="width:510px;overflow:auto;"><tr><td colspan="2" style="border-top:1px #333333 solid;border-bottom:1px #333333 solid;text-align:center;">'+
    'Link and templates'+
    '</td></tr><tr><td>Link here:</td><td><input id= "minimap_tcode1" readonly="readonly" type="text" value="" size="45" onclick="this.select()" /><br />'+
    '</td></tr><tr><td>Popup Template:'+
    '</td><td>'+
      '<table style="width:100%;overflow:auto;"><tr><td>Link text:'+
      '</td><td><input id= "minimap_tcode3" type="text" value="here" size="10" onkeyup="minimap_codes_update();" />'+
      '</td></tr><td>Code:'+
      '</td><td><input id= "minimap_tcode4" readonly="readonly" type="text" value="" size="30" onclick="this.select()" />'+
    '</td></tr></table>'+
    '</td></tr><tr><td>Simple Template:'+
    '</td><td><input id= "minimap_tcode2" readonly="readonly" type="text" value="" size="45" onclick="this.select()" /><br />'
  : '')+
  '</td></tr></table></div>'+
  (wgPageName != 'Mapper' ?
    '<div onclick="window.open(minimap_data_to_url(0));document.getElementById(\'minimap_blackout\').style.display= \'none\'; var t = this, r = new RegExp(/\\bminimap_wp\\b/); while (!r.test(t.className)) { t = t.parentNode; } t.style.display = \'none\'; t.innerHTML = \' \';return false;" class="minimap_wl"></div>'
  : '')+
  '';
  el.innerHTML = tmp;
  if (wgPageName != 'Mapper') { minimap_center_div(el); }

  var ti = document.getElementById('minimap_img');
  minimap_addeventlistener(ti, 'load', function() {
    document.getElementById('minimap_loading').style.display= 'none';
    document.getElementById('minimap_maindiv').style.display= 'block';
  });
  minimap_pos();
  minimap_dragstart(document.getElementById('minimap_img'));
  if (wgPageName == 'Mapper') { try { document.getElementById('mapper_loading').style.display = 'none'; } catch(er) { } }
};

if (wgPageName == 'Mapper') {
  minimap_load(document.getElementById('minimap_wf'), window.location.search.substring(1));
}
else {
  minimap_center_div_f = function() { return function() { minimap_center_div(); }; };
  var i = 0, x, tmp = document.minimap_getElementsByClassName('minimap_wp');
  for (x in tmp) { if (tmp.hasOwnProperty(x)) { i++; } }
  if (i > 0) { minimap_addeventlistener(window, 'resize', minimap_center_div_f()); }
  i = 0;
  var minimap_load_f = function() { return function() { minimap_load(document.getElementById('minimap_popup'+this.parentNode.id.replace('minimap_clic', '')), this.href); return false; }; };
  var x, tmp = document.minimap_getElementsByClassName('minimap_clic');
  for (x in tmp) { if (tmp.hasOwnProperty(x)) {
    tmp[x].id = 'minimap_clic'+i;
    tmp[x].firstChild.onclick = minimap_load_f();
    tmp[x].firstChild.nextSibling.id = 'minimap_popup'+i;
    i++;
  } }
}
//

Обнаружено использование расширения AdBlock.


Викия — это свободный ресурс, который существует и развивается за счёт рекламы. Для блокирующих рекламу пользователей мы предоставляем модифицированную версию сайта.

Викия не будет доступна для последующих модификаций. Если вы желаете продолжать работать со страницей, то, пожалуйста, отключите расширение для блокировки рекламы.

Также на ФЭНДОМЕ

Случайная вики