Skip to content
Snippets Groups Projects
Commit ee074818 authored by Drew Webber's avatar Drew Webber
Browse files

Issue #3345221 by mcdruid, q2_faith: Should relative custom paths should have a leading slash?

parent 6d15395d
No related branches found
No related tags found
1 merge request!10test tweaks for relative paths in examples
Pipeline #298815 passed
...@@ -227,8 +227,10 @@ function jquery_update_settings_form() { ...@@ -227,8 +227,10 @@ function jquery_update_settings_form() {
'#collapsed' => FALSE, '#collapsed' => FALSE,
'#tree' => FALSE, '#tree' => FALSE,
'#group' => 'jquery_update', '#group' => 'jquery_update',
'#description' => t('Custom paths for jQuery libraries (e.g. CDN URLs or paths to local files).'), '#description' => t('Custom paths for jQuery libraries (e.g. CDN URLs or paths to local files).')
. '<br /><em>' . t('Note that the examples may not be correct, e.g. if Drupal is installed in a subdirectory or as part of a multisite.') . '</em>',
); );
$example_path = str_replace($GLOBALS['base_url'], '', file_create_url('public://jquery_update/'));
$latest_version = jquery_update_latest_version('jquery'); $latest_version = jquery_update_latest_version('jquery');
$example_version = $latest_version ? $latest_version : JQUERY_UPDATE_EXAMPLE_JQUERY_VERSION; $example_version = $latest_version ? $latest_version : JQUERY_UPDATE_EXAMPLE_JQUERY_VERSION;
...@@ -238,7 +240,7 @@ function jquery_update_settings_form() { ...@@ -238,7 +240,7 @@ function jquery_update_settings_form() {
'#default_value' => variable_get('jquery_update_custom_path_jquery', ''), '#default_value' => variable_get('jquery_update_custom_path_jquery', ''),
'#description' => t('Example: %url or %path', array( '#description' => t('Example: %url or %path', array(
'%url' => 'https://code.jquery.com/jquery-' . $example_version . '.js', '%url' => 'https://code.jquery.com/jquery-' . $example_version . '.js',
'%path' => '/sites/default/files/jquery_update/jquery.js', '%path' => $example_path . '/jquery.js',
)), )),
); );
$form['jquery_custom']['jquery_update_custom_version_jquery'] = array( $form['jquery_custom']['jquery_update_custom_version_jquery'] = array(
...@@ -256,7 +258,7 @@ function jquery_update_settings_form() { ...@@ -256,7 +258,7 @@ function jquery_update_settings_form() {
'#default_value' => variable_get('jquery_update_custom_path_jqueryui', ''), '#default_value' => variable_get('jquery_update_custom_path_jqueryui', ''),
'#description' => t('Example: %url or %path', array( '#description' => t('Example: %url or %path', array(
'%url' => 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/' . $example_version . '/jquery-ui.min.js', '%url' => 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/' . $example_version . '/jquery-ui.min.js',
'%path' => '/sites/default/files/jquery_update/jquery-ui.min.js', '%path' => $example_path . '/jquery-ui.min.js',
)), )),
); );
$form['jquery_custom']['jquery_update_custom_version_jqueryui'] = array( $form['jquery_custom']['jquery_update_custom_version_jqueryui'] = array(
...@@ -274,7 +276,7 @@ function jquery_update_settings_form() { ...@@ -274,7 +276,7 @@ function jquery_update_settings_form() {
'#default_value' => variable_get('jquery_update_custom_path_migrate', ''), '#default_value' => variable_get('jquery_update_custom_path_migrate', ''),
'#description' => t('Example: %url or %path', array( '#description' => t('Example: %url or %path', array(
'%url' => 'https://cdn.jsdelivr.net/npm/jquery-migrate@' . $example_version . '/dist/jquery-migrate.min.js', '%url' => 'https://cdn.jsdelivr.net/npm/jquery-migrate@' . $example_version . '/dist/jquery-migrate.min.js',
'%path' => '/sites/default/files/jquery_update/jquery-migrate.js', '%path' => $example_path . '/jquery-migrate.js',
)), )),
); );
$form['jquery_custom']['jquery_update_custom_version_jquery_migrate'] = array( $form['jquery_custom']['jquery_update_custom_version_jquery_migrate'] = array(
...@@ -292,7 +294,7 @@ function jquery_update_settings_form() { ...@@ -292,7 +294,7 @@ function jquery_update_settings_form() {
'#default_value' => variable_get('jquery_update_custom_path_cookie', ''), '#default_value' => variable_get('jquery_update_custom_path_cookie', ''),
'#description' => t('Example: %url or %path', array( '#description' => t('Example: %url or %path', array(
'%url' => 'https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@' . $example_version . '/jquery.cookie.js', '%url' => 'https://cdn.jsdelivr.net/gh/carhartl/jquery-cookie@' . $example_version . '/jquery.cookie.js',
'%path' => '/sites/default/files/jquery_update/jquery.cookie.js', '%path' => $example_path . '/jquery.cookie.js',
)), )),
); );
$form['jquery_custom']['jquery_update_custom_version_jquery_cookie'] = array( $form['jquery_custom']['jquery_update_custom_version_jquery_cookie'] = array(
...@@ -310,7 +312,7 @@ function jquery_update_settings_form() { ...@@ -310,7 +312,7 @@ function jquery_update_settings_form() {
'#default_value' => variable_get('jquery_update_custom_path_form', ''), '#default_value' => variable_get('jquery_update_custom_path_form', ''),
'#description' => t('Example: %url or %path', array( '#description' => t('Example: %url or %path', array(
'%url' => 'https://cdn.jsdelivr.net/gh/jquery-form/form@' . $example_version . '/dist/jquery.form.min.js', '%url' => 'https://cdn.jsdelivr.net/gh/jquery-form/form@' . $example_version . '/dist/jquery.form.min.js',
'%path' => '/sites/default/files/jquery_update/jquery.form.js', '%path' => $example_path . '/jquery.form.js',
)), )),
); );
$form['jquery_custom']['jquery_update_custom_version_jquery_form'] = array( $form['jquery_custom']['jquery_update_custom_version_jquery_form'] = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment