iPhone Inspector implemented!

Discussion of the Web Interface for Transmission, formerly known as Clutch. This applies to all version of Transmission
Post Reply
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

iPhone Inspector implemented!

Post by r0ssar00 »

First of all, transmission is great! Several reasons: great webui, compiles almost cleanly on the iPhone(yes, I did say on, hence I'm running transmission on the iPhone), works well.
There's a problem: the webui for the iPhone lacks an inspector. Since I was going to be using my iPod Touch(I don't have an iPhone but iPhone=iPodTouch when dealing with software) exclusively to download torrents, I needed an inspector in the webui.

I'd post a screenshot but I can't get access to iTunes to download the images on the iPod but I *can* descibe it.
Picture the standard iPhone webui, now tap on the torrent name(I'm looking for suggestions on how to best initiate the inspector. I'm currently adding an event binding to the torrent name, I don't want to touch index.html or transmission.js to keep the number of modifications to the standard webui small.). After a few seconds, the torrent list disappears and the inspector takes it's place. The inspector is identical to the standard ui's inspector except for the addition of an icon(grabbed from the iUI project, license text in images/buttons/cancel.png.LICENCE.txt) in the top right(to close the inspector). Not only are you able to set wanted/priority levels, but you can also pause/resume this particular torrent. I haven't tested removal yet but I suppose it would work(I think the dialog would mess up).

I wrote this using iFile on the iPod(seeing a pattern? I didn't have access to a desktop/laptop until now.). I used as much material as possible from the original code so the inspector looks and acts the same as the standard ui. I'll need larger priority images though, the current ones are almost impossible to tap accurately.

Grab it at http://dl.getdropbox.com/u/255759/trans ... bui.tar.gz and extract directly into your web folder(the archive contains all the files at it's root).
Enjoy!


Technical details: the inspector was moved into it's own file(inspector.html) and has it's own javascript(inspector.js) and css(inspect.css) backing it. torrent.js was modified to include an event binding to initiate it as well as a method that initiates it. index.html was modified to include a div and iframe in torrent_container. common.js was modified and now includes a method to close the inspector. transmission.remote.js was modified to allow the inspector to get the details of only one torrent instead of all of them(through loadTorrents(). loadTorrents() is now a wrapper around loadSomeTorrents() which was the old loadTorrents(). loadSomeTorrents() accepts update_files and an array of ids to query information for). When a torrent is clicked, inspector_container's src is set and an onload event is attached. When inspector_container loads, torrent_list is hidden and inspector_container is shown. common.js does the reverse: hides inspector_container and shows torrent_list as well as setting inspector_container's src to about:blank(to stop updating the inspector) and removing the onload event handler.
Anything I haven't mentioned hasn't been modified. All the original files were from the 1.61 release.
kjg
Web Interface Developer
Posts: 14
Joined: Fri May 15, 2009 3:41 pm

Re: iPhone Inspector implemented!

Post by kjg »

Thanks for putting in all that work. It would really help us out though if you could make a patch against trunk instead of 1.61. There have been a lot of changes in the web UI since 1.61 including some of what you were trying to do with loadSomeTorrents().

Thanks!
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

Re: iPhone Inspector implemented!

Post by r0ssar00 »

Absolutely, I'll have access to a laptop tomorrow so it'll make it *much* easier to grab the trunk version and make a patch.
Has there been any changes in trunk that would require me to compile the trunk version to get the webui to work(RPC spec changes, etc)?
kjg
Web Interface Developer
Posts: 14
Joined: Fri May 15, 2009 3:41 pm

Re: iPhone Inspector implemented!

Post by kjg »

There was a bug in 1.61 that prevented torrent files from being uploaded through the web_ui, the fix did require some rpc code to be changed. There were no changes in the spec though iirc.
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

Re: iPhone Inspector implemented!

Post by r0ssar00 »

Perfect, I really didn't want to have to recompile transmission. Took a while last time!
I was working with the version of the RPC spec in trunk so I should be fine.

EDIT: just started taking a look at trunk's javascript. I really should've worked on trunk from the start :( There's some significant api/code changes I'll have to work through. Ah well, I'll have a laptop tomorrow for the entire day.
kjg
Web Interface Developer
Posts: 14
Joined: Fri May 15, 2009 3:41 pm

Re: iPhone Inspector implemented!

Post by kjg »

Just fyi, there are nightly builds available at http://transmission.xpjets.com/ for osx, since I'm assuming that is what you are using
kjg
Web Interface Developer
Posts: 14
Joined: Fri May 15, 2009 3:41 pm

Re: iPhone Inspector implemented!

Post by kjg »

r0ssar00 wrote:compiles almost cleanly on the iPhone(yes, I did say on, hence I'm running transmission on the iPhone), works well.
You have Transmission running Natively on the iPhone? How does that work? To where would it download the files? Or am I just misunderstanding what you mean.
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

Re: iPhone Inspector implemented!

Post by r0ssar00 »

Yes. Very very slowly. Wherever you want. It's especially slow on shutdown and pausing. You have to force reboot the iPhone at the end of a session. btw, I wasn't the first(http://wickedpsyched.net/torrent) , I only wanted an updated client + the binaries from core crash almost right away. I tried to compile something like 10 other clients but none made it past the configure.
Your iPhone has to be jailbroken.
I wouldn't recommend this unless it was a last resort(for me it is because all I have is an iPod Touch for most of the summer).
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

Re: iPhone Inspector implemented!

Post by r0ssar00 »

The changes weren't terrible but it took a while to fix my code.
I'm having a small problem though. I changed the invocation method by adding an arrow to the right of the progress bar(like the little pause button when the webui is in a full browser). I can't get the progress bar to shrink to allow the arrow to fill the empty space. I've tried repurposing the pause button div(and copying part of the style over into iphone.css) and also placing the progress bar and arrow in adjacent cells in a table. Neither work. The progress bar continually overlaps the arrow after the repurposing of the pause div(I don't want to change MaxWidth in refreshHTML because landscape mode throws the sizing off because it's relative). The table was a miserable failure.
Can you shed any light on how the pause button ends up fitting(or should I say how the progress bar ends up shrinking)?
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

Re: iPhone Inspector implemented!

Post by r0ssar00 »

I've almost got the inspector finished with the trunk version of the webui. The only thing on my TODO list is to get the initiator working. I've tried replacing the pause button(beside the progress bar) with an arrow but I can't get it to work(it overlaps and I can't get the progress bar to shrink). I've also tried having the arrow(as-is) alternate to white when the torrent is selected, again it won't work.

Anyways, here's what I'll call the beta version of the inspector: http://dl.getdropbox.com/u/255759/inspector.patch.
How to apply(you must have a GNU-compatible patch and a base64 decoder installed/available, I use GNU diffutils and openssl):
open a terminal, cd into the directory containing the web directory(not *into* the web directory), then execute:

Code: Select all

patch -p0 -i inspector.patch
I've base64 encoded the additional images and the base64 encoded files are present in the patch file and thus are now in web/images/buttons. You'll have to execute

Code: Select all

openssl enc -d -base64 -in myfile.b64 -out myfile.png
where myfile is replaced by each of the b64 encoded files(current.b64, listArrow.b64, and listArrow.sel.b64).
kjg
Web Interface Developer
Posts: 14
Joined: Fri May 15, 2009 3:41 pm

Re: iPhone Inspector implemented!

Post by kjg »

Great, thanks. Sorry to make you jump through more hoops, but it would be great if you could go to http://trac.transmissionbt.com/ and open a ticket there (you'll need to create an account if you don't already have one) and attach the patch. That way I don't forget about it and we can track when it gets done and what not. Thanks for putting in all that work :)
r0ssar00
Posts: 7
Joined: Wed Jun 03, 2009 1:28 pm

Re: iPhone Inspector implemented!

Post by r0ssar00 »

Done(ticket #2165) and you're welcome :) I'm still going to work on the lingering bugs though, I'd like for it to work 100%. Unfortunately it's back to the iPod tomorrow :(
Post Reply