Beautify javascript (fixes #980)

This commit is contained in:
Saivann 2015-07-29 16:55:50 -04:00
parent 75a3c45628
commit d814977536
5 changed files with 654 additions and 647 deletions

View file

@ -10,13 +10,20 @@ layout: null
var zoom = 2;
var minzoom = 1;
if (isMobile()) var zoom = minzoom = 0;
var map = L.map('eventmap',{ 'zoom': zoom, 'minZoom': minzoom, 'center': [20.00, 10.00]});
var map = L.map('eventmap', {
'zoom': zoom,
'minZoom': minzoom,
'center': [20.00, 10.00]
});
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Data &copy; by <a href="http://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>.',
maxZoom: 18
}).addTo(map);
var markers = new L.MarkerClusterGroup({showCoverageOnHover: false, maxClusterRadius: 40});
var markers = new L.MarkerClusterGroup({
showCoverageOnHover: false,
maxClusterRadius: 40
});
for (var i = 0, nds = document.getElementById('eventdata').getElementsByTagName('DIV'), n = nds.length; i < n; i++) {
L.marker([parseFloat(nds[i].getAttribute('data-lat')), parseFloat(nds[i].getAttribute('data-lon'))]).bindPopup(nds[i].innerHTML).addTo(markers);
}

View file

@ -24,14 +24,14 @@ if ((version >= 5.5) && (document.body.filters))
var imgWidth = img.width;
var imgHeight = img.height;
//Workaround for hidden img to prevent 0px width and height
if(img.src.indexOf('/img/clients/')!==-1){imgWidth='72';imgHeight='72';}
if (img.src.indexOf('/img/clients/') !== -1) {
imgWidth = '72';
imgHeight = '72';
}
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + imgWidth + "px; height:" + imgHeight + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + imgWidth + "px; height:" + imgHeight + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i - 1
}