Merge pull request #1719 from ONLYOFFICE/feature/long_title
Long title and Bug 56759
This commit is contained in:
commit
b5ab67917b
|
@ -120,6 +120,7 @@ define([
|
||||||
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
||||||
this.setVisible(action, visible);
|
this.setVisible(action, visible);
|
||||||
}, this));
|
}, this));
|
||||||
|
Common.NotificationCenter.on('tab:resize', _.bind(this.onResizeTabs, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
|
@ -229,7 +230,7 @@ define([
|
||||||
// optsFold.timer = setTimeout(this.collapse, optsFold.timeout);
|
// optsFold.timer = setTimeout(this.collapse, optsFold.timeout);
|
||||||
},
|
},
|
||||||
|
|
||||||
onResize: function(e) {
|
onResizeTabs: function(e) {
|
||||||
if ( this.hasTabInvisible() ) {
|
if ( this.hasTabInvisible() ) {
|
||||||
if ( !$boxTabs.parent().hasClass('short') )
|
if ( !$boxTabs.parent().hasClass('short') )
|
||||||
$boxTabs.parent().addClass('short');
|
$boxTabs.parent().addClass('short');
|
||||||
|
@ -237,6 +238,10 @@ define([
|
||||||
if ( $boxTabs.parent().hasClass('short') ) {
|
if ( $boxTabs.parent().hasClass('short') ) {
|
||||||
$boxTabs.parent().removeClass('short');
|
$boxTabs.parent().removeClass('short');
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onResize: function(e) {
|
||||||
|
this.onResizeTabs();
|
||||||
this.hideMoreBtns();
|
this.hideMoreBtns();
|
||||||
this.processPanelVisible();
|
this.processPanelVisible();
|
||||||
},
|
},
|
||||||
|
|
|
@ -52,7 +52,7 @@ define([
|
||||||
|
|
||||||
Common.Views.Header = Backbone.View.extend(_.extend(function(){
|
Common.Views.Header = Backbone.View.extend(_.extend(function(){
|
||||||
var storeUsers, appConfig;
|
var storeUsers, appConfig;
|
||||||
var $userList, $panelUsers, $btnUsers, $btnUserName;
|
var $userList, $panelUsers, $btnUsers, $btnUserName, $labelDocName;
|
||||||
var _readonlyRights = false;
|
var _readonlyRights = false;
|
||||||
|
|
||||||
var templateUserItem =
|
var templateUserItem =
|
||||||
|
@ -186,11 +186,13 @@ define([
|
||||||
} else {
|
} else {
|
||||||
$panelUsers['hide']();
|
$panelUsers['hide']();
|
||||||
}
|
}
|
||||||
|
updateDocNamePosition(appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLostEditRights() {
|
function onLostEditRights() {
|
||||||
_readonlyRights = true;
|
_readonlyRights = true;
|
||||||
this.btnShare && this.btnShare.setVisible(false);
|
this.btnShare && this.btnShare.setVisible(false);
|
||||||
|
updateDocNamePosition(appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onUsersClick(e) {
|
function onUsersClick(e) {
|
||||||
|
@ -203,27 +205,42 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAppShowed(config) {
|
function updateDocNamePosition(config) {
|
||||||
//config.isCrypted =true; //delete fore merge!
|
if ( $labelDocName && config) {
|
||||||
if ( this.labelDocName ) {
|
var $parent = $labelDocName.parent();
|
||||||
if ( config.isCrypted ) {
|
|
||||||
this.labelDocName.attr({'style':'text-align: left;'});
|
|
||||||
this.labelDocName.before(
|
|
||||||
'<div class="inner-box-icon crypted">' +
|
|
||||||
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
|
|
||||||
'</div>');
|
|
||||||
this.imgCrypted = this.labelDocName.parent().find('.crypted');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!config.isEdit || !config.customization || !config.customization.compactHeader) {
|
if (!config.isEdit || !config.customization || !config.customization.compactHeader) {
|
||||||
var $parent = this.labelDocName.parent();
|
|
||||||
var _left_width = $parent.position().left,
|
var _left_width = $parent.position().left,
|
||||||
_right_width = $parent.next().outerWidth();
|
_right_width = $parent.next().outerWidth();
|
||||||
|
|
||||||
if ( _left_width < _right_width )
|
if ( _left_width < _right_width )
|
||||||
this.labelDocName.parent().css('padding-left', _right_width - _left_width);
|
$parent.css('padding-left', Math.max(2, _right_width - _left_width));
|
||||||
else this.labelDocName.parent().css('padding-right', _left_width - _right_width);
|
else
|
||||||
|
$parent.css('padding-right', Math.max(2, _left_width - _right_width));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(config.customization && config.customization.toolbarHideFileName) && (!config.isEdit || config.customization && config.customization.compactHeader)) {
|
||||||
|
var basis = parseFloat($parent.css('padding-left') || 0) + parseFloat($parent.css('padding-right') || 0) + parseInt($labelDocName.css('min-width') || 50); // 2px - box-shadow
|
||||||
|
config.isCrypted && (basis += 20);
|
||||||
|
$parent.css('flex-basis', Math.ceil(basis) + 'px');
|
||||||
|
$parent.closest('.extra.right').css('flex-basis', Math.ceil(basis) + $parent.next().outerWidth() + 'px');
|
||||||
|
Common.NotificationCenter.trigger('tab:resize');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAppShowed(config) {
|
||||||
|
// config.isCrypted =true; //delete fore merge!
|
||||||
|
if ( $labelDocName ) {
|
||||||
|
if ( config.isCrypted ) {
|
||||||
|
$labelDocName.before(
|
||||||
|
'<div class="inner-box-icon crypted hidden">' +
|
||||||
|
'<svg class="icon"><use xlink:href="#svg-icon-crypted"></use></svg>' +
|
||||||
|
'</div>');
|
||||||
|
this.imgCrypted = $labelDocName.parent().find('.crypted');
|
||||||
|
this._showImgCrypted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateDocNamePosition(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,6 +266,7 @@ define([
|
||||||
});
|
});
|
||||||
me.btnShare.updateHint(me.tipAccessRights);
|
me.btnShare.updateHint(me.tipAccessRights);
|
||||||
me.btnShare.setVisible(!_readonlyRights && appConfig && (appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length || appConfig.canRequestSharingSettings));
|
me.btnShare.setVisible(!_readonlyRights && appConfig && (appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length || appConfig.canRequestSharingSettings));
|
||||||
|
updateDocNamePosition(appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( me.logo )
|
if ( me.logo )
|
||||||
|
@ -279,6 +297,7 @@ define([
|
||||||
});
|
});
|
||||||
$btnUsers.on('click', onUsersClick.bind(me));
|
$btnUsers.on('click', onUsersClick.bind(me));
|
||||||
$panelUsers[(editingUsers > 1 && appConfig && (appConfig.isEdit || appConfig.isRestrictedEdit)) ? 'show' : 'hide']();
|
$panelUsers[(editingUsers > 1 && appConfig && (appConfig.isEdit || appConfig.isRestrictedEdit)) ? 'show' : 'hide']();
|
||||||
|
updateDocNamePosition(appConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appConfig.user.guest && appConfig.canRenameAnonymous) {
|
if (appConfig.user.guest && appConfig.canRenameAnonymous) {
|
||||||
|
@ -336,56 +355,57 @@ define([
|
||||||
|
|
||||||
function onFocusDocName(e){
|
function onFocusDocName(e){
|
||||||
var me = this;
|
var me = this;
|
||||||
me.imgCrypted && me.imgCrypted.attr('hidden', true);
|
me.imgCrypted && me.imgCrypted.toggleClass('hidden', true);
|
||||||
me.isSaveDocName =false;
|
me.isSaveDocName =false;
|
||||||
if(me.withoutExt) return;
|
if(me.withoutExt) return;
|
||||||
var name = me.cutDocName(me.labelDocName.val());
|
var name = me.cutDocName($labelDocName.val());
|
||||||
_.delay(function(){
|
|
||||||
me.labelDocName.val(name);
|
|
||||||
},100);
|
|
||||||
me.withoutExt = true;
|
me.withoutExt = true;
|
||||||
|
_.delay(function(){
|
||||||
|
me.setDocTitle(name);
|
||||||
|
$labelDocName.select();
|
||||||
|
},100);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDocNameKeyDown(e) {
|
function onDocNameKeyDown(e) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
var name = me.labelDocName.val();
|
var name = $labelDocName.val();
|
||||||
if ( e.keyCode == Common.UI.Keys.RETURN ) {
|
if ( e.keyCode == Common.UI.Keys.RETURN ) {
|
||||||
name = name.trim();
|
name = name.trim();
|
||||||
me.isSaveDocName =true;
|
|
||||||
if ( !_.isEmpty(name) && me.cutDocName(me.documentCaption) !== name ) {
|
if ( !_.isEmpty(name) && me.cutDocName(me.documentCaption) !== name ) {
|
||||||
|
me.isSaveDocName =true;
|
||||||
if ( /[\t*\+:\"<>?|\\\\/]/gim.test(name) ) {
|
if ( /[\t*\+:\"<>?|\\\\/]/gim.test(name) ) {
|
||||||
_.defer(function() {
|
_.defer(function() {
|
||||||
Common.UI.error({
|
Common.UI.error({
|
||||||
msg: (new Common.Views.RenameDialog).txtInvalidName + "*+:\"<>?|\/"
|
msg: (new Common.Views.RenameDialog).txtInvalidName + "*+:\"<>?|\/"
|
||||||
, callback: function() {
|
, callback: function() {
|
||||||
_.delay(function() {
|
_.delay(function() {
|
||||||
me.labelDocName.focus();
|
$labelDocName.focus();
|
||||||
me.isSaveDocName =true;
|
me.isSaveDocName =true;
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//me.labelDocName.blur();
|
|
||||||
})
|
})
|
||||||
} else
|
} else
|
||||||
if(me.withoutExt) {
|
if(me.withoutExt) {
|
||||||
name = me.cutDocName(name);
|
name = me.cutDocName(name);
|
||||||
me.options.wopi ? me.api.asc_wopi_renameFile(name) : Common.Gateway.requestRename(name);
|
me.options.wopi ? me.api.asc_wopi_renameFile(name) : Common.Gateway.requestRename(name);
|
||||||
name += me.fileExtention;
|
name += me.fileExtention;
|
||||||
me.labelDocName.val(name);
|
|
||||||
me.withoutExt = false;
|
me.withoutExt = false;
|
||||||
|
me.setDocTitle(name);
|
||||||
Common.NotificationCenter.trigger('edit:complete', me);
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', me);
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if ( e.keyCode == Common.UI.Keys.ESC ) {
|
if ( e.keyCode == Common.UI.Keys.ESC ) {
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
} else {
|
} else {
|
||||||
me.labelDocName.attr('size', name.length + me.fileExtention.length > 10 ? name.length + me.fileExtention.length : 10);
|
_.delay(function(){
|
||||||
|
me.setDocTitle();
|
||||||
|
},10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,18 +507,16 @@ define([
|
||||||
textShare: this.textShare
|
textShare: this.textShare
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if ( !me.labelDocName ) {
|
if ( !$labelDocName ) {
|
||||||
me.labelDocName = $html.find('#rib-doc-name');
|
$labelDocName = $html.find('#rib-doc-name');
|
||||||
if ( me.documentCaption ) {
|
if ( me.documentCaption ) {
|
||||||
me.labelDocName.val(me.documentCaption);
|
me.setDocTitle(me.documentCaption);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$html.find('#rib-doc-name').hide();
|
$html.find('#rib-doc-name').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !_.isUndefined(this.options.canRename) ) {
|
this.setCanRename(!!this.options.canRename);
|
||||||
this.setCanRename(this.options.canRename);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( this.options.canBack === true ) {
|
if ( this.options.canBack === true ) {
|
||||||
me.btnGoBack.render($html.find('#slot-btn-back'));
|
me.btnGoBack.render($html.find('#slot-btn-back'));
|
||||||
|
@ -567,10 +585,11 @@ define([
|
||||||
if ( role == 'title' ) {
|
if ( role == 'title' ) {
|
||||||
var $html = $(_.template(templateTitleBox)());
|
var $html = $(_.template(templateTitleBox)());
|
||||||
|
|
||||||
!!me.labelDocName && me.labelDocName.hide().off(); // hide document title if it was created in right box
|
!!$labelDocName && $labelDocName.hide().off(); // hide document title if it was created in right box
|
||||||
me.labelDocName = $html.find('#title-doc-name');
|
$labelDocName = $html.find('#title-doc-name');
|
||||||
me.labelDocName.val( me.documentCaption );
|
me.setDocTitle( me.documentCaption );
|
||||||
me.options.wopi && me.labelDocName.attr('maxlength', me.options.wopi.FileNameMaxLength);
|
|
||||||
|
me.options.wopi && $labelDocName.attr('maxlength', me.options.wopi.FileNameMaxLength);
|
||||||
|
|
||||||
if (config.user.guest && config.canRenameAnonymous) {
|
if (config.user.guest && config.canRenameAnonymous) {
|
||||||
me.btnUserName = new Common.UI.Button({
|
me.btnUserName = new Common.UI.Button({
|
||||||
|
@ -642,12 +661,8 @@ define([
|
||||||
if (idx>0)
|
if (idx>0)
|
||||||
this.fileExtention = this.documentCaption.substring(idx);
|
this.fileExtention = this.documentCaption.substring(idx);
|
||||||
this.isModified && (value += '*');
|
this.isModified && (value += '*');
|
||||||
if ( this.labelDocName ) {
|
if ( $labelDocName ) {
|
||||||
this.labelDocName.val( value );
|
this.setDocTitle( value );
|
||||||
// this.labelDocName.attr('size', value.length);
|
|
||||||
this.setCanRename(this.options.canRename);
|
|
||||||
|
|
||||||
//this.setCanRename(true);
|
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
|
@ -662,7 +677,7 @@ define([
|
||||||
var _name = this.documentCaption;
|
var _name = this.documentCaption;
|
||||||
changed && (_name += '*');
|
changed && (_name += '*');
|
||||||
|
|
||||||
this.labelDocName.val(_name);
|
this.setDocTitle(_name);
|
||||||
},
|
},
|
||||||
|
|
||||||
setCanBack: function (value, text) {
|
setCanBack: function (value, text) {
|
||||||
|
@ -670,7 +685,7 @@ define([
|
||||||
this.btnGoBack[value ? 'show' : 'hide']();
|
this.btnGoBack[value ? 'show' : 'hide']();
|
||||||
if (value)
|
if (value)
|
||||||
this.btnGoBack.updateHint((text && typeof text == 'string') ? text : this.textBack);
|
this.btnGoBack.updateHint((text && typeof text == 'string') ? text : this.textBack);
|
||||||
|
updateDocNamePosition(appConfig);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -683,7 +698,7 @@ define([
|
||||||
this.btnFavorite[value!==undefined && value!==null ? 'show' : 'hide']();
|
this.btnFavorite[value!==undefined && value!==null ? 'show' : 'hide']();
|
||||||
this.btnFavorite.changeIcon(!!value ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
|
this.btnFavorite.changeIcon(!!value ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'});
|
||||||
this.btnFavorite.updateHint(!value ? this.textAddFavorite : this.textRemoveFavorite);
|
this.btnFavorite.updateHint(!value ? this.textAddFavorite : this.textRemoveFavorite);
|
||||||
|
updateDocNamePosition(appConfig);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -692,12 +707,10 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setCanRename: function (rename) {
|
setCanRename: function (rename) {
|
||||||
//rename = true; //comment out for merge
|
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
me.options.canRename = rename;
|
me.options.canRename = rename;
|
||||||
if ( me.labelDocName ) {
|
if ( $labelDocName ) {
|
||||||
var label = me.labelDocName;
|
var label = $labelDocName;
|
||||||
if ( rename ) {
|
if ( rename ) {
|
||||||
label.removeAttr('disabled').tooltip({
|
label.removeAttr('disabled').tooltip({
|
||||||
title: me.txtRename,
|
title: me.txtRename,
|
||||||
|
@ -708,17 +721,17 @@ define([
|
||||||
'keydown': onDocNameKeyDown.bind(this),
|
'keydown': onDocNameKeyDown.bind(this),
|
||||||
'focus': onFocusDocName.bind(this),
|
'focus': onFocusDocName.bind(this),
|
||||||
'blur': function (e) {
|
'blur': function (e) {
|
||||||
me.imgCrypted && me.imgCrypted.attr('hidden', false);
|
me.imgCrypted && me.imgCrypted.toggleClass('hidden', false);
|
||||||
|
label[0].selectionStart = label[0].selectionEnd = 0;
|
||||||
if(!me.isSaveDocName) {
|
if(!me.isSaveDocName) {
|
||||||
me.labelDocName.val(me.documentCaption);
|
|
||||||
me.withoutExt = false;
|
me.withoutExt = false;
|
||||||
|
me.setDocTitle(me.documentCaption);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'paste': function (e) {
|
'paste': function (e) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
var name = me.cutDocName(me.labelDocName.val());
|
var name = me.cutDocName($labelDocName.val());
|
||||||
me.labelDocName.val(name);
|
me.setDocTitle(name);
|
||||||
me.labelDocName.attr('size', name.length + me.fileExtention.length > 10 ? name.length + me.fileExtention.length : 10);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -737,12 +750,37 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
cutDocName: function(name) {
|
cutDocName: function(name) {
|
||||||
if(name.length <= this.fileExtention.length) return;
|
if(name.length <= this.fileExtention.length) return name;
|
||||||
var idx =name.length - this.fileExtention.length;
|
var idx =name.length - this.fileExtention.length;
|
||||||
|
|
||||||
return (name.substring(idx) == this.fileExtention) ? name.substring(0, idx) : name ;
|
return (name.substring(idx) == this.fileExtention) ? name.substring(0, idx) : name ;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setDocTitle: function(name){
|
||||||
|
if(name)
|
||||||
|
$labelDocName.val(name);
|
||||||
|
else
|
||||||
|
name = $labelDocName.val();
|
||||||
|
var width = this.getTextWidth(name);
|
||||||
|
(width>=0) && $labelDocName.width(width);
|
||||||
|
if (this._showImgCrypted && width>=0) {
|
||||||
|
this.imgCrypted.toggleClass('hidden', false);
|
||||||
|
this._showImgCrypted = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getTextWidth: function(text) {
|
||||||
|
if (!this._testCanvas ) {
|
||||||
|
var font = ($labelDocName.css('font-size') + ' ' + $labelDocName.css('font-family')).trim();
|
||||||
|
if (font) {
|
||||||
|
var canvas = document.createElement("canvas");
|
||||||
|
this._testCanvas = canvas.getContext('2d');
|
||||||
|
this._testCanvas.font = font;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this._testCanvas ? this._testCanvas.measureText(text).width : -1;
|
||||||
|
},
|
||||||
|
|
||||||
setUserName: function(name) {
|
setUserName: function(name) {
|
||||||
this.options.userName = name;
|
this.options.userName = name;
|
||||||
if ( this.btnUserName ) {
|
if ( this.btnUserName ) {
|
||||||
|
|
|
@ -51,6 +51,8 @@
|
||||||
|
|
||||||
&.right {
|
&.right {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
flex-shrink: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-label {
|
.status-label {
|
||||||
|
@ -94,6 +96,9 @@
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
padding: 4px 2px;
|
||||||
|
overflow: hidden;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#rib-doc-name {
|
#rib-doc-name {
|
||||||
|
@ -102,13 +107,20 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-width: 50px;
|
min-width: 50px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
color: @text-toolbar-header-ie;
|
color: @text-toolbar-header-ie;
|
||||||
color: @text-toolbar-header;
|
color: @text-toolbar-header;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: 0 none;
|
border: 0 none;
|
||||||
|
padding: 1px 5px;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
line-height: 32px;
|
line-height: 24px;
|
||||||
|
|
||||||
|
&:hover:not(:disabled),&:focus {
|
||||||
|
box-shadow: 0 0 0 1px @highlight-header-button-hover-ie;
|
||||||
|
box-shadow: 0 0 0 1px @highlight-header-button-hover;
|
||||||
|
border-radius: 1px;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#rib-save-status {
|
#rib-save-status {
|
||||||
|
@ -487,6 +499,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding: 4px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#title-doc-name {
|
#title-doc-name {
|
||||||
|
@ -495,10 +508,19 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 28px;
|
line-height: 24px;
|
||||||
|
padding: 1px 5px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: 0 none;
|
border: 0 none;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
||||||
|
&:hover:not(:disabled),&:focus{
|
||||||
|
box-shadow: 0 0 0 1px @highlight-header-button-hover-ie;
|
||||||
|
box-shadow: 0 0 0 1px @highlight-header-button-hover;
|
||||||
|
border-radius: 1px;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lr-separator {
|
.lr-separator {
|
||||||
|
@ -510,7 +532,9 @@
|
||||||
.inner-box-icon.crypted {
|
.inner-box-icon.crypted {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin-right: 1px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-grow: 0;
|
||||||
> svg {
|
> svg {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-shrink: 1;
|
||||||
|
|
||||||
> ul {
|
> ul {
|
||||||
padding: 4px 0 0;
|
padding: 4px 0 0;
|
||||||
|
@ -544,6 +545,10 @@
|
||||||
#rib-doc-name {
|
#rib-doc-name {
|
||||||
color: @text-normal-ie;
|
color: @text-normal-ie;
|
||||||
color: @text-normal;
|
color: @text-normal;
|
||||||
|
&:hover,&:focus {
|
||||||
|
box-shadow: 0 0 0 1px @highlight-button-hover-ie;
|
||||||
|
box-shadow: 0 0 0 1px @highlight-button-hover;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.editor-native-color {
|
&.editor-native-color {
|
||||||
|
@ -555,7 +560,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.style-skip-docname .toolbar {
|
&.style-skip-docname .toolbar {
|
||||||
#box-doc-name > label {
|
#box-doc-name > input {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,6 +473,9 @@ define([
|
||||||
docInfo.put_Lang(this.editorConfig.lang);
|
docInfo.put_Lang(this.editorConfig.lang);
|
||||||
docInfo.put_Mode(this.editorConfig.mode);
|
docInfo.put_Mode(this.editorConfig.mode);
|
||||||
|
|
||||||
|
if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
|
||||||
|
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
|
||||||
|
|
||||||
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
||||||
docInfo.asc_putIsEnabledMacroses(!!enable);
|
docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||||
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
|
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
|
||||||
|
@ -1564,9 +1567,8 @@ define([
|
||||||
Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this));
|
Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this));
|
||||||
|
|
||||||
// change = true by default in editor
|
// change = true by default in editor
|
||||||
this.appOptions.canLiveView = !!params.asc_getLiveViewerSupport() && (this.editorConfig.mode === 'view') && !isPDFViewer; // viewer: change=false when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
|
|
||||||
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
|
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
|
||||||
this.appOptions.canLiveView && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
|
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ;
|
||||||
|
|
||||||
this.loadCoAuthSettings();
|
this.loadCoAuthSettings();
|
||||||
this.applyModeCommonElements();
|
this.applyModeCommonElements();
|
||||||
|
|
|
@ -430,10 +430,8 @@ define([
|
||||||
docInfo.put_Lang(this.editorConfig.lang);
|
docInfo.put_Lang(this.editorConfig.lang);
|
||||||
docInfo.put_Mode(this.editorConfig.mode);
|
docInfo.put_Mode(this.editorConfig.mode);
|
||||||
|
|
||||||
var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
|
if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
|
||||||
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
|
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
|
||||||
this.editorConfig.coEditing.mode || 'fast';
|
|
||||||
docInfo.put_CoEditingMode(coEditMode);
|
|
||||||
|
|
||||||
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
||||||
docInfo.asc_putIsEnabledMacroses(!!enable);
|
docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||||
|
@ -1210,9 +1208,8 @@ define([
|
||||||
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
|
this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt);
|
||||||
|
|
||||||
// change = true by default in editor
|
// change = true by default in editor
|
||||||
this.appOptions.canLiveView = !!params.asc_getLiveViewerSupport() && (this.editorConfig.mode === 'view'); // viewer: change=false when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
|
|
||||||
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
|
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
|
||||||
this.appOptions.canLiveView && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
|
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ;
|
||||||
|
|
||||||
this.loadCoAuthSettings();
|
this.loadCoAuthSettings();
|
||||||
this.applyModeCommonElements();
|
this.applyModeCommonElements();
|
||||||
|
|
|
@ -504,10 +504,8 @@ define([
|
||||||
docInfo.put_Lang(this.editorConfig.lang);
|
docInfo.put_Lang(this.editorConfig.lang);
|
||||||
docInfo.put_Mode(this.editorConfig.mode);
|
docInfo.put_Mode(this.editorConfig.mode);
|
||||||
|
|
||||||
var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
|
if (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined)
|
||||||
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
|
docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode);
|
||||||
this.editorConfig.coEditing.mode || 'fast';
|
|
||||||
docInfo.put_CoEditingMode(coEditMode);
|
|
||||||
|
|
||||||
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
|
||||||
docInfo.asc_putIsEnabledMacroses(!!enable);
|
docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||||
|
@ -1297,11 +1295,10 @@ define([
|
||||||
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false);
|
||||||
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;
|
this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments;
|
||||||
|
|
||||||
// change = true by default in editor
|
// change = true by default in editor, change = false by default in viewer
|
||||||
this.appOptions.canLiveView = !!params.asc_getLiveViewerSupport() && (this.editorConfig.mode === 'view'); // viewer: change=false when no flag canLiveViewer (i.g. old license), change=true by default when canLiveViewer==true
|
|
||||||
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring &&
|
this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring &&
|
||||||
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
|
!(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) ||
|
||||||
this.appOptions.canLiveView && !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false);
|
!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ;
|
||||||
|
|
||||||
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) {
|
if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) {
|
||||||
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
|
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
|
||||||
|
|
Loading…
Reference in a new issue