[DE mobile] [PE mobile] [SSE mobile] Collaboration moved into Common
This commit is contained in:
parent
df4308513a
commit
a46b3ee10d
|
@ -33,44 +33,49 @@
|
|||
|
||||
/**
|
||||
* Collaboration.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Julia Svinareva on 14/5/19
|
||||
* Created by Julia Svinareva on 12/7/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
Common.Controllers = Common.Controllers || {};
|
||||
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'documenteditor/mobile/app/view/Collaboration'
|
||||
'common/mobile/lib/view/Collaboration'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() {
|
||||
Common.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var _settings = [],
|
||||
_headerType = 1,
|
||||
rootView,
|
||||
var rootView,
|
||||
_userId,
|
||||
editUsers = [],
|
||||
editor = !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE',
|
||||
displayMode = "Markup",
|
||||
arrChangeReview = [],
|
||||
dateChange = [],
|
||||
_fileKey,
|
||||
_userId,
|
||||
editUsers = [];
|
||||
_fileKey;
|
||||
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'Collaboration'
|
||||
'Common.Views.Collaboration'
|
||||
],
|
||||
|
||||
initialize: function() {
|
||||
var me = this;
|
||||
me.addListeners({
|
||||
'Collaboration': {
|
||||
'Common.Views.Collaboration': {
|
||||
'page:show' : me.onPageShow
|
||||
}
|
||||
});
|
||||
|
@ -78,19 +83,23 @@ define([
|
|||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.changeReview, this));
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
if (editor === 'DE') {
|
||||
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.changeReview, this));
|
||||
}
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('Collaboration').render();
|
||||
this.createView('Common.Views.Collaboration').render();
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
this.appConfig = mode;
|
||||
_fileKey = mode.fileKey;
|
||||
_userId = mode.user.id;
|
||||
if (editor === 'DE') {
|
||||
_fileKey = mode.fileKey;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
|
@ -99,7 +108,8 @@ define([
|
|||
var me = this,
|
||||
isAndroid = Framework7.prototype.device.android === true,
|
||||
modalView,
|
||||
mainView = DE.getController('Editor').getView('Editor').f7View;
|
||||
appPrefix = !!window.DE ? DE : !!window.PE ? PE : SSE,
|
||||
mainView = appPrefix.getController('Editor').getView('Editor').f7View;
|
||||
|
||||
uiApp.closeModal();
|
||||
|
||||
|
@ -107,7 +117,7 @@ define([
|
|||
modalView = $$(uiApp.pickerModal(
|
||||
'<div class="picker-modal settings container-collaboration">' +
|
||||
'<div class="view collaboration-root-view navbar-through">' +
|
||||
this.getView('Collaboration').rootLayout() +
|
||||
this.getView('Common.Views.Collaboration').rootLayout() +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
)).on('opened', function () {
|
||||
|
@ -129,7 +139,7 @@ define([
|
|||
'<div class="popover-inner">' +
|
||||
'<div class="content-block">' +
|
||||
'<div class="view popover-view collaboration-root-view navbar-through">' +
|
||||
this.getView('Collaboration').rootLayout() +
|
||||
this.getView('Common.Views.Collaboration').rootLayout() +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
|
@ -149,9 +159,9 @@ define([
|
|||
});
|
||||
|
||||
Common.NotificationCenter.trigger('collaborationcontainer:show');
|
||||
this.onPageShow(this.getView('Collaboration'));
|
||||
this.onPageShow(this.getView('Common.Views.Collaboration'));
|
||||
|
||||
DE.getController('Toolbar').getView('Toolbar').hideSearch();
|
||||
appPrefix.getController('Toolbar').getView('Toolbar').hideSearch();
|
||||
},
|
||||
|
||||
rootView : function() {
|
||||
|
@ -173,13 +183,69 @@ define([
|
|||
} else if('#edit-users-view' == pageId) {
|
||||
me.initEditUsers();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-users-view]', '.page[data-page=edit-users-view] .page-content');
|
||||
} else if ('#comments-view' == pageId) {
|
||||
me.initComments();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content');
|
||||
} else {
|
||||
if(!this.appConfig.canReview) {
|
||||
if(editor === 'DE' && !this.appConfig.canReview) {
|
||||
$('#reviewing-settings').hide();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//Edit users
|
||||
|
||||
onChangeEditUsers: function(users) {
|
||||
editUsers = users;
|
||||
},
|
||||
|
||||
initEditUsers: function() {
|
||||
var usersArray = [];
|
||||
_.each(editUsers, function(item){
|
||||
var fio = item.asc_getUserName().split(' ');
|
||||
var initials = fio[0].substring(0, 1).toUpperCase();
|
||||
if (fio.length > 1) {
|
||||
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
var userAttr = {
|
||||
color: item.asc_getColor(),
|
||||
id: item.asc_getId(),
|
||||
idOriginal: item.asc_getIdOriginal(),
|
||||
name: item.asc_getUserName(),
|
||||
view: item.asc_getView(),
|
||||
initial: initials
|
||||
};
|
||||
if(item.asc_getIdOriginal() == _userId) {
|
||||
usersArray.unshift(userAttr);
|
||||
} else {
|
||||
usersArray.push(userAttr);
|
||||
}
|
||||
}
|
||||
});
|
||||
var userSort = _.chain(usersArray).groupBy('idOriginal').value();
|
||||
var templateUserItem = _.template([
|
||||
'<% _.each(users, function (user) { %>',
|
||||
'<li id="<%= user[0].id %>" class="<% if (user[0].view) {%> viewmode <% } %> item-content">' +
|
||||
'<div class="user-name item-inner">' +
|
||||
'<div class="color" style="background-color: <%= user[0].color %>;"><%= user[0].initial %></div>'+
|
||||
'<label><%= user[0].name %></label>' +
|
||||
'<% if (user.length>1) { %><label class="length"> (<%= user.length %>)</label><% } %>' +
|
||||
'</div>'+
|
||||
'</li>',
|
||||
'<% }); %>'].join(''));
|
||||
var templateUserList = _.template(
|
||||
'<div class="item-content"><div class="item-inner">' +
|
||||
this.textEditUser +
|
||||
'</div></div>' +
|
||||
'<ul>' +
|
||||
templateUserItem({users: userSort}) +
|
||||
'</ul>');
|
||||
$('#user-list').html(templateUserList());
|
||||
},
|
||||
|
||||
//Review
|
||||
|
||||
initReviewingSettingsView: function () {
|
||||
var me = this;
|
||||
$('#settings-review input:checkbox').attr('checked', this.appConfig.isReviewOnly || Common.localStorage.getBool("de-mobile-track-changes-" + (_fileKey || '')));
|
||||
|
@ -204,13 +270,14 @@ define([
|
|||
$checkbox.attr('checked', true);
|
||||
} else {
|
||||
this.api.asc_SetTrackRevisions(state);
|
||||
Common.localStorage.setItem("de-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0);
|
||||
var prefix = !!window.DE ? 'de' : !!window.PE ? 'pe' : 'sse';
|
||||
Common.localStorage.setItem(prefix + "-mobile-track-changes-" + (_fileKey || ''), state ? 1 : 0);
|
||||
}
|
||||
},
|
||||
|
||||
onAcceptAllClick: function() {
|
||||
if (this.api) {
|
||||
this.api.asc_AcceptAllChanges();
|
||||
this.api.asc_AcceptAllChanges();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -517,15 +584,15 @@ define([
|
|||
changetext += '</b>';
|
||||
changetext += proptext;
|
||||
break;
|
||||
case Asc.c_oAscRevisionsChangeType.TablePr:
|
||||
changetext = me.textTableChanged;
|
||||
break;
|
||||
case Asc.c_oAscRevisionsChangeType.RowsAdd:
|
||||
changetext = me.textTableRowsAdd;
|
||||
break;
|
||||
case Asc.c_oAscRevisionsChangeType.RowsRem:
|
||||
changetext = me.textTableRowsDel;
|
||||
break;
|
||||
case Asc.c_oAscRevisionsChangeType.TablePr:
|
||||
changetext = me.textTableChanged;
|
||||
break;
|
||||
case Asc.c_oAscRevisionsChangeType.RowsAdd:
|
||||
changetext = me.textTableRowsAdd;
|
||||
break;
|
||||
case Asc.c_oAscRevisionsChangeType.RowsRem:
|
||||
changetext = me.textTableRowsDel;
|
||||
break;
|
||||
|
||||
}
|
||||
var date = (item.get_DateTime() == '') ? new Date() : new Date(item.get_DateTime()),
|
||||
|
@ -577,57 +644,6 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onChangeEditUsers: function(users) {
|
||||
editUsers = users;
|
||||
},
|
||||
|
||||
initEditUsers: function() {
|
||||
var usersArray = [];
|
||||
_.each(editUsers, function(item){
|
||||
var fio = item.asc_getUserName().split(' ');
|
||||
var initials = fio[0].substring(0, 1).toUpperCase();
|
||||
if (fio.length > 1) {
|
||||
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
var userAttr = {
|
||||
color: item.asc_getColor(),
|
||||
id: item.asc_getId(),
|
||||
idOriginal: item.asc_getIdOriginal(),
|
||||
name: item.asc_getUserName(),
|
||||
view: item.asc_getView(),
|
||||
initial: initials
|
||||
};
|
||||
if(item.asc_getIdOriginal() == _userId) {
|
||||
usersArray.unshift(userAttr);
|
||||
} else {
|
||||
usersArray.push(userAttr);
|
||||
}
|
||||
}
|
||||
});
|
||||
var userSort = _.chain(usersArray).groupBy('idOriginal').value();
|
||||
var templateUserItem = _.template([
|
||||
'<% _.each(users, function (user) { %>',
|
||||
'<li id="<%= user[0].id %>" class="<% if (user[0].view) {%> viewmode <% } %> item-content">' +
|
||||
'<div class="user-name item-inner">' +
|
||||
'<div class="color" style="background-color: <%= user[0].color %>;"><%= user[0].initial %></div>'+
|
||||
'<label><%= user[0].name %></label>' +
|
||||
'<% if (user.length>1) { %><label class="length"> (<%= user.length %>)</label><% } %>' +
|
||||
'</div>'+
|
||||
'</li>',
|
||||
'<% }); %>'].join(''));
|
||||
var templateUserList = _.template(
|
||||
'<div class="item-content"><div class="item-inner">' +
|
||||
this.textEditUser +
|
||||
'</div></div>' +
|
||||
'<ul>' +
|
||||
templateUserItem({users: userSort}) +
|
||||
'</ul>');
|
||||
$('#user-list').html(templateUserList());
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
textInserted: '<b>Inserted:</b>',
|
||||
textDeleted: '<b>Deleted:</b>',
|
||||
|
@ -690,5 +706,5 @@ define([
|
|||
textEditUser: 'Document is currently being edited by several users.'
|
||||
|
||||
}
|
||||
})(), DE.Controllers.Collaboration || {}))
|
||||
})(), Common.Controllers.Collaboration || {}))
|
||||
});
|
|
@ -20,6 +20,7 @@
|
|||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% if (editor === 'DE') { %>
|
||||
<li>
|
||||
<a id="reviewing-settings" class="item-link" data-page="#reviewing-settings-view">
|
||||
<div class="item-content">
|
||||
|
@ -29,6 +30,7 @@
|
|||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -36,6 +38,25 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Editable Users view -->
|
||||
<div id="edit-users-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="left sliding"><a href="#" class="back link"> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
|
||||
<div class="center sliding"><%= scope.textEditUsers %></div>
|
||||
<div class="right sliding"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page page-change" data-page="edit-users-view">
|
||||
<div class="page-content">
|
||||
<div id="user-list" class="list-block">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reviewing Settings view -->
|
||||
<div id="reviewing-settings-view">
|
||||
<div class="navbar">
|
||||
|
@ -137,14 +158,14 @@
|
|||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="doc-orientation" value="Original">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOriginal %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="doc-orientation" value="Original">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOriginal %></div>
|
||||
</div>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -170,7 +191,7 @@
|
|||
<a href="#" id="btn-prev-change" class="link icon-only"><i class="icon icon-prev-change"></i></a>
|
||||
<a href="#" id="btn-next-change" class="link icon-only"><i class="icon icon-next-change"></i></a>
|
||||
</span>
|
||||
<span class="right-buttons">
|
||||
<span class="right-buttons">
|
||||
<a href="#" id="btn-goto-change" class="link icon-only" style="display: none;"><i class="icon icon-goto"></i></a>
|
||||
<span class="accept-reject">
|
||||
<a href="#" id="btn-accept-change" class="link icon-only"><i class="icon icon-accept"></i></a>
|
||||
|
@ -186,23 +207,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Editable Users view -->
|
||||
<div id="edit-users-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="left sliding"><a href="#" class="back link"> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
|
||||
<div class="center sliding"><%= scope.textEditUsers %></div>
|
||||
<div class="right sliding"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page page-change" data-page="edit-users-view">
|
||||
<div class="page-content">
|
||||
<div id="user-list" class="list-block">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -33,22 +33,26 @@
|
|||
|
||||
/**
|
||||
* Collaboration.js
|
||||
* Document Editor
|
||||
*
|
||||
* Created by Julia Svinareva on 14/5/19
|
||||
* Created by Julia Svinareva on 12/7/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
if (Common === undefined)
|
||||
var Common = {};
|
||||
|
||||
Common.Views = Common.Views || {};
|
||||
|
||||
define([
|
||||
'text!documenteditor/mobile/app/template/Collaboration.template',
|
||||
'text!common/mobile/lib/template/Collaboration.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (settingsTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
DE.Views.Collaboration = Backbone.View.extend(_.extend((function() {
|
||||
Common.Views.Collaboration = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
|
||||
return {
|
||||
|
@ -81,7 +85,8 @@ define([
|
|||
android : Common.SharedSettings.get('android'),
|
||||
phone : Common.SharedSettings.get('phone'),
|
||||
orthography: Common.SharedSettings.get('sailfish'),
|
||||
scope : this
|
||||
scope : this,
|
||||
editor : !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE'
|
||||
}));
|
||||
|
||||
return this;
|
||||
|
@ -119,7 +124,10 @@ define([
|
|||
},
|
||||
|
||||
showPage: function(templateId, animate) {
|
||||
var rootView = DE.getController('Collaboration').rootView();
|
||||
var me = this;
|
||||
var prefix = !!window.DE ? DE : !!window.PE ? PE : SSE;
|
||||
var rootView = prefix.getController('Common.Controllers.Collaboration').rootView();
|
||||
|
||||
|
||||
if (rootView && this.layout) {
|
||||
var $content = this.layout.find(templateId);
|
||||
|
@ -155,5 +163,5 @@ define([
|
|||
textEditUsers: 'Users'
|
||||
|
||||
}
|
||||
})(), DE.Views.Collaboration || {}))
|
||||
})(), Common.Views.Collaboration || {}))
|
||||
});
|
|
@ -151,7 +151,7 @@ require([
|
|||
'AddShape',
|
||||
'AddImage',
|
||||
'AddOther',
|
||||
'Collaboration'
|
||||
'Common.Controllers.Collaboration'
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -222,7 +222,7 @@ require([
|
|||
'documenteditor/mobile/app/controller/add/AddShape',
|
||||
'documenteditor/mobile/app/controller/add/AddImage',
|
||||
'documenteditor/mobile/app/controller/add/AddOther',
|
||||
'documenteditor/mobile/app/controller/Collaboration'
|
||||
'common/mobile/lib/controller/Collaboration'
|
||||
], function() {
|
||||
window.compareVersions = true;
|
||||
app.start();
|
||||
|
|
|
@ -162,7 +162,7 @@ require([
|
|||
'AddShape',
|
||||
'AddImage',
|
||||
'AddOther',
|
||||
'Collaboration'
|
||||
'Common.Controllers.Collaboration'
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -233,7 +233,7 @@ require([
|
|||
'documenteditor/mobile/app/controller/add/AddShape',
|
||||
'documenteditor/mobile/app/controller/add/AddImage',
|
||||
'documenteditor/mobile/app/controller/add/AddOther',
|
||||
'documenteditor/mobile/app/controller/Collaboration'
|
||||
'common/mobile/lib/controller/Collaboration'
|
||||
], function() {
|
||||
app.start();
|
||||
});
|
||||
|
|
|
@ -149,14 +149,14 @@ define([
|
|||
}
|
||||
});
|
||||
} else if ('review' == eventName) {
|
||||
var getCollaboration = DE.getController('Collaboration');
|
||||
var getCollaboration = DE.getController('Common.Controllers.Collaboration');
|
||||
getCollaboration.showModal();
|
||||
getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view', false);
|
||||
getCollaboration.getView('Common.Views.Collaboration').showPage('#reviewing-settings-view', false);
|
||||
} else if('reviewchange' == eventName) {
|
||||
var getCollaboration = DE.getController('Collaboration');
|
||||
var getCollaboration = DE.getController('Common.Controllers.Collaboration');
|
||||
getCollaboration.showModal();
|
||||
getCollaboration.getView('Collaboration').showPage('#reviewing-settings-view', false);
|
||||
getCollaboration.getView('Collaboration').showPage('#change-view', false);
|
||||
getCollaboration.getView('Common.Views.Collaboration').showPage('#reviewing-settings-view', false);
|
||||
getCollaboration.getView('Common.Views.Collaboration').showPage('#change-view', false);
|
||||
} else if ('showActionSheet' == eventName && _actionSheets.length > 0) {
|
||||
_.delay(function () {
|
||||
_.each(_actionSheets, function (action) {
|
||||
|
|
|
@ -47,7 +47,7 @@ define([
|
|||
'underscore',
|
||||
'backbone',
|
||||
'documenteditor/mobile/app/view/Settings',
|
||||
'documenteditor/mobile/app/controller/Collaboration'
|
||||
'common/mobile/lib/controller/Collaboration'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
|
@ -249,7 +249,7 @@ define([
|
|||
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
||||
$('#settings-print').single('click', _.bind(me.onPrint, me));
|
||||
$('#settings-collaboration').single('click', _.bind(me.clickCollaboration, me));
|
||||
var _stateDisplayMode = DE.getController('Collaboration').getDisplayMode();
|
||||
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
|
||||
if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") {
|
||||
$('#settings-document').addClass('disabled');
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ define([
|
|||
},
|
||||
|
||||
clickCollaboration: function() {
|
||||
DE.getController('Collaboration').showModal();
|
||||
DE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
onNoCharacters: function(e) {
|
||||
|
@ -339,7 +339,7 @@ define([
|
|||
var value = Common.localStorage.getItem('de-mobile-settings-unit');
|
||||
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
|
||||
$unitMeasurement.val([value]);
|
||||
var _stateDisplayMode = DE.getController('Collaboration').getDisplayMode();
|
||||
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
|
||||
if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") {
|
||||
$('#settings-no-characters').addClass('disabled');
|
||||
$('#settings-hidden-borders').addClass('disabled');
|
||||
|
|
|
@ -153,7 +153,7 @@ define([
|
|||
|
||||
//Collaboration
|
||||
showCollaboration: function () {
|
||||
DE.getController('Collaboration').showModal();
|
||||
DE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
editDocument: function () {
|
||||
|
|
|
@ -3,6 +3,65 @@
|
|||
"Common.UI.ThemeColorPalette.textThemeColors": "Theme Colors",
|
||||
"Common.Utils.Metric.txtCm": "cm",
|
||||
"Common.Utils.Metric.txtPt": "pt",
|
||||
"Common.Controllers.Collaboration.textInserted": "<b>Inserted:</b>",
|
||||
"Common.Controllers.Collaboration.textDeleted": "<b>Deleted:</b>",
|
||||
"Common.Controllers.Collaboration.textParaInserted": "<b>Paragraph Inserted</b>",
|
||||
"Common.Controllers.Collaboration.textParaDeleted": "<b>Paragraph Deleted</b>",
|
||||
"Common.Controllers.Collaboration.textFormatted": "Formatted",
|
||||
"Common.Controllers.Collaboration.textParaFormatted": "<b>Paragraph Formatted</b>",
|
||||
"Common.Controllers.Collaboration.textNot": "Not",
|
||||
"Common.Controllers.Collaboration.textBold": "Bold",
|
||||
"Common.Controllers.Collaboration.textItalic": "Italic",
|
||||
"Common.Controllers.Collaboration.textStrikeout": "Strikeout",
|
||||
"Common.Controllers.Collaboration.textUnderline": "Underline",
|
||||
"Common.Controllers.Collaboration.textColor": "Font color",
|
||||
"Common.Controllers.Collaboration.textBaseline": "Baseline",
|
||||
"Common.Controllers.Collaboration.textSuperScript": "Superscript",
|
||||
"Common.Controllers.Collaboration.textSubScript": "Subscript",
|
||||
"Common.Controllers.Collaboration.textHighlight": "Highlight color",
|
||||
"Common.Controllers.Collaboration.textSpacing": "Spacing",
|
||||
"Common.Controllers.Collaboration.textDStrikeout": "Double strikeout",
|
||||
"Common.Controllers.Collaboration.textCaps": "All caps",
|
||||
"Common.Controllers.Collaboration.textSmallCaps": "Small caps",
|
||||
"Common.Controllers.Collaboration.textPosition": "Position",
|
||||
"Common.Controllers.Collaboration.textShd": "Background color",
|
||||
"Common.Controllers.Collaboration.textContextual": "Don't add interval between paragraphs of the same style",
|
||||
"Common.Controllers.Collaboration.textNoContextual": "Add interval between paragraphs of the same style",
|
||||
"Common.Controllers.Collaboration.textIndentLeft": "Indent left",
|
||||
"Common.Controllers.Collaboration.textIndentRight": "Indent right",
|
||||
"Common.Controllers.Collaboration.textFirstLine": "First line",
|
||||
"Common.Controllers.Collaboration.textRight": "Align right",
|
||||
"Common.Controllers.Collaboration.textLeft": "Align left",
|
||||
"Common.Controllers.Collaboration.textCenter": "Align center",
|
||||
"Common.Controllers.Collaboration.textJustify": "Align justify",
|
||||
"Common.Controllers.Collaboration.textBreakBefore": "Page break before",
|
||||
"Common.Controllers.Collaboration.textKeepNext": "Keep with next",
|
||||
"Common.Controllers.Collaboration.textKeepLines": "Keep lines together",
|
||||
"Common.Controllers.Collaboration.textNoBreakBefore": "No page break before",
|
||||
"Common.Controllers.Collaboration.textNoKeepNext": "Don't keep with next",
|
||||
"Common.Controllers.Collaboration.textNoKeepLines": "Don't keep lines together",
|
||||
"Common.Controllers.Collaboration.textLineSpacing": "Line Spacing: ",
|
||||
"Common.Controllers.Collaboration.textMultiple": "multiple",
|
||||
"Common.Controllers.Collaboration.textAtLeast": "at least",
|
||||
"Common.Controllers.Collaboration.textExact": "exactly",
|
||||
"Common.Controllers.Collaboration.textSpacingBefore": "Spacing before",
|
||||
"Common.Controllers.Collaboration.textSpacingAfter": "Spacing after",
|
||||
"Common.Controllers.Collaboration.textAuto": "auto",
|
||||
"Common.Controllers.Collaboration.textWidow": "Widow control",
|
||||
"Common.Controllers.Collaboration.textNoWidow": "No widow control",
|
||||
"Common.Controllers.Collaboration.textTabs": "Change tabs",
|
||||
"Common.Controllers.Collaboration.textNum": "Change numbering",
|
||||
"Common.Controllers.Collaboration.textEquation": "Equation",
|
||||
"Common.Controllers.Collaboration.textImage": "Image",
|
||||
"Common.Controllers.Collaboration.textChart": "Chart",
|
||||
"Common.Controllers.Collaboration.textShape": "Shape",
|
||||
"Common.Controllers.Collaboration.textTableChanged": "<b>Table Settings Changed</b>",
|
||||
"Common.Controllers.Collaboration.textTableRowsAdd": "<b>Table Rows Added<b/>",
|
||||
"Common.Controllers.Collaboration.textTableRowsDel": "<b>Table Rows Deleted<b/>",
|
||||
"Common.Controllers.Collaboration.textParaMoveTo": "<b>Moved:</b>",
|
||||
"Common.Controllers.Collaboration.textParaMoveFromUp": "<b>Moved Up:</b>",
|
||||
"Common.Controllers.Collaboration.textParaMoveFromDown": "<b>Moved Down:</b>",
|
||||
"Common.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.",
|
||||
"DE.Controllers.AddContainer.textImage": "Image",
|
||||
"DE.Controllers.AddContainer.textOther": "Other",
|
||||
"DE.Controllers.AddContainer.textShape": "Shape",
|
||||
|
@ -185,65 +244,6 @@
|
|||
"DE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application",
|
||||
"DE.Controllers.Toolbar.leaveButtonText": "Leave this Page",
|
||||
"DE.Controllers.Toolbar.stayButtonText": "Stay on this Page",
|
||||
"DE.Controllers.Collaboration.textInserted": "<b>Inserted:</b>",
|
||||
"DE.Controllers.Collaboration.textDeleted": "<b>Deleted:</b>",
|
||||
"DE.Controllers.Collaboration.textParaInserted": "<b>Paragraph Inserted</b>",
|
||||
"DE.Controllers.Collaboration.textParaDeleted": "<b>Paragraph Deleted</b>",
|
||||
"DE.Controllers.Collaboration.textFormatted": "Formatted",
|
||||
"DE.Controllers.Collaboration.textParaFormatted": "<b>Paragraph Formatted</b>",
|
||||
"DE.Controllers.Collaboration.textNot": "Not",
|
||||
"DE.Controllers.Collaboration.textBold": "Bold",
|
||||
"DE.Controllers.Collaboration.textItalic": "Italic",
|
||||
"DE.Controllers.Collaboration.textStrikeout": "Strikeout",
|
||||
"DE.Controllers.Collaboration.textUnderline": "Underline",
|
||||
"DE.Controllers.Collaboration.textColor": "Font color",
|
||||
"DE.Controllers.Collaboration.textBaseline": "Baseline",
|
||||
"DE.Controllers.Collaboration.textSuperScript": "Superscript",
|
||||
"DE.Controllers.Collaboration.textSubScript": "Subscript",
|
||||
"DE.Controllers.Collaboration.textHighlight": "Highlight color",
|
||||
"DE.Controllers.Collaboration.textSpacing": "Spacing",
|
||||
"DE.Controllers.Collaboration.textDStrikeout": "Double strikeout",
|
||||
"DE.Controllers.Collaboration.textCaps": "All caps",
|
||||
"DE.Controllers.Collaboration.textSmallCaps": "Small caps",
|
||||
"DE.Controllers.Collaboration.textPosition": "Position",
|
||||
"DE.Controllers.Collaboration.textShd": "Background color",
|
||||
"DE.Controllers.Collaboration.textContextual": "Don't add interval between paragraphs of the same style",
|
||||
"DE.Controllers.Collaboration.textNoContextual": "Add interval between paragraphs of the same style",
|
||||
"DE.Controllers.Collaboration.textIndentLeft": "Indent left",
|
||||
"DE.Controllers.Collaboration.textIndentRight": "Indent right",
|
||||
"DE.Controllers.Collaboration.textFirstLine": "First line",
|
||||
"DE.Controllers.Collaboration.textRight": "Align right",
|
||||
"DE.Controllers.Collaboration.textLeft": "Align left",
|
||||
"DE.Controllers.Collaboration.textCenter": "Align center",
|
||||
"DE.Controllers.Collaboration.textJustify": "Align justify",
|
||||
"DE.Controllers.Collaboration.textBreakBefore": "Page break before",
|
||||
"DE.Controllers.Collaboration.textKeepNext": "Keep with next",
|
||||
"DE.Controllers.Collaboration.textKeepLines": "Keep lines together",
|
||||
"DE.Controllers.Collaboration.textNoBreakBefore": "No page break before",
|
||||
"DE.Controllers.Collaboration.textNoKeepNext": "Don't keep with next",
|
||||
"DE.Controllers.Collaboration.textNoKeepLines": "Don't keep lines together",
|
||||
"DE.Controllers.Collaboration.textLineSpacing": "Line Spacing: ",
|
||||
"DE.Controllers.Collaboration.textMultiple": "multiple",
|
||||
"DE.Controllers.Collaboration.textAtLeast": "at least",
|
||||
"DE.Controllers.Collaboration.textExact": "exactly",
|
||||
"DE.Controllers.Collaboration.textSpacingBefore": "Spacing before",
|
||||
"DE.Controllers.Collaboration.textSpacingAfter": "Spacing after",
|
||||
"DE.Controllers.Collaboration.textAuto": "auto",
|
||||
"DE.Controllers.Collaboration.textWidow": "Widow control",
|
||||
"DE.Controllers.Collaboration.textNoWidow": "No widow control",
|
||||
"DE.Controllers.Collaboration.textTabs": "Change tabs",
|
||||
"DE.Controllers.Collaboration.textNum": "Change numbering",
|
||||
"DE.Controllers.Collaboration.textEquation": "Equation",
|
||||
"DE.Controllers.Collaboration.textImage": "Image",
|
||||
"DE.Controllers.Collaboration.textChart": "Chart",
|
||||
"DE.Controllers.Collaboration.textShape": "Shape",
|
||||
"DE.Controllers.Collaboration.textTableChanged": "<b>Table Settings Changed</b>",
|
||||
"DE.Controllers.Collaboration.textTableRowsAdd": "<b>Table Rows Added<b/>",
|
||||
"DE.Controllers.Collaboration.textTableRowsDel": "<b>Table Rows Deleted<b/>",
|
||||
"DE.Controllers.Collaboration.textParaMoveTo": "<b>Moved:</b>",
|
||||
"DE.Controllers.Collaboration.textParaMoveFromUp": "<b>Moved Up:</b>",
|
||||
"DE.Controllers.Collaboration.textParaMoveFromDown": "<b>Moved Down:</b>",
|
||||
"DE.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.",
|
||||
"DE.Views.AddImage.textAddress": "Address",
|
||||
"DE.Views.AddImage.textBack": "Back",
|
||||
"DE.Views.AddImage.textFromLibrary": "Picture from Library",
|
||||
|
@ -493,17 +493,17 @@
|
|||
"DE.Views.Settings.textNoCharacters": "Nonprinting Characters",
|
||||
"DE.Views.Settings.textHiddenTableBorders": "Hidden Table Borders",
|
||||
"DE.Views.Toolbar.textBack": "Back",
|
||||
"DE.Views.Collaboration.textCollaboration": "Collaboration",
|
||||
"DE.Views.Collaboration.textReviewing": "Review",
|
||||
"DE.Views.Collaboration.textСomments": "Сomments",
|
||||
"DE.Views.Collaboration.textBack": "Back",
|
||||
"DE.Views.Collaboration.textReview": "Track Changes",
|
||||
"DE.Views.Collaboration.textAcceptAllChanges": "Accept All Changes",
|
||||
"DE.Views.Collaboration.textRejectAllChanges": "Reject All Changes",
|
||||
"DE.Views.Collaboration.textDisplayMode": "Display Mode",
|
||||
"DE.Views.Collaboration.textMarkup": "Markup",
|
||||
"DE.Views.Collaboration.textFinal": "Final",
|
||||
"DE.Views.Collaboration.textOriginal": "Original",
|
||||
"DE.Views.Collaboration.textChange": "Review Change",
|
||||
"DE.Views.Collaboration.textEditUsers": "Users"
|
||||
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
||||
"Common.Views.Collaboration.textReviewing": "Review",
|
||||
"Common.Views.Collaboration.textСomments": "Сomments",
|
||||
"Common.Views.Collaboration.textBack": "Back",
|
||||
"Common.Views.Collaboration.textReview": "Track Changes",
|
||||
"Common.Views.Collaboration.textAcceptAllChanges": "Accept All Changes",
|
||||
"Common.Views.Collaboration.textRejectAllChanges": "Reject All Changes",
|
||||
"Common.Views.Collaboration.textDisplayMode": "Display Mode",
|
||||
"Common.Views.Collaboration.textMarkup": "Markup",
|
||||
"Common.Views.Collaboration.textFinal": "Final",
|
||||
"Common.Views.Collaboration.textOriginal": "Original",
|
||||
"Common.Views.Collaboration.textChange": "Review Change",
|
||||
"Common.Views.Collaboration.textEditUsers": "Users"
|
||||
}
|
|
@ -149,7 +149,7 @@ require([
|
|||
'AddImage',
|
||||
'AddLink',
|
||||
'AddSlide',
|
||||
'Collaboration'
|
||||
'Common.Controllers.Collaboration'
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -218,7 +218,7 @@ require([
|
|||
'presentationeditor/mobile/app/controller/add/AddImage',
|
||||
'presentationeditor/mobile/app/controller/add/AddLink',
|
||||
'presentationeditor/mobile/app/controller/add/AddSlide',
|
||||
'presentationeditor/mobile/app/controller/Collaboration'
|
||||
'common/mobile/lib/controller/Collaboration'
|
||||
|
||||
], function() {
|
||||
window.compareVersions = true;
|
||||
|
|
|
@ -160,7 +160,7 @@ require([
|
|||
'AddImage',
|
||||
'AddLink',
|
||||
'AddSlide',
|
||||
'Collaboration'
|
||||
'Common.Controllers.Collaboration'
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -229,7 +229,7 @@ require([
|
|||
'presentationeditor/mobile/app/controller/add/AddImage',
|
||||
'presentationeditor/mobile/app/controller/add/AddLink',
|
||||
'presentationeditor/mobile/app/controller/add/AddSlide',
|
||||
'presentationeditor/mobile/app/controller/Collaboration'
|
||||
'common/mobile/lib/controller/Collaboration'
|
||||
], function() {
|
||||
app.start();
|
||||
});
|
||||
|
|
|
@ -1,217 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collaboration.js
|
||||
* Presentation Editor
|
||||
*
|
||||
* Created by Julia Svinareva on 31/5/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'presentationeditor/mobile/app/view/Collaboration'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
PE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var rootView,
|
||||
_userId,
|
||||
editUsers = [];
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'Collaboration'
|
||||
],
|
||||
|
||||
initialize: function() {
|
||||
var me = this;
|
||||
me.addListeners({
|
||||
'Collaboration': {
|
||||
'page:show' : me.onPageShow
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('Collaboration').render();
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
this.appConfig = mode;
|
||||
_userId = mode.user.id;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
showModal: function() {
|
||||
var me = this,
|
||||
isAndroid = Framework7.prototype.device.android === true,
|
||||
modalView,
|
||||
mainView = PE.getController('Editor').getView('Editor').f7View;
|
||||
|
||||
uiApp.closeModal();
|
||||
|
||||
if (Common.SharedSettings.get('phone')) {
|
||||
modalView = $$(uiApp.pickerModal(
|
||||
'<div class="picker-modal settings container-collaboration">' +
|
||||
'<div class="view collaboration-root-view navbar-through">' +
|
||||
this.getView('Collaboration').rootLayout() +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
)).on('opened', function () {
|
||||
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
|
||||
me.api.asc_OnShowContextMenu()
|
||||
}
|
||||
}).on('close', function (e) {
|
||||
mainView.showNavbar();
|
||||
}).on('closed', function () {
|
||||
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
|
||||
me.api.asc_OnHideContextMenu()
|
||||
}
|
||||
});
|
||||
mainView.hideNavbar();
|
||||
} else {
|
||||
modalView = uiApp.popover(
|
||||
'<div class="popover settings container-collaboration">' +
|
||||
'<div class="popover-angle"></div>' +
|
||||
'<div class="popover-inner">' +
|
||||
'<div class="content-block">' +
|
||||
'<div class="view popover-view collaboration-root-view navbar-through">' +
|
||||
this.getView('Collaboration').rootLayout() +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>',
|
||||
$$('#toolbar-collaboration')
|
||||
);
|
||||
}
|
||||
|
||||
if (Framework7.prototype.device.android === true) {
|
||||
$$('.view.collaboration-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
|
||||
$$('.view.collaboration-root-view .navbar').prependTo('.view.collaboration-root-view > .pages > .page');
|
||||
}
|
||||
|
||||
rootView = uiApp.addView('.collaboration-root-view', {
|
||||
dynamicNavbar: true,
|
||||
domCache: true
|
||||
});
|
||||
|
||||
Common.NotificationCenter.trigger('collaborationcontainer:show');
|
||||
this.onPageShow(this.getView('Collaboration'));
|
||||
|
||||
PE.getController('Toolbar').getView('Toolbar').hideSearch();
|
||||
},
|
||||
|
||||
rootView : function() {
|
||||
return rootView;
|
||||
},
|
||||
|
||||
onPageShow: function(view, pageId) {
|
||||
var me = this;
|
||||
|
||||
if('#edit-users-view' == pageId) {
|
||||
me.initEditUsers();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-users-view]', '.page[data-page=edit-users-view] .page-content');
|
||||
} else {
|
||||
}
|
||||
},
|
||||
|
||||
onChangeEditUsers: function(users) {
|
||||
editUsers = users;
|
||||
},
|
||||
|
||||
initEditUsers: function() {
|
||||
var usersArray = [];
|
||||
_.each(editUsers, function(item){
|
||||
var fio = item.asc_getUserName().split(' ');
|
||||
var initials = fio[0].substring(0, 1).toUpperCase();
|
||||
if (fio.length > 1) {
|
||||
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
var userAttr = {
|
||||
color: item.asc_getColor(),
|
||||
id: item.asc_getId(),
|
||||
idOriginal: item.asc_getIdOriginal(),
|
||||
name: item.asc_getUserName(),
|
||||
view: item.asc_getView(),
|
||||
initial: initials
|
||||
};
|
||||
if(item.asc_getIdOriginal() == _userId) {
|
||||
usersArray.unshift(userAttr);
|
||||
} else {
|
||||
usersArray.push(userAttr);
|
||||
}
|
||||
}
|
||||
});
|
||||
var userSort = _.chain(usersArray).groupBy('idOriginal').value();
|
||||
var templateUserItem = _.template([
|
||||
'<% _.each(users, function (user) { %>',
|
||||
'<li id="<%= user[0].id %>" class="<% if (user[0].view) {%> viewmode <% } %> item-content">' +
|
||||
'<div class="user-name item-inner">' +
|
||||
'<div class="color" style="background-color: <%= user[0].color %>;"><%= user[0].initial %></div>'+
|
||||
'<label><%= user[0].name %></label>' +
|
||||
'<% if (user.length>1) { %><label class="length"> (<%= user.length %>)</label><% } %>' +
|
||||
'</div>'+
|
||||
'</li>',
|
||||
'<% }); %>'].join(''));
|
||||
var templateUserList = _.template(
|
||||
'<div class="item-content"><div class="item-inner">' +
|
||||
this.textEditUser +
|
||||
'</div></div>' +
|
||||
'<ul>' +
|
||||
templateUserItem({users: userSort}) +
|
||||
'</ul>');
|
||||
$('#user-list').html(templateUserList());
|
||||
},
|
||||
|
||||
|
||||
textEditUser: 'Document is currently being edited by several users.'
|
||||
|
||||
}
|
||||
})(), PE.Controllers.Collaboration || {}))
|
||||
});
|
|
@ -194,7 +194,7 @@ define([
|
|||
},
|
||||
|
||||
onCollaboration: function() {
|
||||
PE.getController('Collaboration').showModal();
|
||||
PE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
initPageColorSchemes: function () {
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="collaboration-root-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="center sliding"><%= scope.textCollaboration %></div>
|
||||
<div class="right sliding close-collaboration"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page" data-page="collaboration-root-view">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="list-edit-users" class="item-link" data-page="#edit-users-view">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textEditUsers %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Editable Users view -->
|
||||
<div id="edit-users-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="left sliding"><a href="#" class="back link"> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
|
||||
<div class="center sliding"><%= scope.textEditUsers %></div>
|
||||
<div class="right sliding"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page page-change" data-page="edit-users-view">
|
||||
<div class="page-content">
|
||||
<div id="user-list" class="list-block">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collaboration.js
|
||||
* Presentation Editor
|
||||
*
|
||||
* Created by Julia Svinareva on 31/5/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!presentationeditor/mobile/app/template/Collaboration.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (settingsTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
PE.Views.Collaboration = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
|
||||
return {
|
||||
|
||||
template: _.template(settingsTemplate),
|
||||
|
||||
events: {
|
||||
//
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
Common.NotificationCenter.on('collaborationcontainer:show', _.bind(this.initEvents, this));
|
||||
this.on('page:show', _.bind(this.updateItemHandlers, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
Common.Utils.addScrollIfNeed('.view[data-page=collaboration-root-view] .pages', '.view[data-page=collaboration-root-view] .page');
|
||||
me.updateItemHandlers();
|
||||
},
|
||||
|
||||
initControls: function() {
|
||||
//
|
||||
},
|
||||
|
||||
// Render layout
|
||||
render: function() {
|
||||
this.layout = $('<div/>').append(this.template({
|
||||
android : Common.SharedSettings.get('android'),
|
||||
phone : Common.SharedSettings.get('phone'),
|
||||
orthography: Common.SharedSettings.get('sailfish'),
|
||||
scope : this
|
||||
}));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
updateItemHandlers: function () {
|
||||
var selectorsDynamicPage = [
|
||||
'.page[data-page=collaboration-root-view]'
|
||||
].map(function (selector) {
|
||||
return selector + ' a.item-link[data-page]';
|
||||
}).join(', ');
|
||||
|
||||
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
|
||||
},
|
||||
|
||||
onItemClick: function (e) {
|
||||
var $target = $(e.currentTarget),
|
||||
page = $target.data('page');
|
||||
|
||||
if (page && page.length > 0 ) {
|
||||
this.showPage(page);
|
||||
}
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
if (this.layout) {
|
||||
var $layour = this.layout.find('#collaboration-root-view'),
|
||||
isPhone = Common.SharedSettings.get('phone');
|
||||
|
||||
return $layour.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
showPage: function(templateId, animate) {
|
||||
var rootView = PE.getController('Collaboration').rootView();
|
||||
|
||||
if (rootView && this.layout) {
|
||||
var $content = this.layout.find(templateId);
|
||||
|
||||
// Android fix for navigation
|
||||
if (Framework7.prototype.device.android) {
|
||||
$content.find('.page').append($content.find('.navbar'));
|
||||
}
|
||||
|
||||
rootView.router.load({
|
||||
content: $content.html(),
|
||||
animatePages: animate !== false
|
||||
});
|
||||
|
||||
this.fireEvent('page:show', [this, templateId]);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
textCollaboration: 'Collaboration',
|
||||
textСomments: 'Сomments',
|
||||
textBack: 'Back',
|
||||
textEditUsers: 'Users'
|
||||
|
||||
}
|
||||
})(), PE.Views.Collaboration || {}))
|
||||
});
|
|
@ -162,7 +162,7 @@ define([
|
|||
|
||||
//Collaboration
|
||||
showCollaboration: function () {
|
||||
PE.getController('Collaboration').showModal();
|
||||
PE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
textBack: 'Back'
|
||||
|
|
|
@ -226,7 +226,7 @@
|
|||
"PE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application",
|
||||
"PE.Controllers.Toolbar.leaveButtonText": "Leave this Page",
|
||||
"PE.Controllers.Toolbar.stayButtonText": "Stay on this Page",
|
||||
"PE.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.",
|
||||
"Common.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.",
|
||||
"PE.Views.AddImage.textAddress": "Address",
|
||||
"PE.Views.AddImage.textBack": "Back",
|
||||
"PE.Views.AddImage.textFromLibrary": "Picture from Library",
|
||||
|
@ -477,8 +477,8 @@
|
|||
"PE.Views.Settings.unknownText": "Unknown",
|
||||
"PE.Views.Settings.textCollaboration": "Collaboration",
|
||||
"PE.Views.Toolbar.textBack": "Back",
|
||||
"PE.Views.Collaboration.textCollaboration": "Collaboration",
|
||||
"PE.Views.Collaboration.textСomments": "Сomments",
|
||||
"PE.Views.Collaboration.textBack": "Back",
|
||||
"PE.Views.Collaboration.textEditUsers": "Users"
|
||||
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
||||
"Common.Views.Collaboration.textСomments": "Сomments",
|
||||
"Common.Views.Collaboration.textBack": "Back",
|
||||
"Common.Views.Collaboration.textEditUsers": "Users"
|
||||
}
|
|
@ -134,8 +134,8 @@ require([
|
|||
,'AddShape'
|
||||
,'AddOther'
|
||||
,'AddLink'
|
||||
,'Collaboration'
|
||||
,'FilterOptions'
|
||||
,'Common.Controllers.Collaboration'
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -207,8 +207,8 @@ require([
|
|||
,'spreadsheeteditor/mobile/app/controller/add/AddShape'
|
||||
,'spreadsheeteditor/mobile/app/controller/add/AddOther'
|
||||
,'spreadsheeteditor/mobile/app/controller/add/AddLink'
|
||||
,'spreadsheeteditor/mobile/app/controller/Collaboration'
|
||||
,'spreadsheeteditor/mobile/app/controller/FilterOptions'
|
||||
,'common/mobile/lib/controller/Collaboration'
|
||||
], function() {
|
||||
window.compareVersions = true;
|
||||
app.start();
|
||||
|
|
|
@ -145,8 +145,8 @@ require([
|
|||
,'AddShape'
|
||||
,'AddOther'
|
||||
,'AddLink'
|
||||
,'Collaboration'
|
||||
,'FilterOptions'
|
||||
,'Common.Controllers.Collaboration'
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -218,8 +218,8 @@ require([
|
|||
,'spreadsheeteditor/mobile/app/controller/add/AddShape'
|
||||
,'spreadsheeteditor/mobile/app/controller/add/AddOther'
|
||||
,'spreadsheeteditor/mobile/app/controller/add/AddLink'
|
||||
,'spreadsheeteditor/mobile/app/controller/Collaboration'
|
||||
,'spreadsheeteditor/mobile/app/controller/FilterOptions'
|
||||
,'common/mobile/lib/controller/Collaboration'
|
||||
], function() {
|
||||
app.start();
|
||||
});
|
||||
|
|
|
@ -1,217 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collaboration.js
|
||||
* Spreadsheet Editor
|
||||
*
|
||||
* Created by Julia Svinareva on 4/6/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
define([
|
||||
'core',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'spreadsheeteditor/mobile/app/view/Collaboration'
|
||||
], function (core, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
SSE.Controllers.Collaboration = Backbone.Controller.extend(_.extend((function() {
|
||||
// Private
|
||||
var rootView,
|
||||
_userId,
|
||||
editUsers = [];
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
views: [
|
||||
'Collaboration'
|
||||
],
|
||||
|
||||
initialize: function() {
|
||||
var me = this;
|
||||
me.addListeners({
|
||||
'Collaboration': {
|
||||
'page:show' : me.onPageShow
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
this.api = api;
|
||||
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onChangeEditUsers, this));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
this.createView('Collaboration').render();
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
this.appConfig = mode;
|
||||
_userId = mode.user.id;
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
showModal: function() {
|
||||
var me = this,
|
||||
isAndroid = Framework7.prototype.device.android === true,
|
||||
modalView,
|
||||
mainView = SSE.getController('Editor').getView('Editor').f7View;
|
||||
|
||||
uiApp.closeModal();
|
||||
|
||||
if (Common.SharedSettings.get('phone')) {
|
||||
modalView = $$(uiApp.pickerModal(
|
||||
'<div class="picker-modal settings container-collaboration">' +
|
||||
'<div class="view collaboration-root-view navbar-through">' +
|
||||
this.getView('Collaboration').rootLayout() +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
)).on('opened', function () {
|
||||
if (_.isFunction(me.api.asc_OnShowContextMenu)) {
|
||||
me.api.asc_OnShowContextMenu()
|
||||
}
|
||||
}).on('close', function (e) {
|
||||
mainView.showNavbar();
|
||||
}).on('closed', function () {
|
||||
if (_.isFunction(me.api.asc_OnHideContextMenu)) {
|
||||
me.api.asc_OnHideContextMenu()
|
||||
}
|
||||
});
|
||||
mainView.hideNavbar();
|
||||
} else {
|
||||
modalView = uiApp.popover(
|
||||
'<div class="popover settings container-collaboration">' +
|
||||
'<div class="popover-angle"></div>' +
|
||||
'<div class="popover-inner">' +
|
||||
'<div class="content-block">' +
|
||||
'<div class="view popover-view collaboration-root-view navbar-through">' +
|
||||
this.getView('Collaboration').rootLayout() +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>',
|
||||
$$('#toolbar-collaboration')
|
||||
);
|
||||
}
|
||||
|
||||
if (Framework7.prototype.device.android === true) {
|
||||
$$('.view.collaboration-root-view.navbar-through').removeClass('navbar-through').addClass('navbar-fixed');
|
||||
$$('.view.collaboration-root-view .navbar').prependTo('.view.collaboration-root-view > .pages > .page');
|
||||
}
|
||||
|
||||
rootView = uiApp.addView('.collaboration-root-view', {
|
||||
dynamicNavbar: true,
|
||||
domCache: true
|
||||
});
|
||||
|
||||
Common.NotificationCenter.trigger('collaborationcontainer:show');
|
||||
this.onPageShow(this.getView('Collaboration'));
|
||||
|
||||
SSE.getController('Toolbar').getView('Toolbar').hideSearch();
|
||||
},
|
||||
|
||||
rootView : function() {
|
||||
return rootView;
|
||||
},
|
||||
|
||||
onPageShow: function(view, pageId) {
|
||||
var me = this;
|
||||
|
||||
if('#edit-users-view' == pageId) {
|
||||
me.initEditUsers();
|
||||
Common.Utils.addScrollIfNeed('.page[data-page=edit-users-view]', '.page[data-page=edit-users-view] .page-content');
|
||||
} else {
|
||||
}
|
||||
},
|
||||
|
||||
onChangeEditUsers: function(users) {
|
||||
editUsers = users;
|
||||
},
|
||||
|
||||
initEditUsers: function() {
|
||||
var usersArray = [];
|
||||
_.each(editUsers, function(item){
|
||||
var fio = item.asc_getUserName().split(' ');
|
||||
var initials = fio[0].substring(0, 1).toUpperCase();
|
||||
if (fio.length > 1) {
|
||||
initials += fio[fio.length - 1].substring(0, 1).toUpperCase();
|
||||
}
|
||||
if(!item.asc_getView()) {
|
||||
var userAttr = {
|
||||
color: item.asc_getColor(),
|
||||
id: item.asc_getId(),
|
||||
idOriginal: item.asc_getIdOriginal(),
|
||||
name: item.asc_getUserName(),
|
||||
view: item.asc_getView(),
|
||||
initial: initials
|
||||
};
|
||||
if(item.asc_getIdOriginal() == _userId) {
|
||||
usersArray.unshift(userAttr);
|
||||
} else {
|
||||
usersArray.push(userAttr);
|
||||
}
|
||||
}
|
||||
});
|
||||
var userSort = _.chain(usersArray).groupBy('idOriginal').value();
|
||||
var templateUserItem = _.template([
|
||||
'<% _.each(users, function (user) { %>',
|
||||
'<li id="<%= user[0].id %>" class="<% if (user[0].view) {%> viewmode <% } %> item-content">' +
|
||||
'<div class="user-name item-inner">' +
|
||||
'<div class="color" style="background-color: <%= user[0].color %>;"><%= user[0].initial %></div>'+
|
||||
'<label><%= user[0].name %></label>' +
|
||||
'<% if (user.length>1) { %><label class="length"> (<%= user.length %>)</label><% } %>' +
|
||||
'</div>'+
|
||||
'</li>',
|
||||
'<% }); %>'].join(''));
|
||||
var templateUserList = _.template(
|
||||
'<div class="item-content"><div class="item-inner">' +
|
||||
this.textEditUser +
|
||||
'</div></div>' +
|
||||
'<ul>' +
|
||||
templateUserItem({users: userSort}) +
|
||||
'</ul>');
|
||||
$('#user-list').html(templateUserList());
|
||||
},
|
||||
|
||||
|
||||
textEditUser: 'Document is currently being edited by several users.'
|
||||
|
||||
}
|
||||
})(), SSE.Controllers.Collaboration || {}))
|
||||
});
|
|
@ -282,7 +282,7 @@ define([
|
|||
},
|
||||
|
||||
onCollaboration: function() {
|
||||
SSE.getController('Collaboration').showModal();
|
||||
SSE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
initSpreadsheetSettings: function() {
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
<!-- Root view -->
|
||||
<div id="collaboration-root-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="center sliding"><%= scope.textCollaboration %></div>
|
||||
<div class="right sliding close-collaboration"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page" data-page="collaboration-root-view">
|
||||
<div class="page-content">
|
||||
<div class="list-block">
|
||||
<ul>
|
||||
<li>
|
||||
<a id="list-edit-users" class="item-link" data-page="#edit-users-view">
|
||||
<div class="item-content">
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textEditUsers %></div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Editable Users view -->
|
||||
<div id="edit-users-view">
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="left sliding"><a href="#" class="back link"> <i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
|
||||
<div class="center sliding"><%= scope.textEditUsers %></div>
|
||||
<div class="right sliding"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pages">
|
||||
<div class="page page-change" data-page="edit-users-view">
|
||||
<div class="page-content">
|
||||
<div id="user-list" class="list-block">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collaboration.js
|
||||
* Presentation Editor
|
||||
*
|
||||
* Created by Julia Svinareva on 31/5/19
|
||||
* Copyright (c) 2019 Ascensio System SIA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
'text!spreadsheeteditor/mobile/app/template/Collaboration.template',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone'
|
||||
], function (settingsTemplate, $, _, Backbone) {
|
||||
'use strict';
|
||||
|
||||
SSE.Views.Collaboration = Backbone.View.extend(_.extend((function() {
|
||||
// private
|
||||
|
||||
return {
|
||||
|
||||
template: _.template(settingsTemplate),
|
||||
|
||||
events: {
|
||||
//
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
Common.NotificationCenter.on('collaborationcontainer:show', _.bind(this.initEvents, this));
|
||||
this.on('page:show', _.bind(this.updateItemHandlers, this));
|
||||
},
|
||||
|
||||
initEvents: function () {
|
||||
var me = this;
|
||||
|
||||
Common.Utils.addScrollIfNeed('.view[data-page=collaboration-root-view] .pages', '.view[data-page=collaboration-root-view] .page');
|
||||
me.updateItemHandlers();
|
||||
},
|
||||
|
||||
initControls: function() {
|
||||
//
|
||||
},
|
||||
|
||||
// Render layout
|
||||
render: function() {
|
||||
this.layout = $('<div/>').append(this.template({
|
||||
android : Common.SharedSettings.get('android'),
|
||||
phone : Common.SharedSettings.get('phone'),
|
||||
orthography: Common.SharedSettings.get('sailfish'),
|
||||
scope : this
|
||||
}));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
updateItemHandlers: function () {
|
||||
var selectorsDynamicPage = [
|
||||
'.page[data-page=collaboration-root-view]'
|
||||
].map(function (selector) {
|
||||
return selector + ' a.item-link[data-page]';
|
||||
}).join(', ');
|
||||
|
||||
$(selectorsDynamicPage).single('click', _.bind(this.onItemClick, this));
|
||||
},
|
||||
|
||||
onItemClick: function (e) {
|
||||
var $target = $(e.currentTarget),
|
||||
page = $target.data('page');
|
||||
|
||||
if (page && page.length > 0 ) {
|
||||
this.showPage(page);
|
||||
}
|
||||
},
|
||||
|
||||
rootLayout: function () {
|
||||
if (this.layout) {
|
||||
var $layour = this.layout.find('#collaboration-root-view'),
|
||||
isPhone = Common.SharedSettings.get('phone');
|
||||
|
||||
return $layour.html();
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
showPage: function(templateId, animate) {
|
||||
var rootView = SSE.getController('Collaboration').rootView();
|
||||
|
||||
if (rootView && this.layout) {
|
||||
var $content = this.layout.find(templateId);
|
||||
|
||||
// Android fix for navigation
|
||||
if (Framework7.prototype.device.android) {
|
||||
$content.find('.page').append($content.find('.navbar'));
|
||||
}
|
||||
|
||||
rootView.router.load({
|
||||
content: $content.html(),
|
||||
animatePages: animate !== false
|
||||
});
|
||||
|
||||
this.fireEvent('page:show', [this, templateId]);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
textCollaboration: 'Collaboration',
|
||||
textСomments: 'Сomments',
|
||||
textBack: 'Back',
|
||||
textEditUsers: 'Users'
|
||||
|
||||
}
|
||||
})(), SSE.Views.Collaboration || {}))
|
||||
});
|
|
@ -158,7 +158,7 @@ define([
|
|||
|
||||
//Collaboration
|
||||
showCollaboration: function () {
|
||||
SSE.getController('Collaboration').showModal();
|
||||
SSE.getController('Common.Controllers.Collaboration').showModal();
|
||||
},
|
||||
|
||||
textBack: 'Back'
|
||||
|
|
|
@ -300,7 +300,7 @@
|
|||
"SSE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application",
|
||||
"SSE.Controllers.Toolbar.leaveButtonText": "Leave this Page",
|
||||
"SSE.Controllers.Toolbar.stayButtonText": "Stay on this Page",
|
||||
"SSE.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.",
|
||||
"Common.Controllers.Collaboration.textEditUser": "Document is currently being edited by several users.",
|
||||
"SSE.Controllers.FilterOptions.textEmptyItem": "{Blanks}",
|
||||
"SSE.Controllers.FilterOptions.textSelectAll": "Select All",
|
||||
"SSE.Controllers.FilterOptions.textErrorTitle": "Warning",
|
||||
|
@ -556,10 +556,10 @@
|
|||
"SSE.Views.Settings.textR1C1Style": "R1C1 Reference Style",
|
||||
"SSE.Views.Settings.textRegionalSettings": "Regional Settings",
|
||||
"SSE.Views.Toolbar.textBack": "Back",
|
||||
"SSE.Views.Collaboration.textCollaboration": "Collaboration",
|
||||
"SSE.Views.Collaboration.textСomments": "Сomments",
|
||||
"SSE.Views.Collaboration.textBack": "Back",
|
||||
"SSE.Views.Collaboration.textEditUsers": "Users",
|
||||
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
||||
"Common.Views.Collaboration.textСomments": "Сomments",
|
||||
"Common.Views.Collaboration.textBack": "Back",
|
||||
"Common.Views.Collaboration.textEditUsers": "Users",
|
||||
"SSE.Views.FilterOptions.textFilter": "Filter Options",
|
||||
"SSE.Views.FilterOptions.textClearFilter": "Clear Filter",
|
||||
"SSE.Views.FilterOptions.textDeleteFilter": "Delete Filter"
|
||||
|
|
Loading…
Reference in a new issue