Merge pull request #3094 from FinnStutzenstein/Issue3092

Fixes #3092, fixes #2453 and fixed motion projection bug
This commit is contained in:
Norman Jäckel 2017-03-21 17:20:49 +01:00 committed by GitHub
commit a412ff9eb3
5 changed files with 16 additions and 9 deletions

View File

@ -154,7 +154,7 @@ body {
.content { .content {
position: absolute; position: absolute;
left: 50px; left: 50px;
top: 150px; top: 100px;
right: 50px; right: 50px;
z-index: -1; z-index: -1;
line-height: 1.3em; line-height: 1.3em;

View File

@ -7,6 +7,7 @@ angular.module('OpenSlidesApp.core', [
'js-data', 'js-data',
'gettext', 'gettext',
'ngAnimate', 'ngAnimate',
'ngBootbox',
'ngSanitize', // TODO: only use this in functions that need it. 'ngSanitize', // TODO: only use this in functions that need it.
'ui.bootstrap', 'ui.bootstrap',
'ui.bootstrap.datetimepicker', 'ui.bootstrap.datetimepicker',
@ -151,7 +152,8 @@ angular.module('OpenSlidesApp.core', [
'gettext', 'gettext',
'gettextCatalog', 'gettextCatalog',
'OpenSlidesPlugins', 'OpenSlidesPlugins',
function (gettext, gettextCatalog, OpenSlidesPlugins) { '$ngBootbox',
function (gettext, gettextCatalog, OpenSlidesPlugins, $ngBootbox) {
return { return {
// get all available languages // get all available languages
getLanguages: function () { getLanguages: function () {
@ -194,8 +196,17 @@ angular.module('OpenSlidesApp.core', [
if (language.code == lang) { if (language.code == lang) {
language.selected = true; language.selected = true;
gettextCatalog.setCurrentLanguage(lang); gettextCatalog.setCurrentLanguage(lang);
// Plugins
if (lang != 'en') { 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 // load language files from plugins
angular.forEach(plugins, function (plugin) { angular.forEach(plugins, function (plugin) {
if (plugin.languages.indexOf(lang) != -1) { if (plugin.languages.indexOf(lang) != -1) {

View File

@ -171,7 +171,7 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core'])
var STEPS = 5; var STEPS = 5;
$scope.scroll = 0; $scope.scroll = 0;
var setScroll = function (scroll) { var setScroll = function (scroll) {
scroll = -250 * scroll; scroll = 250 * scroll;
if ($scope.scrollTimeout) { if ($scope.scrollTimeout) {
$timeout.cancel($scope.scrollTimeout); $timeout.cancel($scope.scrollTimeout);
} }

View File

@ -13,7 +13,6 @@ angular.module('OpenSlidesApp.core.site', [
'formly', 'formly',
'formlyBootstrap', 'formlyBootstrap',
'localytics.directives', 'localytics.directives',
'ngBootbox',
'ngDialog', 'ngDialog',
'ngFileSaver', 'ngFileSaver',
'ngMessages', 'ngMessages',

View File

@ -79,12 +79,9 @@
<div><p>{{ config('motions_preamble') | translate }}</p></div><br> <div><p>{{ config('motions_preamble') | translate }}</p></div><br>
<!-- Text --> <!-- Text -->
<!-- <div ng-bind-html="motion.getTextWithLineBreaks(null, line, scroll) | trusted"
class="motion-text line-numbers-{{ config('motions_default_line_numbering') }}"></div> -->
<!-- Original view --> <!-- Original view -->
<div ng-if="mode == 'original'"> <div ng-if="mode == 'original'">
<div id="view-original-inline-editor" ng-bind-html="motion.getTextWithLineBreaks(null, line, scroll) | trusted" <div id="view-original-inline-editor" ng-bind-html="motion.getTextWithLineBreaks(null, line) | trusted"
class="motion-text motion-text-original line-numbers-{{ config('motions_default_line_numbering') }}" class="motion-text motion-text-original line-numbers-{{ config('motions_default_line_numbering') }}"
contenteditable="false"></div> contenteditable="false"></div>
</div> </div>