Skip to content

Commit

Permalink
Merge remote-tracking branch 'forkcms/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
StijnVrolijk committed Feb 9, 2018
2 parents 5bc1162 + a0055a6 commit 361d9ad
Show file tree
Hide file tree
Showing 147 changed files with 1,183 additions and 1,179 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
5.2.0 (2018-02-09)
------------------

Bugfixes:
* Pages: Fix data-ft-block-optional can also be false of removed [#2409](https://github.com/forkcms/forkcms/pull/2409)
* Core: Fix button macro with icons [#2412](https://github.com/forkcms/forkcms/pull/2412)
* Blog: Add the default fallback for the rss feedback on all the usecases not just a few [#2413](https://github.com/forkcms/forkcms/pull/2413)
* Tags: Fix tag edit action [#2414](https://github.com/forkcms/forkcms/pull/2414)
* Profiles: Show all groups linked to a profile but fade the ones that have expired [#2416](https://github.com/forkcms/forkcms/pull/2416)
* Tags: Make sure the id data attribute of tags in the datagrid contains valid JSON [#2418](https://github.com/forkcms/forkcms/pull/2418)
* Core: Remove annoying whitespace in the datagrid [#2419](https://github.com/forkcms/forkcms/pull/2419)
* MediaLibrary: Media Library in CKEditor - uploaded video has no selection button [#2420](https://github.com/forkcms/forkcms/pull/2420)
* Pages: The edit buttons of blocks in the page edit should be anchors, not buttons [#2427](https://github.com/forkcms/forkcms/pull/2427)
* Blog: Don't publish blogposts created as draft [#2443](https://github.com/forkcms/forkcms/pull/2443)
* Core: Catch Doctrine's DBALException if the database connection fails [#2447](https://github.com/forkcms/forkcms/pull/2447)

Enhancements:
* Core: A11y cancel buttons [#2415](https://github.com/forkcms/forkcms/pull/2415)
* Profiles: Improve the layout of the form to add/edit profile groups [#2417](https://github.com/forkcms/forkcms/pull/2417)
* MediaLibrary: CKEditor media library movies [#2421](https://github.com/forkcms/forkcms/pull/2421)
* MediaLibrary: Make the cropper more accessible [#2425](https://github.com/forkcms/forkcms/pull/2425)
* Core: WCAG audit feedback [#2428](https://github.com/forkcms/forkcms/pull/2428)
* Pages: Make it possible to access all items in navigation tree with keyboard [#2429](https://github.com/forkcms/forkcms/pull/2429)
* Pages: Better default values for the moving page via settings dropdowns [#2430](https://github.com/forkcms/forkcms/pull/2430)
* Core: Use macro for button buttons [#2438](https://github.com/forkcms/forkcms/pull/2438)

Features:
* Core: Make it possible to disable ck editor [#2424](https://github.com/forkcms/forkcms/pull/2424)


5.1.0 (2018-01-25)
------------------

Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.0
5.2.0
3 changes: 1 addition & 2 deletions app/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
imports:
- { resource: console.yml }
- { resource: form.yml }
- { resource: parameters.yml }
- { resource: doctrine.yml }
- { resource: form.yml }

parameters:
fork.is_installed: true
fork.form.theme: 'Core/Layout/Templates/FormLayout.html.twig'

framework:
secret: "%kernel.secret%"
Expand Down
1 change: 1 addition & 0 deletions app/config/config_install.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
imports:
- { resource: console.yml }
- { resource: form.yml }
- { resource: parameters_install.yml }
- { resource: doctrine.yml }

Expand Down
7 changes: 7 additions & 0 deletions app/config/form.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
parameters:
fork.form.theme: 'Core/Layout/Templates/FormLayout.html.twig'
fork.form.default_preferred_editor: 'ck-editor'
fork.form.available_editors:
ck-editor: 'CK Editor'
html: 'HTML'

services:
fork.datepicker.form:
class: Common\Form\DatePickerType
Expand Down
2 changes: 1 addition & 1 deletion app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:

fork.debug_email: <debug-email>
fork.debug_message: 'Internal error.'
fork.version: '5.1.0'
fork.version: '5.2.0'

site.protocol: <site-protocol>
site.domain: <site-domain>
Expand Down
2 changes: 1 addition & 1 deletion app/config/parameters.yml.travis
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:

fork.debug_email: ''
fork.debug_message: 'Internal error.'
fork.version: '5.1.0'
fork.version: '5.2.0'

site.protocol: http
site.domain: fork.local
Expand Down
2 changes: 1 addition & 1 deletion app/config/parameters_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:

fork.debug_email: [email protected]
fork.debug_message: 'Internal error.'
fork.version: '5.1.0'
fork.version: '5.2.0'

site.protocol: <site-protocol>
site.domain: <site-domain>
Expand Down
8 changes: 8 additions & 0 deletions src/Backend/Core/Engine/Base/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ public function execute(): void
'browseActionImages',
BackendModel::createUrlForAction('MediaBrowserImages', 'MediaLibrary') . '#tabLibrary'
);

$this->header->addJsData(
'MediaLibrary',
'browseActionVideos',
BackendModel::createUrlForAction('MediaBrowserVideos', 'MediaLibrary') . '#tabLibrary'
);

$this->header->addJsData('Core', 'preferred_editor', BackendModel::getPreferredEditor());
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Backend/Core/Engine/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public function __construct(
*/
public function addEditor($name, $value = null, $class = null, $classError = null, $HTML = true): SpoonFormTextarea
{
if (BackendModel::getPreferredEditor() !== 'ck-editor') {
return $this->addTextarea($name, $value, $class, $classError, $HTML);
}

if (!$this->header instanceof Header) {
throw new ServiceNotFoundException('header');
}
Expand Down
16 changes: 16 additions & 0 deletions src/Backend/Core/Engine/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,22 @@ public static function insertExtra(
);
}

/**
* This returns the identifier for the editor the logged in user prefers to use in forms.
*
* @return string
*/
public static function getPreferredEditor(): string
{
$defaultPreferredEditor = self::getContainer()->getParameter('fork.form.default_preferred_editor');

if (!Authentication::isLoggedIn()) {
return $defaultPreferredEditor;
}

return Authentication::getUser()->getSetting('preferred_editor', $defaultPreferredEditor);
}

/**
* @param string $module
*
Expand Down
12 changes: 12 additions & 0 deletions src/Backend/Core/Installer/Data/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7245,6 +7245,14 @@
<translation language="zh"><![CDATA[關閉導航]]></translation>
<translation language="de"><![CDATA[schließe die Navigation]]></translation>
</item>
<item type="label" name="OpenTreeNavigation">
<translation language="nl"><![CDATA[klap boomnavigatie open]]></translation>
<translation language="en"><![CDATA[open tree navigation]]></translation>
</item>
<item type="label" name="CloseTreeNavigation">
<translation language="nl"><![CDATA[boomnavigatie dichtklappen]]></translation>
<translation language="en"><![CDATA[close tree navigation]]></translation>
</item>
<item type="label" name="NavigationTitle">
<translation language="nl"><![CDATA[navigatietitel]]></translation>
<translation language="en"><![CDATA[navigation title]]></translation>
Expand Down Expand Up @@ -12151,6 +12159,10 @@
<translation language="nl"><![CDATA[verplaats één positie omlaag]]></translation>
<translation language="en"><![CDATA[move down one position]]></translation>
</item>
<item type="message" name="HelpTextTags">
<translation language="nl"><![CDATA[Typ tekst gevolgd door komma of ⏎ om een nieuwe tag toe te voegen. Typ enkele letters en gebruik pijl omlaag om een bestaande tag te selecteren]]></translation>
<translation language="en"><![CDATA[Type text followed by comma or ⏎ to add a new tag. Type a few letters and use the down arrow to select an existing tag]]></translation>
</item>
</Core>
</Backend>
</locale>
119 changes: 26 additions & 93 deletions src/Backend/Core/Js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var jsBackend =
jsBackend.messages.init()
jsBackend.tooltip.init()
jsBackend.tableSequenceByDragAndDrop.init()
jsBackend.ckeditor.init()
if (jsData.Core.preferred_editor === 'ck-editor') jsBackend.ckeditor.init()
jsBackend.resizeFunctions.init()
jsBackend.navigation.init()

Expand Down Expand Up @@ -437,13 +437,7 @@ jsBackend.ckeditor = {
$('textarea.inputEditor, textarea.inputEditorError').ckeditor(jsBackend.ckeditor.callback, editorConfig)
},

callback: function (element) {
// add the CKFinder
CKFinder.setupCKEditor(null,
{
basePath: '/src/Backend/Core/Js/ckfinder',
width: 800
})
callback: function () {
},

checkContent: function (evt) {
Expand Down Expand Up @@ -480,60 +474,6 @@ jsBackend.ckeditor = {
var dialogDefinition = evt.data.definition
var infoTab = ''

// specific stuff for the image-dialog
if (evt.data.name === 'image') {
// remove the advanced tab because it is confusing fo the end-user
dialogDefinition.removeContents('advanced')

// remove the upload tab because we like our users to think about the place of their images
dialogDefinition.removeContents('Upload')

// remove the Link tab because there is no point of using two interfaces for the same outcome
dialogDefinition.removeContents('Link')

// get the info tab
infoTab = dialogDefinition.getContents('info')

// remove fields we don't want to use, because they will mess up the layout
infoTab.remove('txtBorder')
infoTab.remove('txtHSpace')
infoTab.remove('txtVSpace')
infoTab.remove('txtBorder')
infoTab.remove('cmbAlign')
}

// specific stuff for the link-dialog
if (evt.data.name === 'link') {
// remove the advanced tab because it is confusing fo the end-user
dialogDefinition.removeContents('advanced')

// remove the upload tab because we like our users to think about the place of their images
dialogDefinition.removeContents('upload')

// get the info tab
infoTab = dialogDefinition.getContents('info')

// add a new element
infoTab.add({
type: 'vbox',
id: 'localPageOptions',
children: [
{
type: 'select',
label: jsBackend.locale.msg('EditorSelectInternalPage'),
id: 'localPage',
title: jsBackend.locale.msg('EditorSelectInternalPage'),
items: linkList,
onChange: function (evt) {
CKEDITOR.dialog.getCurrent().getContentElement('info', 'protocol').setValue('')
CKEDITOR.dialog.getCurrent().getContentElement('info', 'linkType').setValue('url')
CKEDITOR.dialog.getCurrent().getContentElement('info', 'url').setValue(evt.data.value)
}
}
]
})
}

// specific stuff for the table-dialog
if (evt.data.name === 'table') {
// remove the advanced tab because it is confusing fo the end-user
Expand All @@ -551,6 +491,30 @@ jsBackend.ckeditor = {
// set a beter default for the width
infoTab.get('txtWidth')['default'] = '100%'
}

if (evt.data.name === 'oembed') {
debugger

dialogDefinition.getContents('general').elements.splice(
2,
0,
{
type: 'button',
id: 'browseServer',
label: 'Browse Server',
onClick: function () {
var editor = this.getDialog().getParentEditor()
editor.popup(window.location.origin + jsData.MediaLibrary.browseActionVideos, 800, 800)

window.onmessage = function (event) {
if (event.data) {
this.setValueOf('general', 'embedCode', event.data)
}
}.bind(this.getDialog())
},
style: 'margin-top: 20px;'
})
}
},

onReady: function (evt) {
Expand Down Expand Up @@ -588,7 +552,6 @@ jsBackend.controls = {
jsBackend.controls.bindRadioButtonFieldCombo()
jsBackend.controls.bindConfirm()
jsBackend.controls.bindFakeDropdown()
jsBackend.controls.bindFullWidthSwitch()
jsBackend.controls.bindMassCheckbox()
jsBackend.controls.bindMassAction()
jsBackend.controls.bindPasswordGenerator()
Expand Down Expand Up @@ -810,36 +773,6 @@ jsBackend.controls = {
})
},

// toggle between full width and sidebar-layout
bindFullWidthSwitch: function () {
// variables
var $fullwidthSwitchLink = $('#fullwidthSwitch a')
var $fullwidthSwitch = $fullwidthSwitchLink.parent()

$fullwidthSwitchLink.toggle(
function (e) {
// prevent default behaviour
e.preventDefault()

// add class
$fullwidthSwitch.addClass('collapsed')

// toggle
$('#subnavigation, #pagesTree').fadeOut(250)
},
function (e) {
// Stuff to do every *even* time the element is clicked
e.preventDefault()

// remove class
$fullwidthSwitch.removeClass('collapsed')

// toggle
$('#subnavigation, #pagesTree').fadeIn(500)
}
)
},

// bind confirm message
bindMassAction: function () {
var $checkboxes = $('table.jsDataGrid .check input:checkbox')
Expand Down
2 changes: 1 addition & 1 deletion src/Backend/Core/Layout/Css/screen.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Backend/Core/Layout/Css/screen.css.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/Backend/Core/Layout/Sass/_bootstrap-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ $gray-lightest: #f1f1f1;
$gray-border: #cccccc;
$white: #fff;

$brand-primary: #2f77d1;
$brand-primary: #2F77CF;
$brand-primary-dark: #01417b;
$brand-primary-darker: #021b45;
$brand-success: #2C9F42;
$brand-success: #068820;
$brand-info: #5bc0de;
$brand-warning: #F5A623;
$brand-danger: #d0021b;
Expand Down Expand Up @@ -512,19 +512,19 @@ $jumbotron-font-size: ceil(($font-size-base * 1.5));
//## Define colors for form feedback states and, by default, alerts.

$state-success-text: $white;
$state-success-bg: rgba($brand-success, .9);
$state-success-bg: $brand-success;
$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%);

$state-info-text: $white;
$state-info-bg: rgba($brand-primary, .9);
$state-info-bg: $brand-primary;
$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%);

$state-warning-text: $brand-warning;
$state-warning-bg: rgba($brand-warning, .9);
$state-warning-bg: $brand-warning;
$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%);

$state-danger-text: $white;
$state-danger-bg: rgba($brand-danger, .9);
$state-danger-bg: $brand-danger;
$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%);


Expand Down Expand Up @@ -647,8 +647,8 @@ $alert-info-bg: $state-info-bg;
$alert-info-text: $state-info-text;
$alert-info-border: $state-info-border;

$alert-warning-bg: $state-warning-bg;
$alert-warning-text: $white;
$alert-warning-bg: #FCDB9E;
$alert-warning-text: $gray-base;
$alert-warning-border: $state-warning-border;

$alert-danger-bg: $state-danger-bg;
Expand Down
9 changes: 9 additions & 0 deletions src/Backend/Core/Layout/Sass/components/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
}
}

.alert-warning {
a,
.fa,
.close {
border-color: $gray-base;
color: $gray-base;
}
}

.alert-static {
margin: -25px 0 25px;
padding: 9px 0;
Expand Down
Loading

0 comments on commit 361d9ad

Please sign in to comment.