Would it be possible to make the jquery ui theme selectable at the admin page !? look for jquery ui themes in the subdirectory and present availables by radios with some nice help sentences about how to add themes !

CommentFileSizeAuthor
#1 jquery_ui_theme-1733338-1.patch4.91 KBliamanderson
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

liamanderson’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Component: User interface » Code
Issue summary: View changes
Status: Active » Needs review
FileSize
4.91 KB

Created patch for version 7.x-3.x-dev.

Functionality added is pretty much as requested. I have added a '--none--' option if the site is not compatible with or does not require any jQuery UI theme.

Adding a jQuery UI Theme:
1. Download the desired jQuery UI Theme.
2. Unzip/tarball if required.
3. Place folder in module's jquery_update/replace/ui/themes/ directory.

Selecting a jQuery UI Theme:
1. Go to admin/config/development/jquery_update settings page.
2. Click on the Performance tab.
3. Select jQuery UI Theme from the drop-down.
4. Click 'Save configuration' button.

thejacer87’s picture

Doesn't work as is. When downloading the theme from jQuery UI the files are named like jquery-ui.{filename}. But in line 476 of the jquery_update.module, it looks for files with the string: jquery.ui.{filename}. So nothing from the theme actually gets included.

Perhaps jQuery UI Themeroller changed up their naming conventions. Unfortunately this means that the base theme might be named wrong and all the hard coded values need to be dealt with. Might need to open up a new issue for that.

thejacer87’s picture

Status: Needs review » Needs work
liamanderson’s picture

The issue outlined in comment #2 will be addressed in issue #2745909. After that issue is resolved I will redo this patch based on it.

markhalliwell’s picture

Status: Needs work » Postponed (maintainer needs more info)

I'm really not convinced that this module should be in charge of the "theme" aspect of jQuery UI. This module is, primarily, about updating the jQuery [UI] version (hence the name of the module).

I think we'll need some solid proof/reasoning why this should be included.

liamanderson’s picture

I agree that this module shouldn't really be in charge of the jQuery UI Theme. The issue is that it already is. Just by updating to a newer version of jQuery (or using a CDN) through this module, it is including a base theme.

The actual issue I have is the jQuery theme is overriding the base css, really I was looking for a way to disable the theme being included. I believe it is not reasonable to ask a user to go into the module code and rename a folder during setup (which would cause 404s and make upgrade compatibility issues) for something that can so easily be changed as a setting.

Because the include is hard coded there is no way for me to hook in and build a module to add this functionality.

Thoughts?

markhalliwell’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I agree that this module shouldn't really be in charge of the jQuery UI Theme.

Ok, then I'm closing this issue.

The issue is that it already is.

Only because it has to provide something that goes with the correct version. If one decides (or needs) to go past this rudimentary implementation, then they really should know what they're getting into and do it in a custom manner (or as a separate module).

jQuery isn't always the easiest and jQuery UI is even less so. Complicating this project by allowing people to choose "themes" just adds more maintenance to it when there is already has enough to deal with.

Because the include is hard coded there is no way for me to hook in and build a module to add this functionality.

This isn't true, like... at all. You can easily manipulate the library information (to change or remove the "base" theme) with hook_library_alter() (in either a theme or a module*), just like jquery_update does already. The caveat with doing this in a module, is that you must ensure that your alter hook is called after jquery_update's using hook_module_implements_alter().

Historically though, I have always done this in the theme for two reasons 1) theme alter hooks are always invoked after modules and 2) this kind of customization is ultimately theme related and thus, should then live with said theme.

markhalliwell’s picture

As a personal side note, I'm not unsympathetic to your situation. I just feel that adding this here complicates matters more.

If anything, I would suggest creating a separate project/repo like https://www.drupal.org/project/jquery_update_themeroller or something like that so it depends on this one.

Then that would ensure this project's alter hooks are called first before its own. I'd be happy to do any reviews or answer any questions if they're needed.

liamanderson’s picture

@markcarver thank you for taking the time to review and for the input/advise. I will look more into the other options for this.