Skip to content

Commit

Permalink
Merge pull request ezsystems#305 from ezsystems/ezp-24731_embed
Browse files Browse the repository at this point in the history
EZP-24731: As an editor, I want to be able to add embed elements in the RichText editor
  • Loading branch information
dpobel committed Sep 2, 2015
2 parents a2c299b + d514be9 commit 4287c98
Show file tree
Hide file tree
Showing 28 changed files with 1,608 additions and 880 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -2,6 +2,8 @@
Tests/report/
*-coverage.js
Tests/instrument/
Tests/js/alloyeditor/toolbars/assets/*.js
Tests/js/alloyeditor/buttons/assets/*.js
node_modules/
Resources/public/vendors/
/vendor/
Expand Down
4 changes: 3 additions & 1 deletion ApplicationConfig/Providers/RootInfo.php
Expand Up @@ -16,10 +16,11 @@ class RootInfo implements Provider
/** @var \Symfony\Component\Templating\Asset\PackageInterface */
private $assetsHelper;

public function __construct(RequestStack $requestStack, AssetsHelper $assetsHelper)
public function __construct(RequestStack $requestStack, AssetsHelper $assetsHelper, $externalAssetsDirectory)
{
$this->requestStack = $requestStack;
$this->assetsHelper = $assetsHelper;
$this->externalAssetsDirectory = $externalAssetsDirectory;
}

/**
Expand All @@ -30,6 +31,7 @@ public function getConfig()
return [
'root' => $this->requestStack->getMasterRequest()->attributes->get('semanticPathInfo'),
'assetRoot' => $this->assetsHelper->getUrl('/'),
'ckeditorPluginPath' => $this->assetsHelper->getUrl($this->externalAssetsDirectory) . '/vendors/',
];
}
}
2 changes: 2 additions & 0 deletions Resources/config/css.yml
Expand Up @@ -82,6 +82,7 @@ system:
- 'bundles/ezplatformui/css/modules/table-data.css'
- 'bundles/ezplatformui/css/modules/breadcrumbs.css'
- 'bundles/ezplatformui/css/modules/yui-calendar.css'
- 'bundles/ezplatformui/css/alloyeditor/content.css'
- 'bundles/ezplatformui/css/alloyeditor/toolbars/appendcontent.css'
# theme stylesheets
- 'bundles/ezplatformui/css/theme/app.css'
Expand Down Expand Up @@ -146,4 +147,5 @@ system:
- 'bundles/ezplatformui/css/theme/modules/breadcrumbs.css'
- 'bundles/ezplatformui/css/theme/modules/yui-calendar.css'
- 'bundles/ezplatformui/css/theme/alloyeditor/general.css'
- 'bundles/ezplatformui/css/theme/alloyeditor/content.css'
- 'bundles/ezplatformui/css/theme/alloyeditor/toolbars/appendcontent.css'
1 change: 1 addition & 0 deletions Resources/config/services.yml
Expand Up @@ -67,6 +67,7 @@ services:
arguments:
- @request_stack
- @templating.helper.assets
- %ez_platformui.external_assets_public_dir%
tags:
- {name: ezsystems.platformui.application_config_provider, key: 'rootInfo'}

Expand Down
8 changes: 8 additions & 0 deletions Resources/config/yui.yml
Expand Up @@ -16,12 +16,18 @@ system:
ez-alloyeditor-plugin-appendcontent:
requires: ['ez-alloyeditor']
path: %ez_platformui.public_dir%/js/alloyeditor/plugins/appendcontent.js
ez-alloyeditor-plugin-embed:
requires: ['ez-alloyeditor']
path: %ez_platformui.public_dir%/js/alloyeditor/plugins/embed.js
ez-alloyeditor-toolbar-appendcontent:
requires: ['ez-alloyeditor']
path: %ez_platformui.public_dir%/js/alloyeditor/toolbars/appendcontent.js
ez-alloyeditor-button-heading:
requires: ['ez-alloyeditor']
path: %ez_platformui.public_dir%/js/alloyeditor/buttons/heading.js
ez-alloyeditor-button-embed:
requires: ['ez-alloyeditor']
path: %ez_platformui.public_dir%/js/alloyeditor/buttons/embed.js
ez-platformuiapp:
requires:
- 'app'
Expand Down Expand Up @@ -421,9 +427,11 @@ system:
- 'ez-fieldeditview'
- 'ez-alloyeditor'
- 'ez-richtextfocusmodebarview'
- 'ez-alloyeditor-plugin-embed'
- 'ez-alloyeditor-plugin-appendcontent'
- 'ez-alloyeditor-toolbar-appendcontent'
- 'ez-alloyeditor-button-heading'
- 'ez-alloyeditor-button-embed'
- 'richtexteditview-ez-template'
path: %ez_platformui.public_dir%/js/views/fields/ez-richtext-editview.js
richtexteditview-ez-template:
Expand Down
22 changes: 22 additions & 0 deletions Resources/public/css/alloyeditor/content.css
@@ -0,0 +1,22 @@
/**
* Copyright (C) eZ Systems AS. All rights reserved.
* For full copyright and license information view LICENSE file distributed with this source code.
*/

.ez-richtext-editable ezembed {
display: block;
margin: 1em 0.1em;
line-height: 2em;
height: 2em;
}

.ez-richtext-editable ezembed:before {
padding: 0 0.2em 0 0.5em;
}

.ez-richtext-editable ezembed:before,
.ez-richtext-editable ezembed:after {
line-height: 100%;
height: 100%;
display: inline-block;
}
7 changes: 6 additions & 1 deletion Resources/public/css/alloyeditor/toolbars/appendcontent.css
Expand Up @@ -6,8 +6,13 @@
.ae-ui .ez-ae-appendcontent .ez-ae-labeled-button {
width: auto;
height: auto;
margin: 0.3em 0.8em;
}

.ae-ui .ez-ae-appendcontent .ez-ae-label {
margin: 0;
margin: 0.3em 0 0 0;
}

.ae-ui .ez-ae-icon:before {
display: block;
}
26 changes: 26 additions & 0 deletions Resources/public/css/theme/alloyeditor/content.css
@@ -0,0 +1,26 @@
/**
* Copyright (C) eZ Systems AS. All rights reserved.
* For full copyright and license information view LICENSE file distributed with this source code.
*/

.ez-richtext-editable ezembed {
background: #eee;
border: 1px solid #aaa;
font-size: 1.1em;
}

.ez-richtext-editable ezembed:before {
font-family: 'ez-platformui-icomoon';
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;

content: "\E62e";
}

.ez-richtext-editable ezembed:after {
content: attr(href);
}
Expand Up @@ -10,3 +10,11 @@
.ae-ui .ez-ae-appendcontent .ez-ae-label {
font-size: 80%;
}

.ae-ui .ez-ae-icon:before {
font-size: 28px;
}

.ae-ui .ez-ae-icon-embed:before {
content: "\E62e";
}
Binary file modified Resources/public/fonts/icomoon.eot
Binary file not shown.
1 change: 1 addition & 0 deletions Resources/public/fonts/icomoon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/public/fonts/icomoon.ttf
Binary file not shown.
Binary file modified Resources/public/fonts/icomoon.woff
Binary file not shown.

0 comments on commit 4287c98

Please sign in to comment.