Switch to full style
Discussions about Coollector.
Post a reply

Re: HTML export

Sun Nov 11, 2012 1:05 pm

I still don't see the connection with Coollector :wacko:

Re: HTML export

Sun Nov 11, 2012 1:13 pm

(cool) Hector wrote:I still don't see the connection with Coollector :wacko:


The idea was to use the exported data files from coollector as the data source for the web app. :whistle:

Re: HTML export

Sun Nov 11, 2012 1:35 pm

kakashi wrote:The idea was to use the exported data files from coollector as the data source for the web app. :whistle:

That's what I thought, but I fail to see how it's worth all your hard work. Isn't it easier to just use Coollector ? Or XBMC ? Why do you need a web interface ? Are you trying to access your files from the internet when you're not home ? Or to give access to your friends ?

Re: HTML export

Sun Nov 11, 2012 2:13 pm

(cool) Hector wrote:Or XBMC ?

I use XBMC sometimes.

(cool) Hector wrote:That's what I thought, but I fail to see how it's worth all your hard work.

Not that much work...

(cool) Hector wrote: Are you trying to access your files from the internet when you're not home ? Or to give access to your friends ?

My home network has quite a few pc's operating on it.

Re: HTML export

Sun Nov 11, 2012 2:27 pm

kakashi wrote:My home network has quite a few pc's operating on it.

Well, all your PCs could have Coollector installed, and your coollection file could be shared on the network.

Anyway, I will improve the export feature soon, and you'll do whatever you want with it ;)

Re: HTML export

Mon Nov 12, 2012 3:26 am

Sorry but i cant leave without first defending JSON.

w3schools wrote:JSON: JavaScript Object Notation.

JSON is syntax for storing and exchanging text information. Much like XML.
JSON is smaller than XML, and faster and easier to parse.


When Coollector generates a json file it in essence declares a javascript array containing all the relevant information. All that is really necessary to display the information is to simply assign the values in the array to a HTML object ( in this case <div id="movies"></div> ).
Code:
document.getElementById('list_desc').innerText=listdesc + ':';
   
for(i=0 ; i<moviecount ; i++)
   document.getElementById('movies').innerHTML+=
      '<div class="movie"><p class="title">' + movies[i].title +
      '</p><img class="poster" src="' + imagefolder + movies[i].imglocation + '"></div>';   
            


The 2 lines of code above (3 if you count the for loop separately) will create all the necessary HTML objects and fill them with the relevant information.

Capture.PNG


The resulting HTML template is only 1.5kb in size and already contains styling information and the four required lines of JavaScript.
Coollector Web List.zip
(1.39 MiB) Downloaded 284 times
Last edited by kakashi on Mon Nov 12, 2012 1:11 pm, edited 1 time in total.

Re: HTML export

Mon Nov 12, 2012 10:57 am

kakashi wrote:When Coollector generates a json file

When ? Never :P

Sorry, I'm not convinced :beee:

Re: HTML export

Mon Nov 12, 2012 12:25 pm

:shock:

Re: HTML export

Mon Nov 12, 2012 12:27 pm

kakashi wrote: :shock:

Don't even try, my heart is a rock.

Re: HTML export

Mon Nov 12, 2012 4:23 pm

(cool) Hector wrote:it's possible to have a combo box to change the style at any moment. It 'll just change the XSLT that is used.

Can be done with JSON too. It's actually pretty easy...

Capture.JPG


Plus there's all the 'little' things that are easily done with the values in a JavaScript array. e.g. changing title color to yellow if the movie is owned etc.

Coollector Web List.zip
(1.39 MiB) Downloaded 267 times

Re: HTML export

Mon Nov 12, 2012 5:01 pm

Ok, ok, ok.

The future export feature will handle XML and json.

Re: HTML export

Mon Nov 12, 2012 11:47 pm

:yahoo: :yahoo: :yahoo:

the defense rests. :whistle:
Post a reply