Thursday, May 24, 2007

OlinDocs Wiki & a little bit of javascript

If nothing else, at least this website has given me a lot to blog about.

I will get to the internals. Really. You'll get the juicy python and javascript. But. I just added a feature so maybe I'll babble about that instead. Or wait. I can do some javascript and my new feature. Hoorah!

All right. So I set up a wiki. I set it up to allow people to describe documents. I originally considered putting something directly on OlinDocs in the results, but, honestly, more than 10 results is a ways to scroll without each result being twice as long by virtue of a description paragraph. Also, now other people can do the work instead of me. Yay!

I'm using Netcipia for my Wiki needs. It can host blogs, pics, and of course wikis. You get 2 GB of space, unlimited users can use your wiki for unlimited time, you get a place name (placename.netcipia.net) and you get a decent amount of control over your place and who can see, edit and comment on it. Hot. Right now I just have it fully open; hopefully I don't have to change that ever. I'm not sure if you have to be an user of netcipia in general to edit... if so I'll just make an account for general anonymous OlinDocs use.

Despite Netcipia going all buggy yesterday for a couple of hours when I was testing some new code and making me think I was wrong, I decided that I heart it anyways. (That harrowing experience felt something like working on a circuit for hours only to find that the chip your using had been dead). Anyhow, I wrote them for support and they fixed it. It was kinda neat cuz they said you could write in English, Spanish or French; since I know all three to varying degrees, I wrote in all three for them. w00t!

So. Now I had a wiki set up. I used some python magic that I'll talk about some other day to build myself a database that had links to unique wikis for each document. (This does assume that no two documents with the same name and file extension will coexist, but I'd already made that assumption by putting all the documents in the same directory). So. That rocked. Now all of my documents were linked to wikis that could be used to describe or comment (a different section) on them. Cool.

That's kinda nice, but I wanted this all to be searchable for the advanced search page. Lucky for me, Netcipia had me covered and all I had to do was point something at olindocs.netcipia.net/xwiki/bin/view/Main/WebSearch?text=$$$ ($$$ represents the search term). Cool.

So. HTML/javascript time: [value="Go" id="wsearch" onclick="window.open(prep_wsearch())" type="button"]. (imagine those are the correct brackets for me ok?) Cool. This makes a button that looks like this: But what does it do?

Well that's the javascript part. I have this little text input box next to the button. It has an ID. I can call it's ID.value to get what's in the input box. then I join that string with the 'olindocs.netcipia.net/.../WebSearch?text=' string and, well, a window is opened at that address. w00t! Feel free to look at the site or its source code: advanced search. There's lots more stuff in there, but I'll get to that some other day as this post is getting unwieldy.

1 comment:

Anonymous said...

Samsung Gаlаxy S battle tο begin. In a market wherе іt сan't compete as effectively as it used to be the Desire 2, was in fact just a bit advanced for my tastes. Samsung galaxy Ace has a more rectilinear design than the Mini with 8 GB of internal storage capacity of 8 GB and 16 GB.