Merge branch 'release/v6.1.0' into develop
This commit is contained in:
commit
1956a2e365
|
@ -185,7 +185,7 @@ define([
|
|||
el.find('.color-palette a').removeClass('active');
|
||||
$target.addClass('active');
|
||||
me.currentColor = color;
|
||||
if (effectId) {
|
||||
if (effectId!==undefined) {
|
||||
me.currentColor = {color: color, effectId: effectId};
|
||||
}
|
||||
me.trigger('select', me, me.currentColor);
|
||||
|
|
|
@ -88,6 +88,7 @@ define([
|
|||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||
this.api.asc_registerCallback('asc_onAddComment', _.bind(this.onApiAddComment, this));
|
||||
this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this));
|
||||
this.api.asc_registerCallback('asc_onChangeCommentData', _.bind(this.onApiChangeCommentData, this));
|
||||
|
@ -229,6 +230,13 @@ define([
|
|||
me.initComments();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content');
|
||||
} else {
|
||||
var length = 0;
|
||||
_.each(editUsers, function (item) {
|
||||
if ((item.asc_getState()!==false) && !item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
(length<1) && $('#item-edit-users').hide();
|
||||
|
||||
if(editor === 'DE' && !this.appConfig.canReview && !canViewReview) {
|
||||
$('#reviewing-settings').hide();
|
||||
}
|
||||
|
@ -241,6 +249,20 @@ define([
|
|||
editUsers = users;
|
||||
},
|
||||
|
||||
onUserConnection: function(change){
|
||||
var changed = false;
|
||||
for (var uid in editUsers) {
|
||||
if (undefined !== uid) {
|
||||
var user = editUsers[uid];
|
||||
if (user && user.asc_getId() == change.asc_getId()) {
|
||||
editUsers[uid] = change;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
!changed && change && (editUsers[change.asc_getId()] = change);
|
||||
},
|
||||
|
||||
getUsersInfo: function() {
|
||||
var usersArray = [];
|
||||
_.each(editUsers, function(item){
|
||||
|
@ -250,7 +272,7 @@ define([
|
|||
if (fio.length > 1) {
|
||||
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
if((item.asc_getState()!==false) && !item.asc_getView()) {
|
||||
var userAttr = {
|
||||
color: item.asc_getColor(),
|
||||
id: item.asc_getId(),
|
||||
|
@ -810,9 +832,6 @@ define([
|
|||
me.indexCurrentComment = 0;
|
||||
me.updateViewComment();
|
||||
}
|
||||
if (window.SSE) {
|
||||
SSE.getController('AddOther').setHideAddComment(true);
|
||||
}
|
||||
},
|
||||
|
||||
apiHideComments: function() {
|
||||
|
@ -820,9 +839,6 @@ define([
|
|||
uiApp.closeModal();
|
||||
$('.container-view-comment').remove();
|
||||
}
|
||||
if (window.SSE) {
|
||||
SSE.getController('AddOther').setHideAddComment(false);
|
||||
}
|
||||
},
|
||||
|
||||
disabledViewComments: function(disabled) {
|
||||
|
@ -1341,8 +1357,11 @@ define([
|
|||
onEditComment: function(comment) {
|
||||
var value = $('#comment-text')[0].value.trim();
|
||||
if (value && value.length > 0) {
|
||||
this.getCurrentUser();
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.comment = value;
|
||||
comment.userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
if ($('.container-view-comment').length > 0) {
|
||||
|
@ -1421,9 +1440,12 @@ define([
|
|||
onEditReply: function(comment, indReply) {
|
||||
var value = $('.edit-reply-textarea')[0].value.trim();
|
||||
if (value && value.length > 0) {
|
||||
this.getCurrentUser();
|
||||
if ($('.container-view-comment').length > 0) {
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.replys[indReply].reply = value;
|
||||
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.replys[indReply].username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
if (Common.SharedSettings.get('phone')) {
|
||||
|
@ -1440,6 +1462,8 @@ define([
|
|||
} else {
|
||||
if (!_.isUndefined(this.onChangeComment)) {
|
||||
comment.replys[indReply].reply = value;
|
||||
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
|
||||
comment.replys[indReply].username = this.currentUser.asc_getUserName();
|
||||
this.onChangeComment(comment);
|
||||
}
|
||||
rootView.router.back();
|
||||
|
@ -1514,7 +1538,9 @@ define([
|
|||
date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
|
||||
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()});
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
|
||||
});
|
||||
var username = data.asc_getReply(i).asc_getUserName();
|
||||
replies.push({
|
||||
ind : i,
|
||||
|
@ -1535,8 +1561,10 @@ define([
|
|||
readSDKComment: function(id, data) {
|
||||
var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}),
|
||||
groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getUserId());
|
||||
});
|
||||
var groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
|
||||
var username = data.asc_getUserName();
|
||||
var comment = {
|
||||
uid : id,
|
||||
|
@ -1577,7 +1605,9 @@ define([
|
|||
date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
|
||||
|
||||
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()});
|
||||
var user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getUserId());
|
||||
});
|
||||
comment.comment = data.asc_getText();
|
||||
comment.userid = data.asc_getUserId();
|
||||
comment.username = data.asc_getUserName();
|
||||
|
@ -1597,7 +1627,9 @@ define([
|
|||
dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
|
||||
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
|
||||
|
||||
user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()});
|
||||
user = _.find(editUsers, function(item){
|
||||
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
|
||||
});
|
||||
var username = data.asc_getReply(i).asc_getUserName();
|
||||
replies.push({
|
||||
ind : i,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<li id="item-edit-users">
|
||||
<a id="list-edit-users" class="item-link" data-page="#edit-users-view">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
|
|
|
@ -164,3 +164,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px @themeColor;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
|
|
@ -168,4 +168,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px @themeColor;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
|
|
@ -91,12 +91,16 @@ DE.ApplicationController = new(function(){
|
|||
permissions = $.extend(permissions, docConfig.permissions);
|
||||
|
||||
var _permissions = $.extend({}, docConfig.permissions),
|
||||
docInfo = new Asc.asc_CDocInfo();
|
||||
docInfo = new Asc.asc_CDocInfo(),
|
||||
_user = new Asc.asc_CUserInfo();
|
||||
_user.put_Id(config.user && config.user.id ? config.user.id : ('uid-' + Date.now()));
|
||||
|
||||
docInfo.put_Id(docConfig.key);
|
||||
docInfo.put_Url(docConfig.url);
|
||||
docInfo.put_Title(docConfig.title);
|
||||
docInfo.put_Format(docConfig.fileType);
|
||||
docInfo.put_VKey(docConfig.vkey);
|
||||
docInfo.put_UserInfo(_user);
|
||||
docInfo.put_Token(docConfig.token);
|
||||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(config.encryptionKeys);
|
||||
|
|
|
@ -631,9 +631,11 @@ define([
|
|||
},
|
||||
|
||||
autoCorrect: function() {
|
||||
(new Common.Views.AutoCorrectDialog({
|
||||
if (this.dlgAutoCorrect && this.dlgAutoCorrect.isVisible()) return;
|
||||
this.dlgAutoCorrect = new Common.Views.AutoCorrectDialog({
|
||||
api: this.api
|
||||
})).show();
|
||||
});
|
||||
this.dlgAutoCorrect.show();
|
||||
},
|
||||
|
||||
strLiveComment: 'Turn on option',
|
||||
|
@ -1127,7 +1129,7 @@ define([
|
|||
|
||||
var appname = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appname) {
|
||||
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || '');
|
||||
appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || '');
|
||||
this.lblApplication.text(appname);
|
||||
}
|
||||
this._ShowHideInfoItem(this.lblApplication, !!appname);
|
||||
|
|
|
@ -207,7 +207,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
|||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||
this.Spacing = properties.get_Spacing();
|
||||
}
|
||||
this.Spacing.put_Before(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
||||
var value = field.getNumberValue();
|
||||
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
||||
}, this));
|
||||
this.spinners.push(this.numSpacingBefore);
|
||||
|
||||
|
@ -227,7 +228,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
|||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||
this.Spacing = properties.get_Spacing();
|
||||
}
|
||||
this.Spacing.put_After(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
||||
var value = field.getNumberValue();
|
||||
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
||||
}, this));
|
||||
this.spinners.push(this.numSpacingAfter);
|
||||
|
||||
|
@ -795,8 +797,10 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
|
|||
this.numIndentsLeft.setValue(this.LeftIndent!==null ? Common.Utils.Metric.fnRecalcFromMM(this.LeftIndent) : '', true);
|
||||
this.numIndentsRight.setValue((props.get_Ind() !== null && props.get_Ind().get_Right() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Ind().get_Right()) : '', true);
|
||||
|
||||
this.numSpacingBefore.setValue((props.get_Spacing() !== null && props.get_Spacing().get_Before() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Before()) : '', true);
|
||||
this.numSpacingAfter.setValue((props.get_Spacing() !== null && props.get_Spacing().get_After() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_After()) : '', true);
|
||||
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
||||
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
||||
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
||||
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
||||
|
||||
var linerule = props.get_Spacing().get_LineRule();
|
||||
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
||||
|
|
|
@ -639,9 +639,9 @@ define([
|
|||
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
|
||||
|
||||
if (!me.appOptions.canReview) {
|
||||
var canViewReview = me.appOptions.isEdit || me.api.asc_HaveRevisionsChanges(true);
|
||||
DE.getController('Common.Controllers.Collaboration').setCanViewReview(canViewReview);
|
||||
if (canViewReview) {
|
||||
me.appOptions.canViewReview = me.appOptions.isEdit || me.api.asc_HaveRevisionsChanges(true);
|
||||
DE.getController('Common.Controllers.Collaboration').setCanViewReview(me.appOptions.canViewReview);
|
||||
if (me.appOptions.canViewReview) {
|
||||
var viewReviewMode = Common.localStorage.getItem("de-view-review-mode");
|
||||
if (viewReviewMode===null)
|
||||
viewReviewMode = me.appOptions.customization && /^(original|final|markup)$/i.test(me.appOptions.customization.reviewDisplay) ? me.appOptions.customization.reviewDisplay.toLocaleLowerCase() : 'original';
|
||||
|
@ -649,6 +649,7 @@ define([
|
|||
DE.getController('Common.Controllers.Collaboration').turnDisplayMode(viewReviewMode);
|
||||
}
|
||||
}
|
||||
DE.getController('Toolbar').displayCollaboration();
|
||||
|
||||
Common.Gateway.documentReady();
|
||||
|
||||
|
|
|
@ -442,7 +442,7 @@ define([
|
|||
|
||||
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appProps) {
|
||||
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || '');
|
||||
var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || '');
|
||||
appName ? $('#settings-doc-application').html(appName) : $('.display-application').remove();
|
||||
}
|
||||
var props = (this.api) ? this.api.asc_getCoreProps() : null;
|
||||
|
|
|
@ -52,6 +52,7 @@ define([
|
|||
DE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
|
||||
// private
|
||||
var stateDisplayMode = false;
|
||||
var _users = [];
|
||||
|
||||
return {
|
||||
models: [],
|
||||
|
@ -78,12 +79,14 @@ define([
|
|||
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
|
||||
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
this.mode = mode;
|
||||
this.getView('Toolbar').setMode(mode);
|
||||
},
|
||||
|
||||
|
@ -191,19 +194,38 @@ define([
|
|||
DE.getController('Settings').hideModal();
|
||||
},
|
||||
|
||||
displayCollaboration: function(users) {
|
||||
if(users !== undefined) {
|
||||
displayCollaboration: function() {
|
||||
if(_users !== undefined) {
|
||||
var length = 0;
|
||||
_.each(users, function (item) {
|
||||
if (!item.asc_getView())
|
||||
_.each(_users, function (item) {
|
||||
if ((item.asc_getState()!==false) && !item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
if (length > 0) {
|
||||
$('#toolbar-collaboration').show();
|
||||
} else {
|
||||
if (length < 1 && this.mode && !this.mode.canViewComments && !this.mode.canReview && !this.mode.canViewReview)
|
||||
$('#toolbar-collaboration').hide();
|
||||
else
|
||||
$('#toolbar-collaboration').show();
|
||||
}
|
||||
},
|
||||
|
||||
onUsersChanged: function(users) {
|
||||
_users = users;
|
||||
this.displayCollaboration();
|
||||
},
|
||||
|
||||
onUserConnection: function(change){
|
||||
var changed = false;
|
||||
for (var uid in _users) {
|
||||
if (undefined !== uid) {
|
||||
var user = _users[uid];
|
||||
if (user && user.asc_getId() == change.asc_getId()) {
|
||||
_users[uid] = change;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
!changed && change && (_users[change.asc_getId()] = change);
|
||||
this.displayCollaboration();
|
||||
},
|
||||
|
||||
dlgLeaveTitleText : 'You leave the application',
|
||||
|
|
|
@ -244,7 +244,7 @@ define([
|
|||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-1, distance - step);
|
||||
} else {
|
||||
distance = Math.min(maxValue, distance + step);
|
||||
distance = (distance<0) ? 0 : Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
@ -273,7 +273,7 @@ define([
|
|||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-1, distance - step);
|
||||
} else {
|
||||
distance = Math.min(maxValue, distance + step);
|
||||
distance = (distance<0) ? 0 : Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
|
|
@ -132,8 +132,8 @@ define([
|
|||
_paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small');
|
||||
_paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all');
|
||||
|
||||
_fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
|
||||
$('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
|
||||
_fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
|
||||
$('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -327,9 +327,9 @@ define([
|
|||
spacing = _fontInfo.letterSpacing;
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
spacing = Math.max(-100, --spacing);
|
||||
spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing);
|
||||
} else {
|
||||
spacing = Math.min(100, ++spacing);
|
||||
spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing);
|
||||
}
|
||||
_fontInfo.letterSpacing = spacing;
|
||||
|
||||
|
@ -370,7 +370,9 @@ define([
|
|||
}
|
||||
|
||||
if (this.api) {
|
||||
this.api.put_TextColor(Common.Utils.ThemeColor.getRgbColor("000000"));
|
||||
var color = new Asc.asc_CColor();
|
||||
color.put_auto(true);
|
||||
this.api.put_TextColor(color);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -449,7 +451,8 @@ define([
|
|||
onApiBullets: function(data) {
|
||||
var type = data.get_ListType(),
|
||||
subtype = data.get_ListSubType();
|
||||
|
||||
$('.dataview.bullets li').removeClass('active');
|
||||
$('.dataview.numbers li').removeClass('active');
|
||||
switch (type) {
|
||||
case 0:
|
||||
$('.dataview.bullets li[data-type=' + subtype + ']').addClass('active');
|
||||
|
@ -457,6 +460,9 @@ define([
|
|||
case 1:
|
||||
$('.dataview.numbers li[data-type=' + subtype + ']').addClass('active');
|
||||
break;
|
||||
default:
|
||||
$('.dataview.bullets li[data-type="-1"]').addClass('active');
|
||||
$('.dataview.numbers li[data-type="-1"]').addClass('active');
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -480,12 +486,17 @@ define([
|
|||
|
||||
onApiTextColor: function (color) {
|
||||
var me = this;
|
||||
var palette = this.getView('EditText').paletteTextColor;
|
||||
|
||||
if (color.get_auto()) {
|
||||
if (palette) {
|
||||
palette.clearSelection();
|
||||
}
|
||||
|
||||
$('#font-color .color-preview').css('background-color', '#000');
|
||||
$('#font-color-auto').addClass('active');
|
||||
} else {
|
||||
var palette = me.getView('EditText').paletteTextColor,
|
||||
clr;
|
||||
var clr;
|
||||
|
||||
if (color) {
|
||||
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
|
||||
|
@ -499,7 +510,7 @@ define([
|
|||
|
||||
$('#font-color .color-preview').css('background-color', '#' + (_.isObject(clr) ? clr.color : clr));
|
||||
}
|
||||
|
||||
$('#font-color-auto').removeClass('active');
|
||||
if (palette) {
|
||||
palette.select(clr);
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="150" value="0" step="1">
|
||||
<input type="range" min="0" max="55" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
<a id="font-color-auto" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-media">
|
||||
<div style="width:22px; height: 22px; background-color: #000;"></div>
|
||||
<div class="color-auto" style="width:22px; height: 22px; background-color: #000;"></div>
|
||||
</div>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textAutomatic %></div>
|
||||
|
|
|
@ -6354,6 +6354,10 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after
|
|||
.custom-colors .color-picker-wheel .color-picker-sb-spectrum-handle.color-picker-sb-spectrum-handle-pressed:after {
|
||||
transform: scale(1.5) translate(-33.333%, -33.333%);
|
||||
}
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px #446995;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.about .page-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -5929,6 +5929,10 @@ html.phone .document-menu .list-block .item-link {
|
|||
.custom-colors .color-picker-wheel .color-picker-sb-spectrum-handle.color-picker-sb-spectrum-handle-pressed:after {
|
||||
transform: scale(1.5) translate(-33.333%, -33.333%);
|
||||
}
|
||||
#font-color-auto.active .color-auto {
|
||||
box-shadow: 0 0 0 1px white, 0 0 0 4px #446995;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.about .page-content {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -92,12 +92,16 @@ PE.ApplicationController = new(function(){
|
|||
permissions = $.extend(permissions, docConfig.permissions);
|
||||
|
||||
var _permissions = $.extend({}, docConfig.permissions),
|
||||
docInfo = new Asc.asc_CDocInfo();
|
||||
docInfo = new Asc.asc_CDocInfo(),
|
||||
_user = new Asc.asc_CUserInfo();
|
||||
_user.put_Id(config.user && config.user.id ? config.user.id : ('uid-' + Date.now()));
|
||||
|
||||
docInfo.put_Id(docConfig.key);
|
||||
docInfo.put_Url(docConfig.url);
|
||||
docInfo.put_Title(docConfig.title);
|
||||
docInfo.put_Format(docConfig.fileType);
|
||||
docInfo.put_VKey(docConfig.vkey);
|
||||
docInfo.put_UserInfo(_user);
|
||||
docInfo.put_Token(docConfig.token);
|
||||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(config.encryptionKeys);
|
||||
|
|
|
@ -543,9 +543,11 @@ define([
|
|||
},
|
||||
|
||||
autoCorrect: function() {
|
||||
(new Common.Views.AutoCorrectDialog({
|
||||
if (this.dlgAutoCorrect && this.dlgAutoCorrect.isVisible()) return;
|
||||
this.dlgAutoCorrect = new Common.Views.AutoCorrectDialog({
|
||||
api: this.api
|
||||
})).show();
|
||||
});
|
||||
this.dlgAutoCorrect.show();
|
||||
},
|
||||
|
||||
strInputMode: 'Turn on hieroglyphs',
|
||||
|
@ -998,7 +1000,7 @@ define([
|
|||
|
||||
var appname = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appname) {
|
||||
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || '');
|
||||
appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || '');
|
||||
this.lblApplication.text(appname);
|
||||
}
|
||||
this._ShowHideInfoItem(this.lblApplication, !!appname);
|
||||
|
|
|
@ -212,7 +212,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
|||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||
this.Spacing = properties.get_Spacing();
|
||||
}
|
||||
this.Spacing.put_Before(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
||||
var value = field.getNumberValue();
|
||||
this.Spacing.put_Before(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
||||
}, this));
|
||||
this.spinners.push(this.numSpacingBefore);
|
||||
|
||||
|
@ -232,7 +233,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
|||
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
|
||||
this.Spacing = properties.get_Spacing();
|
||||
}
|
||||
this.Spacing.put_After(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
|
||||
var value = field.getNumberValue();
|
||||
this.Spacing.put_After(value<0 ? -1 : Common.Utils.Metric.fnRecalcToMM(value));
|
||||
}, this));
|
||||
this.spinners.push(this.numSpacingAfter);
|
||||
|
||||
|
@ -467,8 +469,10 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
|
|||
this.cmbSpecial.setValue(this.CurSpecial);
|
||||
this.numSpecialBy.setValue(this.FirstLine!== null ? Math.abs(Common.Utils.Metric.fnRecalcFromMM(this.FirstLine)) : '', true);
|
||||
|
||||
this.numSpacingBefore.setValue((props.get_Spacing() !== null && props.get_Spacing().get_Before() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_Before()) : '', true);
|
||||
this.numSpacingAfter.setValue((props.get_Spacing() !== null && props.get_Spacing().get_After() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Spacing().get_After()) : '', true);
|
||||
var value = props.get_Spacing() ? props.get_Spacing().get_Before() : null;
|
||||
this.numSpacingBefore.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
||||
value = props.get_Spacing() ? props.get_Spacing().get_After() : null;
|
||||
this.numSpacingAfter.setValue((value !== null) ? (value<0 ? value : Common.Utils.Metric.fnRecalcFromMM(value)) : '', true);
|
||||
|
||||
var linerule = props.get_Spacing().get_LineRule();
|
||||
this.cmbLineRule.setValue((linerule !== null) ? linerule : '', true);
|
||||
|
|
|
@ -202,7 +202,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
|
|||
width: 100,
|
||||
defaultUnit : "cm",
|
||||
value: '0.19 cm',
|
||||
maxValue: 9.34,
|
||||
maxValue: 55.87,
|
||||
minValue: 0
|
||||
});
|
||||
this.spnMarginLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
|
@ -220,7 +220,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
|
|||
width: 100,
|
||||
defaultUnit : "cm",
|
||||
value: '0.19 cm',
|
||||
maxValue: 9.34,
|
||||
maxValue: 55.87,
|
||||
minValue: 0
|
||||
});
|
||||
this.spnMarginRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
|
|
|
@ -147,7 +147,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
|
|||
width: 85,
|
||||
defaultUnit : "cm",
|
||||
value: '0.19 cm',
|
||||
maxValue: 9.34,
|
||||
maxValue: 55.87,
|
||||
minValue: 0
|
||||
});
|
||||
this.spnTableMarginLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
|
@ -167,7 +167,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
|
|||
width: 85,
|
||||
defaultUnit : "cm",
|
||||
value: '0.19 cm',
|
||||
maxValue: 9.34,
|
||||
maxValue: 55.87,
|
||||
minValue: 0
|
||||
});
|
||||
this.spnTableMarginRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
|
@ -259,7 +259,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
|
|||
width: 85,
|
||||
defaultUnit : "cm",
|
||||
value: '0.19 cm',
|
||||
maxValue: 9.34,
|
||||
maxValue: 55.87,
|
||||
minValue: 0
|
||||
});
|
||||
this.spnMarginLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
|
@ -279,7 +279,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
|
|||
width: 85,
|
||||
defaultUnit : "cm",
|
||||
value: '0.19 cm',
|
||||
maxValue: 9.34,
|
||||
maxValue: 55.87,
|
||||
minValue: 0
|
||||
});
|
||||
this.spnMarginRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
|
||||
|
|
|
@ -226,7 +226,7 @@ define([
|
|||
|
||||
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appProps) {
|
||||
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || '');
|
||||
var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || '');
|
||||
appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove();
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ define([
|
|||
|
||||
PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend((function() {
|
||||
// private
|
||||
var _users = [];
|
||||
|
||||
return {
|
||||
models: [],
|
||||
|
@ -77,13 +78,15 @@ define([
|
|||
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
|
||||
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onApiCountPages, this));
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
this.mode = mode;
|
||||
this.getView('Toolbar').setMode(mode);
|
||||
},
|
||||
|
||||
|
@ -200,19 +203,38 @@ define([
|
|||
PE.getController('Settings').hideModal();
|
||||
},
|
||||
|
||||
displayCollaboration: function(users) {
|
||||
if(users !== undefined) {
|
||||
displayCollaboration: function() {
|
||||
if(_users !== undefined) {
|
||||
var length = 0;
|
||||
_.each(users, function (item) {
|
||||
if (!item.asc_getView())
|
||||
_.each(_users, function (item) {
|
||||
if ((item.asc_getState()!==false) && !item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
if (length > 0) {
|
||||
$('#toolbar-collaboration').show();
|
||||
} else {
|
||||
if (length < 1 && this.mode && !this.mode.canViewComments)
|
||||
$('#toolbar-collaboration').hide();
|
||||
else
|
||||
$('#toolbar-collaboration').show();
|
||||
}
|
||||
},
|
||||
|
||||
onUsersChanged: function(users) {
|
||||
_users = users;
|
||||
this.displayCollaboration();
|
||||
},
|
||||
|
||||
onUserConnection: function(change){
|
||||
var changed = false;
|
||||
for (var uid in _users) {
|
||||
if (undefined !== uid) {
|
||||
var user = _users[uid];
|
||||
if (user && user.asc_getId() == change.asc_getId()) {
|
||||
_users[uid] = change;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
!changed && change && (_users[change.asc_getId()] = change);
|
||||
this.displayCollaboration();
|
||||
},
|
||||
|
||||
dlgLeaveTitleText : 'You leave the application',
|
||||
|
|
|
@ -146,8 +146,8 @@ define([
|
|||
_paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small');
|
||||
_paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all');
|
||||
|
||||
_fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
|
||||
$('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
|
||||
_fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
|
||||
$('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
|
||||
}
|
||||
|
||||
_paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before());
|
||||
|
@ -304,9 +304,9 @@ define([
|
|||
spacing = _fontInfo.letterSpacing;
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
spacing = Math.max(-100, --spacing);
|
||||
spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing);
|
||||
} else {
|
||||
spacing = Math.min(100, ++spacing);
|
||||
spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing);
|
||||
}
|
||||
_fontInfo.letterSpacing = spacing;
|
||||
|
||||
|
@ -415,35 +415,58 @@ define([
|
|||
|
||||
onDistanceBefore: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
distance = _paragraphInfo.spaceBefore;
|
||||
distance = _paragraphInfo.spaceBefore,
|
||||
step,
|
||||
maxValue;
|
||||
|
||||
if (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) {
|
||||
step = 1;
|
||||
} else {
|
||||
step = 0.01;
|
||||
}
|
||||
|
||||
maxValue = Common.Utils.Metric.fnRecalcFromMM(558.8);
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-1, --distance);
|
||||
distance = Math.max(-1, distance - step);
|
||||
} else {
|
||||
distance = Math.min(100, ++distance);
|
||||
distance = (distance<0) ? 0 : Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
||||
_paragraphInfo.spaceBefore = distance;
|
||||
|
||||
$('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : (_paragraphInfo.spaceBefore) + ' ' + metricText);
|
||||
$('#paragraph-distance-before .item-after label').text(_paragraphInfo.spaceBefore < 0 ? 'Auto' : distanceFix + ' ' + metricText);
|
||||
|
||||
this.api.put_LineSpacingBeforeAfter(0, (_paragraphInfo.spaceBefore < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceBefore));
|
||||
},
|
||||
|
||||
onDistanceAfter: function (e) {
|
||||
var $button = $(e.currentTarget),
|
||||
distance = _paragraphInfo.spaceAfter;
|
||||
distance = _paragraphInfo.spaceAfter,
|
||||
step,
|
||||
maxValue;
|
||||
|
||||
if (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.pt) {
|
||||
step = 1;
|
||||
} else {
|
||||
step = 0.01;
|
||||
}
|
||||
|
||||
maxValue = Common.Utils.Metric.fnRecalcFromMM(558.8);
|
||||
|
||||
if ($button.hasClass('decrement')) {
|
||||
distance = Math.max(-1, --distance);
|
||||
distance = Math.max(-1, distance - step);
|
||||
} else {
|
||||
distance = Math.min(100, ++distance);
|
||||
distance = (distance<0) ? 0 : Math.min(maxValue, distance + step);
|
||||
}
|
||||
|
||||
var distanceFix = parseFloat(distance.toFixed(2));
|
||||
|
||||
_paragraphInfo.spaceAfter = distance;
|
||||
|
||||
$('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : (_paragraphInfo.spaceAfter) + ' ' + metricText);
|
||||
|
||||
$('#paragraph-distance-after .item-after label').text(_paragraphInfo.spaceAfter < 0 ? 'Auto' : distanceFix + ' ' + metricText);
|
||||
this.api.put_LineSpacingBeforeAfter(1, (_paragraphInfo.spaceAfter < 0) ? -1 : Common.Utils.Metric.fnRecalcToMM(_paragraphInfo.spaceAfter));
|
||||
},
|
||||
|
||||
|
@ -544,7 +567,8 @@ define([
|
|||
onApiBullets: function(data) {
|
||||
var type = data.get_ListType(),
|
||||
subtype = data.get_ListSubType();
|
||||
|
||||
$('.dataview.bullets li').removeClass('active');
|
||||
$('.dataview.numbers li').removeClass('active');
|
||||
switch (type) {
|
||||
case 0:
|
||||
$('.dataview.bullets li[data-type=' + subtype + ']').addClass('active');
|
||||
|
@ -552,6 +576,9 @@ define([
|
|||
case 1:
|
||||
$('.dataview.numbers li[data-type=' + subtype + ']').addClass('active');
|
||||
break;
|
||||
default:
|
||||
$('.dataview.bullets li[data-type="-1"]').addClass('active');
|
||||
$('.dataview.numbers li[data-type="-1"]').addClass('active');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<div class="item-inner">
|
||||
<div class="item-input">
|
||||
<div class="range-slider">
|
||||
<input type="range" min="0" max="150" value="0" step="1">
|
||||
<input type="range" min="0" max="55" value="0" step="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after value">0 pt</div>
|
||||
|
|
|
@ -90,12 +90,16 @@ SSE.ApplicationController = new(function(){
|
|||
permissions = $.extend(permissions, docConfig.permissions);
|
||||
|
||||
var _permissions = $.extend({}, docConfig.permissions),
|
||||
docInfo = new Asc.asc_CDocInfo();
|
||||
docInfo = new Asc.asc_CDocInfo(),
|
||||
_user = new Asc.asc_CUserInfo();
|
||||
_user.put_Id(config.user && config.user.id ? config.user.id : ('uid-' + Date.now()));
|
||||
|
||||
docInfo.put_Id(docConfig.key);
|
||||
docInfo.put_Url(docConfig.url);
|
||||
docInfo.put_Title(docConfig.title);
|
||||
docInfo.put_Format(docConfig.fileType);
|
||||
docInfo.put_VKey(docConfig.vkey);
|
||||
docInfo.put_UserInfo(_user);
|
||||
docInfo.put_Token(docConfig.token);
|
||||
docInfo.put_Permissions(_permissions);
|
||||
docInfo.put_EncryptedInfo(config.encryptionKeys);
|
||||
|
|
|
@ -1443,9 +1443,11 @@ define([
|
|||
},
|
||||
|
||||
autoCorrect: function() {
|
||||
(new Common.Views.AutoCorrectDialog({
|
||||
if (this.dlgAutoCorrect && this.dlgAutoCorrect.isVisible()) return;
|
||||
this.dlgAutoCorrect = new Common.Views.AutoCorrectDialog({
|
||||
api: this.api
|
||||
})).show();
|
||||
});
|
||||
this.dlgAutoCorrect.show();
|
||||
},
|
||||
|
||||
strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE',
|
||||
|
@ -1853,7 +1855,7 @@ define([
|
|||
|
||||
var appname = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appname) {
|
||||
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || '');
|
||||
appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || '');
|
||||
this.lblApplication.text(appname);
|
||||
}
|
||||
this._ShowHideInfoItem(this.lblApplication, !!appname);
|
||||
|
|
|
@ -86,16 +86,6 @@ define([
|
|||
this.api.asc_registerCallback('asc_onHidePopMenu', _.bind(this.onApiHidePopMenu, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect,this));
|
||||
this.api.asc_registerCallback('asc_onShowComment', _.bind(this.onApiShowComment, this));
|
||||
this.api.asc_registerCallback('asc_onHideComment', _.bind(this.onApiHideComment, this));
|
||||
},
|
||||
|
||||
onApiShowComment: function(comments) {
|
||||
_isComments = comments && comments.length>0;
|
||||
},
|
||||
|
||||
onApiHideComment: function() {
|
||||
_isComments = false;
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
|
@ -313,6 +303,7 @@ define([
|
|||
var iscelllocked = cellinfo.asc_getLocked(),
|
||||
seltype = cellinfo.asc_getSelectionType(),
|
||||
xfs = cellinfo.asc_getXfs();
|
||||
_isComments = cellinfo.asc_getComments().length>0; //prohibit adding multiple comments in one cell;
|
||||
|
||||
switch (seltype) {
|
||||
case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;
|
||||
|
|
|
@ -295,7 +295,7 @@ define([
|
|||
|
||||
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appProps) {
|
||||
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || '');
|
||||
var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || '');
|
||||
appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove();
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ define([
|
|||
book: false,
|
||||
sheet: false
|
||||
};
|
||||
var _users = [];
|
||||
|
||||
return {
|
||||
models: [],
|
||||
|
@ -84,14 +85,16 @@ define([
|
|||
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onApiWorksheetLocked, this));
|
||||
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onApiActiveSheetChanged, this));
|
||||
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.displayCollaboration, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onUsersChanged, this));
|
||||
this.api.asc_registerCallback('asc_onConnectionStateChanged', _.bind(this.onUserConnection, this));
|
||||
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
||||
|
||||
Common.NotificationCenter.on('sheet:active', this.onApiActiveSheetChanged.bind(this));
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
this.mode = mode;
|
||||
this.getView('Toolbar').setMode(mode);
|
||||
},
|
||||
|
||||
|
@ -219,19 +222,38 @@ define([
|
|||
SSE.getController('Settings').hideModal();
|
||||
},
|
||||
|
||||
displayCollaboration: function(users) {
|
||||
if(users !== undefined) {
|
||||
displayCollaboration: function() {
|
||||
if(_users !== undefined) {
|
||||
var length = 0;
|
||||
_.each(users, function (item) {
|
||||
if (!item.asc_getView())
|
||||
_.each(_users, function (item) {
|
||||
if ((item.asc_getState()!==false) && !item.asc_getView())
|
||||
length++;
|
||||
});
|
||||
if (length > 0) {
|
||||
$('#toolbar-collaboration').show();
|
||||
} else {
|
||||
if (length < 1 && this.mode && !this.mode.canViewComments)
|
||||
$('#toolbar-collaboration').hide();
|
||||
else
|
||||
$('#toolbar-collaboration').show();
|
||||
}
|
||||
},
|
||||
|
||||
onUsersChanged: function(users) {
|
||||
_users = users;
|
||||
this.displayCollaboration();
|
||||
},
|
||||
|
||||
onUserConnection: function(change){
|
||||
var changed = false;
|
||||
for (var uid in _users) {
|
||||
if (undefined !== uid) {
|
||||
var user = _users[uid];
|
||||
if (user && user.asc_getId() == change.asc_getId()) {
|
||||
_users[uid] = change;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
!changed && change && (_users[change.asc_getId()] = change);
|
||||
this.displayCollaboration();
|
||||
},
|
||||
|
||||
dlgLeaveTitleText : 'You leave the application',
|
||||
|
|
|
@ -70,6 +70,7 @@ define([
|
|||
var me = this;
|
||||
me.api = api;
|
||||
me.api.asc_registerCallback('asc_onError', _.bind(me.onError, me));
|
||||
me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me));
|
||||
|
||||
// me.api.asc_registerCallback('asc_onInitEditorFonts', _.bind(onApiLoadFonts, me));
|
||||
|
||||
|
@ -80,8 +81,8 @@ define([
|
|||
this.view.canViewComments = mode.canViewComments;
|
||||
},
|
||||
|
||||
setHideAddComment: function(hide) {
|
||||
this.view.isComments = hide; //prohibit adding multiple comments in one cell
|
||||
onApiSelectionChanged: function(info) {
|
||||
this.view.isComments = info.asc_getComments().length>0; //prohibit adding multiple comments in one cell
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
|
|
|
@ -916,7 +916,7 @@
|
|||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a data-type="SEg6bW0=" class="item-link no-indicator">
|
||||
<a data-type="aCUzQW1tJTNCJTQw" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title">10:56</div>
|
||||
|
@ -926,7 +926,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="SEg6TU06c3M=" class="item-link no-indicator">
|
||||
<a data-type="aCUzQW1tJTNBc3MlM0IlNDA=" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title">21:56:00</div>
|
||||
|
@ -936,7 +936,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="aGg6bW0gdHQ=" class="item-link no-indicator">
|
||||
<a data-type="aCUzQW1tJTIwQU0lMkZQTSUzQiU0MA==" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title">05:56 AM</div>
|
||||
|
@ -946,7 +946,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="aGg6bW06c3MgdHQ=" class="item-link no-indicator">
|
||||
<a data-type="aCUzQW1tJTNBc3MlMjBBTSUyRlBNJTNCJTQw" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title">05:56:00 AM</div>
|
||||
|
@ -956,7 +956,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-type="W2hdOm1tOnNz" class="item-link no-indicator">
|
||||
<a data-type="JTVCaCU1RCUzQW1tJTNBc3MlM0IlNDA=" class="item-link no-indicator">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title">38:56:00</div>
|
||||
|
|
106
translation/convert_translation.py
Normal file
106
translation/convert_translation.py
Normal file
|
@ -0,0 +1,106 @@
|
|||
import os
|
||||
import io
|
||||
import shutil
|
||||
|
||||
def strSplit(str):
|
||||
result = []
|
||||
ind1 = str.find('"')
|
||||
ind2 = str.find('"', ind1+1)
|
||||
result.append(str[ind1+1:ind2])
|
||||
ind3 = str.find('"', ind2+1)
|
||||
indLast = str.rfind('"')
|
||||
result.append(str[ind3+1:indLast])
|
||||
return result
|
||||
app_names = ['documenteditor', 'presentationeditor', 'spreadsheeteditor']
|
||||
app_types = ['embed', 'main', 'mobile']
|
||||
prefix_apps = '../apps/'
|
||||
prefix_src = 'src/'
|
||||
prefix_dest = 'dest/'
|
||||
str_apps = []
|
||||
langs = []
|
||||
for i in range(len(app_names)):
|
||||
for j in range (len(app_types)):
|
||||
locale_path = prefix_apps + app_names[i] + '/' + app_types[j] + '/locale/'
|
||||
src_path = prefix_src + app_names[i] + '/' + app_types[j] + '/locale/'
|
||||
dest_path = prefix_dest + app_names[i] + '/' + app_types[j] + '/locale/'
|
||||
print(locale_path)
|
||||
if os.path.isdir(locale_path):
|
||||
langs = os.listdir(locale_path)
|
||||
if not os.path.isdir(dest_path):
|
||||
os.makedirs(dest_path)
|
||||
if len(langs)>0:
|
||||
try:
|
||||
f = io.open(locale_path + 'en.json', mode='r', encoding='utf-8')
|
||||
except Exception:
|
||||
continue
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
str_apps = []
|
||||
for k in range(1, len(lines)-1):
|
||||
arr = strSplit(lines[k])
|
||||
if len(arr) > 0:
|
||||
str_apps.append(arr[0])
|
||||
for l in range(len(langs)):
|
||||
lang = langs[l].split('.')[0]
|
||||
f = io.open(locale_path + lang+ '.json', mode='r', encoding='utf-8')
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
try:
|
||||
f = io.open(src_path + lang+ '.json', mode='r', encoding='utf-8')
|
||||
except Exception:
|
||||
f.close()
|
||||
f = io.open(dest_path + lang + '.json', mode='w', encoding='utf-8')
|
||||
f.writelines(lines)
|
||||
f.close()
|
||||
print(' ' + lang+ '.json - copied')
|
||||
continue
|
||||
d_locale = dict()
|
||||
d_src = dict()
|
||||
# locale
|
||||
for k in range(1, len(lines)-1):
|
||||
arr = strSplit(lines[k])
|
||||
if len(arr) > 1:
|
||||
d_locale[arr[0]] = arr[1]
|
||||
# src
|
||||
lines = f.readlines()
|
||||
for k in range(1, len(lines)-1):
|
||||
arr = strSplit(lines[k])
|
||||
if len(arr) > 1:
|
||||
d_src[arr[0]] = arr[1]
|
||||
f.close()
|
||||
f = io.open(dest_path + lang + '.json', mode='w', encoding='utf-8')
|
||||
f.write(u'{')
|
||||
f.write(u'\n')
|
||||
changed = 'not changed'
|
||||
isFirst = True
|
||||
arr_len = len(str_apps)
|
||||
for k in range(arr_len):
|
||||
str = str_apps[k]
|
||||
if str.find('del_')==0:
|
||||
continue
|
||||
if str in d_src:
|
||||
changed = 'changed'
|
||||
str = ' "' + str + '": "' + d_src[str] + '"'
|
||||
if isFirst:
|
||||
isFirst = False
|
||||
else:
|
||||
f.write(u',\n')
|
||||
f.write(str)
|
||||
elif str in d_locale:
|
||||
str = ' "' + str + '": "' + d_locale[str] + '"'
|
||||
if isFirst:
|
||||
isFirst = False
|
||||
else:
|
||||
f.write(u',\n')
|
||||
f.write(str)
|
||||
f.write(u'\n')
|
||||
f.write(u'}')
|
||||
f.close()
|
||||
print(' ' + lang + '.json - ' + changed)
|
||||
add_langs = os.listdir(src_path)
|
||||
for l in range(len(langs)):
|
||||
add_langs.remove(langs[l])
|
||||
for l in range(len(add_langs)):
|
||||
lang = add_langs[l]
|
||||
shutil.copyfile(src_path + lang, dest_path + lang)
|
||||
print(' ' + lang + ' - ' + 'added')
|
Loading…
Reference in a new issue