Saturday, October 28, 2006
Fun with Javabunda
This is a test of the new javascript I stuck in our template. Look what happens when you click on the image. The html that goes into your posting I will write into the comments.
Subscribe to:
Post Comments (Atom)
9 comments:
Here's the html you should modify. Notice it still has some of Dr Bundinho's Portuguese in it.
JJ: I see the script you added (I assume you just lifted it from soemwhere -- you do not know how to write Java scripts, do you???) is the followingh, yes?
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=600,height=900,resizable=yes,scrollbars=yes');
return false;
}
So OK, how does it work? It reads a symbolic link into that stupid blogger input window for pics?
Yeah, that's the script, but you're missing the script tags, of course. This was a bit of a pain. I went to bundablog and wondered how he got the popups. I looked through all the blogger options and found nothing so I decided to look at his source. Since all his images pop up the same way, I figured the difference between our source and his source was in our respective templates so I added this script to our head. In the source of his posts I saw this call (in the jpg above) and figured that was what goes in each upload window. I got it to work after couple tries.
I still am not sure what everything means. You?
Although this is likely good for jokes, what I really want is to be able to upload pdfs and txt. Any ideas?
A higher tech version of the linkjuice above is
(lessthan)a onclick="return popup(this,'omia')" href="http://whereyougoing">(lessthan)img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px;" src="http://thepicturecoveringyourbutton.jpg" border="0" alt="" />(lessthan)/a(greaterthan)
Then you can fool with the size of the thing and its placement in the page...
JJ: This is high-tech clicking-onn-things! Yes, I've dabbled myself also a bit in javacode, but basically the same way--tweaking other people's little gadgets. Note another annoying feature here: we can't quote ad-literam things like a piece of code, complete with less than symbols, etc. Oh, well, as that old Romanian proverb has it (and I'm translating loosely), "you don't look a gift horse in the mouth".
I'll try and see how this gizmo works, maybe we can tweak it further...
Cool. This is fun.
AI, Here is a big library of free scripts one can download. They are interesting and in retrospect I should have just gone here rather than poring through Bundinho's source. For example, they have a popup that sizes itself according to the size of the picture and not of a fixed size as in the code you copied.
In fact, I already had to change that for the Villepin post.
AI, I put in other javascript I downloaded from the web. This has the advantage of automatically sizing the popup windows and you can size the image that goes on the main page. So for images it's much better. The disadvantage is that it won't open webpages other than images in the popup. For that Dr Bundinho's code was better.
Anyhow, we know how to do things now and you have written the old script (minus tags) for posterity above. I was thinking of having the two javascripts cohabit, but I got a lot of errors on publishing.
They aren't really errors, obviously. If you repeat the republishing and look at the detals of the error it will never be the same thing twice. Also they refer to old posts in which there was no call to a script. It's just that Blogger is OK for simple things but at some poiint if we want to do cool stuff or even learn much more, we need our own hosting service.
Now we have both.
Post a Comment