In doing some work on the module, and in trying to understand the theming code decided to refactor it.

In doing this I have changed very little functionality, but I have added mention of settings[skin], which is something I am playing with. It would be trivial to remove this.

I am putting this work forward in the hop it can form the basis of an easier to understand and maintain theme layer for the module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rivimey’s picture

This is my patch.

rivimey’s picture

Category: Task » Support request
rivimey’s picture

I have done some further work on this code, and pushed the whole module here:

https://github.com/rivimey/jplayer-drupal

It's not usable, yet, but the skinning code does work: the remaining issue is JS related, I think.

markie’s picture

Title: Reworked theming code. » Allow for custom CSS and JS paths to be defined for easier theming.
Category: Support request » Task
Status: Active » Needs review
FileSize
8.77 KB

@rivimey attached is a patch, which is more the direction I have been planning on going but adding CSS and JS custom paths to the admin page that allows a person to, well, customize the css and js. Combined with a TPL file I have been able to get the circle player to properly work. I have been wanting to blog about this for some time now, but time is not something we have these days. Please take a look and let me know if this is similar to what yo were thinking.

rivimey’s picture

@markie, finally found time to look through the patch.

I can see a number of improvements that are in the just 'do it' category, for example the improved comments, the uninstall hook and the readme.

However, choosing to rely on the existing tpl file and only use js/css for modified appearance, wasn't really what I was trying to do: I wanted to be able to support (and now, can) both the blue monday and pink flag themes from the jQ distribution, and importantly to select which to display on a per-field basis. I wanted this because I wanted to have a small, compact JP instance on views lists while having a more capable, more generous one on main node pages. I wanted to retain a lot of compatibility with the css/html files in the jquery.jplayer distro, to make it simpler to port themes from 'the web', though I had to do more to them than I'd hoped.

In moving to my goal, I have also enabled any module to provide alternate theme implementations -- so in fact my own site will be using a 'blue flag' variant of the pink flag, theme, at least to begin with, complete with modified PNGs. The things I haven't cracked yet are playlist mode and multiple themes on the same page (currently they share css names, so although multiple files are added, they style the same).

The changes made to the code are, however, extensive. Hopefully in a good way, but that is why mentioned calling this jplayer 3.x rather than 2.something.

Along the way I have fixed quite a few issues, and probably introduced more :). The code is in the repo above.

Is this totally not what you'd wanted?