diff --git a/core/CHANGELOG.txt b/core/CHANGELOG.txt index 33c3fa9..36b6029 100644 --- a/core/CHANGELOG.txt +++ b/core/CHANGELOG.txt @@ -42,6 +42,7 @@ Drupal 8.0, xxxx-xx-xx (development version) * Poll * Profile * Trigger +- Removed the Overlay module from core. - Removed the Garland theme from core. - Removed the Statistics module's accesslog functionality and reports from core. - Removed backwards-compatibility with 'magic_quotes_gpc'/'magic_quotes_runtime' diff --git a/core/MAINTAINERS.txt b/core/MAINTAINERS.txt index 2d797c9..0d50f46 100644 --- a/core/MAINTAINERS.txt +++ b/core/MAINTAINERS.txt @@ -311,9 +311,6 @@ Number module Options module - Yves Chedemois 'yched' http://drupal.org/user/39567 -Overlay module -- ? - Path module - ? diff --git a/core/misc/displace.js b/core/misc/displace.js index 32e4db3..0b6186a 100644 --- a/core/misc/displace.js +++ b/core/misc/displace.js @@ -17,10 +17,6 @@ */ Drupal.behaviors.drupalDisplace = { attach: function () { - // Do not process the window of the overlay. - if (parent.Drupal.overlay && parent.Drupal.overlay.iframeWindow === window) { - return; - } // Mark this behavior as processed on the first pass. if (this.displaceProcessed) { return; diff --git a/core/misc/tabbingmanager.js b/core/misc/tabbingmanager.js index f212a1d..9914233 100644 --- a/core/misc/tabbingmanager.js +++ b/core/misc/tabbingmanager.js @@ -7,12 +7,6 @@ "use strict"; -// Do not process the window of the overlay. -if (parent.Drupal.overlay && parent.Drupal.overlay.iframeWindow === window) { - return; -} - - /** * Provides an API for managing page tabbing order modifications. */ diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 8fa59ea..bec16a5 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -237,9 +237,7 @@ function block_page_build(&$page) { '#type' => 'link', '#title' => t('Exit block region demonstration'), '#href' => 'admin/structure/block' . (Drupal::config('system.theme')->get('default') == $theme ? '' : '/list/' . $theme), - // Add the "overlay-restore" class to indicate this link should restore - // the context in which the region demonstration page was opened. - '#options' => array('attributes' => array('class' => array('block-demo-backlink', 'overlay-restore'))), + '#options' => array('attributes' => array('class' => array('block-demo-backlink'))), '#weight' => -10, ); } @@ -585,7 +583,7 @@ function block_menu_delete($menu) { */ function block_admin_paths() { $paths = array( - // Exclude the block demonstration page from admin (overlay) treatment. + // Exclude the block demonstration page from admin treatment. // This allows us to present this page in its true form, full page. 'admin/structure/block/demo/*' => FALSE, ); diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index 527cc2b..bf2c6dd 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -133,9 +133,7 @@ function contextual_library_info() { 'title' => 'Contextual Links Toolbar Tab', 'version' => Drupal::VERSION, 'js' => array( - // Add the JavaScript, with a group and weight such that it will run - // before modules/overlay/overlay-parent.js. - $path . '/js/contextual.toolbar.js' => array('group' => JS_LIBRARY, 'weight' => -1), + $path . '/js/contextual.toolbar.js' => array('group' => JS_LIBRARY), ), 'css' => array( $path . '/css/contextual.toolbar.css' => array(), diff --git a/core/modules/contextual/js/contextual.toolbar.js b/core/modules/contextual/js/contextual.toolbar.js index f4a37f5..43e82f7 100644 --- a/core/modules/contextual/js/contextual.toolbar.js +++ b/core/modules/contextual/js/contextual.toolbar.js @@ -32,16 +32,6 @@ function initContextualToolbar (context) { new contextualToolbar.VisualView(viewOptions); new contextualToolbar.AuralView(viewOptions); - // Update the model based on overlay events. - $(document).on({ - 'drupalOverlayOpen.contextualToolbar': function () { - model.set('overlayIsOpen', true); - }, - 'drupalOverlayClose.contextualToolbar': function () { - model.set('overlayIsOpen', false); - } - }); - // Show the edit tab while there's >=1 contextual link. if (Drupal.contextual && Drupal.contextual.collection) { var contextualCollection = Drupal.contextual.collection; @@ -99,10 +89,8 @@ Drupal.contextualToolbar = { // Indicates whether the toggle is currently in "view" or "edit" mode. isViewing: true, // Indicates whether the toggle should be visible or hidden. Automatically - // calculated, depends on overlayIsOpen and contextualCount. + // calculated, depends on contextualCount. isVisible: false, - // Indicates whether the overlay is open or not. - overlayIsOpen: false, // Tracks how many contextual links exist on the page. contextualCount: 0, // A TabbingContext object as returned by Drupal.TabbingManager: the set @@ -110,8 +98,8 @@ Drupal.contextualToolbar = { tabbingContext: null }, initialize: function () { - this.on('change:overlayIsOpen change:contextualCount', function (model) { - model.set('isVisible', !model.get('overlayIsOpen') && model.get('contextualCount') > 0); + this.on('change:contextualCount', function (model) { + model.set('isVisible', model.get('contextualCount') > 0); }); } }), diff --git a/core/modules/overlay/css/overlay-child.css b/core/modules/overlay/css/overlay-child.css deleted file mode 100644 index 8162d5b..0000000 --- a/core/modules/overlay/css/overlay-child.css +++ /dev/null @@ -1,177 +0,0 @@ -/** - * @file - * Basic styling for the Overlay child pages. - */ - -html[dir="rtl"] { - direction: rtl; -} - -.js { - background: transparent !important; - overflow-y: scroll; -} -.js body { - background: transparent !important; - margin-left: 0; - margin-right: 0; - padding: 20px 0; -} - -#overlay { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - display: block; - margin: 0 auto; - max-width: 80em; - max-width: 80rem; - min-height: 100px; - position: relative; - padding: 2em 40px; - width: 100%; -} -#overlay-titlebar { - padding: 0 20px; - position: relative; - white-space: nowrap; - z-index: 100; -} -#overlay-content { - background: #fff; - clear: both; - color: #000; - padding: .5em 1em; - position: relative; -} - -#overlay-title-wrapper { - overflow: hidden; -} -#overlay-title { - color: #fff; - float: left; /* LTR */ - font-size: 20px; - margin: 0; - padding: 0.3em 0; -} -[dir="rtl"] #overlay-title { - float: right; - left: auto; -} -#overlay-title:active, -#overlay-title:focus { - outline: 0; -} -.overlay #skip-link a { - color: #fff; /* This is white to contrast with the dark background behind it. */ -} - -#overlay-close-wrapper { - position: absolute; - right: 0; /* LTR */ -} -[dir="rtl"] #overlay-close-wrapper { - left: 0; - right: auto; -} -#overlay-close, -#overlay-close:hover { - background: #ffffff url(../images/close.png) no-repeat; - border-radius: 0 12px 12px 0; /* LTR */ - display: block; - height: 26px; - margin: 0; - padding: 0; - /* Replace with position:fixed to get a scrolling close button. */ - position: absolute; - width: 26px; -} -[dir="rtl"] #overlay-close, -[dir="rtl"] #overlay-close:hover { - border-radius: 12px 0 0 12px; -} - -/** - * Tabs on the overlay. - */ -#overlay-tabs { - line-height: 26px; - margin: -28px 0 0 0; - position: absolute; - right: 20px; /* LTR */ - text-transform: uppercase; -} -[dir="rtl"] #overlay-tabs { - left: 20px; - right: auto; -} -#overlay-tabs li { - display: inline-block; - list-style: none; - margin: 0; - padding: 0; -} -#overlay-tabs li a, -#overlay-tabs li a:active, -#overlay-tabs li a:visited, -#overlay-tabs li a:hover { - background-color: #a6a7a2; - border-radius: 8px 8px 0 0; - color: #000; - display: inline-block; - font-size: 11px; - font-weight: bold; - margin: 0 1px; - outline: 0; - padding: 0 14px; - text-decoration: none; -} -#overlay-tabs li.active a, -#overlay-tabs li.active a.active, -#overlay-tabs li.active a:active, -#overlay-tabs li.active a:visited { - background-color: #fff; - margin-bottom: 0; - padding-bottom: 2px; -} -#overlay-tabs li a:focus, -#overlay-tabs li a:hover { - color: #fff; -} -#overlay-tabs li.active a:focus, -#overlay-tabs li.active a:hover { - color: #000; -} - -/** - * Add to shortcuts link - */ -#overlay-titlebar .add-or-remove-shortcuts { - padding-top: 0.6em; -} -#overlay-titlebar .add-or-remove-shortcuts .icon { - margin-top: 4px; -} -#overlay-titlebar .add-or-remove-shortcuts .text { - padding-top: 0; -} -/** - * Disable message. - */ -#overlay-disable-message { - background-color: #fff; - margin: 0 auto 20px; - width: 80%; - border-radius: 0 0 8px 8px; -} -.overlay-disable-message-focused { - padding: 0.5em; -} -.overlay-disable-message-focused a { - display: block; - float: left; -} -.overlay-disable-message-focused #overlay-dismiss-message { - float: right; -} diff --git a/core/modules/overlay/css/overlay-parent.css b/core/modules/overlay/css/overlay-parent.css deleted file mode 100644 index c036aa9..0000000 --- a/core/modules/overlay/css/overlay-parent.css +++ /dev/null @@ -1,55 +0,0 @@ - -/** - * @file - * Basic styling for the Overlay module. - */ - -html.overlay-open, -html.overlay-open body { - height: 100%; - overflow: hidden; -} - -#overlay-container, -.overlay-modal-background, -.overlay-element { - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; - z-index: 500; -} - -.overlay-modal-background { - /* Using a transparent png renders faster than using opacity */ - background: transparent url(../images/background.png) repeat; -} - -.overlay-element { - background: transparent; - left: -200%; - z-index: 501; -} -.overlay-element.overlay-active { - left: 0; -} - -html.overlay-open .displace-top, -html.overlay-open .displace-bottom { - z-index: 600; -} - -/** - * Within the overlay parent, the message about disabling the overlay is for - * screen-reader users only. It is always kept invisible with the - * visually-hidden class, and removed from the tab order. Overlay-child.css - * contains styling for the same message appearing within the overlay, and - * intended for sighted users. - */ -#overlay-disable-message { - display: none; -} -html.overlay-open #overlay-disable-message { - display: block; -} diff --git a/core/modules/overlay/images/background.png b/core/modules/overlay/images/background.png deleted file mode 100644 index 9be2193..0000000 Binary files a/core/modules/overlay/images/background.png and /dev/null differ diff --git a/core/modules/overlay/images/close.png b/core/modules/overlay/images/close.png deleted file mode 100644 index 44d2b6b..0000000 Binary files a/core/modules/overlay/images/close.png and /dev/null differ diff --git a/core/modules/overlay/lib/Drupal/overlay/Access/DismissMessageAccessCheck.php b/core/modules/overlay/lib/Drupal/overlay/Access/DismissMessageAccessCheck.php deleted file mode 100644 index 9e42716..0000000 --- a/core/modules/overlay/lib/Drupal/overlay/Access/DismissMessageAccessCheck.php +++ /dev/null @@ -1,43 +0,0 @@ -getRequirements()); - } - - /** - * {@inheritdoc} - */ - public function access(Route $route, Request $request) { - $account = $request->attributes->get('_account'); - if (!$account->hasPermission('access overlay')) { - return static::DENY; - } - // It's unlikely, but possible that "access overlay" permission is granted - // to the anonymous role. In this case, we do not display the message to - // disable the overlay, so there is nothing to dismiss. - if (!$account->id()) { - return static::DENY; - } - return static::ALLOW; - } - -} diff --git a/core/modules/overlay/lib/Drupal/overlay/Controller/OverlayController.php b/core/modules/overlay/lib/Drupal/overlay/Controller/OverlayController.php deleted file mode 100644 index 98d568b..0000000 --- a/core/modules/overlay/lib/Drupal/overlay/Controller/OverlayController.php +++ /dev/null @@ -1,77 +0,0 @@ -attributes->get('_account'); - - // @todo Integrate CSRF link token directly into routing system: http://drupal.org/node/1798296. - $token = $request->attributes->get('token'); - if (!isset($token) || !drupal_valid_token($token, 'overlay')) { - throw new AccessDeniedHttpException(); - } - $request->attributes->get('user.data')->set('overlay', $account->id(), 'message_dismissed', 1); - drupal_set_message(t('The message has been dismissed. You can change your overlay settings at any time by visiting your profile page.')); - // Destination is normally given. Go to the user profile as a fallback. - return new RedirectResponse(url('user/' . $account->id() . '/edit', array('absolute' => TRUE))); - } -} diff --git a/core/modules/overlay/lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php b/core/modules/overlay/lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php deleted file mode 100644 index 18a392b..0000000 --- a/core/modules/overlay/lib/Drupal/overlay/EventSubscriber/OverlaySubscriber.php +++ /dev/null @@ -1,191 +0,0 @@ -negotiation = $negotiation; - $this->userData = $user_data; - $this->urlGenerator = $url_generator; - } - - /** - * Performs check on the beginning of a request. - * - * Determine whether the current page request is destined to appear in the - * parent window or in the overlay window, and format the page accordingly. - * - * @see overlay_set_mode() - */ - public function onRequest(GetResponseEvent $event) { - $request = $event->getRequest(); - if ($this->negotiation->getContentType($request) != 'html') { - // Only act on html pages. - return; - } - global $user; - - $mode = overlay_get_mode(); - - // Only act if the user has access to the overlay and a mode was not already - // set. Other modules can also enable the overlay directly for other uses. - $user_data = $this->userData->get('overlay', $user->id(), 'enabled'); - $use_overlay = !isset($user_data) || $user_data; - if (empty($mode) && $user->hasPermission('access overlay') && $use_overlay) { - $current_path = $request->attributes->get('_system_path'); - // After overlay is enabled on the modules page, redirect to - // #overlay=admin/modules to actually enable the overlay. - if (isset($_SESSION['overlay_enable_redirect']) && $_SESSION['overlay_enable_redirect']) { - unset($_SESSION['overlay_enable_redirect']); - $url = $this->urlGenerator - ->generateFromPath('', array( - 'fragment' => 'overlay=' . $current_path, - 'absolute' => TRUE, - )); - $response = new RedirectResponse($url); - $event->setResponse($response); - } - - if ($request->query->get('render') == 'overlay') { - // If a previous page requested that we close the overlay, close it and - // redirect to the final destination. - if (isset($_SESSION['overlay_close_dialog'])) { - $response = call_user_func_array('overlay_close_dialog', $_SESSION['overlay_close_dialog']); - unset($_SESSION['overlay_close_dialog']); - $event->setResponse($response); - } - // If this page shouldn't be rendered inside the overlay, redirect to - // the parent. - elseif (!path_is_admin($current_path)) { - $response = overlay_close_dialog($current_path, array('query' => drupal_get_query_parameters(NULL, array('render')))); - $event->setResponse($response); - } - - // Indicate that we are viewing an overlay child page. - overlay_set_mode('child'); - - // Unset the render parameter to avoid it being included in URLs on the - // page. - $request->query->remove('render'); - } - // Do not enable the overlay if we already are on an admin page. - elseif (!path_is_admin($current_path)) { - // Otherwise add overlay parent code and our behavior. - overlay_set_mode('parent'); - } - } - } - - /** - * Performs end of request tasks. - * - * When viewing an overlay child page, check if we need to trigger a refresh of - * the supplemental regions of the overlay on the next page request. - */ - public function onResponse(FilterResponseEvent $event) { - // Check that we are in an overlay child page. - if (overlay_get_mode() == 'child') { - // Load any markup that was stored earlier in the page request, via calls - // to overlay_store_rendered_content(). If none was stored, this is not a - // page request where we expect any changes to the overlay supplemental - // regions to have occurred, so we do not need to proceed any further. - $original_markup = overlay_get_rendered_content(); - if (!empty($original_markup)) { - // Compare the original markup to the current markup that we get from - // rendering each overlay supplemental region now. If they don't match, - // something must have changed, so we request a refresh of that region - // within the parent window on the next page request. - foreach (overlay_supplemental_regions() as $region) { - if (!isset($original_markup[$region]) || $original_markup[$region] != overlay_render_region($region)) { - overlay_request_refresh($region); - } - } - } - $response = $event->getResponse(); - if ($response instanceOf RedirectResponse) { - $path = $response->getTargetUrl(); - // The authorize.php script bootstraps Drupal to a very low level, where - // the PHP code that is necessary to close the overlay properly will not - // be loaded. Therefore, if we are redirecting to authorize.php inside - // the overlay, instead redirect back to the current page with - // instructions to close the overlay there before redirecting to the - // final destination. - $options = array('absolute' => TRUE); - if ($path == system_authorized_get_url($options) || $path == system_authorized_batch_processing_url($options)) { - $_SESSION['overlay_close_dialog'] = array($path, $options); - $path = current_path(); - $options = drupal_get_query_parameters(); - } - - // If the current page request is inside the overlay, add ?render=overlay - // to the new path, so that it appears correctly inside the overlay. - if (isset($options['query'])) { - $options['query'] += array('render' => 'overlay'); - } - else { - $options['query'] = array('render' => 'overlay'); - } - $response->setTargetUrl($this->urlGenerator->generateFromPath($path, $options)); - } - } - } - - /** - * {@inheritdoc} - */ - static function getSubscribedEvents() { - $events[KernelEvents::REQUEST][] = array('onRequest'); - $events[KernelEvents::RESPONSE][] = array('onResponse'); - - return $events; - } -} diff --git a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlayCloseTest.php b/core/modules/overlay/lib/Drupal/overlay/Tests/OverlayCloseTest.php deleted file mode 100644 index 406755c..0000000 --- a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlayCloseTest.php +++ /dev/null @@ -1,61 +0,0 @@ - 'Overlay closing functionality', - 'description' => 'Test that the overlay can be correctly closed.', - 'group' => 'Overlay', - ); - } - - /** - * Tests that the overlay is correctly closed after creating a node. - */ - function testNodeCreation() { - // Make sure the node creation page is considered an administrative path - // (which will appear in the overlay). - $this->container->get('config.factory')->get('node.settings')->set('use_admin_theme', '1')->save(); - - // Create a content type and a user who has permission to create it inside - // the overlay. - $this->drupalCreateContentType(array('type' => 'test', 'name' => 'Test content type')); - $admin_user = $this->drupalCreateUser(array('access content', 'access overlay', 'create test content')); - $this->drupalLogin($admin_user); - - // Create a new node, with ?render=overlay in the query parameter to - // simulate creating it inside the overlay. - $this->drupalPostForm('node/add/test', array('title' => 'Test node title'), t('Save'), array('query' => array('render' => 'overlay'))); - - // Make sure a bare minimum HTML page is displayed that contains the - // JavaScript necessary to close the overlay. - $this->assertRaw('', 'An empty body tag is present on the page request after a node is created inside the overlay.'); - $this->assertRaw('"closeOverlay":true', 'The JavaScript setting for closing the overlay is present on the page request after a node is created inside the overlay.'); - - // Visit another page and make sure that we now see the message saying the - // node was created (i.e., that it does not appear inside the overlay where - // no one would have time to read it before the overlay closes). - $this->drupalGet(''); - $this->assertRaw(t('!post %title has been created.', array('!post' => 'Test content type', '%title' => 'Test node title')), 'Message about the node being created is displayed on the next page request after the overlay is closed.'); - } -} diff --git a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlayRenderTest.php b/core/modules/overlay/lib/Drupal/overlay/Tests/OverlayRenderTest.php deleted file mode 100644 index b32c4d6..0000000 --- a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlayRenderTest.php +++ /dev/null @@ -1,44 +0,0 @@ - 'Overlay child page rendering', - 'description' => 'Tests the rendering of a page in an overlay.', - 'group' => 'Overlay', - ); - } - - /** - * Tests the title of a page in an overlay. - */ - public function testOverlayTitle() { - $account = $this->drupalCreateUser(array('access overlay')); - $this->drupalLogin($account); - - $this->drupalGet('admin/test-render-title', array('query' => array('render' => 'overlay'))); - $result = $this->xpath('//h1[@id = "overlay-title"]'); - $this->assertEqual((string) $result[0], 'Foo'); - } - -} diff --git a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php b/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php deleted file mode 100644 index 7ae4b1f..0000000 --- a/core/modules/overlay/lib/Drupal/overlay/Tests/OverlaySettingTest.php +++ /dev/null @@ -1,46 +0,0 @@ - 'Overlay settings', - 'description' => 'Test that users can configure the overlay', - 'group' => 'Overlay', - ); - } - - /** - * Test that users can configure the overlay. - */ - function testNodeCreation() { - $user = $this->drupalCreateUser(array('access overlay')); - $this->drupalLogin($user); - - $this->drupalGet('user/' . $user->id() . '/edit'); - $this->assertFieldChecked('edit-overlay'); - $this->drupalPostForm(NULL, array('overlay' => FALSE), t('Save')); - $this->assertNoFieldChecked('edit-overlay'); - $this->assertFalse(\Drupal::service('user.data')->get('overlay', $user->id(), 'enabled'), 'Overlay disabled'); - - } -} diff --git a/core/modules/overlay/overlay-child.js b/core/modules/overlay/overlay-child.js deleted file mode 100644 index cd7cdee..0000000 --- a/core/modules/overlay/overlay-child.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @file - * Attaches the behaviors for the Overlay child pages. - */ - -(function ($) { - -"use strict"; - -/** - * Attach the child dialog behavior to new content. - */ -Drupal.behaviors.overlayChild = { - attach: function (context, settings) { - // Make sure this behavior is not processed more than once. - if (this.processed) { - return; - } - this.processed = true; - - // If we cannot reach the parent window, break out of the overlay. - if (!parent.Drupal || !parent.Drupal.overlay) { - window.location = window.location.href.replace(/([?&]?)render=overlay&?/g, '$1').replace(/\?$/, ''); - } - - settings = settings.overlayChild || {}; - - // If the entire parent window should be refreshed when the overlay is - // closed, pass that information to the parent window. - if (settings.refreshPage) { - parent.Drupal.overlay.refreshPage = true; - } - - // If a form has been submitted successfully, then the server side script - // may have decided to tell the parent window to close the popup dialog. - if (settings.closeOverlay) { - parent.Drupal.overlay.bindChild(window, true); - // Use setTimeout to close the child window from a separate thread, - // because the current one is busy processing Drupal behaviors. - setTimeout(function () { - if (typeof settings.redirect === 'string') { - parent.Drupal.overlay.redirect(settings.redirect); - } - else { - parent.Drupal.overlay.close(); - } - }, 1); - return; - } - - // If one of the regions displaying outside the overlay needs to be - // reloaded immediately, let the parent window know. - if (settings.refreshRegions) { - parent.Drupal.overlay.refreshRegions(settings.refreshRegions); - } - - // Ok, now we can tell the parent window we're ready. - parent.Drupal.overlay.bindChild(window); - - // IE8 crashes on certain pages if this isn't called; reason unknown. - window.scrollTo(window.scrollX, window.scrollY); - - // Attach child related behaviors to the iframe document. - Drupal.overlayChild.attachBehaviors(context, settings); - - // There are two links within the message that informs people about the - // overlay and how to disable it. Make sure both links are visible when - // either one has focus and add a class to the wrapper for styling purposes. - $(context).find('#overlay-disable-message') - .focusin(function () { - $(this).addClass('overlay-disable-message-focused') - .find('a.focusable').removeClass('visually-hidden'); - }) - .focusout(function () { - $(this).removeClass('overlay-disable-message-focused') - .find('a.focusable').addClass('visually-hidden'); - }); - } -}; - -/** - * Overlay object for child windows. - */ -Drupal.overlayChild = Drupal.overlayChild || { - behaviors: {} -}; - -Drupal.overlayChild.prototype = {}; - -/** - * Attach child related behaviors to the iframe document. - */ -Drupal.overlayChild.attachBehaviors = function (context, settings) { - var behavior, behaviors = this.behaviors; - for (behavior in behaviors) { - if (behaviors.hasOwnProperty(behavior)) { - behaviors[behavior](context, settings); - } - } -}; - -/** - * Capture and handle clicks. - * - * Instead of binding a click event handler to every link we bind one to the - * document and handle events that bubble up. This also allows other scripts - * to bind their own handlers to links and also to prevent overlay's handling. - */ -Drupal.overlayChild.behaviors.addClickHandler = function (context, settings) { - $(document).bind('click.drupal-overlay mouseup.drupal-overlay', $.proxy(parent.Drupal.overlay, 'eventhandlerOverrideLink')); -}; - -/** - * Modify forms depending on their relation to the overlay. - * - * By default, forms are assumed to keep the flow in the overlay. Thus their - * action attribute get a ?render=overlay suffix. - */ -Drupal.overlayChild.behaviors.parseForms = function (context, settings) { - $(context).find('form').once('overlay', function () { - // Obtain the action attribute of the form. - var action = $(this).attr('action'); - // Keep internal forms in the overlay. - if (typeof action === 'undefined' || (action.indexOf('http') !== 0 && action.indexOf('https') !== 0)) { - action += (action.indexOf('?') > -1 ? '&' : '?') + 'render=overlay'; - $(this).attr('action', action); - } - // Submit external forms into a new window. - else { - $(this).attr('target', '_new'); - } - }); -}; - -/** - * Replace the overlay title with a message while loading another page. - */ -Drupal.overlayChild.behaviors.loading = function (context, settings) { - var $title; - var text = Drupal.t('Loading'); - var dots = ''; - - $(document).bind('drupalOverlayBeforeLoad.drupal-overlay.drupal-overlay-child-loading', function () { - $title = $('#overlay-title').text(text); - setInterval(function () { - dots = (dots.length > 10) ? '' : dots + '.'; - $title.text(text + dots); - }, 500); - }); -}; - -/** - * Switch active tab immediately. - */ -Drupal.overlayChild.behaviors.tabs = function (context, settings) { - var $tabsLinks = $('#overlay-tabs > li > a'); - - $('#overlay-tabs > li > a').bind('click.drupal-overlay', function () { - var active_tab = Drupal.t('(active tab)'); - $tabsLinks.parent().siblings().removeClass('active').find('visually-hidden:contains(' + active_tab + ')').appendTo(this); - $(this).parent().addClass('active'); - }); -}; - -/** - * If the shortcut add/delete button exists, move it to the overlay titlebar. - */ -Drupal.overlayChild.behaviors.shortcutAddLink = function (context, settings) { - // Remove any existing shortcut button markup from the titlebar. - $('#overlay-titlebar').find('.add-or-remove-shortcuts').remove(); - // If the shortcut add/delete button exists, move it to the titlebar. - var $addToShortcuts = $('.add-or-remove-shortcuts'); - if ($addToShortcuts.length) { - $addToShortcuts.insertAfter('#overlay-title'); - } - - $(document).bind('drupalOverlayBeforeLoad.drupal-overlay.drupal-overlay-child-loading', function () { - $('#overlay-titlebar').find('.add-or-remove-shortcuts').remove(); - }); -}; - -Drupal.overlayChild.behaviors.bindDrupalViewportOffsetChangeEvent = function (context, settings) { - // Workaround because of the way jQuery events works. - // jQuery from the parent frame needs to be used to catch this event. - parent.jQuery(parent.document).on('drupalViewportOffsetChange', function (event, offsets) { - // Fires an event that the child iframe can listen to. - $(document).trigger('drupalViewportOffsetChange', offsets); - }); -}; - -})(jQuery); diff --git a/core/modules/overlay/overlay-parent.js b/core/modules/overlay/overlay-parent.js deleted file mode 100644 index 4f45299..0000000 --- a/core/modules/overlay/overlay-parent.js +++ /dev/null @@ -1,878 +0,0 @@ -/** - * @file - * Attaches the behaviors for the Overlay parent pages. - */ - -(function ($, Drupal, displace) { - -"use strict"; - -/** - * Open the overlay, or load content into it, when an admin link is clicked. - */ -Drupal.behaviors.overlayParent = { - attach: function (context, settings) { - if (this.processed) { - return; - } - this.processed = true; - - $(window) - // When the hash (URL fragment) changes, open the overlay if needed. - .bind('hashchange.drupal-overlay', $.proxy(Drupal.overlay, 'eventhandlerOperateByURLFragment')) - // Trigger the hashchange handler once, after the page is loaded, so that - // permalinks open the overlay. - .triggerHandler('hashchange.drupal-overlay'); - - // Do not use the overlay on devices with low screen width. - // @todo Replace with conditional loading. - if(!Drupal.checkWidthBreakpoint()) { - return; - } - - $(document) - // Instead of binding a click event handler to every link we bind one to - // the document and only handle events that bubble up. This allows other - // scripts to bind their own handlers to links and also to prevent - // overlay's handling. - .bind('click.drupal-overlay mouseup.drupal-overlay', $.proxy(Drupal.overlay, 'eventhandlerOverrideLink')); - } -}; - -/** - * Overlay object for parent windows. - * - * Events - * Overlay triggers a number of events that can be used by other scripts. - * - drupalOverlayOpen: This event is triggered when the overlay is opened. - * - drupalOverlayBeforeClose: This event is triggered when the overlay attempts - * to close. If an event handler returns false, the close will be prevented. - * - drupalOverlayClose: This event is triggered when the overlay is closed. - * - drupalOverlayBeforeLoad: This event is triggered right before a new URL - * is loaded into the overlay. - * - drupalOverlayReady: This event is triggered when the DOM of the overlay - * child document is fully loaded. - * - drupalOverlayLoad: This event is triggered when the overlay is finished - * loading. - * - drupalOverlayResize: This event is triggered when the overlay is being - * resized to match the parent window. - */ -Drupal.overlay = Drupal.overlay || { - isOpen: false, - isOpening: false, - isClosing: false, - isLoading: false -}; - -Drupal.overlay.prototype = {}; - -/** - * Open the overlay. - * - * @param url - * The URL of the page to open in the overlay. - * - * @return - * TRUE if the overlay was opened, FALSE otherwise. - */ -Drupal.overlay.open = function (url) { - // Just one overlay is allowed. - if (this.isOpen || this.isOpening) { - return this.load(url); - } - this.isOpening = true; - // Store the original document title. - this.originalTitle = document.title; - - // Create the dialog and related DOM elements. - this.create(); - - this.isOpening = false; - this.isOpen = true; - $(document.documentElement).addClass('overlay-open'); - - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayOpen'); - - return this.load(url); -}; - -/** - * Create the underlying markup and behaviors for the overlay. - */ -Drupal.overlay.create = function () { - // Update offsets values on the page. - displace(false); - - // Build the overlay container. - this.$container = $(Drupal.theme('overlayContainer')) - .appendTo(document.body); - - // Overlay uses transparent iframes that cover the full parent window. - // When the overlay is open the scrollbar of the parent window is hidden. - // Because some browsers show a white iframe background for a short moment - // while loading a page into an iframe, overlay uses two iframes. By loading - // the page in a hidden (inactive) iframe the user doesn't see the white - // background. When the page is loaded the active and inactive iframes - // are switched. - this.activeFrame = this.$iframeA = $(Drupal.theme('overlayElement')) - .appendTo(this.$container); - - this.inactiveFrame = this.$iframeB = $(Drupal.theme('overlayElement')) - .appendTo(this.$container); - - this.$iframeA.bind('load.drupal-overlay', { self: this.$iframeA[0], sibling: this.$iframeB }, $.proxy(this, 'loadChild')); - this.$iframeB.bind('load.drupal-overlay', { self: this.$iframeB[0], sibling: this.$iframeA }, $.proxy(this, 'loadChild')); - - // Add a second class "drupal-overlay-open" to indicate these event handlers - // should only be bound when the overlay is open. - var eventClass = '.drupal-overlay.drupal-overlay-open'; - $(window) - .bind('resize' + eventClass, $.proxy(this, 'eventhandlerOuterResize')); - $(document) - .bind('drupalViewportOffsetChange' + eventClass, $.proxy(this, 'eventhandlerViewportOffsetChange')) - .bind('drupalOverlayLoad' + eventClass, $.proxy(this, 'eventhandlerOuterResize')) - .bind('drupalOverlayReady' + eventClass + - ' drupalOverlayClose' + eventClass, $.proxy(this, 'eventhandlerSyncURLFragment')) - .bind('drupalOverlayClose' + eventClass, $.proxy(this, 'eventhandlerRefreshPage')) - .bind('drupalOverlayBeforeClose' + eventClass + - ' drupalOverlayBeforeLoad' + eventClass + - ' drupalOverlayResize' + eventClass, $.proxy(this, 'eventhandlerDispatchEvent')); - - $(document) - .bind('drupalOverlayResize' + eventClass, $.proxy(this, 'eventhandlerAlterDisplacedElements')) - .bind('drupalOverlayClose' + eventClass, $.proxy(this, 'eventhandlerRestoreDisplacedElements')); -}; - -/** - * Load the given URL into the overlay iframe. - * - * Use this method to change the URL being loaded in the overlay if it is - * already open. - * - * @return - * TRUE if URL is loaded into the overlay, FALSE otherwise. - */ -Drupal.overlay.load = function (url) { - if (!this.isOpen) { - return false; - } - - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayBeforeLoad'); - - $(document.documentElement).addClass('overlay-loading'); - - // The contentDocument property is not supported in IE until IE8. - var iframeDocument = this.inactiveFrame[0].contentDocument || this.inactiveFrame[0].contentWindow.document; - - // location.replace doesn't create a history entry. location.href does. - // In this case, we want location.replace, as we're creating the history - // entry using URL fragments. - iframeDocument.location.replace(url); - - return true; -}; - -/** - * Close the overlay and remove markup related to it from the document. - * - * @return - * TRUE if the overlay was closed, FALSE otherwise. - */ -Drupal.overlay.close = function () { - // Prevent double execution when close is requested more than once. - if (!this.isOpen || this.isClosing) { - return false; - } - - // Allow other scripts to respond to this event. - var event = $.Event('drupalOverlayBeforeClose'); - $(document).trigger(event); - // If a handler returned false, the close will be prevented. - if (event.isDefaultPrevented()) { - return false; - } - - this.isClosing = true; - this.isOpen = false; - $(document.documentElement).removeClass('overlay-open'); - // Restore the original document title. - document.title = this.originalTitle; - - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayClose'); - - Drupal.announce(Drupal.t('Tabbing is no longer constrained by the Overlay module.')); - - // When the iframe is still loading don't destroy it immediately but after - // the content is loaded (see Drupal.overlay.loadChild). - if (!this.isLoading) { - this.destroy(); - this.isClosing = false; - } - return true; -}; - -/** - * Destroy the overlay. - */ -Drupal.overlay.destroy = function () { - $([document, window]).unbind('.drupal-overlay-open'); - this.$container.remove(); - - this.$container = null; - this.$iframeA = null; - this.$iframeB = null; - - this.iframeWindow = null; -}; - -/** - * Redirect the overlay parent window to the given URL. - * - * @param url - * Can be an absolute URL or a relative link to the domain root. - */ -Drupal.overlay.redirect = function (url) { - // Create a native Link object, so we can use its object methods. - var link = $(url.link(url)).get(0); - - // If the link is already open, force the hashchange event to simulate reload. - if (window.location.href === link.href) { - $(window).triggerHandler('hashchange.drupal-overlay'); - } - - window.location.href = link.href; - return true; -}; - -/** - * Bind the child window. - * - * Note that this function is fired earlier than Drupal.overlay.loadChild. - */ -Drupal.overlay.bindChild = function (iframeWindow, isClosing) { - this.iframeWindow = iframeWindow; - - // We are done if the child window is closing. - if (isClosing || this.isClosing || !this.isOpen) { - return; - } - - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayReady'); -}; - -/** - * Event handler: load event handler for the overlay iframe. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: load - * - event.currentTarget: iframe - */ -Drupal.overlay.loadChild = function (event) { - var iframe = event.data.self; - var iframeDocument = iframe.contentDocument || iframe.contentWindow.document; - var iframeWindow = iframeDocument.defaultView || iframeDocument.parentWindow; - if (iframeWindow.location.href === 'about:blank') { - return; - } - - this.isLoading = false; - $(document.documentElement).removeClass('overlay-loading'); - event.data.sibling.removeClass('overlay-active').prop({ 'tabindex': -1 }); - - // Only continue when overlay is still open and not closing. - if (this.isOpen && !this.isClosing) { - // And child document is an actual overlayChild. - if (iframeWindow.Drupal && iframeWindow.Drupal.overlayChild) { - // Replace the document title with title of iframe. - document.title = iframeWindow.document.title; - - this.activeFrame = $(iframe) - .addClass('overlay-active') - // Add a title attribute to the iframe for accessibility. - .attr('title', Drupal.t('@title dialog', { '@title': iframeWindow.jQuery('#overlay-title').text() })).prop('tabindex', false); - this.inactiveFrame = event.data.sibling; - - Drupal.announce(Drupal.t('The overlay has been opened to @title', {'@title': iframeWindow.jQuery('#overlay-title').text()})); - - // Load an empty document into the inactive iframe. - (this.inactiveFrame[0].contentDocument || this.inactiveFrame[0].contentWindow.document).location.replace('about:blank'); - - // Create a fake link before the skip link in order to give it focus. - var skipLink = iframeWindow.jQuery('[href="#main-content"]'); - Drupal.overlay.setFocusBefore(skipLink, iframeWindow.document); - - // Report these tabbables to the TabbingManger in the parent window. - Drupal.overlay.releaseTabbing(); - Drupal.overlay.constrainTabbing($(iframeWindow.document).add('#toolbar-administration')); - - Drupal.announce(Drupal.t('Tabbing is constrained to items in the administrative toolbar and the overlay.')); - - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayLoad'); - } - else { - window.location = iframeWindow.location.href.replace(/([?&]?)render=overlay&?/g, '$1').replace(/\?$/, ''); - } - } - else { - this.destroy(); - } -}; - -/** - * Creates a placeholder element to receive document focus. - * - * Setting the document focus to a link will make it visible, even if it's a - * "skip to main content" link that should normally be visible only when the - * user tabs to it. This function can be used to set the document focus to - * just before such an invisible link. - * - * @param $element - * The jQuery element that should receive focus on the next tab press. - * @param document - * The iframe window element to which the placeholder should be added. The - * placeholder element has to be created inside the same iframe as the element - * it precedes, to keep IE happy. (http://bugs.jquery.com/ticket/4059) - */ -Drupal.overlay.setFocusBefore = function ($element, document) { - // Create an anchor inside the placeholder document. - var placeholder = document.createElement('a'); - var $placeholder = $(placeholder).addClass('visually-hidden').attr('href', '#'); - // Put the placeholder where it belongs, and set the document focus to it. - $placeholder.insertBefore($element); - $placeholder.attr('autofocus', true); - // Make the placeholder disappear as soon as it loses focus, so that it - // doesn't appear in the tab order again. - $placeholder.one('blur', function () { - $(this).remove(); - }); -}; - -/** - * Check if the given link is in the administrative section of the site. - * - * @param url - * The URL to be tested. - * - * @return boolean - * TRUE if the URL represents an administrative link, FALSE otherwise. - */ -Drupal.overlay.isAdminLink = function (url) { - if (Drupal.overlay.isExternalLink(url)) { - return false; - } - - var path = this.getPath(url); - - // Turn the list of administrative paths into a regular expression. - if (!this.adminPathRegExp) { - 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); - this.nonAdminPathRegExp = new RegExp(nonAdminPaths); - } - - return this.adminPathRegExp.exec(path) && !this.nonAdminPathRegExp.exec(path); -}; - -/** - * Determine whether a link is external to the site. - * - * @param url - * The URL to be tested. - * - * @return boolean - * TRUE if the URL is external to the site, FALSE otherwise. - */ -Drupal.overlay.isExternalLink = function (url) { - var re = new RegExp('^((f|ht)tps?:)?//(?!' + window.location.host + ')'); - return re.test(url); -}; - -/** - * Responds to the drupalViewportOffsetChange event. - * - * @param object event - * A jQuery event object. - * - * @param object offsets - * An object whose keys are the for sides an element -- top, right, bottom - * and left. The value of each key is the viewport displacement distance for - * that edge. - */ -Drupal.overlay.eventhandlerViewportOffsetChange = function (event, offsets) { - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayResize'); -}; - -/** - * Event handler: resizes overlay according to the size of the parent window. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: any - * - event.currentTarget: any - */ -Drupal.overlay.eventhandlerOuterResize = function (event) { - // Proceed only if the overlay still exists. - if (!(this.isOpen || this.isOpening) || this.isClosing || !this.iframeWindow) { - return; - } - - // IE6 uses position:absolute instead of position:fixed. - if (typeof document.body.style.maxHeight !== 'string') { - this.activeFrame.height($(window).height()); - } - - // Allow other scripts to respond to this event. - $(document).trigger('drupalOverlayResize'); -}; - -/** - * Event handler: resizes displaced elements so they won't overlap the scrollbar - * of overlay's iframe. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: any - * - event.currentTarget: any - */ -Drupal.overlay.eventhandlerAlterDisplacedElements = function (event) { - // Proceed only if the overlay still exists. - if (!(this.isOpen || this.isOpening) || this.isClosing || !this.iframeWindow) { - return; - } - - var offsets = displace.offsets; - - // Move the body of the iframe contentDocument inward a sufficient distance - // to prevent it from appearing underneath displacing elements like the - // toolbar. - var iframeBody = this.iframeWindow.document.body; - $(iframeBody).css({ - 'padding-top': offsets.top, - 'padding-right': offsets.right, - 'padding-bottom': offsets.bottom, - 'padding-left': offsets.left - }); - // Trigger a repaint. - iframeBody.style.display = 'none'; - iframeBody.style.display = 'block'; - - // Constrain the width of offsetting top and bottom elements, such as the - // toolbar, so that a scroll in the overlay iframe won't be occluded. - var iframeBodyWidth = iframeBody.clientWidth; - if (iframeBodyWidth > 0 && iframeBodyWidth < document.documentElement.clientWidth) { - $('[data-offset-top], [data-offset-bottom]').css('max-width', iframeBodyWidth); - } -}; - -/** - * Event handler: restores size of displaced elements as they were before - * overlay was opened. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: any - * - event.currentTarget: any - */ -Drupal.overlay.eventhandlerRestoreDisplacedElements = function (event) { - $('[data-offset-top], [data-offset-bottom]').css('max-width', 'none'); -}; - -/** - * Event handler: overrides href of administrative links to be opened in - * the overlay. - * - * This click event handler should be bound to any document (for example the - * overlay iframe) of which you want links to open in the overlay. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: click, mouseup - * - event.currentTarget: document - * - * @see Drupal.overlayChild.behaviors.addClickHandler - */ -Drupal.overlay.eventhandlerOverrideLink = function (event) { - // In some browsers the click event isn't fired for right-clicks. Use the - // mouseup event for right-clicks and the click event for everything else. - if ((event.type === 'click' && event.button === 2) || (event.type === 'mouseup' && event.button !== 2)) { - return; - } - - var $target = $(event.target); - - // Only continue if clicked target (or one of its parents) is a link. - if (!$target.is('a')) { - $target = $target.closest('a'); - if (!$target.length) { - return; - } - } - - // Never open links in the overlay that contain the overlay-exclude class. - if ($target.hasClass('overlay-exclude')) { - return; - } - - // Close the overlay when the link contains the overlay-close class. - if ($target.hasClass('overlay-close')) { - // Clearing the overlay URL fragment will close the overlay. - $.bbq.removeState('overlay'); - return; - } - - var target = $target[0]; - var href = target.href; - // Only handle links that have an href attribute and use the HTTP(S) protocol. - if (typeof href !== 'undefined' && href !== '' && (/^https?\:/).test(target.protocol)) { - var anchor = href.replace(target.ownerDocument.location.href, ''); - // Skip anchor links. - if (anchor.length === 0 || anchor.charAt(0) === '#') { - return; - } - // Open admin links in the overlay. - else if (this.isAdminLink(href)) { - // If the link contains the overlay-restore class and the overlay-context - // state is set, also update the parent window's location. - var parentLocation = ($target.hasClass('overlay-restore') && typeof $.bbq.getState('overlay-context') === 'string') ? Drupal.url($.bbq.getState('overlay-context')) : null; - href = this.fragmentizeLink($target.get(0), parentLocation); - // Only override default behavior when left-clicking and user is not - // pressing the ALT, CTRL, META (Command key on the Macintosh keyboard) - // or SHIFT key. - if (event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { - // Redirect to a fragmentized href. This will trigger a hashchange event. - this.redirect(href); - // Prevent default action and further propagation of the event. - return false; - } - // Otherwise alter clicked link's href. This is being picked up by - // the default action handler. - else { - $target - // Restore link's href attribute on blur or next click. - .one('blur mousedown', { target: target, href: target.href }, function (event) { $(event.data.target).attr('href', event.data.href); }) - .attr('href', href); - } - } - // Non-admin links should close the overlay and open in the main window, - // which is the default action for a link. We only need to handle them - // if the overlay is open and the clicked link is inside the overlay iframe. - else if (this.isOpen && target.ownerDocument === this.iframeWindow.document) { - // Open external links in the immediate parent of the frame, unless the - // link already has a different target. - if (target.hostname !== window.location.hostname) { - if (!$target.attr('target')) { - $target.attr('target', '_parent'); - } - } - else { - // Add the overlay-context state to the link, so "overlay-restore" links - // can restore the context. - // Leave links with an existing fragment alone. Adding an extra - // parameter to a link like "node/1#section-1" breaks the link. - if (!$target[0].hash) { - // For links with no existing fragment, add the overlay context. - $target.attr('href', $.param.fragment(href, { 'overlay-context': this.getPath(window.location) + window.location.search })); - } - - // When the link has a destination query parameter and that destination - // is an admin link we need to fragmentize it. This will make it reopen - // in the overlay. - var params = $.deparam.querystring(href); - if (params.destination && this.isAdminLink(params.destination)) { - var fragmentizedDestination = $.param.fragment(this.getPath(window.location), { overlay: params.destination }); - $target.attr('href', $.param.querystring(href, { destination: fragmentizedDestination })); - } - - // Make the link open in the immediate parent of the frame, unless the - // link already has a different target. - if (!$target.attr('target')) { - $target.attr('target', '_parent'); - } - } - } - } -}; - -/** - * Event handler: opens or closes the overlay based on the current URL fragment. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: hashchange - * - event.currentTarget: document - */ -Drupal.overlay.eventhandlerOperateByURLFragment = function (event) { - // If we changed the hash to reflect an internal redirect in the overlay, - // its location has already been changed, so don't do anything. - if ($.data(window.location, window.location.href) === 'redirect') { - $.data(window.location, window.location.href, null); - return; - } - - // Get the overlay URL from the current URL fragment. - var state = $.bbq.getState('overlay'); - if (state) { - // Append render variable, so the server side can choose the right - // rendering and add child frame code to the page if needed. - var url = $.param.querystring(Drupal.url(state), { render: 'overlay' }); - - this.open(url); - this.resetActiveClass(this.getPath(url)); - } - // If there is no overlay URL in the fragment and the overlay is (still) - // open, close the overlay. - else if (this.isOpen && !this.isClosing) { - this.close(); - this.resetActiveClass(this.getPath(window.location)); - } -}; - -/** - * Event handler: makes sure the internal overlay URL is reflected in the parent - * URL fragment. - * - * Normally the parent URL fragment determines the overlay location. However, if - * the overlay redirects internally, the parent doesn't get informed, and the - * parent URL fragment will be out of date. This is a sanity check to make - * sure we're in the right place. - * - * The parent URL fragment is also not updated automatically when overlay's - * open, close or load functions are used directly (instead of through - * eventhandlerOperateByURLFragment). - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: drupalOverlayReady, drupalOverlayClose - * - event.currentTarget: document - */ -Drupal.overlay.eventhandlerSyncURLFragment = function (event) { - if (this.isOpen) { - var expected = $.bbq.getState('overlay'); - // This is just a sanity check, so we're comparing paths, not query strings. - if (this.getPath(Drupal.url(expected)) !== this.getPath(this.iframeWindow.document.location)) { - // There may have been a redirect inside the child overlay window that the - // parent wasn't aware of. Update the parent URL fragment appropriately. - var newLocation = Drupal.overlay.fragmentizeLink(this.iframeWindow.document.location); - // Set a 'redirect' flag on the new location so the hashchange event handler - // knows not to change the overlay's content. - $.data(window.location, newLocation, 'redirect'); - // Use location.replace() so we don't create an extra history entry. - window.location.replace(newLocation); - } - } - else { - $.bbq.removeState('overlay'); - } -}; - -/** - * Event handler: if the child window suggested that the parent refresh on - * close, force a page refresh. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: drupalOverlayClose - * - event.currentTarget: document - */ -Drupal.overlay.eventhandlerRefreshPage = function (event) { - if (Drupal.overlay.refreshPage) { - window.location.reload(true); - } -}; - -/** - * Event handler: dispatches events to the overlay document. - * - * @param event - * Event being triggered, with the following restrictions: - * - event.type: any - * - event.currentTarget: any - */ -Drupal.overlay.eventhandlerDispatchEvent = function (event) { - if (this.iframeWindow && this.iframeWindow.document) { - this.iframeWindow.jQuery(this.iframeWindow.document).trigger(event); - } -}; - -/** - * Make a regular admin link into a URL that will trigger the overlay to open. - * - * @param link - * A JavaScript Link object (i.e. an element). - * @param parentLocation - * (optional) URL to override the parent window's location with. - * - * @return - * A URL that will trigger the overlay (in the form - * /node/1#overlay=admin/config). - */ -Drupal.overlay.fragmentizeLink = function (link, parentLocation) { - // Don't operate on links that are already overlay-ready. - var params = $.deparam.fragment(link.href); - if (params.overlay) { - return link.href; - } - - // Determine the link's original destination. - var path = this.getPath(link); - // Preserve existing query and fragment parameters in the URL, except for - // "render=overlay" which is re-added in Drupal.overlay.eventhandlerOperateByURLFragment. - var destination = path + link.search.replace(/&?render=overlay/, '').replace(/\?$/, '') + link.hash; - - // Assemble and return the overlay-ready link. - return $.param.fragment(parentLocation || window.location.href, { overlay: destination }); -}; - -/** - * Refresh a specific region. - * - * @param regionName - * Name of the region. - * @param regionSelector - * CSS selector for the region. - */ -function refreshRegion(regionName, regionSelector) { - var $region = $(regionSelector); - Drupal.detachBehaviors($region); - $.get(Drupal.url(Drupal.settings.overlay.ajaxCallback + '/' + regionName), function (newElement) { - $region.replaceWith($(newElement)); - Drupal.attachBehaviors($region, Drupal.settings); - }); -} - -/** - * Refresh any regions of the page that are displayed outside the overlay. - * - * @param data - * An array of objects with information on the page regions to be refreshed. - * For each object, the key is a CSS class identifying the region to be - * refreshed, and the value represents the section of the Drupal $page array - * corresponding to this region. - */ -Drupal.overlay.refreshRegions = function (data) { - var region, region_info, regionClass; - for (region in data) { - if (data.hasOwnProperty(region)) { - region_info = data[region]; - for (regionClass in region_info) { - if (region_info.hasOwnProperty(regionClass)) { - refreshRegion(region_info[regionClass], '.' + regionClass); - } - } - } - } -}; - -/** - * Reset the active class on links in displaced elements according to - * given path. - * - * @param activePath - * Path to match links against. - */ -Drupal.overlay.resetActiveClass = function(activePath) { - var self = this; - var windowDomain = window.location.protocol + window.location.hostname; - - $('#toolbar-administration') - .find('a[href]') - // Remove active class from all links in displaced elements. - .removeClass('active') - // Add active class to links that match activePath. - .each(function () { - var linkDomain = this.protocol + this.hostname; - var linkPath = self.getPath(this); - - // A link matches if it is part of the active trail of activePath, except - // for frontpage links. - if (linkDomain === windowDomain && (activePath + '/').indexOf(linkPath + '/') === 0 && (linkPath !== '' || activePath === '')) { - $(this).addClass('active'); - } - }); -}; - -/** - * Helper function to get the (corrected) Drupal path of a link. - * - * @param link - * Link object or string to get the Drupal path from. - * - * @return - * The Drupal path. - */ -Drupal.overlay.getPath = function (link) { - if (typeof link === 'string') { - // Create a native Link object, so we can use its object methods. - link = $(link.link(link)).get(0); - } - - var path = link.pathname; - // Ensure a leading slash on the path, omitted in some browsers. - if (path.charAt(0) !== '/') { - path = '/' + path; - } - path = path.replace(new RegExp(Drupal.settings.basePath + Drupal.settings.scriptPath), ''); - - return path; -}; - -/** - * Makes elements outside the overlay unreachable via the tab key. - */ -Drupal.overlay.constrainTabbing = function ($tabbables) { - // If a tabset is already active, return without creating a new one. - if (this.tabset && !this.tabset.released) { - return; - } - // Leave links inside the overlay and toolbars alone. - this.tabset = Drupal.tabbingManager.constrain($tabbables); - var self = this; - $(document).on('drupalOverlayClose.tabbing', function () { - self.tabset.release(); - $(document).off('drupalOverlayClose.tabbing'); - }); -}; - -/** - * - */ -Drupal.overlay.releaseTabbing = function () { - if (this.tabset) { - this.tabset.release(); - delete this.tabset; - } -}; - -$.extend(Drupal.theme, { - /** - * Theme function to create the overlay iframe element. - */ - overlayContainer: function () { - return '
'; - }, - - /** - * Theme function to create an overlay iframe element. - */ - overlayElement: function (url) { - return ''; - } -}); - -})(jQuery, Drupal, Drupal.displace); diff --git a/core/modules/overlay/overlay.api.php b/core/modules/overlay/overlay.api.php deleted file mode 100644 index bc23546..0000000 --- a/core/modules/overlay/overlay.api.php +++ /dev/null @@ -1,40 +0,0 @@ -#overlay=admin/modules on hook_init(). - $_SESSION['overlay_enable_redirect'] = 1; - } -} - -/** - * Implements hook_update_dependencies(). - */ -function overlay_update_dependencies() { - // Migrate users.data after User module prepared the tables. - $dependencies['overlay'][8000] = array( - 'user' => 8016, - ); - return $dependencies; -} - -/** - * Migrate {users}.data into {users_data}. - */ -function overlay_update_8000() { - $query = db_select('_d7_users_data', 'ud'); - $query->condition('name', 'overlay'); - $query->addField('ud', 'uid'); - $query->addExpression("'overlay'", 'module'); - $query->addExpression("'enabled'", 'name'); - $query->addField('ud', 'value', 'value'); - $query->addExpression(1, 'serialized'); - - db_insert('users_data') - ->from($query) - ->execute(); - - // Migrate 'overlay_message_dismissed'. - $query = db_select('_d7_users_data', 'ud'); - $query->condition('name', 'overlay_message_dismissed'); - $query->addField('ud', 'uid'); - $query->addExpression("'overlay'", 'module'); - $query->addExpression("'message_dismissed'", 'name'); - $query->addField('ud', 'value', 'value'); - $query->addExpression(1, 'serialized'); - - db_insert('users_data') - ->from($query) - ->execute(); - - db_delete('_d7_users_data') - ->condition('name', array('overlay', 'overlay_message_dismissed')) - ->execute(); -} diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module deleted file mode 100644 index 3788535..0000000 --- a/core/modules/overlay/overlay.module +++ /dev/null @@ -1,838 +0,0 @@ -' . t('About') . ''; - $output .= '

