Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 08-28-2011, 12:44 PM   #1
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
[Old Thread] Web Front end

Hey, people. Sorry I have been MIA for a sec but I've had to work on stuff that would feed me. I have been working on a new front end for the web server. Mostly that has been reading up on python and reading the source. I feel a little more comfortable with it now and hopefully I can move faster and faster on this.

The version in my branch works on webkit (chrome) only right now but I am making the changes to make it cross browser. I will not be targeting ie6 because - well, it's ie6.

all of the functionality of the original is in my branch it's just more symantic and prettier.

Going forward I want to do the following:
  1. Make cross browser
  2. Refactor JS and CSS for faster and smaller downloads

I would *really* prefer to have a better back end to work with. I am investigating how to get cherrypy to serve correct json objects so the server can have true MVC. It'll be so much cooler and easier to add features, interfaces, and device compatibility.

I could use the opds XML but there are some features I can't get working right. Sort is the primary one right now.

Any suggestions would be appreciated.
DezmondFinney is offline   Reply With Quote
Old 08-28-2011, 12:56 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What's the problem with getting cherrypy to serve json? IIRC, the current backend serves json. I'll be happy to help if there's something you cannot figure out.

Last edited by kovidgoyal; 08-28-2011 at 12:59 PM.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-28-2011, 01:25 PM   #3
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
Right now the server seems to use the application/json to serve html snippets. I use an ajax call to one of the json endpoints to get back a string of <li>s to persist the menu in a side bar. This video shows what I did http://vimeo.com/28268644. (Btw there is alot that is not done in the vid including elements I have hidden like the donate button, opds link etc.)

I would prefer a json object that I can use to create any type of html element I'd like client side. Libraries like backbone.js expect json objects to persist and manipulate client side. So do template systems like handlebars.js

If there is a function that does just that I have not seen it but like I said before reading python is hard for me cause I don't know the language. I suppose I can replace the html with a properly formatted json string and that is what I am thinking I will do.
DezmondFinney is offline   Reply With Quote
Old 08-28-2011, 01:43 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can certainly do that if you like. If you tell me what data you want in the JSON object, I'll cook up an endpoint that generates the JSON object for you. Once you see the patch to create such an endpoint, creating new ones should be trivial for you. And can we move this to email (my email address is all over the calirbre source code)
kovidgoyal is offline   Reply With Quote
Old 08-28-2011, 02:26 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I committed code that returns the metadata of a book as a JSON object

/get/json/<book id>
kovidgoyal is offline   Reply With Quote
Advert
Old 08-28-2011, 03:39 PM   #6
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
Sweet! That was fast!
DezmondFinney is offline   Reply With Quote
Old 08-29-2011, 12:59 AM   #7
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
By the way that last link has was bad. This one is better http://vimeo.com/28288784 though it is still a little wonky. Video does not start till 25sec in.

Upgraded to Ubuntu 11.04 and have been messed up since. There are times that I miss my Mac.
DezmondFinney is offline   Reply With Quote
Old 08-29-2011, 01:03 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I should have your Ajax APIs done sometime tomorrow. I like this layout better, you may consider implementing a switch between this and only cover view for those that prefer that.
kovidgoyal is offline   Reply With Quote
Old 08-29-2011, 02:01 AM   #9
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
I don't know if anyone noticed but there is a list/grid button in the navbar I forgot to get that active in the vid. All good since I accidentally broke it by changing a class name in the CSS )

Actually, I will be starting over from scratch once I get those AJAX APIs it will be much cleaner to do it that way.

Anyone else have input? Interface ideas or use cases I have not thought of for the desktop. I've been waiting for the API that interfaces easily with a touch library (jquery mobile or even sproutcore touch 2.0 - I've been waiting for an excuse to use it) to do the touch ui. I'd rather use a library than reinvent the wheel
DezmondFinney is offline   Reply With Quote
Old 08-29-2011, 03:30 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Something that's been on my todo list for a long time if to add an advanced search builder, something like the Tag Browser in the desktop GUI where you can expand categories and click on them to construct complex search expressions.
kovidgoyal is offline   Reply With Quote
Old 08-29-2011, 01:02 PM   #11
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
I know I could do that with returned JavaScript objects. I was thinking about doing something similar. I thought it would be cool to have html5 offline storage of the library and only require data connections for downloading the actual books and/or book covers. The app would be more responsive, there would be some offline availability and building an advanced search builder would be easier (for me as a front end guy). Eventually the parameters for the custom search could be sent back to calibre-server and made available for use on the QT desktop app.

The problem is that when a library is large (3-4k books) the object returned is 6 or 7 MB. Modern browsers can do up to 50MB but is it realistic to expect a 7MB datastore? Do people have libraries that large? I don't ... I downloaded a torrent of 4000 books just for testing. (This is why you see so many in my vids) I am deleting them when I am done developing because I don't need them but perhaps there are some who have that many or more. What is the average size of a library?
DezmondFinney is offline   Reply With Quote
Old 08-29-2011, 01:39 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The problem with doing an offline store is how are you going to manage syncing?

Building an advanced search builder should be very easy in any case with the JSON API I am developing, the hard part is the front end. I can easily add an API method that takes a list of selected tag browser items and builds a search from them. You then stick that built search into search box and submit the search form.
kovidgoyal is offline   Reply With Quote
Old 08-29-2011, 01:54 PM   #13
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
Lol I was just thinking "The front end is the easy part"

As far as syncing is concerned that is not as big of an issue as in other applications because there is a low chance of merge conflicts. Most people are using this to manage personal libraries. If this where in widespread use in libraries with multiple concurrent admin connections it would be harder to manage sync. CouchDB is one way to handle it. There are other ways as well. But that's getting ahead of ourselves.

If the API that you build will have the tools for doing the searches remotely that'll do just fine. I can manage building a front end that will build an ajax call to the method will all the proper arguments.
DezmondFinney is offline   Reply With Quote
Old 08-29-2011, 03:06 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,779
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Lots of people share their libraries with multiple friends/family members. I strongly doubt syncing will be as easy as you think. I'll leave aside the search builder API for the moment, lets finish the rest first, once that's done I can add the API.
kovidgoyal is offline   Reply With Quote
Old 08-29-2011, 03:16 PM   #15
DezmondFinney
Member
DezmondFinney began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Aug 2011
Location: Atlanta, Ga
Device: kindle
I agree with you that it would not be "easy". Syncing is the holy grail of modern web app development. I just don't think it would be as hard as other apps where things change all the time. Even Apple and Google struggle with it on apps like that (thinking about calendar sync in gCal and iCal)

It's an interesting problem though, I just have to not get distracted by it.
DezmondFinney is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre as front end to content server PapaKilo Library Management 5 10-14-2012 03:34 PM
soPDF GUI Front-End Nathan Campos PDF 37 11-04-2011 07:45 PM
Web front end DezmondFinney Development 7 08-10-2011 09:51 AM
Hacking the front-end DezmondFinney Development 18 08-05-2011 03:22 AM
GuteBook - the Project Gutenberg eBook Maker/Front-end nrapallo Workshop 67 03-27-2011 04:46 PM


All times are GMT -4. The time now is 12:14 AM.


MobileRead.com is a privately owned, operated and funded community.