diff --git a/CHANGELOG b/CHANGELOG
index 915486123..125909cd7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -31,6 +31,7 @@ Core:
- Added template hook system for plugins.
- Made a lot of code clean up, improvements and bug fixes in client and
backend.
+- Use CKEditor for editin projector messages.
Motions:
- Added adjustable line numbering mode (outside, inside, none) for each
diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js
index 645b289c7..29530ff25 100644
--- a/openslides/core/static/js/core/site.js
+++ b/openslides/core/static/js/core/site.js
@@ -381,6 +381,43 @@ angular.module('OpenSlidesApp.core.site', [
}
])
+.factory('ProjectorMessageForm', [
+ 'Editor',
+ 'gettextCatalog',
+ function (Editor, gettextCatalog) {
+ return {
+ getDialog: function (message) {
+ return {
+ template: 'static/templates/core/projector-message-form.html',
+ controller: 'ProjectorMessageEditCtrl',
+ className: 'ngdialog-theme-default wide-form',
+ closeByEscape: false,
+ closeByDocument: false,
+ resolve: {
+ projectorMessage: function () {
+ return message;
+ }
+ },
+ };
+ },
+ getFormFields: function () {
+ return [
+ {
+ key: 'message',
+ type: 'editor',
+ templateOptions: {
+ label: gettextCatalog.getString('Message'),
+ },
+ data: {
+ ckeditorOptions: Editor.getOptions()
+ }
+ },
+ ];
+ },
+ };
+ }
+])
+
/* This factory handles the filtering of the OS-data-tables. It contains
* all logic needed for the table header filtering. Things to configure:
* - multiselectFilters: A dict associating the filter name to a list (empty per default). E.g.
@@ -992,8 +1029,11 @@ angular.module('OpenSlidesApp.core.site', [
'ProjectorMessage',
'Countdown',
'gettextCatalog',
+ 'ngDialog',
+ 'ProjectorMessageForm',
function($scope, $http, $interval, $state, $q, Config, Projector, CurrentListOfSpeakersItem,
- ListOfSpeakersOverlay, ProjectionDefault, ProjectorMessage, Countdown, gettextCatalog) {
+ ListOfSpeakersOverlay, ProjectionDefault, ProjectorMessage, Countdown, gettextCatalog,
+ ngDialog, ProjectorMessageForm) {
ProjectorMessage.bindAll({}, $scope, 'messages');
var intervals = [];
@@ -1106,8 +1146,7 @@ angular.module('OpenSlidesApp.core.site', [
// *** message functions ***
$scope.editMessage = function (message) {
- message.editFlag = false;
- ProjectorMessage.save(message);
+ ngDialog.open(ProjectorMessageForm.getDialog(message));
};
$scope.addMessage = function () {
var message = {message: ''};
@@ -1130,6 +1169,23 @@ angular.module('OpenSlidesApp.core.site', [
}
])
+.controller('ProjectorMessageEditCtrl', [
+ '$scope',
+ 'projectorMessage',
+ 'ProjectorMessage',
+ 'ProjectorMessageForm',
+ function ($scope, projectorMessage, ProjectorMessage, ProjectorMessageForm) {
+ $scope.formFields = ProjectorMessageForm.getFormFields();
+ $scope.model = angular.copy(projectorMessage);
+
+ $scope.save = function (message) {
+ ProjectorMessage.inject(message);
+ ProjectorMessage.save(message);
+ $scope.closeThisDialog();
+ };
+ }
+])
+
.controller('ManageProjectorsCtrl', [
'$scope',
'$http',
diff --git a/openslides/core/static/templates/core/projector-controls.html b/openslides/core/static/templates/core/projector-controls.html
index c1fa61031..2ca50baaa 100644
--- a/openslides/core/static/templates/core/projector-controls.html
+++ b/openslides/core/static/templates/core/projector-controls.html
@@ -239,7 +239,7 @@
@@ -249,18 +249,7 @@
ng-class="{ 'projected': isProjected(message).length }">