diff --git a/core/modules/outside_in/css/outside_in.module.css b/core/modules/outside_in/css/outside_in.module.css index a3e2ea5..a7fec82 100644 --- a/core/modules/outside_in/css/outside_in.module.css +++ b/core/modules/outside_in/css/outside_in.module.css @@ -24,7 +24,7 @@ width: 40px; border: 0; border-radius: 0; - background: url(/core/misc/icons/bebebe/ex.svg) center center no-repeat; + background: url(../../../misc/icons/bebebe/ex.svg) center center no-repeat; color: transparent; cursor: pointer; z-index: 501; @@ -81,7 +81,7 @@ margin-right: -300px; padding-top: 39px; } - /* Wrap the rest of the site so we can control it's width. */ + /* Wrap the rest of the site so we can control its width. */ #main-canvas-wrapper #main-canvas { display: inline-block; width: 100%; @@ -116,7 +116,7 @@ -ms-transform: translateX(-100%); transform: translateX(-100%); } - /* Wrap the rest of the site so we can control it's width. */ + /* Wrap the rest of the site so we can control its width. */ #main-canvas-wrapper #main-canvas { display: inline-block; width: 100%; @@ -141,7 +141,7 @@ display: inline-block; width: 30%; } - /* Wrap the rest of the site so we can control it's width. */ + /* Wrap the rest of the site so we can control its width. */ #main-canvas-wrapper #main-canvas { display: inline-block; width: 100%; @@ -158,7 +158,7 @@ display: inline-block; width: 25%; } - /* Wrap the rest of the site so we can control it's width. */ + /* Wrap the rest of the site so we can control its width. */ #main-canvas-wrapper #main-canvas { display: inline-block; width: 100%; diff --git a/core/modules/outside_in/css/outside_in.theme.css b/core/modules/outside_in/css/outside_in.theme.css index c263ba0..c063115 100644 --- a/core/modules/outside_in/css/outside_in.theme.css +++ b/core/modules/outside_in/css/outside_in.theme.css @@ -20,7 +20,7 @@ button.toolbar-icon.toolbar-icon-edit.toolbar-item:focus { } button.toolbar-icon.toolbar-icon-edit.toolbar-item:before:hover, button.toolbar-icon.toolbar-icon-edit.toolbar-item:before:focus { - background-image: url(../../images/core/icons/ffffff/pencil.svg); + background-image: url(../../../misc/icons/ffffff/pencil.svg); } button.toolbar-icon.toolbar-icon-edit.toolbar-item:hover, button.toolbar-icon.toolbar-icon-edit.toolbar-item:focus { @@ -29,10 +29,10 @@ button.toolbar-icon.toolbar-icon-edit.toolbar-item:focus { outline: none; } button.toolbar-icon.toolbar-icon-edit.toolbar-item:hover > .toolbar-icon-edit:before { - background-image: url(../../images/core/icons/ffffff/pencil.svg); + background-image: url(../../../misc/icons/ffffff/pencil.svg); } #toolbar-bar.button.toolbar-icon.toolbar-icon.toolbar-icon-edit:before { - background-image: url(../../images/core/icons/ffffff/pencil.svg); + background-image: url(../../../misc/icons/ffffff/pencil.svg); } /* Style the toolbar when in edit mode. */ @@ -47,7 +47,7 @@ button.toolbar-icon.toolbar-icon-edit.toolbar-item:hover > .toolbar-icon-edit:be color: #333; } /* Set color back to white for 'editing' button only. */ -#toolbar-bar.js-outside-in-edit-mode button.toolbar-icon.toolbar-icon-edit.toolbar-item.is-active { +#toolbar-bar.js-outside-in-edit-mode button.toolbar-icon.toolbar-icon-edit.toolbar-item.is-active { color: #fff; } #toolbar-bar.js-outside-in-edit-mode button.toolbar-icon.toolbar-icon-edit.toolbar-item.is-active:hover { diff --git a/core/modules/outside_in/js/offcanvas.js b/core/modules/outside_in/js/offcanvas.js index 5a03e8a..6904f3e 100644 --- a/core/modules/outside_in/js/offcanvas.js +++ b/core/modules/outside_in/js/offcanvas.js @@ -1,6 +1,6 @@ /** * @file - * Drupal's off canvas library. + * Drupal's off-canvas library. */ (function ($, Drupal) { @@ -8,13 +8,13 @@ 'use strict'; /** - * Create a wrapper container for the off canvas element. + * Create a wrapper container for the off-canvas element. * - * @param {number} pageWidth + * @param {number} pageWidth * The width of #page-wrapper. * * @return {object} - * jQuery object that is the off canvas wrapper element. + * jQuery object that is the off-canvas wrapper element. */ var createOffCanvasWrapper = function (pageWidth) { return $('
', { @@ -25,41 +25,41 @@ }; /** - * Create the title element for the off canvas element. + * Create the title element for the off-canvas element. * - * @param {string} title + * @param {string} title * The title string. * * @return {object} - * jQuery object that is the off canvas title element. + * jQuery object that is the off-canvas title element. */ var createTitle = function (title) { return $('', {text: title, id: 'offcanvas-header'}); }; /** - * Create the actual off canvas content. + * Create the actual off-canvas content. * - * @param {string} data + * @param {string} data * This is fully rendered HTML from Drupal. * * @return {object} - * jQuery object that is the off canvas content element. + * jQuery object that is the off-canvas content element. */ var createOffCanvasContent = function (data) { return $('', {class: 'offcanvas-content', html: data}); }; /** - * Create the off canvas close element. + * Create the off-canvas close element. * * @param {object} offCanvasWrapper - * The jQuery off canvas wrapper element + * The jQuery off-canvas wrapper element * @param {object} pageWrapper * The jQuery off page wrapper element * * @return {jQuery} - * jQuery object that is the off canvas close element. + * jQuery object that is the off-canvas close element. */ var createOffCanvasClose = function (offCanvasWrapper, pageWrapper) { return $('', { @@ -80,7 +80,7 @@ /** - * Command to open an off canvas element. + * Command to open an off-canvas element. * * @param {Drupal.Ajax} ajax * The Drupal Ajax object. @@ -96,16 +96,16 @@ var $pageWrapper = $('#main-canvas-wrapper'); var pageWidth = $pageWrapper.width(); - // Set the initial state of the off canvas element. + // Set the initial state of the off-canvas element. // If the state has been set previously, use it. Drupal.offCanvas = { visible: (Drupal.offCanvas ? Drupal.offCanvas.visible : false) }; - // Construct off canvas wrapper + // Construct off-canvas wrapper var $offcanvasWrapper = createOffCanvasWrapper(pageWidth); - // Construct off canvas internal elements. + // Construct off-canvas internal elements. var $offcanvasClose = createOffCanvasClose($offcanvasWrapper, $pageWrapper); var $title = createTitle(response.dialogOptions.title); var $offcanvasContent = createOffCanvasContent(response.data); diff --git a/core/modules/outside_in/js/outside_in.js b/core/modules/outside_in/js/outside_in.js index 6cc4460..2d6fed7 100644 --- a/core/modules/outside_in/js/outside_in.js +++ b/core/modules/outside_in/js/outside_in.js @@ -1,6 +1,6 @@ /** * @file - * Drupal's Outside In library. + * Drupal's Outside-In library. */ (function ($, Drupal) { @@ -78,7 +78,7 @@ // Bind a listener to all 'Quick Edit' links for blocks // Click "Edit" button in toolbar to force Contextual Edit which starts - // Outside In edit mode also. + // Outside-In edit mode also. data.$el.find('.outside-inblock-configure a').on('click', function () { if (!isActiveMode()) { $('div.contextual-toolbar-tab.toolbar-tab button').click(); diff --git a/core/modules/outside_in/outside_in.info.yml b/core/modules/outside_in/outside_in.info.yml index 8fcb964..83f45e5 100644 --- a/core/modules/outside_in/outside_in.info.yml +++ b/core/modules/outside_in/outside_in.info.yml @@ -1,4 +1,4 @@ -name: 'Outside In' +name: 'Outside-In' type: module description: 'Provides the ability to access useful configuration from the Drupal front-end.' package: Core (Experimental) diff --git a/core/modules/outside_in/outside_in.module b/core/modules/outside_in/outside_in.module index 7a1d0b1..02c203f 100644 --- a/core/modules/outside_in/outside_in.module +++ b/core/modules/outside_in/outside_in.module @@ -18,7 +18,7 @@ function outside_in_help($route_name, RouteMatchInterface $route_match) { case 'help.page.outside_in': $output = '' . t('The Outside In module is something that we should have help for. For more information, see the online documentation for the Outside In module.', [':outside-in-documentation' => 'https://www.drupal.org/documentation/modules/outside_in']) . '
'; + $output .= '' . t('The Outside-In module is something that we should have help for. For more information, see the online documentation for the Outside-In module.', [':outside-in-documentation' => 'https://www.drupal.org/documentation/modules/outside_in']) . '
'; return $output; } } @@ -35,11 +35,7 @@ function outside_in_contextual_links_view_alter(&$element, $items) { 'data-dialog-type' => 'offcanvas', ]; - $element['#attached'] = [ - 'library' => [ - 'outside_in/drupal.off_canvas', - ], - ]; + $element['#attached']['library'][] = 'outside_in/drupal.off_canvas'; } } @@ -87,10 +83,10 @@ function outside_in_preprocess_block(&$variables) { } /** - * Determines if the Outside In logic should be run on the current page. + * Determines if the Outside-In logic should be run on the current page. * * @return bool - * TRUE if the Outside In logic should be run. + * TRUE if the Outside-In logic should be run. */ function _outside_in_apply_on_current_page() { // Remove on Admin routes. diff --git a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php index 1d0986d..d1ccb61 100644 --- a/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php +++ b/core/modules/outside_in/src/Ajax/OpenOffCanvasDialogCommand.php @@ -5,7 +5,7 @@ use Drupal\Core\Ajax\OpenDialogCommand; /** - * Defines an AJAX command to open content in a dialog in a off canvas tray. + * Defines an AJAX command to open content in a dialog in a off-canvas tray. * * @ingroup ajax */ diff --git a/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php b/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php index 313fbe1..089feae 100644 --- a/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php +++ b/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php @@ -6,13 +6,12 @@ use Drupal\Core\Block\BlockPluginInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\PluginWithFormsInterface; -use Drupal\Core\Url; /** * Provides form for block instance forms when used in the off-canvas tray. * - * This form will remove advanced sections of regular block form such as the - * visibility settings, machine id and region. + * This form removes advanced sections of regular block form such as the + * visibility settings, machine ID and region. */ class BlockEntityOffCanvasForm extends BlockForm { @@ -24,25 +23,19 @@ public function form(array $form, FormStateInterface $form_state) { // Create link to full block form. $query = []; - $advance_url = Url::fromRoute( - 'entity.block.edit_form', - [ - 'block' => $this->entity->id(), - ] - ); - - if ($destination = $this->getRequest()->query->has('destination')) { - $query['destination'] = $this->getRequest()->query->get('destination'); - $advance_url->setOption('query', $query); + if ($destination = $this->getRequest()->query->get('destination')) { + $query['destination'] = $destination; } $form['advanced_link'] = [ '#type' => 'link', - '#title' => $this->t('Advanced Options'), - '#url' => $advance_url, + '#title' => $this->t('Advanced options'), + '#url' => $this->entity->toUrl('edit-form', ['query' => $query]), '#weight' => 1000, ]; + // Remove the ID and region elements. unset($form['id'], $form['region']); + return $form; } diff --git a/core/modules/outside_in/src/Form/SystemBrandingOffCanvasForm.php b/core/modules/outside_in/src/Form/SystemBrandingOffCanvasForm.php index 6e71c76..65139ec 100644 --- a/core/modules/outside_in/src/Form/SystemBrandingOffCanvasForm.php +++ b/core/modules/outside_in/src/Form/SystemBrandingOffCanvasForm.php @@ -9,14 +9,14 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * The OffCanvas form handler for the SystemBrandingBlock. + * The off-canvas form handler for the SystemBrandingBlock. * * @see outside_in_block_alter() */ class SystemBrandingOffCanvasForm extends PluginFormBase implements ContainerInjectionInterface { /** - * The plugin. + * The block plugin. * * @var \Drupal\Core\Block\BlockPluginInterface */ diff --git a/core/modules/outside_in/src/Form/SystemMenuOffCanvasForm.php b/core/modules/outside_in/src/Form/SystemMenuOffCanvasForm.php index 90005a0..73cda59 100644 --- a/core/modules/outside_in/src/Form/SystemMenuOffCanvasForm.php +++ b/core/modules/outside_in/src/Form/SystemMenuOffCanvasForm.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * The OffCanvas form handler for the SystemMenuBlock. + * The off-canvas form handler for the SystemMenuBlock. * * @see outside_in_block_alter() */ diff --git a/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php b/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php index 87a761d..5d24c09 100644 --- a/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php +++ b/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php @@ -44,8 +44,8 @@ public function renderResponse(array $main_content, Request $request, RouteMatch // First render the main content, because it might provide a title. $content = $this->renderer->renderRoot($main_content); - // Attach the library necessary for using the OpenModalDialogCommand and set - // the attachments for this Ajax response. + // Attach the library necessary for using the OpenOffCanvasDialogCommand and + // set the attachments for this Ajax response. $main_content['#attached']['library'][] = 'outside_in/drupal.off_canvas'; $response->setAttachments($main_content['#attached']); diff --git a/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php index 2df1e71..2d360f9 100644 --- a/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php +++ b/core/modules/outside_in/src/Tests/Ajax/OffCanvasDialogTest.php @@ -9,7 +9,7 @@ /** * Performs tests on opening and manipulating dialogs via AJAX commands. * - * @group Outside In + * @group Outside-In */ class OffCanvasDialogTest extends AjaxTestBase { diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInJavascriptTestBase.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInJavascriptTestBase.php index fecb28a..5871aef 100644 --- a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInJavascriptTestBase.php +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInJavascriptTestBase.php @@ -5,7 +5,7 @@ use Drupal\FunctionalJavascriptTests\JavascriptTestBase; /** - * Base class contains common test functionality for the Outside In module. + * Base class contains common test functionality for the Outside-In module. */ abstract class OutsideInJavascriptTestBase extends JavascriptTestBase { @@ -44,7 +44,7 @@ protected function waitForOffCanvasToClose() { * @param string $selector * CSS selector. * @param int $timeout - * (Optional) Timeout in milliseconds, defaults to 1000. + * (optional) Timeout in milliseconds, defaults to 1000. */ protected function waitForElement($selector, $timeout = 1000) { $condition = "(jQuery('$selector').length > 0)";