Skip to content
Snippets Groups Projects
Commit c0e4891b authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Added admin path exclude functionality settings.

parent f91185ed
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,14 @@ function jquery_loadinganimation_settings_form() {
'#required' => FALSE,
'#default_value' => variable_get('jquery_loadinganimation_settings_form',
''));
// Exclude
$form['jquery_loadinganimation_path_match_exclude'] = array(
'#type' => 'textarea',
'#title' => t('Exclude the following path(s)'),
'#description' => t(
"jQuery Loadinganimation will not be used for paths that match these patterns.") . ' ' . t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.") . ' ' . t("Default: 'admin/*'"),
'#required' => TRUE,
'#default_value' => variable_get('jquery_loadinganimation_path_match_exclude', 'admin/*'));
$form['jquery_loadinganimation_close_on_click'] = array(
'#type' => 'checkbox',
'#title' => t('Close on layer click'),
......
......@@ -6,9 +6,12 @@
function jquery_loadinganimation_init() {
$module_path = drupal_get_path('module', 'jquery_loadinganimation');
$js_settings = _jquery_loadinganimation_get_settings();
drupal_add_js(array('jquery_loadinganimation' => $js_settings), 'setting');
drupal_add_js($module_path . '/jquery_loadinganimation.js');
drupal_add_css($module_path . '/jquery_loadinganimation.css');
$path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
if (!drupal_match_path($path, $js_settings['jquery_loadinganimation_path_match_exclude'])) {
drupal_add_js(array('jquery_loadinganimation' => $js_settings), 'setting');
drupal_add_js($module_path . '/jquery_loadinganimation.js');
drupal_add_css($module_path . '/jquery_loadinganimation.css');
}
}
/**
......@@ -20,7 +23,7 @@ function jquery_loadinganimation_help($path, $arg) {
case 'admin/help#jquery_loadinganimation':
case 'admin/config/user-interface/jquery_loadinganimation':
return '<p>' . t(
'JQuery loadinganimation module shows a loading layer on page loading events. These may be triggered by form submission, clicking a hyperlink or executing an AJAX call.
'JQuery loadinganimation module shows a loading layer on page loading events. These may be triggered by form submission, clicking a hyperlink or executing an AJAX call.
Hyperlinks may be excluded from trigger by adding a ".noLoadingAnimation" class.
Further "javascript" and "#" hyperlinks are excluded.');
}
......@@ -53,8 +56,9 @@ function _jquery_loadinganimation_get_settings() {
'img_src' => variable_get('jquery_loadinganimation_img_src', $module_path . '/images/ajax-loader.gif'),
'show_on_ajax' => variable_get('jquery_loadinganimation_show_on_ajax', FALSE),
'show_on_href' => variable_get('jquery_loadinganimation_show_on_href', TRUE),
'show_on_form_submit' => variable_get('jquery_loadinganimation_show_on_form_submit', TRUE),
'show_on_form_submit' => variable_get('jquery_loadinganimation_show_on_form_submit', TRUE),
'close_on_click' => variable_get('jquery_loadinganimation_close_on_click', TRUE),
'close_on_esc' => variable_get('jquery_loadinganimation_close_on_esc', TRUE),
'jquery_loadinganimation_path_match_exclude' => variable_get('jquery_loadinganimation_path_match_exclude', 'admin/*'),
'subselector' => variable_get('jquery_loadinganimation_subselector', ''));
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment