SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: katoon on January 04, 2013, 05:05:04 PM

Title: Minecraft Map block
Post by: katoon on January 04, 2013, 05:05:04 PM
please look here

http://dev.bukkit.org/server-mods/dynmap/ (http://dev.bukkit.org/server-mods/dynmap/)
 https://github.com/webbukkit/dynmap/wiki/Setting-up-without-the-Internal-Web-Server  (https://github.com/webbukkit/dynmap/wiki/Setting-up-without-the-Internal-Web-Server)

how would i setup these files in a block?

 http://gyazo.com/1b77779b842edd6efbcdd40ae8d549dd  (http://gyazo.com/1b77779b842edd6efbcdd40ae8d549dd)
Title: Re: Minecraft Map block
Post by: telemus on January 05, 2013, 11:28:19 PM
The way I would do this is using simpleportal to create a block and put iframe code inside the block. Similar to this:

Code: [Select]
<script type="text/javascript">
var iframeids=["myframe"]
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script>
<iframe id="myframe" src="http://insertyourwebsite.com/dynmap" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>

Upload your files to the site into it's own folder and link it above

I've done similar things that your asking for connecting to a server of mine and grabbing specific information.

Hope this helps
Title: Re: Minecraft Map block
Post by: Phuriousgeorge on February 23, 2013, 01:40:14 PM
Thanks for the information! Any idea why when I scroll around using the mouse that it latches on to the mouse and won't let go? Meaning once I've panned, anytime I scroll over the block it follows the mouse and I can pan as I should be able to.
SimplePortal 2.3.8 © 2008-2024, SimplePortal