' . 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 Overlay module.', array('@overlay' => 'http://drupal.org/documentation/modules/overlay')) . '

'; - return $output; - } -} - -/** - * Implements hook_admin_paths(). - */ -function overlay_admin_paths() { - $paths = array( - // This is marked as an administrative path so that if it is visited from - // within the overlay, the user will stay within the overlay while the - // callback is being processed. - 'overlay/dismiss-message' => TRUE, - ); - return $paths; -} - -/** - * Implements hook_permission(). - */ -function overlay_permission() { - return array( - 'access overlay' => array( - 'title' => t('Access the administrative overlay'), - 'description' => t('View administrative pages in the overlay.'), - ), - ); -} - -/** - * Implements hook_theme(). - */ -function overlay_theme() { - return array( - 'overlay' => array( - 'render element' => 'page', - 'template' => 'overlay', - ), - 'overlay_disable_message' => array( - 'render element' => 'element', - 'template' => 'overlay-disable-message', - ), - ); -} - -/** - * Implements hook_field_extra_fields(). - */ -function overlay_field_extra_fields() { - $fields['user']['user']['form']['overlay_control'] = array( - 'label' => t('Administrative overlay'), - 'description' => t('Overlay module form element.'), - 'weight' => 4, - ); - return $fields; -} - -/** - * Implements hook_form_FORM_ID_alter(). - */ -function overlay_form_user_form_alter(&$form, &$form_state) { - $account = $form_state['controller']->getEntity(); - if ($account->hasPermission('access overlay')) { - $account_data = Drupal::service('user.data')->get('overlay', $account->id(), 'enabled'); - $form['overlay_control'] = array( - '#type' => 'details', - '#title' => t('Administrative overlay'), - '#weight' => 4, - ); - $form['overlay_control']['overlay'] = array( - '#type' => 'checkbox', - '#title' => t('Use the overlay for administrative pages.'), - '#description' => t('Show administrative pages on top of the page you started from.'), - '#default_value' => isset($account_data) ? $account_data : 1, - ); - $form['actions']['submit']['#submit'][] = 'overlay_user_profile_form_submit'; - } -} - -/** - * Submit callback for the user profile form to save the overlay page setting. - */ -function overlay_user_profile_form_submit($form, &$form_state) { - $account = $form_state['controller']->getEntity(); - if ($account->id() && isset($form_state['values']['overlay'])) { - Drupal::service('user.data')->set('overlay', $account->id(), 'enabled', (int) $form_state['values']['overlay']); - } -} - -/** - * Implements hook_library_info(). - */ -function overlay_library_info() { - $module_path = drupal_get_path('module', 'overlay'); - - // Overlay parent. - $libraries['drupal.overlay.parent'] = array( - 'title' => 'Overlay: Parent', - 'website' => 'http://drupal.org/documentation/modules/overlay', - 'version' => '1.0', - 'js' => array( - $module_path . '/overlay-parent.js' => array(), - ), - 'css' => array( - $module_path . '/css/overlay-parent.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.displace'), - array('system', 'drupal.tabbingmanager'), - array('system', 'drupal.announce'), - array('system', 'jquery.ui.core'), - array('system', 'jquery.bbq'), - ), - ); - // Overlay child. - $libraries['drupal.overlay.child'] = array( - 'title' => 'Overlay: Child', - 'website' => 'http://drupal.org/documentation/modules/overlay', - 'version' => '1.0', - 'js' => array( - $module_path . '/overlay-child.js' => array(), - ), - 'css' => array( - $module_path . '/css/overlay-child.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} - -/** - * Implements hook_batch_alter(). - * - * If the current page request is inside the overlay, add ?render=overlay to - * the success callback URL, so that it appears correctly within the overlay. - * - * @see overlay_get_mode() - */ -function overlay_batch_alter(&$batch) { - if (overlay_get_mode() == 'child') { - if (isset($batch['url_options']['query'])) { - $batch['url_options']['query']['render'] = 'overlay'; - } - else { - $batch['url_options']['query'] = array('render' => 'overlay'); - } - } -} - -/** - * Implements hook_page_alter(). - */ -function overlay_page_alter(&$page) { - // If we are limiting rendering to a subset of page regions, deny access to - // all other regions so that they will not be processed. - if ($regions_to_render = overlay_get_regions_to_render()) { - $skipped_regions = array_diff(element_children($page), $regions_to_render); - foreach ($skipped_regions as $skipped_region) { - $page[$skipped_region]['#access'] = FALSE; - } - } - - $mode = overlay_get_mode(); - if ($mode == 'child') { - // Add the overlay wrapper before the html wrapper. - array_unshift($page['#theme_wrappers'], 'overlay'); - } - elseif ($mode == 'parent' && ($message = overlay_disable_message())) { - $page['page_top']['disable_overlay'] = $message; - } -} - -/** - * Returns a renderable array representing a message for disabling the overlay. - * - * If the current user can access the overlay and has not previously indicated - * that this message should be dismissed, this function returns a message - * containing a link to disable the overlay. Nothing is returned for anonymous - * users, because the links control per-user settings. Because some screen - * readers are unable to properly read overlay contents, site builders are - * discouraged from granting the "access overlay" permission to the anonymous - * role. - * - * @see http://drupal.org/node/890284 - */ -function overlay_disable_message() { - global $user; - - $build = array(); - if ($user->isAnonymous() || !$user->hasPermission('access overlay')) { - return $build; - } - - $user_data = Drupal::service('user.data')->get('overlay', $user->id()); - if (empty($user_data['message_dismissed']) && (!isset($user_data['enabled']) || $user_data['enabled'])) { - $build = array( - '#theme' => 'overlay_disable_message', - '#weight' => -99, - // Link to the user's profile page, where the overlay can be disabled. - 'profile_link' => array( - '#type' => 'link', - '#title' => t('If you have problems accessing administrative pages on this site, disable the overlay on your profile page.'), - '#href' => 'user/' . $user->id() . '/edit', - '#options' => array( - 'query' => drupal_get_destination(), - 'fragment' => 'edit-overlay-control', - 'attributes' => array( - 'id' => 'overlay-profile-link', - // Prevent the target page from being opened in the overlay. - 'class' => array('overlay-exclude'), - ), - ), - ), - // Link to a menu callback that allows this message to be permanently - // dismissed for the current user. - 'dismiss_message_link' => array( - '#type' => 'link', - '#title' => t('Dismiss this message.'), - '#href' => 'overlay/dismiss-message', - '#options' => array( - 'query' => drupal_get_destination() + array( - // Add a token to protect against cross-site request forgeries. - 'token' => drupal_get_token('overlay'), - ), - 'attributes' => array( - 'id' => 'overlay-dismiss-message', - // If this message is being displayed outside the overlay, prevent - // this link from opening the overlay. - 'class' => (overlay_get_mode() == 'parent') ? array('overlay-exclude') : array(), - ), - ), - ) - ); - } - - return $build; -} - -/** - * Prepares variables for overlay disable message templates. - * - * Default template: overlay-disable-message.html.twig. - * - * @param array $variables - * An associative array with an 'element' element, which itself is an - * associative array containing: - * - profile_link: The link to this user's account. - * - dismiss_message_link: The link to dismiss the overlay. - */ -function template_preprocess_overlay_disable_message(&$variables) { - $element = $variables['element']; - - // Add CSS classes to hide the links from most sighted users, while keeping - // them accessible to screen-reader users and keyboard-only users. To assist - // screen-reader users, this message appears in both the parent and child - // documents, but only the one in the child document is part of the tab order. - foreach (array('profile_link', 'dismiss_message_link') as $key) { - $element[$key]['#options']['attributes']['class'][] = 'visually-hidden'; - if (overlay_get_mode() == 'child') { - $element[$key]['#options']['attributes']['class'][] = 'focusable'; - } - } - - $variables['profile_link'] = $element['profile_link']; - $variables['dismiss_link'] = $element['dismiss_message_link']; -} - -/** - * Implements hook_block_access(). - */ -function overlay_block_access(Block $block, $operation, AccountInterface $account, $langcode) { - // If we are limiting rendering to a subset of page regions, hide all blocks - // which appear in regions not on that list. Note that overlay_page_alter() - // does a more comprehensive job of preventing unwanted regions from being - // displayed (regardless of whether they contain blocks or not), but the - // reason for duplicating effort here is performance; we do not even want - // these blocks to be built if they are not going to be displayed. - if ($regions_to_render = overlay_get_regions_to_render()) { - if (!in_array($block->get('region'), $regions_to_render)) { - return FALSE; - } - } -} - -/** - * Implements hook_system_info_alter(). - * - * Add default regions for the overlay. - */ -function overlay_system_info_alter(&$info, $file, $type) { - if ($type == 'theme') { - $info['overlay_regions'][] = 'content'; - $info['overlay_regions'][] = 'help'; - } -} - -/** - * Implements hook_preprocess_HOOK() for html.tpl.php. - * - * If the current page request is inside the overlay, add appropriate classes - * to the element, and simplify the page title. - * - * @see overlay_get_mode() - */ -function overlay_preprocess_html(&$variables) { - if (overlay_get_mode() == 'child') { - // Add overlay class, so themes can react to being displayed in the overlay. - $variables['attributes']['class'][] = 'overlay'; - } -} - -/** - * Implements hook_preprocess_HOOK() for maintenance-page.html.twig. - * - * If the current page request is inside the overlay, add appropriate classes - * to the element, and simplify the page title. - */ -function overlay_preprocess_maintenance_page(&$variables) { - overlay_preprocess_html($variables); -} - -/** - * Implements template_preprocess_HOOK() for overlay.tpl.php - * - * If the current page request is inside the overlay, add appropriate classes - * to the element, and simplify the page title. - * - * @see overlay.tpl.php - */ -function template_preprocess_overlay(&$variables) { - $variables['tabs'] = menu_primary_local_tasks(); - - if (isset($variables['page']['#title'])) { - $variables['title'] = $variables['page']['#title']; - } - else { - $variables['title'] = new RenderWrapper('drupal_get_title'); - } - $variables['disable_overlay'] = overlay_disable_message(); - - // Add attributes for the overlay container. - $variables['attributes']['id'] = 'overlay'; - $variables['attributes']['class'][] = 'overlay'; - // Add attributes for the overlay title. - $variables['title_attributes']['id'] = 'overlay-title'; - // Add attributes for the overlay content. - $variables['content_attributes']['id'] = 'overlay-content'; - $variables['content_attributes']['class'][] = 'clearfix'; -} - -/** - * Implements hook_preprocess_HOOK() for page.tpl.php. - * - * If the current page request is inside the overlay, hide the tabs. - * - * @see overlay_get_mode() - */ -function overlay_preprocess_page(&$variables) { - if (overlay_get_mode() == 'child') { - unset($variables['tabs']['#primary']); - } -} - -/** - * Prints an empty page. - * - * This function is used to print out a bare minimum empty page which still has - * the scripts and styles necessary in order to trigger the overlay to close. - * - * It can be used to prevent a page request which closes the overlay (for - * example, a form submission) from being fully re-rendered before the overlay - * is closed, thereby allowing the dialog to be closed faster and with less - * interruption, and also allowing the display of messages to be deferred to - * the parent window (rather than displaying them in the child window, which - * will close before the user has had a chance to read them). - * - * @return \Symfony\Component\HttpFoundation\Response - * A Response object. - */ -function overlay_deliver_empty_page() { - $empty_page = '' . drupal_get_css() . drupal_get_js() . ''; - return new Response($empty_page); -} - -/** - * Gets the current overlay mode. - * - * @see overlay_set_mode() - */ -function overlay_get_mode() { - return overlay_set_mode(NULL); -} - -/** - * Sets the overlay mode and adds proper JavaScript and styles to the page. - * - * Note that since setting the overlay mode triggers a variety of behaviors - * (including hooks being invoked), it can only be done once per page request. - * Therefore, the first call to this function which passes along a value of the - * $mode parameter controls the overlay mode that will be used. - * - * @param $mode - * To set the mode, pass in one of the following values: - * - 'parent': This is used in the context of a parent window (a regular - * browser window). If set, JavaScript is added so that administrative - * links in the parent window will open in an overlay. - * - 'child': This is used in the context of the child overlay window (the - * page actually appearing within the overlay iframe). If set, JavaScript - * and CSS are added so that Drupal behaves nicely from within the overlay. - * - 'none': This is used to avoid adding any overlay-related code to the - * page at all. Modules can set this to explicitly prevent the overlay from - * being used. For example, since the overlay module itself sets the mode - * to 'parent' or 'child' in the overlay event subscriber when certain - * conditions are met, other modules which want to override that behavior - * can do so by setting the mode to 'none' earlier in the page request - - * e.g., in their own event subscribers, if they have a higher priority. - * This parameter is optional, and if omitted, the current mode will be - * returned with no action taken. - * - * @return - * The current mode, if any has been set, or NULL if no mode has been set. - * - * @ingroup overlay_api - * @see \Drupal\overlay\EventSubscriber\OverlaySubscriber::onRequest() - */ -function overlay_set_mode($mode = NULL) { - global $base_path; - // We're not using drupal_static() here since the static cache is reset in - // drupal_flush_all_caches(); this could lead to the loss of the overlay when - // submitting the admin/modules form, for instance. - static $overlay_mode; - - // Make sure external resources are not included more than once. Also return - // the current mode, if no mode was specified. - if (isset($overlay_mode) || !isset($mode)) { - return $overlay_mode; - } - $overlay_mode = $mode; - - switch ($overlay_mode) { - case 'parent': - drupal_add_library('overlay', 'drupal.overlay.parent'); - - // Allow modules to act upon overlay events. - Drupal::moduleHandler()->invokeAll('overlay_parent_initialize'); - break; - - case 'child': - drupal_add_library('overlay', 'drupal.overlay.child'); - - // Allow modules to act upon overlay events. - Drupal::moduleHandler()->invokeAll('overlay_child_initialize'); - break; - } - return $overlay_mode; -} - -/** - * Implements hook_overlay_parent_initialize(). - */ -function overlay_overlay_parent_initialize() { - // Let the client side know which paths are administrative. - $paths = path_get_admin_paths(); - foreach ($paths as &$type) { - $type = str_replace('', Drupal::config('system.site')->get('page.front'), $type); - } - drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); - $path_prefixes = array(); - if (module_exists('language')) { - language_negotiation_include(); - if (Drupal::config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) { - // Skip the empty string indicating the default language. We always accept - // paths without a prefix. - $path_prefixes = language_negotiation_url_prefixes(); - $path_prefixes = array_values(array_filter($path_prefixes)); - } - } - 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'); -} - -/** - * Implements hook_overlay_child_initialize(). - */ -function overlay_overlay_child_initialize() { - // Check if the parent window needs to refresh any page regions on this page - // request. - overlay_trigger_refresh(); - // If this is a POST request, or a GET request with a token parameter, we - // have an indication that something in the supplemental regions of the - // overlay might change during the current page request. We therefore store - // the initial rendered content of those regions here, so that we can compare - // it to the same content rendered in OverlaySubscriber::onResponse(), - // at the end of the page request. This allows us to check if anything - // actually did change, and, if so, trigger an immediate Ajax refresh - // of the parent window. - $token = Drupal::request()->query->get('token'); - $post = Drupal::request()->request->count(); - if (!empty($post) || isset($token)) { - foreach (overlay_supplemental_regions() as $region) { - overlay_store_rendered_content($region, overlay_render_region($region)); - } - // In addition, notify the parent window that when the overlay closes, - // the entire parent window should be refreshed. - overlay_request_page_refresh(); - } - // Indicate that when the main page rendering occurs later in the page - // request, only the regions that appear within the overlay should be - // rendered. - overlay_set_regions_to_render(overlay_regions()); -} - -/** - * Immediately returns HTML to to the browser and closes the overlay. - * - * @param $redirect - * (optional) The path that should open in the parent window after the - * overlay closes. If not set, no redirect will be performed on the parent - * window. - * - * @param $redirect_options - * (optional) An associative array of options to use when generating the - * redirect URL. - * - * @return \Symfony\Component\HttpFoundation\Response - * A Response object. - * - * @todo This function should only request that the overlay close when the page - * is displayed (as it did in Drupal 7), not immediately end the request. - */ -function overlay_close_dialog($redirect = NULL, $redirect_options = array()) { - $settings = array( - 'overlayChild' => array( - 'closeOverlay' => TRUE, - ), - ); - - // Tell the child window to perform the redirection when requested to. - if (isset($redirect)) { - $settings['overlayChild']['redirect'] = url($redirect, $redirect_options); - } - - drupal_add_js($settings, array('type' => 'setting')); - - // Since we are closing the overlay as soon as the page is displayed, we do - // not want to show any of the page's actual content. - return overlay_deliver_empty_page(); -} - -/** - * Returns a list of page regions that appear in the overlay. - * - * Overlay regions correspond to the entire contents of the overlay child - * window and are refreshed each time a new page request is made within the - * overlay. - * - * @return - * An array of region names that correspond to those which appear in the - * overlay, within the theme that is being used to display the current page. - * - * @see overlay_supplemental_regions() - */ -function overlay_regions() { - return _overlay_region_list('overlay_regions'); -} - -/** - * Returns a list of supplemental page regions for the overlay. - * - * Supplemental overlay regions are those which are technically part of the - * parent window, but appear to the user as being related to the overlay - * (usually because they are displayed next to, rather than underneath, the - * main overlay regions) and therefore need to be dynamically refreshed if any - * administrative actions taken within the overlay change their contents. - * - * An example of a typical overlay supplemental region would be the 'page_top' - * region, in the case where a toolbar is being displayed there. - * - * @return - * An array of region names that correspond to supplemental overlay regions, - * within the theme that is being used to display the current page. - * - * @see overlay_regions() - */ -function overlay_supplemental_regions() { - return _overlay_region_list('overlay_supplemental_regions'); -} - -/** - * Returns a list of page regions related to the overlay. - * - * @param $type - * The type of regions to return. This can either be 'overlay_regions' or - * 'overlay_supplemental_regions'. - * - * @return - * An array of region names of the given type, within the theme that is being - * used to display the current page. - * - * @see overlay_regions() - * @see overlay_supplemental_regions() - */ -function _overlay_region_list($type) { - // Obtain the current theme. We need to first make sure the theme system is - // initialized, since this function can be called early in the page request. - drupal_theme_initialize(); - $themes = list_themes(); - $theme = $themes[$GLOBALS['theme']]; - // Return the list of regions stored within the theme's info array, or an - // empty array if no regions of the appropriate type are defined. - return !empty($theme->info[$type]) ? $theme->info[$type] : array(); -} - -/** - * Returns a list of page regions that rendering should be limited to. - * - * @return - * An array containing the names of the regions that will be rendered when - * drupal_render_page() is called. If empty, then no limits will be imposed, - * and all regions of the page will be rendered. - * - * @see overlay_page_alter() - * @see overlay_block_access() - * @see overlay_set_regions_to_render() - */ -function overlay_get_regions_to_render() { - return overlay_set_regions_to_render(); -} - -/** - * Sets the regions of the page that rendering will be limited to. - * - * @param $regions - * (Optional) An array containing the names of the regions that should be - * rendered when drupal_render_page() is called. Pass in an empty array to - * remove all limits and cause drupal_render_page() to render all page - * regions (the default behavior). If this parameter is omitted, no change - * will be made to the current list of regions to render. - * - * @return - * The current list of regions to render, or an empty array if the regions - * are not being limited. - * - * @see overlay_page_alter() - * @see overlay_block_access() - * @see overlay_get_regions_to_render() - */ -function overlay_set_regions_to_render($regions = NULL) { - $regions_to_render = &drupal_static(__FUNCTION__, array()); - if (isset($regions)) { - $regions_to_render = $regions; - } - return $regions_to_render; -} - -/** - * Renders an individual page region. - * - * This function is primarily intended to be used for checking the content of - * supplemental overlay regions (e.g., a region containing a toolbar). Passing - * in a region that is intended to display the main page content is not - * supported; the region will be rendered by this function, but the main page - * content will not appear in it. In addition, although this function returns - * the rendered HTML for the provided region, it does not place it on the final - * page, nor add any of its associated JavaScript or CSS to the page. - * - * @param $region - * The name of the page region that should be rendered. - * - * @return - * The rendered HTML of the provided region. - */ -function overlay_render_region($region) { - // Indicate the region that we will be rendering, so that other regions will - // be hidden by overlay_page_alter() and overlay_block_access(). - overlay_set_regions_to_render(array($region)); - // Do what is necessary to force drupal_render_page() to only display HTML - // from the requested region. Specifically, declare that the main page - // content does not need to automatically be added to the page, and pass in - // a page array that has all theme functions removed (so that overall HTML - // for the page will not be added either). - $system_main_content_added = &drupal_static('system_main_content_added'); - $system_main_content_added = TRUE; - $page = array( - '#type' => 'page', - '#theme' => NULL, - '#theme_wrappers' => array(), - ); - // Render the region, but do not cache any JavaScript or CSS associated with - // it. This region might not be included the next time drupal_render_page() - // is called, and we do not want its JavaScript or CSS to erroneously appear - // on the final rendered page. - $original_js = drupal_add_js(); - $original_css = drupal_add_css(); - $original_libraries = drupal_static('drupal_add_library'); - $js = &drupal_static('drupal_add_js'); - $css = &drupal_static('drupal_add_css'); - $libraries = &drupal_static('drupal_add_library'); - $markup = drupal_render_page($page); - $js = $original_js; - $css = $original_css; - $libraries = $original_libraries; - // Indicate that the main page content has not, in fact, been displayed, so - // that future calls to drupal_render_page() will be able to render it - // correctly. - $system_main_content_added = FALSE; - // Restore the original behavior of rendering all regions for the next time - // drupal_render_page() is called. - overlay_set_regions_to_render(array()); - return $markup; -} - -/** - * Returns any rendered content that was stored earlier in the page request. - * - * @return - * An array of all rendered HTML that was stored earlier in the page request, - * keyed by the identifier with which it was stored. If no content was - * stored, an empty array is returned. - * - * @see overlay_store_rendered_content() - */ -function overlay_get_rendered_content() { - return overlay_store_rendered_content(); -} - -/** - * Stores strings representing rendered HTML content. - * - * This function is used to keep a static cache of rendered content that can be - * referred to later in the page request. - * - * @param $id - * (Optional) An identifier for the content which is being stored, which will - * be used as an array key in the returned array. If omitted, no change will - * be made to the current stored data. - * @param $content - * (Optional) A string representing the rendered data to store. This only has - * an effect if $id is also provided. - * - * @return - * An array representing all data that is currently being stored, or an empty - * array if there is none. - * - * @see overlay_get_rendered_content() - */ -function overlay_store_rendered_content($id = NULL, $content = NULL) { - $rendered_content = &drupal_static(__FUNCTION__, array()); - if (isset($id)) { - $rendered_content[$id] = $content; - } - return $rendered_content; -} - -/** - * Requests that the parent window refreshes a particular page region. - * - * @param $region - * The name of the page region to refresh. The parent window will trigger a - * refresh of this region on the next page load. - * - * @see overlay_trigger_refresh() - * @see Drupal.overlay.refreshRegions() - */ -function overlay_request_refresh($region) { - $class = drupal_html_class("region-$region"); - $_SESSION['overlay_regions_to_refresh'][] = array($class => $region); -} - -/** - * Requests that the entire parent window is reloaded when the overlay closes. - * - * @see overlay_trigger_refresh() - */ -function overlay_request_page_refresh() { - $_SESSION['overlay_refresh_parent'] = TRUE; -} - -/** - * Checks if the parent window needs to be refreshed on this page load. - * - * If the previous page load requested that any page regions be refreshed, or - * if it requested that the entire page be refreshed when the overlay closes, - * pass that request via JavaScript to the child window, so it can in turn pass - * the request to the parent window. - * - * @see overlay_request_refresh() - * @see overlay_request_page_refresh() - * @see Drupal.overlay.refreshRegions() - */ -function overlay_trigger_refresh() { - if (!empty($_SESSION['overlay_regions_to_refresh'])) { - $settings = array( - 'overlayChild' => array( - 'refreshRegions' => $_SESSION['overlay_regions_to_refresh'], - ), - ); - drupal_add_js($settings, array('type' => 'setting')); - unset($_SESSION['overlay_regions_to_refresh']); - } - if (!empty($_SESSION['overlay_refresh_parent'])) { - drupal_add_js(array('overlayChild' => array('refreshPage' => TRUE)), array('type' => 'setting')); - unset($_SESSION['overlay_refresh_parent']); - } -} diff --git a/core/modules/overlay/overlay.routing.yml b/core/modules/overlay/overlay.routing.yml deleted file mode 100644 index 50bc120..0000000 --- a/core/modules/overlay/overlay.routing.yml +++ /dev/null @@ -1,13 +0,0 @@ -overlay_message: - pattern: '/overlay/dismiss-message' - defaults: - _controller: '\Drupal\overlay\Controller\OverlayController::overlayMessage' - requirements: - _access_overlay_dismiss_message: 'TRUE' - -overlay_ajax: - pattern: '/overlay-ajax/{region}' - defaults: - _controller: '\Drupal\overlay\Controller\OverlayController::regionRender' - requirements: - _permission: 'access overlay' diff --git a/core/modules/overlay/overlay.services.yml b/core/modules/overlay/overlay.services.yml deleted file mode 100644 index aed4378..0000000 --- a/core/modules/overlay/overlay.services.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - overlay.subscriber: - class: Drupal\overlay\EventSubscriber\OverlaySubscriber - tags: - - { name: event_subscriber } - arguments: ['@content_negotiation', '@user.data', '@url_generator'] - - access_check.overlay.dismiss_message: - class: Drupal\overlay\Access\DismissMessageAccessCheck - tags: - - { name: access_check } diff --git a/core/modules/overlay/templates/overlay-disable-message.html.twig b/core/modules/overlay/templates/overlay-disable-message.html.twig deleted file mode 100644 index d5891a3..0000000 --- a/core/modules/overlay/templates/overlay-disable-message.html.twig +++ /dev/null @@ -1,18 +0,0 @@ -{# -/** - * @file - * Default theme implementation for the message about disabling the overlay. - * - * Available variables: - * - profile_link: The link to this user's account. - * - dismiss_link: The link to dismiss the overlay. - * - * @see template_preprocess_overlay_disable_message() - * - * @ingroup themeable - */ -#} -
-

