[SSE] removed collaboration elements from status bar

This commit is contained in:
Maxim Kadushkin 2017-04-27 18:27:41 +03:00
parent d2de0c7dfc
commit a80342235d
3 changed files with 1 additions and 146 deletions

View file

@ -79,9 +79,7 @@ define([
},
onLaunch: function() {
this.statusbar = this.createView('Statusbar', {
storeUsers: this.getApplication().getCollection('Common.Collections.Users')
}).render();
this.statusbar = this.createView('Statusbar').render();
this.statusbar.$el.css('z-index', 10);
this.statusbar.labelZoom.css('min-width', 70);
this.statusbar.zoomMenu.on('item:click', _.bind(this.menuZoomClick, this));

View file

@ -19,20 +19,6 @@
</div>
<button id="status-btn-zoomup" type="button" class="btn small btn-toolbar" style="margin-right:40px;"><i class="icon btn-zoom-up">&nbsp;</i></button>
</div>
<!-- /** coauthoring begin **/ -->
<div id="status-users-ct" class="status-group dropup" style="display:none;">
<div class="separator short" />
<div id="status-users-block" style="display:inline-block; cursor:pointer; margin-left: 12px;">
<span id="status-users-icon" class="img-commonctrl" style="margin-bottom: 1px;"/>
<label id="status-users-count" class="status-label" style="font-size: 14px; font-weight: normal; margin-top: -1px;">+</label>
</div>
<div id="status-users-menu" class="dropdown-menu">
<label style="display: block;margin-right: 14px;"><%= scope.tipUsers %></label>
<div id="status-users-list"></div>
<label id="status-change-rights" class="link" style="margin-top: 15px;"><%= scope.txAccessRights %></label>
</div>
</div>
<!-- /** coauthoring end **/ -->
<div id="status-math-box" class="status-group">
<div class="separator short" style="margin-right: 12px;" />
<label id="status-math-average">AVERAGE: 10</label>

View file

@ -58,20 +58,6 @@ define([
el: '#statusbar',
template: _.template(template),
storeUsers: undefined,
tplUser: ['<li id="status-chat-user-<%= user.get("id") %>" class="<% if (!user.get("online")) { %> offline <% } if (user.get("view")) {%> viewmode <% } %>">',
'<div class="color" style="background-color: <%= user.get("color") %>;" >',
'<label class="name"><%= scope.getUserName(user.get("username")) %></label>',
'</div>',
'</li>'].join(''),
templateUserList: _.template('<ul>' +
'<% _.each(users, function(item) { %>' +
'<%= _.template(usertpl)({user: item, scope: scope}) %>' +
'<% }); %>' +
'</ul>'),
events: function() {
return {
'click #status-btn-tabfirst': _.bind(this.onBtnTabScroll, this, 'first'),
@ -178,39 +164,6 @@ define([
this.labelZoom = $('#status-label-zoom',this.$el);
/** coauthoring begin **/
this.panelUsersList = $('#status-users-list', this.el);
this.storeUsers.bind({
add : _.bind(this._onAddUser, this),
change : _.bind(this._onUsersChanged, this),
reset : _.bind(this._onResetUsers, this)
});
this.panelUsers = $('#status-users-ct', this.el);
this.panelUsers.on('shown.bs.dropdown', function () {
me.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
var tip = me.panelUsersBlock.data('bs.tooltip');
if (tip) tip.hide();
});
this.panelUsersBlock = this.panelUsers.find('#status-users-block');
this.panelUsersBlock.tooltip({
title: this.tipAccessRights,
html: true,
placement: 'top'
});
this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
this.lblUserCount = this.panelUsers.find('#status-users-count');
this.lblChangeRights = this.panelUsers.find('#status-change-rights');
this.lblChangeRights.on('click', _.bind(this.onUsersClick, this));
this.$el.find('#status-users-menu').on('click', function() {
return false;
});
/** coauthoring end **/
this.tabBarBox = $('#status-sheets-bar-box', this.el);
this.tabbar = new Common.UI.TabBar({
el: '#status-sheets-bar',
@ -338,11 +291,6 @@ define([
setApi: function(api) {
this.api = api;
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.update, this));
/** coauthoring begin **/
this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onApiUsersChanged, this));
this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onApiUsersChanged, this));
this.api.asc_coAuthoringGetUsers();
/** coauthoring end **/
return this;
},
@ -351,8 +299,6 @@ define([
// this.$el.find('.el-edit')[mode.isEdit?'show':'hide']();
this.btnAddWorksheet.setVisible(this.mode.isEdit);
this.btnAddWorksheet.setDisabled(this.mode.isDisconnected);
this.lblChangeRights[(!this.mode.isOffline && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
this.panelUsers[(!this.mode.isOffline && this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
this.updateTabbarBorders();
},
@ -453,71 +399,6 @@ define([
},30);
},
/** coauthoring begin **/
onUsersClick: function() {
this.panelUsers.removeClass('open');
this.fireEvent('click:users', this);
},
onApiUsersChanged: function(users) {
var length = 0;
_.each(users, function(item){
if (!item.asc_getView())
length++;
});
this.panelUsers[(length>1 || this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length)?'show':'hide']();
this.updateTabbarBorders();
this.lblUserCount.css({
'font-size': (length > 1 ? '11px' : '14px'),
'font-weight': (length > 1 ? 'bold' : 'normal'),
'margin-top': (length > 1 ? '0' : '-1px')
});
this.lblUserCount.text(length > 1 ? length : '+');
$('#status-users-icon').css('margin-bottom', length > 1 ? '0' : '1px');
var usertip = this.panelUsersBlock.data('bs.tooltip');
if (usertip) {
usertip.options.title = (length > 1) ? this.tipViewUsers : this.tipAccessRights;
usertip.setContent();
}
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
},
_onAddUser: function(m, c, opts) {
if (this.panelUsersList) {
this.panelUsersList.find('ul').append(_.template(this.tplUser)({user: m, scope: this}));
this.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
}
},
_onUsersChanged: function(m) {
if (m.changed.online != undefined && this.panelUsersList) {
this.panelUsersList.find('#status-chat-user-'+ m.get('id'))[m.changed.online?'removeClass':'addClass']('offline');
this.panelUsersList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true});
}
},
_onResetUsers: function(c, opts) {
if (this.panelUsersList) {
this.panelUsersList.html(this.templateUserList({users: c.models, usertpl: this.tplUser, scope: this}));
this.panelUsersList.scroller = new Common.UI.Scroller({
el : $('#status-users-list ul'),
useKeyboard : true,
minScrollbarLength : 40,
alwaysVisibleY: true
});
}
},
getUserName: function (username) {
return Common.Utils.String.htmlEncode(username);
},
/** coauthoring end **/
onSheetChanged: function(o, index, tab) {
this.api.asc_showWorksheet(tab.sheetindex);
@ -632,11 +513,6 @@ define([
visible = true;
}
if (this.panelUsers.is(':visible')) {
right += parseInt(this.panelUsers.css('width'));
visible = true;
}
this.boxZoom.find('.separator').css('border-left-color',visible?'':'transparent');
this.tabBarBox.css('right', right + 'px');
},
@ -674,13 +550,8 @@ define([
textSum : 'SUM',
textCount : 'COUNT',
textAverage : 'AVERAGE',
tipUsers : 'Document is currently being edited by several users.',
tipAccessRights : 'Manage document access rights',
tipViewUsers : 'View users and manage document access rights',
txAccessRights : 'Change access rights',
filteredRecordsText : '{0} of {1} records filtered',
filteredText : 'Filter mode'
}, SSE.Views.Statusbar || {}));
SSE.Views.Statusbar.RenameDialog = Common.UI.Window.extend(_.extend({