Comments (6)
Would this be better to leave implementing jQuery version to theme developers? As long as admin overlay is off, admin can run 1.4, and theme developers can run whatever version they like via the theme?
from govcms7.
Comment from @jozhao:
Working with module whitelist/blacklist, we can provide a jQuery update module https://www.drupal.org/project/jquery_update in distribution, then site developer/builder can enable this module if different version of jQuery is needed.
Did a local testing with this module enabled in a white label govCMS site, this module breaks some javascript plugins and brings issues to admin pages - need a confirmation here if the site developer can take this risk and they can fix such issues etc.
thanks, Joseph
from govcms7.
What modules in govCMS currently that would value from this module? If there are none, there there is no reason to add this module. Theme developers should use the version of jQuery provided (even if its not the latest) as to work with supported versions and not introduce software that can break exisiting govCMS functionality.
from govcms7.
For example there are a few agencies on GovCMS currently running Bootstrap-based themes such as Australia.gov.au. In the meantime some agencies running generic Drupal such as the Australian War Memorial are using Bootstrap-based themes. Bootstrap requires jQuery version 1.9.1 or higher and it is getting increasingly popular. It is therefore always desirable to allow theme developers to have the flexibility to choose jQuery.
Under certain circumstances however, jQuery Update module may not suffice. For example if the business wants to edit content using the front-end theme rather than the admin theme (e.g. Australia.gov.au).
Perhaps a simpler solution is to advise theme developers to use hook_js_alter. Example code below to include in theme's template.php.
The conditions can also be built as a configurable item on the theme's config page and assign permission to desired roles.
function hook_js_alter(&$javascript) {
$replace_jquery = TRUE;
$extra_admin_paths = array(
'path/one',
'path/two',
'path/n',
);
// do not apply to admin pages that may require lower version of jQuery provided by Drupal core
if (path_is_admin(current_path())) {
$replace_jquery = FALSE;
} else {
foreach ($extra_admin_paths as $extra_admin_path) {
if (drupal_match_path(current_path(), $extra_admin_path)) {
$replace_jquery = FALSE;
}
}
}
if ($replace_jquery) {
$javascript['misc/jquery.js']['data'] = drupal_get_path('theme', 'your_theme') . '/path/to/alternative/jquery.min.js';
}
}
from govcms7.
The use case for Bootstrap is certainly building and if running a higher version of jQuery is a prerequisite then so be it. Have have noticed on several sites however that admin sections of the site can break when using high levels of jQuery (e.g. Views). So I wouldn't be comfortable offering a module in govCMS that could break things when its turned on. Instead, I'd prefer to have it turned on by default and we have good defaults set for the module so that it doesn't impact the administration interface.
That would put govCMS is a better a position of support bootstrap which seems like a growing preference of choice for government themes.
from govcms7.
Many govCMS features my rely on specific version of govCMS which we won't be able to guarantee if we give the ability to change the version of jQuery. So we've decided to not support this feature but will review opportunities to update jQuery as required.
from govcms7.
Related Issues (20)
- GovCMS Drupal 7 - Updates, Support, End of Life November 2022
- Update UUID to 7.x-1.1 HOT 1
- Field Groups not created properly in PHP7.1 HOT 2
- Checkboxes not visible on admin forms using default Shiny theme.
- Consider adding flood_control and flood_unblock modules in the distro. HOT 1
- Update Drupal core to 7.61 HOT 2
- Include an easy solution for implementing mega menus HOT 1
- Behat test failing - year dropdown HOT 1
- XML Sitemap: An unknown error has occurred (805303f4)
- Webform email "include files as attachments" function broken in govCMS 7.x-3.7 HOT 1
- PHP Notice in hierarchical_select module HOT 3
- Upgrade xmlsitemap to 7.x-2.6 HOT 3
- Upgrade Funnelback Search Integration to 7.x-4.0-beta5 HOT 1
- What does PHP 7.2 mean to govCMS 7 sites? HOT 2
- Logs flooded with warning messages "Invalid display settings encountered" HOT 2
- Remove the SCAYT plugin from CKEditor - rely on the native browser spellchecker instead.
- How does Solr search work in govCMS platforms? HOT 4
- Patch redis module to force a timeout HOT 1
- Facet block titles display for empty facets HOT 1
- Bean update 7.x-1.13 Causes Duplicate Headers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from govcms7.