From 4f84a9f75203a94d29aac3aa82b4421f48e4970f Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 17 Mar 2017 11:19:17 +0100 Subject: [PATCH] Fixes #3092, fixes #2453 and fixed motion projection bug --- openslides/core/static/css/projector.css | 2 +- openslides/core/static/js/core/base.js | 15 +++++++++++++-- openslides/core/static/js/core/projector.js | 2 +- openslides/core/static/js/core/site.js | 1 - .../static/templates/motions/slide_motion.html | 5 +---- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/openslides/core/static/css/projector.css b/openslides/core/static/css/projector.css index ce5b52ad8..8dffa1f4f 100644 --- a/openslides/core/static/css/projector.css +++ b/openslides/core/static/css/projector.css @@ -154,7 +154,7 @@ body { .content { position: absolute; left: 50px; - top: 150px; + top: 100px; right: 50px; z-index: -1; line-height: 1.3em; diff --git a/openslides/core/static/js/core/base.js b/openslides/core/static/js/core/base.js index 3c036d9e0..748ebdc49 100644 --- a/openslides/core/static/js/core/base.js +++ b/openslides/core/static/js/core/base.js @@ -7,6 +7,7 @@ angular.module('OpenSlidesApp.core', [ 'js-data', 'gettext', 'ngAnimate', + 'ngBootbox', 'ngSanitize', // TODO: only use this in functions that need it. 'ui.bootstrap', 'ui.bootstrap.datetimepicker', @@ -151,7 +152,8 @@ angular.module('OpenSlidesApp.core', [ 'gettext', 'gettextCatalog', 'OpenSlidesPlugins', - function (gettext, gettextCatalog, OpenSlidesPlugins) { + '$ngBootbox', + function (gettext, gettextCatalog, OpenSlidesPlugins, $ngBootbox) { return { // get all available languages getLanguages: function () { @@ -194,8 +196,17 @@ angular.module('OpenSlidesApp.core', [ if (language.code == lang) { language.selected = true; gettextCatalog.setCurrentLanguage(lang); + // Plugins if (lang != 'en') { - gettextCatalog.loadRemote("static/i18n/" + lang + ".json"); + gettextCatalog.loadRemote("static/i18n/" + lang + ".json").then(function (success) { + // translate ng-bootbox directives when the translations are available. + $ngBootbox.addLocale(lang, { + OK: gettextCatalog.getString('OK'), + CANCEL: gettextCatalog.getString('Cancel'), + CONFIRM: gettextCatalog.getString('OK'), // Yes, 'OK' is the original string. + }); + $ngBootbox.setLocale(lang); + }); // load language files from plugins angular.forEach(plugins, function (plugin) { if (plugin.languages.indexOf(lang) != -1) { diff --git a/openslides/core/static/js/core/projector.js b/openslides/core/static/js/core/projector.js index fd769560d..7c025528f 100644 --- a/openslides/core/static/js/core/projector.js +++ b/openslides/core/static/js/core/projector.js @@ -171,7 +171,7 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core']) var STEPS = 5; $scope.scroll = 0; var setScroll = function (scroll) { - scroll = -250 * scroll; + scroll = 250 * scroll; if ($scope.scrollTimeout) { $timeout.cancel($scope.scrollTimeout); } diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 0916d0776..79d61c3b0 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -13,7 +13,6 @@ angular.module('OpenSlidesApp.core.site', [ 'formly', 'formlyBootstrap', 'localytics.directives', - 'ngBootbox', 'ngDialog', 'ngFileSaver', 'ngMessages', diff --git a/openslides/motions/static/templates/motions/slide_motion.html b/openslides/motions/static/templates/motions/slide_motion.html index cac4708ec..338f333b5 100644 --- a/openslides/motions/static/templates/motions/slide_motion.html +++ b/openslides/motions/static/templates/motions/slide_motion.html @@ -79,12 +79,9 @@

{{ config('motions_preamble') | translate }}


- -
-