{{ 'Options for the administrative overlay'|t }}

- {{ profile_link }} {{ dismiss_link }} -
diff --git a/core/modules/overlay/templates/overlay.html.twig b/core/modules/overlay/templates/overlay.html.twig deleted file mode 100644 index 732bc33..0000000 --- a/core/modules/overlay/templates/overlay.html.twig +++ /dev/null @@ -1,37 +0,0 @@ -{# -/** - * @file - * Default theme implementation to display a page in the overlay. - * - * Available variables: - * - attributes: HTML attributes for the containing element. - * - content_attributes: HTML attributes for the content. - * - title_attributes: HTML attributes for the title. - * - title: The (sanitized) title of the page. - * - page: The rendered page content. - * - tabs: Tabs linking to any sub-pages beneath the current page (e.g., the - * view and edit tabs when displaying a node). - * - disable_overlay: The message about how to disable the overlay. - * - * @see template_preprocess_overlay() - * - * @ingroup themeable - */ -#} -{{ disable_overlay }} - -
-
- {{ title }} -
- - {% if tabs %} -

{{ 'Primary tabs'|t }}

    {{ tabs }}
- {% endif %} -
- - {{ page }} - - diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php index 7457533..623e536 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php @@ -125,10 +125,6 @@ public function testFilledStandardUpgrade() { $this->assertEqual(unserialize($userdata[1]['contact']['enabled']->value), 1); $this->assertEqual($userdata[1]['contact']['enabled']->serialized, 1); $this->assertEqual(unserialize($userdata[2]['contact']['enabled']->value), 0); - $this->assertEqual(unserialize($userdata[1]['overlay']['enabled']->value), 1); - $this->assertEqual(unserialize($userdata[2]['overlay']['enabled']->value), 1); - $this->assertEqual(unserialize($userdata[1]['overlay']['message_dismissed']->value), 1); - $this->assertFalse(isset($userdata[2]['overlay']['message_dismissed'])); // Make sure that only the garbage is remaining in the helper table. $this->assertEqual(db_query('SELECT COUNT(*) FROM {_d7_users_data}')->fetchField(), 2); diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index d366e01..b61da09 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -51,8 +51,7 @@ function hook_hook_info() { * * Modules may specify whether or not the paths they define in hook_menu() are * to be considered administrative. Other modules may use this information to - * display those pages differently (e.g. in a modal overlay, or in a different - * theme). + * display those pages differently. * * To change the administrative status of menu items defined in another module's * hook_menu(), modules should implement hook_admin_paths_alter(). @@ -3343,16 +3342,7 @@ function hook_token_info_alter(&$data) { * @ingroup batch */ function hook_batch_alter(&$batch) { - // If the current page request is inside the overlay, add ?render=overlay to - // the success callback URL, so that it appears correctly within the overlay. - if (overlay_get_mode() == 'child') { - if (isset($batch['url_options']['query'])) { - $batch['url_options']['query']['render'] = 'overlay'; - } - else { - $batch['url_options']['query'] = array('render' => 'overlay'); - } - } + /* TODO replace */ } /** diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 10bc48d..1c704a8 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1157,7 +1157,7 @@ function system_library_info() { // A utility that measures and reports viewport offset dimensions from // elements like the toolbar that can potentially displace the positioning of - // elements like the overlay. + // elements. $libraries['drupal.displace'] = array( 'title' => 'Drupal displace', 'version' => Drupal::VERSION, diff --git a/core/modules/system/tests/upgrade/drupal-7.user_data.database.php b/core/modules/system/tests/upgrade/drupal-7.user_data.database.php index d55f4bf..a2f7d46 100644 --- a/core/modules/system/tests/upgrade/drupal-7.user_data.database.php +++ b/core/modules/system/tests/upgrade/drupal-7.user_data.database.php @@ -16,8 +16,6 @@ ->fields(array( 'data' => serialize(array( 'contact' => 1, - 'overlay_message_dismissed' => '1', - 'overlay' => '1', 'garbage' => 'data', )), )) @@ -28,7 +26,6 @@ ->fields(array( 'data' => serialize(array( 'contact' => '0', - 'overlay' => 1, 'more' => array('garbage', 'data'), )), )) diff --git a/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js index 344abe6..904cfe2 100644 --- a/core/modules/toolbar/js/toolbar.js +++ b/core/modules/toolbar/js/toolbar.js @@ -92,15 +92,6 @@ Drupal.behaviors.toolbar = { // Update the model when the viewport offset changes. .on('drupalViewportOffsetChange.toolbar', function (event, offsets) { model.set('offsets', offsets); - }) - // The overlay will hide viewport overflow, potentially stranding tray - // items that are offscreen. The toolbar will adjust tray presentation - // to prevent this when viewport overflow is hidden. - .on('drupalOverlayOpen.toolbar', function () { - model.set('isViewportOverflowConstrained', true); - }) - .on('drupalOverlayClose.toolbar', function () { - model.set('isViewportOverflowConstrained', false); }); // Broadcast model changes to other modules. @@ -196,9 +187,9 @@ Drupal.toolbar = { // Indicates whether the toolbar is positioned absolute (false) or fixed // (true). isFixed: false, - // If the viewport overflow becomes constrained, such as when the overlay - // is open, isFixed must be true so that elements in the trays aren't - // lost offscreen and impossible to get to. + // If the viewport overflow becomes constrained, isFixed must be true so + // that elements in the trays aren't lost off-screen and impossible to + // get to. isViewportOverflowConstrained: false, // The orientation of the active tray. orientation: 'vertical', diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 43ad735..244c05a 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -387,8 +387,7 @@ function theme_toolbar_tray_heading_wrapper(&$variables) { * is an overlay supplemental region that should be refreshed whenever its * content is updated. * - * This information is provided for any module that might need to use it, not - * just the core Overlay module. + * This information is provided for any module that might need to use it. */ function toolbar_system_info_alter(&$info, $file, $type) { if ($type == 'theme') { diff --git a/core/modules/tour/js/tour.js b/core/modules/tour/js/tour.js index 86357e7..cdd9e9b 100644 --- a/core/modules/tour/js/tour.js +++ b/core/modules/tour/js/tour.js @@ -28,33 +28,6 @@ Drupal.behaviors.tour = { model: model }); - // Update the model based on Overlay events. - $(document) - // Overlay is opening: cancel tour if active and mark overlay as open. - .on('drupalOverlayOpen.tour', function () { - model.set({ isActive: false, overlayIsOpen: true }); - }) - // Overlay is loading a new URL: clear tour & cancel if active. - .on('drupalOverlayBeforeLoad.tour', function () { - model.set({ isActive: false, overlayTour: [] }); - }) - // Overlay is closing: clear tour & cancel if active, mark overlay closed. - .on('drupalOverlayClose.tour', function () { - model.set({ isActive: false, overlayIsOpen: false, overlayTour: [] }); - }) - // Overlay has loaded DOM: check whether a tour is available. - .on('drupalOverlayReady.tour', function () { - // We must select the tour in the Overlay's window using the Overlay's - // jQuery, because the joyride plugin only works for the window in which - // it was loaded. - // @todo Make upstream contribution so this can be simplified, which - // should also allow us to *not* load jquery.joyride.js in the Overlay, - // resulting in better front-end performance. - var overlay = Drupal.overlay.iframeWindow; - var $overlayContext = overlay.jQuery(overlay.document); - model.set('overlayTour', $overlayContext.find('ol#tour')); - }); - model // Allow other scripts to respond to tour events. .on('change:isActive', function (model, isActive) { @@ -82,10 +55,6 @@ Drupal.tour.models.StateModel = Backbone.Model.extend({ defaults: { // Indicates whether the Drupal root window has a tour. tour: [], - // Indicates whether the Overlay is open. - overlayIsOpen: false, - // Indicates whether the Overlay window has a tour. - overlayTour: [], // Indicates whether the tour is currently running. isActive: false, // Indicates which tour is the active one (necessary to cleanly stop). @@ -104,7 +73,7 @@ Drupal.tour.views.ToggleTourView = Backbone.View.extend({ * Implements Backbone Views' initialize(). */ initialize: function () { - this.model.on('change:tour change:overlayTour change:overlayIsOpen change:isActive', this.render, this); + this.model.on('change:tour change:isActive', this.render, this); this.model.on('change:isActive', this.toggleTour, this); }, @@ -159,8 +128,7 @@ Drupal.tour.views.ToggleTourView = Backbone.View.extend({ * A jQuery element pointing to a
    containing tour items. */ _getTour: function () { - var whichTour = (this.model.get('overlayIsOpen')) ? 'overlayTour' : 'tour'; - return this.model.get(whichTour); + return this.model.get('tour'); }, /** @@ -168,12 +136,10 @@ Drupal.tour.views.ToggleTourView = Backbone.View.extend({ * * @return jQuery * A jQuery element pointing to the document within which a tour would be - * started given the current state. I.e. when the Overlay is open, this will - * point to the HTML document inside the Overlay's iframe, otherwise it will - * point to the Drupal root window. + * started given the current state. */ _getDocument: function () { - return (this.model.get('overlayIsOpen')) ? $(Drupal.overlay.iframeWindow.document) : $(document); + return $(document); }, /** @@ -196,6 +162,7 @@ Drupal.tour.views.ToggleTourView = Backbone.View.extend({ */ _removeIrrelevantTourItems: function ($tour, $document) { var removals = false; + // @todo don't use jquery-bbq for this. var query = $.deparam.querystring(); $tour .find('li') diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module index 9cb4f64..bbd9f34 100644 --- a/core/modules/tour/tour.module +++ b/core/modules/tour/tour.module @@ -28,9 +28,7 @@ function tour_library_info() { 'title' => 'Tour', 'version' => Drupal::VERSION, 'js' => array( - // Add the JavaScript, with a group and weight such that it will run - // before modules/overlay/overlay-parent.js. - $path . '/js/tour.js' => array('group' => JS_LIBRARY, 'weight' => -1), + $path . '/js/tour.js' => array('group' => JS_LIBRARY), ), 'dependencies' => array( array('system', 'jquery'), @@ -47,7 +45,7 @@ function tour_library_info() { 'version' => Drupal::VERSION, 'css' => array( $path . '/css/tour.module.css' => array('media' => 'screen'), - ) + ), ); $libraries['jquery.joyride'] = array( diff --git a/core/modules/views_ui/js/ajax.js b/core/modules/views_ui/js/ajax.js index 87c7a1b..ff44171 100644 --- a/core/modules/views_ui/js/ajax.js +++ b/core/modules/views_ui/js/ajax.js @@ -59,8 +59,7 @@ }; Drupal.AjaxCommands.prototype.viewsReplaceTitle = function (ajax, response, status) { - // In case we're in the overlay, get a reference to the underlying window. - var doc = parent.document; + var doc = document; // For the element, make a best-effort attempt to replace the page // title and leave the site name alone. If the theme doesn't use the site // name in the <title> element, this will fail. @@ -72,7 +71,6 @@ doc.title = oldTitle.replace(re, response.title + ' $1 ' + response.siteName); $('h1.page-title').text(response.title); - $('h1#overlay-title').text(response.title); }; /** diff --git a/core/profiles/standard/standard.info.yml b/core/profiles/standard/standard.info.yml index 4502ecd..ba41dd5 100644 --- a/core/profiles/standard/standard.info.yml +++ b/core/profiles/standard/standard.info.yml @@ -30,7 +30,6 @@ dependencies: - search - shortcut - toolbar - - overlay - field_ui - file - rdf diff --git a/core/themes/bartik/css/colors.css b/core/themes/bartik/css/colors.css index 96f3877..1ad555a 100644 --- a/core/themes/bartik/css/colors.css +++ b/core/themes/bartik/css/colors.css @@ -1,7 +1,6 @@ /* ---------- Color Module Styles ----------- */ -body, -body.overlay { +body { color: #3b3b3b; } .comment .comment-arrow { diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index dab43ff..4e3bbc9 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -1517,10 +1517,6 @@ input.form-submit:focus { div.password-suggestions { border: 0; } -.ui-widget-overlay { - background: #222222; - opacity: 0.7; -} #forum .name { font-size: 1.083em; } @@ -1661,9 +1657,6 @@ ol.search-results { div.add-or-remove-shortcuts { padding-top: 0.9em; } -.overlay div.add-or-remove-shortcuts { - padding-top: 0.8em; -} /* ---------- Admin-specific Theming ---------- */ @@ -1692,13 +1685,7 @@ div.add-or-remove-shortcuts { .page-admin #admin-dblog img { margin: 0 5px; } -/* Fix spacing when Seven is used in the overlay. */ -#system-theme-settings details { - padding: 0; -} -#system-theme-settings details summary { - margin-top: 0; -} + /* Configuration. */ div.admin .right, div.admin .left { @@ -1725,33 +1712,6 @@ div.admin-panel .description { margin: 0 0 14px 7px; } -/* ---------- Overlay layout styles ----------- */ - -.overlay #main, -.overlay #content { - width: auto; - float: none; -} -.overlay #page { - padding: 0 2em; -} -.overlay .region-page-top, -.overlay #header, -.overlay #page-title, -.overlay #featured, -.overlay #sidebar-first, -.overlay #triptych-wrapper, -.overlay #footer-wrapper { - display: none; -} -.overlay-processed .field-type-image { - display: block; - float: none; -} -.overlay #messages { - width: auto; -} - /* ---------- book ----------- */ .book-navigation .menu { border-top: 1px solid #d6d6d6; diff --git a/core/themes/seven/jquery.ui.theme.css b/core/themes/seven/jquery.ui.theme.css index 5099b9a..89aa38b 100644 --- a/core/themes/seven/jquery.ui.theme.css +++ b/core/themes/seven/jquery.ui.theme.css @@ -323,21 +323,6 @@ } /** - * Overlays - */ -.ui-widget-overlay { - background: #000; - opacity: .70; - filter: Alpha(Opacity=70); -} -.overlay { - padding-right: 26px; -} -.overlay .ui-dialog-titlebar { - background: transparent; -} - -/** * Slider */ .ui-slider { diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index c628c55..fa1af14 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -1091,50 +1091,6 @@ body.in-maintenance #logo { color: green; } -/* Overlay theming */ -.overlay #branding { - background-color: #fff; - padding-top: 15px; - padding-bottom: 15px; -} -.overlay #branding h1.page-title, -.overlay #left, -.overlay #footer { - display: none; -} -.overlay #page { - margin: 0; - padding: 0 20px; -} -.overlay #branding .breadcrumb { - float: left; /* LTR */ - position: relative; - z-index: 10; -} -[dir="rtl"] .overlay #branding .breadcrumb { - float: right; -} -#overlay-tabs { - bottom: -1px; - font-size: 1.54em; - line-height: 1.54em; - margin: 0; -} -.overlay ul.secondary { - background: transparent none; - margin: -1.4em 0 0.3em 0; /* LTR */ - overflow: visible; -} -[dir="rtl"] .overlay ul.secondary { - margin: -1.4em 0 0.3em 0; -} -.overlay #content { - padding: 0; -} -h1#overlay-title { - font-weight: normal; -} - /* Shortcut theming */ .add-or-remove-shortcuts a:focus span.text, .add-or-remove-shortcuts a:hover span.text { @@ -1252,28 +1208,6 @@ h1#overlay-title { background-color: #73b3dd; } -/* Disable overlay message */ -#overlay-disable-message { - background-color: #addafc; -} -#overlay-disable-message a, -#overlay-disable-message a:visited { - color: #000; -} -#overlay-disable-message a:focus, -#overlay-disable-message a:active { - outline: none; - text-decoration: underline; -} -.overlay-disable-message-focused a { - padding: 0.4em 0.6em; -} -.overlay-disable-message-focused #overlay-dismiss-message { - background-color: #59a0d8; - color: #fff; - border-radius: 8px; -} - /** * Views styling */ @@ -1647,9 +1581,6 @@ details.fieldset-no-legend { .entity-meta details .summary { display: none; /* Hide JS summaries. @todo Rethink summaries. */ } -.overlay .layout-region-node-footer { - padding-bottom: .5em; -} /** * Widescreen @@ -1717,47 +1648,6 @@ details.fieldset-no-legend { .entity-meta-header { border-top: 0; } - - /* Additional overlay theming */ - - /** - * These are terrible selectors. - * @todo Add a proper class to the overlay for this page. - */ - .overlay[class*="page-node-add-"] #overlay-content, - .overlay.page-node-edit #overlay-content { - padding: 0; - } - .overlay[class*="page-node-add-"] #page, - .overlay.page-node-edit #page { - padding: 0; - } - .overlay[class*="page-node-add-"] #branding, - .overlay.page-node-edit #branding { - padding-left: 2em; - padding-right: 2em; - } - .overlay[class*="page-node-add-"] #console, - .overlay.page-node-edit #console { - margin: 0 2em; - } - .overlay[class*="page-node-add-"] .messages, - .overlay.page-node-edit .messages { - margin-bottom: 1em; - } - .overlay .layout-node-form { - border-top: 1px solid #bfbfbf; - } - .overlay .layout-node-form:before { - display: none; - } - .overlay .layout-region-node-main, - .overlay .layout-region-node-footer { - padding-left: 2em; - } - .overlay .layout-region-node-footer { - padding-bottom: 1.5em; - } } @media screen and (max-width: 1020px),