05-15-2015, 09:03 PM
Hi everyone,
Currently, the look of the Gridview Add-on only matches the default bluemonday feather, and doesn't fit in at all with the other bundled feathers in Nightingale. Rather than update each of the feathers to skin over the Gridview media page, I figured an easier way might be to follow a similar method to that used by the MLyrics add-on (source here):
- For each feather, a relatively short CSS file containing the appropriate colours is put in the chrome/content/style folder
- Within chrome/content/jscripts/paneWindow.js, a function is used to determine the current feather employed by the user, and from this a new variable is created: currentStyleFile = currentSkin + ".css"; which allows the "graphics drawing" portion of the code to reference the appropriate CSS file from what I can tell.
In Gridview (source here), the colours are currently defined in chrome/skin/view.css, and this CSS file is referenced in chrome/content/view.xml. So I thought it might be possible to use the same function that MLyrics uses to determine the current employed feather and then make the same currentStyleFile variable that would replace the view.css reference. Here are my problems:
1) How can I implement a javascript function within XML code? I looked up that it might be possible to put the function within a <![CDATA[ ]]> block...
2) How would I get this function to pass on the variable determined from the javascript function to something readable by the XML code so that it can reference the appropriate CSS file?
Hopefully my explanation was clear enough - if not I'll pastebin the relevant code from the add-ons. This seems like a fairly simple problem, but I'm having trouble Googling for answers...maybe because I am going about this all wrong?
Any advice is appreciated!
Currently, the look of the Gridview Add-on only matches the default bluemonday feather, and doesn't fit in at all with the other bundled feathers in Nightingale. Rather than update each of the feathers to skin over the Gridview media page, I figured an easier way might be to follow a similar method to that used by the MLyrics add-on (source here):
- For each feather, a relatively short CSS file containing the appropriate colours is put in the chrome/content/style folder
- Within chrome/content/jscripts/paneWindow.js, a function is used to determine the current feather employed by the user, and from this a new variable is created: currentStyleFile = currentSkin + ".css"; which allows the "graphics drawing" portion of the code to reference the appropriate CSS file from what I can tell.
In Gridview (source here), the colours are currently defined in chrome/skin/view.css, and this CSS file is referenced in chrome/content/view.xml. So I thought it might be possible to use the same function that MLyrics uses to determine the current employed feather and then make the same currentStyleFile variable that would replace the view.css reference. Here are my problems:
1) How can I implement a javascript function within XML code? I looked up that it might be possible to put the function within a <![CDATA[ ]]> block...
2) How would I get this function to pass on the variable determined from the javascript function to something readable by the XML code so that it can reference the appropriate CSS file?
Hopefully my explanation was clear enough - if not I'll pastebin the relevant code from the add-ons. This seems like a fairly simple problem, but I'm having trouble Googling for answers...maybe because I am going about this all wrong?
