could you put a portal block in, and the sign and door is screwed up, as in, you get the screwed up sign and the half-door.
I think the doors and signs are fixed now and have added the portal block. Note that the portal block does not create a portal, and if you put more than one next to each other they'll disappear. Still, I guess they could be used for decoration or something.
Hmm... I just found your page is using "Quirks mode". That happens because you are using no doctype at all. This means browsers will enter "quirks mode", which is a compatibility mode that tries to emulate old browser behaviors (and bugs).
Solution? Add a doctype. I recommend adding this as the very first line of your file:
After you add it, you will probably notice the browser will render your page differently. However, this time it will be the correct rendering, because it will use the "strict mode". (really, don't waste your time with quirks mode) Wanna check the current mode? Try this bookmarklet:
javascript:alert(document.compatMode);
(CSS1Compat is shown if it is in Strict mode; while BackCompat means Quirks mode)
Cool, just what I've been needing, someone to push me to get my code in order. I definitely appreciate the tips and such, as I've been lazy on the html/css side of things. It's not good to have things seem to work when you don't know that they always will.
I had the css in the html file because it was easier with how I'm doing things on the backend (it's dynamically generated for the "item_xxx" classes). As for html validation, I have a lot of dynamically generated html on the page as well, though I tried to keep most of in the html document itself and have the javascript copy/hide/show it when necessary. I'll play with the doctype and will adjust my css accordingly. And I'll run my html through the validator. But I'm not sure yet if I'll move the css to an external stylesheet.
It'll be interesting to see if IE works after I get the doctype fixed up.
Also, and maybe this isn't the best place for this question, but are there any other Minecraft tools that could be web-based anyone would like to see? Map editing is out of the question as you'd need to load too many files, but a build planner or map generator (for new maps) could be done. I would also like to throw some tools together to perhaps edit spawn points, locate chunks players are in, or even just spit out the filename for a particular chunk so you can delete pre-biome chunks and have them be recreated with biomes.
After inventory editing, I think it could be nice to edit the chest contents. But I'm not sure how easy would it be to get the map uploaded to the server.
About the HTML/CSS/JavaScript code... Maybe you could share that in github or something. Also, you can dynamically generate CSS/JS (for items) and still deliver them as separate files. (bonus if you make those dynamic files cacheable http://www.mnot.net/cache_docs/ - it should be easy to do that based on modified-date!)
Ok, got my stuff (mostly) validating. Only one weird html error ("end tag for "head" which is not finished"). I also fixed an issue where items dragged from the right-hand list of items would not show when dragged from their container. IE8 still chokes on some of the javascript stuff.
I've got my code in a git repository on my machine.. I'd planned on releasing it to github, and now that it's cleaned up I will try and get to that soon. I already have my Perl modules available on github (see original post), and you can of course view source to see my html/css/js. I'll definitely be adding some caching soon, and maybe even some css and js minification to squeeze out all the performance I can.
If there was a way (and there might be) to use Adobe Air, or similar, to automatically grab files from a particular folder, I'd have the ability to do more mapping tools. But I think the ability to do that is a security concern so I doubt it's possible. And having to zip and upload your world files would be a pain and also be a resource hog, so for now map editing is out of the question. (I am looking at ways to package my perl scripts as standalone executables, but that'll take time to figure out and get right).
hmmm... you could ship a built-in web-server written in Perl or so. It would be a solution for such "stand-alone" version.
Instructions on how to run that on each user own's web server would be good too.
About accessing local map files... I think we have two solutions:
1. Run the server locally (like in the stand-alone version I suggested above), so it has direct server-side access to the files. It might be a good solution for people with Minecraft servers, as well as some users.
2. Use a plugin (a Java Applet might be the "best" solution) to access local files.
3. (this is not possible) Use HTML 5 File API to access local files. This does not work because it only "receives" files selected by user, requiring them to manually select/drag-n-drop the files. Also, it does not support directories, only files. (references: HTML5Rocks and Mozilla Developer Center)
About using a minifier... Yeah, maybe it helps... But I don't believe it will help considerably. I'd rather configure the web server to enable gzip-compressed output.
as a popup window and then will not find the file to download. I am on Ubuntu's latest Netbook edition with chromium (not chrome. yeah. the original browser. that may be the issue isn't it :/)
Ok, got my stuff (mostly) validating. Only one weird html error ("end tag for "head" which is not finished").
You've added the XHTML 1.0 Transitional doctype. Maybe you should stick with what I suggested, which is the (small) HTML 5 doctype (based on this recommendation). If you do that, then the validator will give you more relevant error messages. Not just that, but there is no reason to use XHTML if the server still sends the document as text/html. Just stick to HTML.
Basically, after changing the doctype, you need to:
[*:3aer5cw6]Add an encoding declaration to the page (this will be enough: <meta http-equiv="Content-type" content="text/html;charset=UTF-8">)
[*:3aer5cw6]Add the missing <title> element to the <head>
[*:3aer5cw6]Remove clear="all" from . Instead, use clear: both; at the stylesheet.
Ah, that's the html5 doctype.. I was going by some old blog post by PPK (of quirksmode.org). And the missing title was probably why the validator was complaining. I'll make these changes. Is there currently a css-only way to clear floats without having to add an html tag to apply the css "clear:both" to? I'll see if I can search around for that, as I don't like adding in markup for display purposes (though I do it all the time anyway).
Also, Sayo, are you still getting that error? I was hoping I had squashed all the bugs.
Is there currently a css-only way to clear floats without having to add an html tag to apply the css "clear:both" to? I'll see if I can search around for that, as I don't like adding in markup for display purposes (though I do it all the time anyway).
Well, the
in your case means "end of floats", so it serves a purpose... But yes, you can make some ugly CSS hack that doesn't need using
, but I don't think it's better than the current solution. What's more: it's much more likely to be buggy on other browsers.
just tried to use this, after uploading file, seeing my current inventory i had in game, filling what i wanted into my inventory, i got the following error when trying to download my new file. and no minecraft is not open. And im using the latest firefox.
Invalid JSON: <html><body>
<p align="center"><font face="Verdana, Arial, Helvetica, sans-serif">[b]System error[/b]</font></p>
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]error:[/b] </font></td>
<td align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">File not found at /usr/local/www/sites/bosak.net/libs//Minecraft/NBT.pm line 201.
</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]context:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]...[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"></font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]197:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> $args = shift;</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]198:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> }</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]199:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> my $filename = delete $args->{file} if $args;</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]200:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> die "No file given" unless $filename;</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]201:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><font color=red> die "File not found" unless -e $filename;</font></font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]202:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"></font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]203:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> $args->{fh} = Minecraft::Util::get_read_fh($filename);</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]204:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> $args->{is_named} = 1;</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]205:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> my $return = parse_from_fh($args);</font></td>
</tr>
<tr>
<td nowrap="nowrap" align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]...[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"></font></td>
</tr>
</table>
</font></td>
</tr>
<tr>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">[b]code stack:[/b] </font></td>
<td align="left" valign="top" nowrap="nowrap"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
/usr/local/www/sites/bosak.net/libs/Minecraft/NBT.pm:201
/usr/local/www/sites/bosak.net/htdocs/minecraft/save_inventory.html:21
</font></td>
</tr>
</table>
[url="#raw"]raw error[/url]
<a name="raw"></a>
<pre>File not found at /usr/local/www/sites/bosak.net/libs//Minecraft/NBT.pm line 201.
Trace begun at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Exceptions.pm line 129
HTML::Mason::Exceptions::rethrow_exception('File not found at /usr/local/www/sites/bosak.net/libs//Minecraft/NBT.pm line 201.^J') called at /usr/local/www/sites/bosak.net/libs/Minecraft/NBT.pm line 201
Minecraft::NBT::parse_from_file('Minecraft::NBT', 'HASH(0x86f2048)') called at /usr/local/www/sites/bosak.net/htdocs/minecraft/save_inventory.html line 21
HTML::Mason::Commands::__ANON__('inventory', '[{"id":"6","count":64,"slot":"14"},{"id":"39","count":64,"slot":"16"},{"id":3,"count":2,"slot":"0"}]', 'session_id', 'ab33f5864d122060228c9cd7b19c3a26') called at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x8b60830)', 'inventory', '[{"id":"6","count":64,"slot":"14"},{"id":"39","count":64,"slot":"16"},{"id":3,"count":2,"slot":"0"}]', 'session_id', 'ab33f5864d122060228c9cd7b19c3a26') called at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Request.pm line 1297
eval {...} at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'inventory', '[{"id":"6","count":64,"slot":"14"},{"id":"39","count":64,"slot":"16"},{"id":3,"count":2,"slot":"0"}]', 'session_id', 'ab33f5864d122060228c9cd7b19c3a26') called at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Request.pm line 481
eval {...} at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Request.pm line 481
eval {...} at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/Request.pm line 433
HTML::Mason::Request::exec('HTML::Mason::Request::ApacheHandler=HASH(0x86f1e88)') called at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/ApacheHandler.pm line 168
HTML::Mason::Request::ApacheHandler::exec('HTML::Mason::Request::ApacheHandler=HASH(0x86f1e88)') called at /usr/local/www/perl/lib/site_perl/5.12.2/HTML/Mason/ApacheHandler.pm line 825
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::ApacheHandler=HASH(0x876c2f0)', 'Apache2::RequestRec=SCALAR(0x846ae90)') called at (eval 34) line 8
HTML::Mason::ApacheHandler::handler('HTML::Mason::ApacheHandler', 'Apache2::RequestRec=SCALAR(0x846ae90)') called at -e line 0
eval {...} at -e line 0
</pre>
</body></html>
this pops up in a new window, then it goes to a page saying
Not Found
The requested URL /minecraft/download/level.dat was not found on this server.
just tried to use this, after uploading file, seeing my current inventory i had in game, filling what i wanted into my inventory, i got the following error when trying to download my new file. and no minecraft is not open. And im using the latest firefox.
Odd, I just got an error as well when I went to my tool. Refreshing the page a couple of times seemed to get it working again, but your problem might be different than what I saw. I'll do some digging to find out what's going on.
EDIT: One question.. was there a big gap in time between uploading your file and downloading the edited version?
CrazyTerabyte: I tried a trick that's supposed to work involving adding "overflow: auto" to the block containing the floating divs. It works but causes problems with the drag and drop javascript. I'll have to figure that out later.
kassquatch: Hm, it seems I might still have cookie problems. If you can, would you give me the cookie value for my site called "session_id"? If I have that I can see if the file you uploaded had any issues or whether the session itself had a problem. You can likely get going again by clearing the cookies for my site and re-uploading your file. But if you can get me more info first I can try to track down this prob.
I think the doors and signs are fixed now and have added the portal block. Note that the portal block does not create a portal, and if you put more than one next to each other they'll disappear. Still, I guess they could be used for decoration or something.
Solution? Add a doctype. I recommend adding this as the very first line of your file:
(read more here: http://hixie.ch/advocacy/xhtml and http://en.wikipedia.org/wiki/Quirks_mode )
After you add it, you will probably notice the browser will render your page differently. However, this time it will be the correct rendering, because it will use the "strict mode". (really, don't waste your time with quirks mode) Wanna check the current mode? Try this bookmarklet: (CSS1Compat is shown if it is in Strict mode; while BackCompat means Quirks mode)
After that, you can try to fix validation errors. They help you make sure your HTML code is correct.
http://validator.w3.org/check?uri=http: ... ntory.html
Finally, move your CSS to an external file. It will allow you to easily check if your CSS is valid: http://jigsaw.w3.org/css-validator/
https://denilson.sa.nom.br/
I had the css in the html file because it was easier with how I'm doing things on the backend (it's dynamically generated for the "item_xxx" classes). As for html validation, I have a lot of dynamically generated html on the page as well, though I tried to keep most of in the html document itself and have the javascript copy/hide/show it when necessary. I'll play with the doctype and will adjust my css accordingly. And I'll run my html through the validator. But I'm not sure yet if I'll move the css to an external stylesheet.
It'll be interesting to see if IE works after I get the doctype fixed up.
About the HTML/CSS/JavaScript code... Maybe you could share that in github or something. Also, you can dynamically generate CSS/JS (for items) and still deliver them as separate files. (bonus if you make those dynamic files cacheable http://www.mnot.net/cache_docs/ - it should be easy to do that based on modified-date!)
https://denilson.sa.nom.br/
I've got my code in a git repository on my machine.. I'd planned on releasing it to github, and now that it's cleaned up I will try and get to that soon. I already have my Perl modules available on github (see original post), and you can of course view source to see my html/css/js. I'll definitely be adding some caching soon, and maybe even some css and js minification to squeeze out all the performance I can.
If there was a way (and there might be) to use Adobe Air, or similar, to automatically grab files from a particular folder, I'd have the ability to do more mapping tools. But I think the ability to do that is a security concern so I doubt it's possible. And having to zip and upload your world files would be a pain and also be a resource hog, so for now map editing is out of the question. (I am looking at ways to package my perl scripts as standalone executables, but that'll take time to figure out and get right).
Instructions on how to run that on each user own's web server would be good too.
About accessing local map files... I think we have two solutions:
1. Run the server locally (like in the stand-alone version I suggested above), so it has direct server-side access to the files. It might be a good solution for people with Minecraft servers, as well as some users.
2. Use a plugin (a Java Applet might be the "best" solution) to access local files.
3. (this is not possible) Use HTML 5 File API to access local files. This does not work because it only "receives" files selected by user, requiring them to manually select/drag-n-drop the files. Also, it does not support directories, only files. (references: HTML5Rocks and Mozilla Developer Center)
About using a minifier... Yeah, maybe it helps... But I don't believe it will help considerably. I'd rather configure the web server to enable gzip-compressed output.
https://denilson.sa.nom.br/
also website issues, it looks like an ongoing issue. when i go to download the file, i get this error:
as a popup window and then will not find the file to download. I am on Ubuntu's latest Netbook edition with chromium (not chrome. yeah. the original browser. that may be the issue isn't it :/)
You've added the XHTML 1.0 Transitional doctype. Maybe you should stick with what I suggested, which is the (small) HTML 5 doctype (based on this recommendation). If you do that, then the validator will give you more relevant error messages. Not just that, but there is no reason to use XHTML if the server still sends the document as text/html. Just stick to HTML.
Basically, after changing the doctype, you need to:
[*:3aer5cw6]Add an encoding declaration to the page (this will be enough: <meta http-equiv="Content-type" content="text/html;charset=UTF-8">)
[*:3aer5cw6]Add the missing <title> element to the <head>
[*:3aer5cw6]Remove clear="all" from
. Instead, use clear: both; at the stylesheet.
https://denilson.sa.nom.br/
Recently, we also have MCPlayerEdit and InvGrid for Linux:
http://www.minecraftwiki.net/wiki/Progr ... ry_Editors
They were added to that page less than a week ago.
But, yeah, this web-based inventory editor is neat. :smile.gif:
https://denilson.sa.nom.br/
Also, Sayo, are you still getting that error? I was hoping I had squashed all the bugs.
Well, the
in your case means "end of floats", so it serves a purpose... But yes, you can make some ugly CSS hack that doesn't need using
, but I don't think it's better than the current solution. What's more: it's much more likely to be buggy on other browsers.
https://denilson.sa.nom.br/
this pops up in a new window, then it goes to a page saying
Odd, I just got an error as well when I went to my tool. Refreshing the page a couple of times seemed to get it working again, but your problem might be different than what I saw. I'll do some digging to find out what's going on.
EDIT: One question.. was there a big gap in time between uploading your file and downloading the edited version?
i tried about 5 more times, with 1 simple change, and it was all within 15 secs of upload
also, just tried refreshing a bunch, didnt help
kassquatch: Hm, it seems I might still have cookie problems. If you can, would you give me the cookie value for my site called "session_id"? If I have that I can see if the file you uploaded had any issues or whether the session itself had a problem. You can likely get going again by clearing the cookies for my site and re-uploading your file. But if you can get me more info first I can try to track down this prob.
just fyi.
cookie stuff.....
name: session_id
Content: bbf936fac4355c256e7ab5162e16ca17
domain: .bosak.net