Commit 240392cc authored by alexpott's avatar alexpott

Issue #1874640 by xjm, Wim Leers: Rename edit module to quickedit.

parent a62511ff
......@@ -21,7 +21,7 @@
* "string",
* "email"
* },
* edit = {
* quickedit = {
* "editor" = "plain_text"
* }
* )
......
......@@ -27,7 +27,7 @@
* field_types = {
* "comment"
* },
* edit = {
* quickedit = {
* "editor" = "disabled"
* }
* )
......
services:
plugin.manager.edit.editor:
class: Drupal\edit\Plugin\InPlaceEditorManager
parent: default_plugin_manager
access_check.edit.entity_field:
class: Drupal\edit\Access\EditEntityFieldAccessCheck
arguments: ['@entity.manager']
tags:
- { name: access_check, applies_to: _access_edit_entity_field }
access_check.edit.entity:
class: Drupal\edit\Access\EditEntityAccessCheck
arguments: ['@entity.manager']
tags:
- { name: access_check, applies_to: _access_edit_entity }
edit.editor.selector:
class: Drupal\edit\EditorSelector
arguments: ['@plugin.manager.edit.editor', '@plugin.manager.field.formatter']
edit.metadata.generator:
class: Drupal\edit\MetadataGenerator
arguments: ['@access_check.edit.entity_field', '@edit.editor.selector', '@plugin.manager.edit.editor']
......@@ -31,12 +31,12 @@ drupal.editor.dialog:
- core/drupal.ajax
- core/drupalSettings
edit.inPlaceEditor.formattedText:
quickedit.inPlaceEditor.formattedText:
version: VERSION
js:
js/editor.formattedTextEditor.js: { scope: footer, attributes: { defer: true } }
dependencies:
- edit/edit
- quickedit/quickedit
- editor/drupal.editor
- core/drupal.ajax
- core/drupalSettings
......@@ -13,7 +13,7 @@ editor.field_untransformed_text:
_theme: ajax_base_page
requirements:
_permission: 'access in-place editing'
_access_edit_entity_field: 'TRUE'
_access_quickedit_entity_field: 'TRUE'
editor.image_dialog:
path: '/editor/dialog/image/{filter_format}'
......
......@@ -14,7 +14,7 @@
"use strict";
Drupal.edit.editors.editor = Drupal.edit.EditorView.extend({
Drupal.quickedit.editors.editor = Drupal.quickedit.EditorView.extend({
// The text format for this field.
textFormat: null,
......@@ -32,9 +32,9 @@
* {@inheritdoc}
*/
initialize: function (options) {
Drupal.edit.EditorView.prototype.initialize.call(this, options);
Drupal.quickedit.EditorView.prototype.initialize.call(this, options);
var metadata = Drupal.edit.metadata.get(this.fieldModel.get('fieldID'), 'custom');
var metadata = Drupal.quickedit.metadata.get(this.fieldModel.get('fieldID'), 'custom');
this.textFormat = drupalSettings.editor.formats[metadata.format];
this.textFormatHasTransformations = metadata.formatHasTransformations;
this.textEditor = Drupal.editors[this.textFormat.editor];
......@@ -137,7 +137,7 @@
/**
* {@inheritdoc}
*/
getEditUISettings: function () {
getQuickEditUISettings: function () {
return { padding: true, unifiedToolbar: true, fullWidthToolbar: true, popup: false };
},
......@@ -164,7 +164,7 @@
// Create a Drupal.ajax instance to load the form.
var textLoaderAjax = new Drupal.ajax(fieldID, this.$el, {
url: Drupal.edit.util.buildUrl(fieldID, Drupal.url('editor/!entity_type/!id/!field_name/!langcode/!view_mode')),
url: Drupal.quickedit.util.buildUrl(fieldID, Drupal.url('editor/!entity_type/!id/!field_name/!langcode/!view_mode')),
event: 'editor-internal.editor',
submit: { nocssjs: true },
progress: { type: null } // No progress indicator.
......
......@@ -8,7 +8,7 @@
namespace Drupal\editor\Ajax;
use Drupal\Core\Ajax\CommandInterface;
use Drupal\edit\Ajax\BaseCommand;
use Drupal\quickedit\Ajax\BaseCommand;
/**
* AJAX command to rerender a processed text field without any transformation
......
......@@ -9,7 +9,7 @@
use Drupal\Component\Plugin\PluginBase;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\edit\Plugin\InPlaceEditorInterface;
use Drupal\quickedit\Plugin\InPlaceEditorInterface;
use Drupal\filter\Plugin\FilterInterface;
/**
......@@ -88,7 +88,7 @@ public function getAttachments() {
$attachments = $manager->getAttachments($formats);
// Also include editor.module's formatted text editor.
$attachments['library'][] = 'editor/edit.inPlaceEditor.formattedText';
$attachments['library'][] = 'editor/quickedit.inPlaceEditor.formattedText';
return $attachments;
}
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\editor\Tests\EditIntegrationLoadingTest.
* Contains \Drupal\editor\Tests\QuickEditIntegrationLoadingTest.
*/
namespace Drupal\editor\Tests;
......@@ -11,16 +11,16 @@
use Drupal\simpletest\WebTestBase;
/**
* Tests Edit module integration endpoints.
* Tests Quick Edit module integration endpoints.
*/
class EditIntegrationLoadingTest extends WebTestBase {
class QuickEditIntegrationLoadingTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('edit', 'filter', 'node', 'editor');
public static $modules = array('quickedit', 'filter', 'node', 'editor');
/**
* The basic permissions necessary to view content and use in-place editing.
......@@ -32,7 +32,7 @@ class EditIntegrationLoadingTest extends WebTestBase {
public static function getInfo() {
return array(
'name' => 'In-place text editor loading',
'description' => 'Tests Edit module integration endpoints.',
'description' => 'Tests Quick Edit module integration endpoints.',
'group' => 'Text Editor',
);
}
......
......@@ -2,25 +2,25 @@
/**
* @file
* Contains \Drupal\editor\Tests\EditIntegrationTest.
* Contains \Drupal\editor\Tests\QuickEditIntegrationTest.
*/
namespace Drupal\editor\Tests;
use Drupal\Component\Utility\Json;
use Drupal\Core\Language\Language;
use Drupal\edit\EditorSelector;
use Drupal\edit\MetadataGenerator;
use Drupal\edit\Plugin\InPlaceEditorManager;
use Drupal\edit\Tests\EditTestBase;
use Drupal\edit_test\MockEditEntityFieldAccessCheck;
use Drupal\quickedit\EditorSelector;
use Drupal\quickedit\MetadataGenerator;
use Drupal\quickedit\Plugin\InPlaceEditorManager;
use Drupal\quickedit\Tests\QuickEditTestBase;
use Drupal\quickedit_test\MockEditEntityFieldAccessCheck;
use Drupal\editor\EditorController;
use Symfony\Component\HttpFoundation\Request;
/**
* Tests Edit module integration (Editor module's inline editing support).
*/
class EditIntegrationTest extends EditTestBase {
class QuickEditIntegrationTest extends QuickEditTestBase {
/**
* The manager for editor plug-ins.
......@@ -32,21 +32,21 @@ class EditIntegrationTest extends EditTestBase {
/**
* The metadata generator object to be tested.
*
* @var \Drupal\edit\MetadataGeneratorInterface.php
* @var \Drupal\quickedit\MetadataGeneratorInterface.php
*/
protected $metadataGenerator;
/**
* The editor selector object to be used by the metadata generator object.
*
* @var \Drupal\edit\EditorSelectorInterface
* @var \Drupal\quickedit\EditorSelectorInterface
*/
protected $editorSelector;
/**
* The access checker object to be used by the metadata generator object.
*
* @var \Drupal\edit\Access\EditEntityFieldAccessCheckInterface
* @var \Drupal\quickedit\Access\EditEntityFieldAccessCheckInterface
*/
protected $accessChecker;
......@@ -59,7 +59,7 @@ class EditIntegrationTest extends EditTestBase {
public static function getInfo() {
return array(
'name' => 'In-place text editors (Edit module integration)',
'name' => 'In-place text editors (Quick Edit module integration)',
'description' => 'Tests Edit module integration (Editor module\'s inline editing support).',
'group' => 'Text Editor',
);
......@@ -124,8 +124,8 @@ protected function getSelectedEditor($entity_id, $field_name, $view_mode = 'defa
* format compatibility.
*/
public function testEditorSelection() {
$this->editorManager = $this->container->get('plugin.manager.edit.editor');
$this->editorSelector = $this->container->get('edit.editor.selector');
$this->editorManager = $this->container->get('plugin.manager.quickedit.editor');
$this->editorSelector = $this->container->get('quickedit.editor.selector');
// Create an entity with values for this text field.
$this->entity = entity_create('entity_test');
......@@ -151,9 +151,9 @@ public function testEditorSelection() {
* Tests (custom) metadata when the formatted text editor is used.
*/
public function testMetadata() {
$this->editorManager = $this->container->get('plugin.manager.edit.editor');
$this->editorManager = $this->container->get('plugin.manager.quickedit.editor');
$this->accessChecker = new MockEditEntityFieldAccessCheck();
$this->editorSelector = $this->container->get('edit.editor.selector');
$this->editorSelector = $this->container->get('quickedit.editor.selector');
$this->metadataGenerator = new MetadataGenerator($this->accessChecker, $this->editorSelector, $this->editorManager);
// Create an entity with values for the field.
......
/**
* @file
* Icons for edit module.
* Icons for Quick Edit module.
*/
.edit .icon {
.quickedit .icon {
min-height: 1em;
min-width: 2.5em;
position: relative;
}
.edit .icon.icon-only {
.quickedit .icon.icon-only {
text-indent: -9999px;
}
.edit .icon.icon-end {
.quickedit .icon.icon-end {
padding-right: 2.5em; /* LTR */
}
[dir="rtl"] .edit .icon.icon-end {
[dir="rtl"] .quickedit .icon.icon-end {
padding-left: 2.5em;
padding-right: 0;
}
.edit .icon:before {
.quickedit .icon:before {
background-attachment: scroll;
background-color: transparent;
background-position: center center;
......@@ -31,23 +31,23 @@
top: 0;
width: 100%;
}
[dir="rtl"] .edit .icon:before {
[dir="rtl"] .quickedit .icon:before {
left: auto;
right: 0;
}
.edit .icon-end:before {
.quickedit .icon-end:before {
left: auto; /* LTR */
right: 0.5em; /* LTR */
width: 18px;
}
[dir="rtl"] .edit .icon-end:before {
[dir="rtl"] .quickedit .icon-end:before {
left: 0.5em;
right: auto;
}
.edit button.icon {
.quickedit button.icon {
font-size: 1em;
}
.edit .icon-pencil {
.quickedit .icon-pencil {
margin-left: .5em;
padding-left: 1.5em;
}
......@@ -55,19 +55,19 @@
/**
* Images.
*/
.edit .icon-close:before {
.quickedit .icon-close:before {
background-image: url('../../../misc/icons/787878/ex.svg');
height: 12px;
top: 10px;
}
.edit .icon-close:hover:before,
.edit .icon-close:active:before {
.quickedit .icon-close:hover:before,
.quickedit .icon-close:active:before {
background-image: url('../../../misc/icons/000000/ex.svg');
}
.edit .icon-throbber:before {
.quickedit .icon-throbber:before {
background-image: url("../images/icon-throbber.gif");
}
.edit .icon-pencil:before {
.quickedit .icon-pencil:before {
background-image: url('../../../misc/icons/5181c6/pencil.svg');
background-position: left center;
background-size: 1.3em;
......
/**
* @file
* Generic base styles for edit module.
* Generic base styles for Quick Edit module.
*
* Note: every class is prefixed with "edit-" to prevent collisions with modules
* or themes. In Edit module-specific DOM subtrees, this is not necessary.
* Note: every class is prefixed with "quickedit-" to prevent collisions with
* modules or themes. In Edit module-specific DOM subtrees, this is not
* necessary.
*/
/**
* Editable.
*/
.edit-editable {
.quickedit-editable {
z-index: 98;
position: relative;
cursor: pointer;
}
.edit-editable:focus {
.quickedit-editable:focus {
outline: none;
}
/**
* Highlighted (hovered) editable.
*/
.edit-editable.edit-highlighted {
.quickedit-editable.quickedit-highlighted {
z-index: 99;
}
.edit-validation-errors > .messages {
.quickedit-validation-errors > .messages {
margin-left: 0;
margin-right: 0;
}
.edit-validation-errors > .messages > ul {
.quickedit-validation-errors > .messages > ul {
list-style: none;
margin: 0;
padding: 0;
......@@ -37,18 +38,18 @@
/**
* In-place editors that don't use a popup.
*/
.edit-validation-errors {
.quickedit-validation-errors {
z-index: 300;
position: relative;
}
.edit-validation-errors .messages.error {
.quickedit-validation-errors .messages.error {
position: absolute;
top: 6px;
left: -5px; /* LTR */
margin: 0;
border: none;
}
[dir="rtl"] .edit-validation-errors .messages.error {
[dir="rtl"] .quickedit-validation-errors .messages.error {
left: auto;
right: -5px;
}
......@@ -56,46 +57,46 @@
/**
* Styling specific to the 'form' in-place editor.
*/
#edit_backstage {
#quickedit_backstage {
display: none;
}
.edit-form {
.quickedit-form {
position: absolute;
z-index: 300;
max-width: 35em;
}
.edit-form .placeholder {
.quickedit-form .placeholder {
min-height: 22px;
}
/**
* Default form styling overrides.
*/
.edit-form .form-wrapper .form-wrapper {
.quickedit-form .form-wrapper .form-wrapper {
margin: inherit;
}
.edit-form .form-actions {
.quickedit-form .form-actions {
display: none;
}
.edit-form input {
.quickedit-form input {
max-width: 100%;
}
/**
* Entity toolbar.
*/
.edit-toolbar-container {
.quickedit-toolbar-container {
max-width: 100%;
position: absolute;
max-width: 320px;
width: 320px;
z-index: 100;
}
.edit-toolbar-container > .edit-toolbar-pointer,
.edit-toolbar-container > .edit-toolbar-lining {
.quickedit-toolbar-container > .quickedit-toolbar-pointer,
.quickedit-toolbar-container > .quickedit-toolbar-lining {
display: none;
}
.edit-form-container {
.quickedit-form-container {
position: relative;
padding: 0;
border: 0;
......@@ -103,16 +104,16 @@
vertical-align: baseline;
z-index: 100;
}
.edit-toolgroup.ops {
.quickedit-toolgroup.ops {
float: right; /* LTR */
}
[dir="rtl"] .edit-toolgroup.ops {
[dir="rtl"] .quickedit-toolgroup.ops {
float: left;
}
.edit-toolbar-label {
.quickedit-toolbar-label {
overflow: hidden;
}
#edit-toolbar-fence {
#quickedit-toolbar-fence {
bottom: 0;
left: 0;
right: 0;
......
/**
* @file
* Styling for edit module.
* Styling for Quick Edit module.
*/
/**
* Editable.
*/
.edit-field.edit-editable,
.edit-field .edit-editable {
.quickedit-field.quickedit-editable,
.quickedit-field .quickedit-editable {
box-shadow: 0 0 0 2px #74b7ff;
}
/**
* Highlighted (hovered) editable.
*/
.edit-field.edit-highlighted,
.edit-form.edit-highlighted,
.edit-field .edit-highlighted {
.quickedit-field.quickedit-highlighted,
.quickedit-form.quickedit-highlighted,
.quickedit-field .quickedit-highlighted {
box-shadow: 0 0 0 1px #74b7ff, 0 0 0 2px #007fff;
}
.edit-field.edit-changed,
.edit-form.edit-changed,
.edit-field .edit-changed {
.quickedit-field.quickedit-changed,
.quickedit-form.quickedit-changed,
.quickedit-field .quickedit-changed {
box-shadow: 0 0 0 1px #fec17e, 0 0 0 2px #f7870a;
}
.edit-editing.edit-validation-error,
.edit-form.edit-validation-error {
.quickedit-editing.quickedit-validation-error,
.quickedit-form.quickedit-validation-error {
box-shadow: 0 0 0px 1px #ee8b74, 0 0 0 2px #fa2209;
}
.edit-editing.edit-editor-is-popup {
.quickedit-editing.quickedit-editor-is-popup {
box-shadow: none;
}
.edit-form .form-item .error {
.quickedit-form .form-item .error {
border: 1px solid #eea0a0;
}
/**
* Default form styling overrides.
*/
.edit-form form {
.quickedit-form form {
padding: 0.5em;
}
.edit-form .form-item {
.quickedit-form .form-item {
margin: 0;
}
.edit-form .form-wrapper {
.quickedit-form .form-wrapper {
margin: .5em;
}
/**
* Animations.
*/
.edit-animate-invisible {
.quickedit-animate-invisible {
opacity: 0;
}
.edit-animate-default {
.quickedit-animate-default {
-webkit-transition: all .4s ease;
transition: all .4s ease;
}
.edit-animate-slow {
.quickedit-animate-slow {
-webkit-transition: all .6s ease;
transition: all .6s ease;
}
.edit-animate-delay-veryfast {
.quickedit-animate-delay-veryfast {
-webkit-transition-delay: .05s;
transition-delay: .05s;
}
.edit-animate-delay-fast {
.quickedit-animate-delay-fast {
-webkit-transition-delay: .2s;
transition-delay: .2s;
}
.edit-animate-disable-width {
.quickedit-animate-disable-width {
-webkit-transition: width 0s;
transition: width 0s;
}
.edit-animate-only-visibility {
.quickedit-animate-only-visibility {
-webkit-transition: opacity .2s ease;
transition: opacity .2s ease;
}
......@@ -82,7 +82,7 @@
/**
* In-place editors that don't use a popup.
*/
.edit-validation-errors .messages.error {
.quickedit-validation-errors .messages.error {
box-shadow: 0 0 1px 1px red, 0 0 3px 3px rgba(153, 153, 153, .5);
background-color: white;
}
......@@ -90,7 +90,7 @@
/**
* Styling specific to the 'form' in-place editor.
*/
.edit-form {
.quickedit-form {
box-shadow: 0 0 30px 4px #4f4f4f;
background-color: white;
}
......@@ -98,14 +98,14 @@
/**
* Toolbars.
*/
.edit-toolbar-container {
.quickedit-toolbar-container {
font-family: 'Source Sans Pro','Lucida Grande', sans-serif;
padding-bottom: 7px;
padding-top: 7px;
-webkit-transition: all 1s;
transition: all 1s;
}
.edit-toolbar-container > .edit-toolbar-content {
.quickedit-toolbar-container > .quickedit-toolbar-content {
background-image: -webkit-linear-gradient(top, #fff, #e4e4e4);
background-image: -moz-linear-gradient(top, #fff, #e4e4e4);
background-image: -o-linear-gradient(top, #fff, #e4e4e4);
......@@ -122,7 +122,7 @@
user-select: none;
z-index: 2;
}
.edit-toolbar-container > .edit-toolbar-pointer {
.quickedit-toolbar-container > .quickedit-toolbar-pointer {
background-color: #e4e4e4;
bottom: 2px;
box-shadow: 0 0 0 1px #818181, 0px 0px 0 4px rgba(150, 150, 150, 0.5);
......@@ -136,15 +136,15 @@
width: 16px;
z-index: 1;
}
[dir="rtl"] .edit-toolbar-container > .edit-toolbar-pointer {
[dir="rtl"] .quickedit-toolbar-container > .quickedit-toolbar-pointer {
left: auto;
right: 18px;
}
.edit-toolbar-container.edit-toolbar-pointer-top > .edit-toolbar-pointer {
.quickedit-toolbar-container.quickedit-toolbar-pointer-top > .quickedit-toolbar-pointer {
bottom: auto;
top: 2px;
}
.edit-toolbar-container > .edit-toolbar-lining {
.quickedit-toolbar-container > .quickedit-toolbar-lining {
bottom: 7px;
box-shadow: 0 0 0 1px #818181, 0px 3px 0px 1px rgba(150, 150, 150, 0.5);
display: block;
......@@ -155,43 +155,43 @@
z-index: 0;
}
.edit-toolbar-label {
.quickedit-toolbar-label {
font-style: italic;
overflow: hidden;
padding: 0.333em 0.4em;
text-overflow: ellipsis;
white-space: nowrap;
}
.edit-toolbar-label .field:after {
.quickedit-toolbar-label .field:after {
content: ' → ';
}
/* The toolbar; these are not necessarily visible. */
.edit-toolbar {
.quickedit-toolbar {
font-family: 'Droid sans', 'Lucida Grande', sans-serif;
}
.edit-toolbar-entity {
.quickedit-toolbar-entity {
padding: 0.1667em 0.2em;
}
/**
* Info toolgroup.
*/
.edit-toolbar-fullwidth {
.quickedit-toolbar-fullwidth {
width: 100%;
}
.edit-toolgroup.wysiwyg-floated {
.quickedit-toolgroup.wysiwyg-floated {
float: right; /* LTR */
}
[dir="rtl"] .edit-toolgroup.wysiwyg-floated {
[dir="rtl"] .quickedit-toolgroup.wysiwyg-floated {
float: left;
}
.edit-toolgroup.wysiwyg-main {
.quickedit-toolgroup.wysiwyg-main {
clear: both;
width: 100%;
padding-left: 0; /* LTR */