[PE] Bug 39782

This commit is contained in:
Julia Radzhabova 2019-06-11 17:06:10 +03:00
parent 8d4b957598
commit 8bfbea3ef9
2 changed files with 64 additions and 2 deletions

View file

@ -95,6 +95,37 @@ require([
using : 'reporter'
});
var setDocumentTitle = function(title) {
function getUrlParams() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
}
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
presenter = 'Presenter View';
if ( lang == 'de') presenter = '';
else if ( lang == 'es') presenter = '';
else if ( lang == 'fr') presenter = '';
else if ( lang == 'it') presenter = '';
else if ( lang == 'pt') presenter = '';
else if ( lang == 'ru') presenter = 'Режим докладчика';
else if ( lang == 'sl') presenter = '';
else if ( lang == 'tr') presenter = '';
presenter && (presenter += ' - ');
window.document.title = presenter + (title || '');
};
function load_document(data) {
var docInfo = {};
@ -108,7 +139,7 @@ require([
docInfo.put_Options(data.options);
docInfo.put_Token(data.token);
docInfo.put_Permissions(data.permissions || {});
window.document.title = 'Presenter View' + (data.title ? (' - ' + data.title) : '');
setDocumentTitle(data.title);
}
api.preloadReporter(data);

View file

@ -96,6 +96,37 @@ require([
using : 'reporter'
});
var setDocumentTitle = function(title) {
function getUrlParams() {
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
q = window.location.search.substring(1),
urlParams = {};
while (e = r.exec(q))
urlParams[d(e[1])] = d(e[2]);
return urlParams;
}
var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
presenter = 'Presenter View';
if ( lang == 'de') presenter = '';
else if ( lang == 'es') presenter = '';
else if ( lang == 'fr') presenter = '';
else if ( lang == 'it') presenter = '';
else if ( lang == 'pt') presenter = '';
else if ( lang == 'ru') presenter = 'Режим докладчика';
else if ( lang == 'sl') presenter = '';
else if ( lang == 'tr') presenter = '';
presenter && (presenter += ' - ');
window.document.title = presenter + (title || '');
};
function load_document(data) {
var docInfo = {};
@ -109,7 +140,7 @@ require([
docInfo.put_Options(data.options);
docInfo.put_Token(data.token);
docInfo.put_Permissions(data.permissions || {});
window.document.title = 'Presenter View' + (data.title ? (' - ' + data.title) : '');
setDocumentTitle(data.title);
}
api.preloadReporter(data);