diff options
Diffstat (limited to 'modules/overlay')
-rw-r--r-- | modules/overlay/overlay-parent.js | 21 | ||||
-rw-r--r-- | modules/overlay/overlay.module | 20 |
2 files changed, 32 insertions, 9 deletions
diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index 3519e84f6..ace7deff7 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -1,4 +1,3 @@ - (function ($) { /** @@ -354,9 +353,14 @@ Drupal.overlay.isAdminLink = function (url) { // Turn the list of administrative paths into a regular expression. if (!this.adminPathRegExp) { - var regExpPrefix = '^' + Drupal.settings.pathPrefix + '('; - var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$'; - var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$'; + var prefix = ''; + if (Drupal.settings.overlay.pathPrefixes.length) { + // Allow path prefixes used for language negatiation followed by slash, + // and the empty string. + prefix = '(' + Drupal.settings.overlay.pathPrefixes.join('/|') + '/|)'; + } + var adminPaths = '^' + prefix + '(' + Drupal.settings.overlay.paths.admin.replace(/\s+/g, '|') + ')$'; + var nonAdminPaths = '^' + prefix + '(' + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, '|') + ')$'; adminPaths = adminPaths.replace(/\*/g, '.*'); nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*'); this.adminPathRegExp = new RegExp(adminPaths); @@ -856,8 +860,13 @@ Drupal.overlay.getDisplacement = function (region) { if (lastDisplaced.length) { displacement = lastDisplaced.offset().top + lastDisplaced.outerHeight(); - // Remove height added by IE Shadow filter. - if (lastDisplaced[0].filters && lastDisplaced[0].filters.length && lastDisplaced[0].filters.item('DXImageTransform.Microsoft.Shadow')) { + // In modern browsers (including IE9), when box-shadow is defined, use the + // normal height. + var cssBoxShadowValue = lastDisplaced.css('box-shadow'); + var boxShadow = (typeof cssBoxShadowValue !== 'undefined' && cssBoxShadowValue !== 'none'); + // In IE8 and below, we use the shadow filter to apply box-shadow styles to + // the toolbar. It adds some extra height that we need to remove. + if (!boxShadow && /DXImageTransform\.Microsoft\.Shadow/.test(lastDisplaced.css('filter'))) { displacement -= lastDisplaced[0].filters.item('DXImageTransform.Microsoft.Shadow').strength; displacement = Math.max(0, displacement); } diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module index 7609033a7..6acc2603d 100644 --- a/modules/overlay/overlay.module +++ b/modules/overlay/overlay.module @@ -13,7 +13,7 @@ function overlay_help($path, $arg) { case 'admin/help#overlay': $output = ''; $output .= '<h3>' . t('About') . '</h3>'; - $output .= '<p>' . t('The Overlay module makes the administration pages on your site display in a JavaScript overlay of the page you were viewing when you clicked the administrative link, instead of replacing the page in your browser window. Use the close link on the overlay to return to the page you were viewing when you clicked the link. For more information, see the online handbook entry for <a href="@overlay">Overlay module</a>.', array('@overlay' => 'http://drupal.org/handbook/modules/overlay')) . '</p>'; + $output .= '<p>' . t('The Overlay module makes the administration pages on your site display in a JavaScript overlay of the page you were viewing when you clicked the administrative link, instead of replacing the page in your browser window. Use the close link on the overlay to return to the page you were viewing when you clicked the link. For more information, see the online handbook entry for <a href="@overlay">Overlay module</a>.', array('@overlay' => 'http://drupal.org/documentation/modules/overlay')) . '</p>'; return $output; } } @@ -202,7 +202,7 @@ function overlay_library() { // Overlay parent. $libraries['parent'] = array( 'title' => 'Overlay: Parent', - 'website' => 'http://drupal.org/handbook/modules/overlay', + 'website' => 'http://drupal.org/documentation/modules/overlay', 'version' => '1.0', 'js' => array( $module_path . '/overlay-parent.js' => array(), @@ -218,7 +218,7 @@ function overlay_library() { // Overlay child. $libraries['child'] = array( 'title' => 'Overlay: Child', - 'website' => 'http://drupal.org/handbook/modules/overlay', + 'website' => 'http://drupal.org/documentation/modules/overlay', 'version' => '1.0', 'js' => array( $module_path . '/overlay-child.js' => array(), @@ -641,6 +641,20 @@ function overlay_overlay_parent_initialize() { $type = str_replace('<front>', variable_get('site_frontpage', 'node'), $type); } drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); + $path_prefixes = array(); + if (module_exists('locale') && variable_get('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX) == LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX) { + // Get languages grouped by status and select only the enabled ones. + $languages = language_list('enabled'); + $languages = $languages[1]; + + $path_prefixes = array(); + foreach ($languages as $language) { + if ($language->prefix) { + $path_prefixes[] = $language->prefix; + } + } + } + drupal_add_js(array('overlay' => array('pathPrefixes' => $path_prefixes)), 'setting'); // Pass along the Ajax callback for rerendering sections of the parent window. drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting'); } |