Re: LMS webUI: create overlay across width of *entire* page?

afriend <afriend.a4zxjz-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]>
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
peterw wrote: 
> Otherwise you might consider hacking out of the iframe completely, as I
> did years ago to allow PlayLog to show the history table using the full
> screen, e.g. *if (window != window.top )*  then use *top.location.href*
> to reload and take over the whole viewport. Ugly hack, but I don't have
> to worry that my code my pollute the regular LMS DOM and cause problems
> with regular LMS code.

Thank you. That what I came up with eventually. Wish I'd read your post
earlier. Ugly, maybe, but the beautiful overlay should make up for it.
:-)

Maybe one more question since I've never felt quite at ease with all the
JS/Ajax/JSON roundtrips between webpages and the plugin:

I need some data from the plugin -before- I open the overlay. The
overlays is a chart that expects among other things 2 separate arrays
with data for the x and y axis. Here's an example of the data and its
format that the overlay JS expects:


Code:
--------------------
    const LMSdata = {
  	labels: ['Artist A', 'Artist XY', 'Some other artist', 'LOLZ'],
  	datasets: [{
  		data: [65, 59, 80, 81],
  			axis: 'y',
  			label: ' Number of tracks',
  	}]
  };
--------------------


The URL for  JSON requests to the plugin is 
/plugins/testplugin/getdata.html

Before I open the overlay I need to make a JSON call to the plugin
including the query type like "artistswithmosttracks" so the plugin
knows for what kind of SQL query it needs to return the results.

What's the simplest way to send the ajax call with the query type to the
plugin and then to receive the callback on the web page so I basically
have 2 ready-to-use variables for the 2 arrays (x/y axis)?
And would I need to do some JS promise stuff to account for possible
callback delays? Ah, JS, JSON, ajax, the horror... :-)
If you know of any simple examples in other plugins that I can learn
from please let me know. 
Thank you.


------------------------------------------------------------------------
afriend's Profile: http://forums.slimdevices.com/member.php?userid=39306
View this thread: http://forums.slimdevices.com/showthread.php?t=114857
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.