commit
cda6734a0a
|
@ -164,11 +164,14 @@ define([
|
||||||
var result = Array.prototype.slice.call(this);
|
var result = Array.prototype.slice.call(this);
|
||||||
|
|
||||||
args.forEach(function(sub){
|
args.forEach(function(sub){
|
||||||
Array.prototype.push.apply(result, sub);
|
if (sub instanceof Array )
|
||||||
|
Array.prototype.push.apply(result, sub);
|
||||||
|
else if (sub)
|
||||||
|
result.push(sub);
|
||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
};
|
||||||
|
|
||||||
var _out_array = Object.create(ButtonsArray.prototype);
|
var _out_array = Object.create(ButtonsArray.prototype);
|
||||||
for ( var i in arguments ) {
|
for ( var i in arguments ) {
|
||||||
|
|
|
@ -119,7 +119,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMessage: function(msg) {
|
_onMessage: function(msg) {
|
||||||
if (msg && msg.Referer == "onlyoffice") {
|
if (msg /*&& msg.Referer == "onlyoffice"*/) {
|
||||||
if (msg.needUpdate)
|
if (msg.needUpdate)
|
||||||
this.trigger('accessrights', this, msg.sharingSettings);
|
this.trigger('accessrights', this, msg.sharingSettings);
|
||||||
Common.NotificationCenter.trigger('window:close', this);
|
Common.NotificationCenter.trigger('window:close', this);
|
||||||
|
|
|
@ -150,7 +150,7 @@ define([
|
||||||
function onResetUsers(collection, opts) {
|
function onResetUsers(collection, opts) {
|
||||||
var usercount = collection.getEditingCount();
|
var usercount = collection.getEditingCount();
|
||||||
if ( $userList ) {
|
if ( $userList ) {
|
||||||
if ( usercount > 1 || usercount > 0 && appConfig && !appConfig.isEdit) {
|
if ( usercount > 1 || usercount > 0 && appConfig && !appConfig.isEdit && !appConfig.canComments) {
|
||||||
$userList.html(templateUserList({
|
$userList.html(templateUserList({
|
||||||
users: collection.models,
|
users: collection.models,
|
||||||
usertpl: _.template(templateUserItem),
|
usertpl: _.template(templateUserItem),
|
||||||
|
@ -172,7 +172,8 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
function applyUsers(count) {
|
function applyUsers(count) {
|
||||||
if ( count > 1 || count > 0 && appConfig && !appConfig.isEdit) {
|
var has_edit_users = count > 1 || count > 0 && appConfig && !appConfig.isEdit && !appConfig.canComments; // has other user(s) who edit document
|
||||||
|
if ( has_edit_users ) {
|
||||||
$btnUsers
|
$btnUsers
|
||||||
.attr('data-toggle', 'dropdown')
|
.attr('data-toggle', 'dropdown')
|
||||||
.addClass('dropdown-toggle')
|
.addClass('dropdown-toggle')
|
||||||
|
@ -189,13 +190,13 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
$btnUsers.find('.caption')
|
$btnUsers.find('.caption')
|
||||||
.css({'font-size': ((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? '12px' : '14px'),
|
.css({'font-size': ((has_edit_users) ? '12px' : '14px'),
|
||||||
'margin-top': ((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? '0' : '-1px')})
|
'margin-top': ((has_edit_users) ? '0' : '-1px')})
|
||||||
.html((count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? count : '+');
|
.html((has_edit_users) ? count : '+');
|
||||||
|
|
||||||
var usertip = $btnUsers.data('bs.tooltip');
|
var usertip = $btnUsers.data('bs.tooltip');
|
||||||
if ( usertip ) {
|
if ( usertip ) {
|
||||||
usertip.options.title = (count > 1 || count > 0 && appConfig && !appConfig.isEdit) ? usertip.options.titleExt : usertip.options.titleNorm;
|
usertip.options.title = (has_edit_users) ? usertip.options.titleExt : usertip.options.titleNorm;
|
||||||
usertip.setContent();
|
usertip.setContent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +248,7 @@ define([
|
||||||
|
|
||||||
var editingUsers = storeUsers.getEditingCount();
|
var editingUsers = storeUsers.getEditingCount();
|
||||||
$btnUsers.tooltip({
|
$btnUsers.tooltip({
|
||||||
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit) ? me.tipViewUsers : me.tipAccessRights,
|
title: (editingUsers > 1 || editingUsers>0 && !appConfig.isEdit && !appConfig.canComments) ? me.tipViewUsers : me.tipAccessRights,
|
||||||
titleNorm: me.tipAccessRights,
|
titleNorm: me.tipAccessRights,
|
||||||
titleExt: me.tipViewUsers,
|
titleExt: me.tipViewUsers,
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
|
@ -263,7 +264,7 @@ define([
|
||||||
});
|
});
|
||||||
|
|
||||||
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
||||||
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
$panelUsers[(editingUsers > 1 || editingUsers > 0 && !appConfig.isEdit && !appConfig.canComments || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||||
|
|
||||||
if ( $saveStatus ) {
|
if ( $saveStatus ) {
|
||||||
$saveStatus.attr('data-width', me.textSaveExpander);
|
$saveStatus.attr('data-width', me.textSaveExpander);
|
||||||
|
@ -674,7 +675,7 @@ define([
|
||||||
};
|
};
|
||||||
btn.setDisabled( true );
|
btn.setDisabled( true );
|
||||||
} else {
|
} else {
|
||||||
btn.setDisabled( btn.keepState.disabled );
|
btn.setDisabled( btn.keepState && btn.keepState.disabled || lock);
|
||||||
delete btn.keepState;
|
delete btn.keepState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,11 +154,11 @@ define([
|
||||||
} else {
|
} else {
|
||||||
this.initCodePages();
|
this.initCodePages();
|
||||||
this.updatePreview();
|
this.updatePreview();
|
||||||
|
this.onPrimary = function() {
|
||||||
|
me._handleInput('ok');
|
||||||
|
return false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
this.onPrimary = function() {
|
|
||||||
me._handleInput('ok');
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -242,13 +242,13 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1041;
|
z-index: 102;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
&.cover {
|
&.cover {
|
||||||
ul {
|
ul {
|
||||||
z-index: 1042;
|
z-index: 102;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,11 +286,11 @@ define([
|
||||||
|
|
||||||
clickSaveAsFormat: function(menu, format) {
|
clickSaveAsFormat: function(menu, format) {
|
||||||
if (menu) {
|
if (menu) {
|
||||||
if (format == Asc.c_oAscFileType.TXT) {
|
if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
|
||||||
Common.UI.warning({
|
Common.UI.warning({
|
||||||
closable: false,
|
closable: false,
|
||||||
title: this.notcriticalErrorTitle,
|
title: this.notcriticalErrorTitle,
|
||||||
msg: this.warnDownloadAs,
|
msg: (format == Asc.c_oAscFileType.TXT) ? this.warnDownloadAs : this.warnDownloadAsRTF,
|
||||||
buttons: ['ok', 'cancel'],
|
buttons: ['ok', 'cancel'],
|
||||||
callback: _.bind(function(btn){
|
callback: _.bind(function(btn){
|
||||||
if (btn == 'ok') {
|
if (btn == 'ok') {
|
||||||
|
@ -731,6 +731,7 @@ define([
|
||||||
textLoadHistory : 'Loading versions history...',
|
textLoadHistory : 'Loading versions history...',
|
||||||
notcriticalErrorTitle: 'Warning',
|
notcriticalErrorTitle: 'Warning',
|
||||||
leavePageText: 'All unsaved changes in this document will be lost.<br> Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.',
|
leavePageText: 'All unsaved changes in this document will be lost.<br> Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.',
|
||||||
warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?'
|
warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?',
|
||||||
|
warnDownloadAsRTF : 'If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?'
|
||||||
}, DE.Controllers.LeftMenu || {}));
|
}, DE.Controllers.LeftMenu || {}));
|
||||||
});
|
});
|
|
@ -169,7 +169,7 @@ define([ 'text!documenteditor/main/app/template/MailMergeEmailDlg.template',
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMessage: function(msg) {
|
_onMessage: function(msg) {
|
||||||
if (msg && msg.Referer == "onlyoffice") {
|
if (msg /*&& msg.Referer == "onlyoffice"*/) {
|
||||||
// if ( !_.isEmpty(msg.folder) ) {
|
// if ( !_.isEmpty(msg.folder) ) {
|
||||||
// this.trigger('mailmergefolder', this, msg.folder); // save last folder url
|
// this.trigger('mailmergefolder', this, msg.folder); // save last folder url
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -116,7 +116,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMessage: function(msg) {
|
_onMessage: function(msg) {
|
||||||
if (msg && msg.Referer == "onlyoffice" && msg.file !== undefined) {
|
if (msg /*&& msg.Referer == "onlyoffice"*/ && msg.file !== undefined) {
|
||||||
Common.NotificationCenter.trigger('window:close', this);
|
Common.NotificationCenter.trigger('window:close', this);
|
||||||
var me = this;
|
var me = this;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
|
@ -120,7 +120,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
_onMessage: function(msg) {
|
_onMessage: function(msg) {
|
||||||
if (msg && msg.Referer == "onlyoffice") {
|
if (msg /*&& msg.Referer == "onlyoffice"*/) {
|
||||||
if ( !_.isEmpty(msg.error) ) {
|
if ( !_.isEmpty(msg.error) ) {
|
||||||
this.trigger('mailmergeerror', this, msg.error);
|
this.trigger('mailmergeerror', this, msg.error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,6 +302,7 @@
|
||||||
"DE.Controllers.LeftMenu.textReplaceSkipped": "Der Ersatzvorgang wurde durchgeführt. {0} Vorkommen wurden ausgelassen.",
|
"DE.Controllers.LeftMenu.textReplaceSkipped": "Der Ersatzvorgang wurde durchgeführt. {0} Vorkommen wurden ausgelassen.",
|
||||||
"DE.Controllers.LeftMenu.textReplaceSuccess": "Der Suchvorgang wurde durchgeführt. Vorkommen wurden ersetzt:{0}",
|
"DE.Controllers.LeftMenu.textReplaceSuccess": "Der Suchvorgang wurde durchgeführt. Vorkommen wurden ersetzt:{0}",
|
||||||
"DE.Controllers.LeftMenu.warnDownloadAs": "Wenn Sie mit dem Speichern in diesem Format fortsetzen, werden alle Objekte außer Text verloren gehen.<br>Möchten Sie wirklich fortsetzen?",
|
"DE.Controllers.LeftMenu.warnDownloadAs": "Wenn Sie mit dem Speichern in diesem Format fortsetzen, werden alle Objekte außer Text verloren gehen.<br>Möchten Sie wirklich fortsetzen?",
|
||||||
|
"DE.Controllers.LeftMenu.warnDownloadAsRTF": "Wenn Sie mit dem Speichern in diesem Format fortsetzen, kann die Formatierung teilweise verloren gehen.<br>Möchten Sie wirklich fortsetzen?",
|
||||||
"DE.Controllers.Main.applyChangesTextText": "Die Änderungen werden geladen...",
|
"DE.Controllers.Main.applyChangesTextText": "Die Änderungen werden geladen...",
|
||||||
"DE.Controllers.Main.applyChangesTitleText": "Laden von Änderungen",
|
"DE.Controllers.Main.applyChangesTitleText": "Laden von Änderungen",
|
||||||
"DE.Controllers.Main.convertationTimeoutText": "Timeout für die Konvertierung wurde überschritten.",
|
"DE.Controllers.Main.convertationTimeoutText": "Timeout für die Konvertierung wurde überschritten.",
|
||||||
|
|
|
@ -302,6 +302,7 @@
|
||||||
"DE.Controllers.LeftMenu.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
|
"DE.Controllers.LeftMenu.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.",
|
||||||
"DE.Controllers.LeftMenu.textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
|
"DE.Controllers.LeftMenu.textReplaceSuccess": "The search has been done. Occurrences replaced: {0}",
|
||||||
"DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
"DE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
|
||||||
|
"DE.Controllers.LeftMenu.warnDownloadAsRTF": "If you continue saving in this format some of the formatting might be lost.<br>Are you sure you want to continue?",
|
||||||
"DE.Controllers.Main.applyChangesTextText": "Loading the changes...",
|
"DE.Controllers.Main.applyChangesTextText": "Loading the changes...",
|
||||||
"DE.Controllers.Main.applyChangesTitleText": "Loading the Changes",
|
"DE.Controllers.Main.applyChangesTitleText": "Loading the Changes",
|
||||||
"DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
|
"DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.",
|
||||||
|
|
|
@ -302,6 +302,7 @@
|
||||||
"DE.Controllers.LeftMenu.textReplaceSkipped": "Замена выполнена. Пропущено вхождений - {0}.",
|
"DE.Controllers.LeftMenu.textReplaceSkipped": "Замена выполнена. Пропущено вхождений - {0}.",
|
||||||
"DE.Controllers.LeftMenu.textReplaceSuccess": "Поиск выполнен. Заменено вхождений: {0}",
|
"DE.Controllers.LeftMenu.textReplaceSuccess": "Поиск выполнен. Заменено вхождений: {0}",
|
||||||
"DE.Controllers.LeftMenu.warnDownloadAs": "Если Вы продолжите сохранение в этот формат, весь функционал, кроме текста, будет потерян.<br>Вы действительно хотите продолжить?",
|
"DE.Controllers.LeftMenu.warnDownloadAs": "Если Вы продолжите сохранение в этот формат, весь функционал, кроме текста, будет потерян.<br>Вы действительно хотите продолжить?",
|
||||||
|
"DE.Controllers.LeftMenu.warnDownloadAsRTF": "Если вы продолжите сохранение в этот формат, часть форматирования может быть потеряна.<br>Вы действительно хотите продолжить?",
|
||||||
"DE.Controllers.Main.applyChangesTextText": "Загрузка изменений...",
|
"DE.Controllers.Main.applyChangesTextText": "Загрузка изменений...",
|
||||||
"DE.Controllers.Main.applyChangesTitleText": "Загрузка изменений",
|
"DE.Controllers.Main.applyChangesTitleText": "Загрузка изменений",
|
||||||
"DE.Controllers.Main.convertationTimeoutText": "Превышено время ожидания конвертации.",
|
"DE.Controllers.Main.convertationTimeoutText": "Превышено время ожидания конвертации.",
|
||||||
|
|
|
@ -193,7 +193,6 @@ define([
|
||||||
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
|
||||||
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
$('#settings-search').single('click', _.bind(me.onSearch, me));
|
||||||
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
|
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
|
||||||
$('#settings-edit-document').single('click', _.bind(me.onEditDocumet, me));
|
|
||||||
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
|
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
|
||||||
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
|
||||||
}
|
}
|
||||||
|
@ -267,10 +266,6 @@ define([
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
|
|
||||||
onEditDocumet: function() {
|
|
||||||
Common.Gateway.requestEditRights();
|
|
||||||
},
|
|
||||||
|
|
||||||
onSearch: function (e) {
|
onSearch: function (e) {
|
||||||
var toolbarView = DE.getController('Toolbar').getView('Toolbar');
|
var toolbarView = DE.getController('Toolbar').getView('Toolbar');
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<li>
|
|
||||||
<a id="settings-edit-document" class="item-link no-indicator">
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="item-media">
|
|
||||||
<i class="icon icon-edit"></i>
|
|
||||||
</div>
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title"><%= scope.textEditDoc %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<div id="settings-readermode" class="item-content">
|
<div id="settings-readermode" class="item-content">
|
||||||
<div class="item-media">
|
<div class="item-media">
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
|
||||||
|
<i class="icon icon-edit"></i>
|
||||||
|
</a>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-search" class="link icon-only">
|
<a href="#" id="toolbar-search" class="link icon-only">
|
||||||
<i class="icon icon-search"></i>
|
<i class="icon icon-search"></i>
|
||||||
|
|
|
@ -113,10 +113,8 @@ define([
|
||||||
isPhone = Common.SharedSettings.get('phone');
|
isPhone = Common.SharedSettings.get('phone');
|
||||||
|
|
||||||
if (_isEdit) {
|
if (_isEdit) {
|
||||||
$layour.find('#settings-edit-document').hide();
|
|
||||||
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||||
} else {
|
} else {
|
||||||
if (!_canEdit) $layour.find('#settings-edit-document').hide();
|
|
||||||
$layour.find('#settings-document').hide();
|
$layour.find('#settings-document').hide();
|
||||||
}
|
}
|
||||||
if (!_canReader)
|
if (!_canReader)
|
||||||
|
@ -219,7 +217,6 @@ define([
|
||||||
permissions = _.extend(permissions, data.doc.permissions);
|
permissions = _.extend(permissions, data.doc.permissions);
|
||||||
|
|
||||||
if (permissions.edit === false) {
|
if (permissions.edit === false) {
|
||||||
$('#settings-edit-document').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,7 +62,8 @@ define([
|
||||||
"click #toolbar-search" : "searchToggle",
|
"click #toolbar-search" : "searchToggle",
|
||||||
"click #toolbar-edit" : "showEdition",
|
"click #toolbar-edit" : "showEdition",
|
||||||
"click #toolbar-add" : "showInserts",
|
"click #toolbar-add" : "showInserts",
|
||||||
"click #toolbar-settings" : "showSettings"
|
"click #toolbar-settings" : "showSettings",
|
||||||
|
"click #toolbar-edit-document": "editDocument"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set innerHTML and get the references to the DOM elements
|
// Set innerHTML and get the references to the DOM elements
|
||||||
|
@ -100,6 +101,8 @@ define([
|
||||||
setMode: function (mode) {
|
setMode: function (mode) {
|
||||||
if (mode.isEdit) {
|
if (mode.isEdit) {
|
||||||
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
||||||
|
} else if (mode.canEdit && mode.canRequestEditRights){
|
||||||
|
$('#toolbar-edit-document').show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -147,6 +150,10 @@ define([
|
||||||
DE.getController('Settings').showModal();
|
DE.getController('Settings').showModal();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editDocument: function () {
|
||||||
|
Common.Gateway.requestEditRights();
|
||||||
|
},
|
||||||
|
|
||||||
textBack: 'Back'
|
textBack: 'Back'
|
||||||
}
|
}
|
||||||
})(), DE.Views.Toolbar || {}))
|
})(), DE.Views.Toolbar || {}))
|
||||||
|
|
|
@ -890,7 +890,7 @@ define([
|
||||||
this.api.asc_Save();
|
this.api.asc_Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
toolbar.btnsSave.setDisabled(!toolbar.mode.forcesave);
|
toolbar.btnSave.setDisabled(!toolbar.mode.forcesave);
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
Common.component.Analytics.trackEvent('Save');
|
Common.component.Analytics.trackEvent('Save');
|
||||||
|
@ -1963,7 +1963,7 @@ define([
|
||||||
var toolbar = this.toolbar;
|
var toolbar = this.toolbar;
|
||||||
toolbar.$el.find('.toolbar').toggleClass('masked', disable);
|
toolbar.$el.find('.toolbar').toggleClass('masked', disable);
|
||||||
|
|
||||||
this.toolbar.lockToolbar(PE.enumLock.menuFileOpen, disable, {array: [toolbar.btnsAddSlide, toolbar.btnChangeSlide, toolbar.btnPreview, toolbar.btnHide]});
|
this.toolbar.lockToolbar(PE.enumLock.menuFileOpen, disable, {array: toolbar.btnsAddSlide.concat(toolbar.btnChangeSlide, toolbar.btnPreview)});
|
||||||
if(disable) {
|
if(disable) {
|
||||||
mask = $("<div class='toolbar-mask'>").appendTo(toolbar.$el.find('.toolbar'));
|
mask = $("<div class='toolbar-mask'>").appendTo(toolbar.$el.find('.toolbar'));
|
||||||
Common.util.Shortcuts.suspendEvents('command+k, ctrl+k, alt+h, command+f5, ctrl+f5');
|
Common.util.Shortcuts.suspendEvents('command+k, ctrl+k, alt+h, command+f5, ctrl+f5');
|
||||||
|
|
|
@ -80,6 +80,7 @@ define([
|
||||||
toolbar.setExtra('left', me.header.getPanel('left', config));
|
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||||
},
|
},
|
||||||
'view:compact' : function (toolbar, state) {
|
'view:compact' : function (toolbar, state) {
|
||||||
|
me.header.mnuitemCompactToolbar.setChecked(state, true);
|
||||||
me.viewport.vlayout.getItem('toolbar').height = state ?
|
me.viewport.vlayout.getItem('toolbar').height = state ?
|
||||||
Common.Utils.InternalSettings.get('toolbar-height-compact') : Common.Utils.InternalSettings.get('toolbar-height-normal');
|
Common.Utils.InternalSettings.get('toolbar-height-compact') : Common.Utils.InternalSettings.get('toolbar-height-normal');
|
||||||
},
|
},
|
||||||
|
@ -208,7 +209,7 @@ define([
|
||||||
|
|
||||||
var mnuitemHideRulers = new Common.UI.MenuItem({
|
var mnuitemHideRulers = new Common.UI.MenuItem({
|
||||||
caption: me.header.textHideLines,
|
caption: me.header.textHideLines,
|
||||||
checked: Common.localStorage.getBool("pe-hidden-rulers"),
|
checked: Common.localStorage.getBool("pe-hidden-rulers", true),
|
||||||
checkable: true,
|
checkable: true,
|
||||||
value: 'rulers'
|
value: 'rulers'
|
||||||
});
|
});
|
||||||
|
|
|
@ -155,7 +155,6 @@ define([
|
||||||
var me = this;
|
var me = this;
|
||||||
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
||||||
$('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me));
|
$('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me));
|
||||||
$('#settings-edit-presentation').single('click', _.bind(me._onEditPresentation, me));
|
|
||||||
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
||||||
$('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me));
|
$('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me));
|
||||||
|
|
||||||
|
@ -224,10 +223,6 @@ define([
|
||||||
$('#settings-presentation-title').html(name ? name : '-');
|
$('#settings-presentation-title').html(name ? name : '-');
|
||||||
},
|
},
|
||||||
|
|
||||||
_onEditPresentation: function() {
|
|
||||||
Common.Gateway.requestEditRights();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSearch: function (e) {
|
_onSearch: function (e) {
|
||||||
var toolbarView = PE.getController('Toolbar').getView('Toolbar');
|
var toolbarView = PE.getController('Toolbar').getView('Toolbar');
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<li>
|
|
||||||
<a id="settings-edit-presentation" class="item-link no-indicator">
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="item-media">
|
|
||||||
<i class="icon icon-edit"></i>
|
|
||||||
</div>
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title"><%= scope.textEditPresent %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<a id="settings-presentation-setup" class="item-link">
|
<a id="settings-presentation-setup" class="item-link">
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
|
||||||
|
<i class="icon icon-edit"></i>
|
||||||
|
</a>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-search" class="link icon-only">
|
<a href="#" id="toolbar-search" class="link icon-only">
|
||||||
<i class="icon icon-search"></i>
|
<i class="icon icon-search"></i>
|
||||||
|
|
|
@ -114,11 +114,9 @@ define([
|
||||||
isPhone = Common.SharedSettings.get('phone');
|
isPhone = Common.SharedSettings.get('phone');
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
$layour.find('#settings-edit-presentation').hide();
|
|
||||||
$layour.find('#settings-readermode').hide();
|
$layour.find('#settings-readermode').hide();
|
||||||
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||||
} else {
|
} else {
|
||||||
if (!canEdit) $layour.find('#settings-edit-presentation').hide();
|
|
||||||
$layour.find('#settings-presentation-setup').hide();
|
$layour.find('#settings-presentation-setup').hide();
|
||||||
$layour.find('#settings-readermode input:checkbox')
|
$layour.find('#settings-readermode input:checkbox')
|
||||||
.attr('checked', Common.SharedSettings.get('readerMode'))
|
.attr('checked', Common.SharedSettings.get('readerMode'))
|
||||||
|
@ -196,7 +194,6 @@ define([
|
||||||
permissions = _.extend(permissions, data.doc.permissions);
|
permissions = _.extend(permissions, data.doc.permissions);
|
||||||
|
|
||||||
if (permissions.edit === false) {
|
if (permissions.edit === false) {
|
||||||
$('#settings-edit-presentation').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -63,7 +63,8 @@ define([
|
||||||
"click #toolbar-edit" : "showEdition",
|
"click #toolbar-edit" : "showEdition",
|
||||||
"click #toolbar-add" : "showInserts",
|
"click #toolbar-add" : "showInserts",
|
||||||
"click #toolbar-settings" : "showSettings",
|
"click #toolbar-settings" : "showSettings",
|
||||||
"click #toolbar-preview" : "showPreview"
|
"click #toolbar-preview" : "showPreview",
|
||||||
|
"click #toolbar-edit-document": "editDocument"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set innerHTML and get the references to the DOM elements
|
// Set innerHTML and get the references to the DOM elements
|
||||||
|
@ -101,6 +102,8 @@ define([
|
||||||
setMode: function (mode) {
|
setMode: function (mode) {
|
||||||
if (mode.isEdit) {
|
if (mode.isEdit) {
|
||||||
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
||||||
|
} else if (mode.canEdit && mode.canRequestEditRights){
|
||||||
|
$('#toolbar-edit-document').show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -152,6 +155,10 @@ define([
|
||||||
PE.getController('DocumentPreview').show();
|
PE.getController('DocumentPreview').show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editDocument: function () {
|
||||||
|
Common.Gateway.requestEditRights();
|
||||||
|
},
|
||||||
|
|
||||||
textBack: 'Back'
|
textBack: 'Back'
|
||||||
}
|
}
|
||||||
})(), PE.Views.Toolbar || {}))
|
})(), PE.Views.Toolbar || {}))
|
||||||
|
|
|
@ -872,7 +872,6 @@ define([
|
||||||
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
|
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
|
||||||
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
|
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
|
||||||
this.appOptions.trialMode = params.asc_getLicenseMode();
|
this.appOptions.trialMode = params.asc_getLicenseMode();
|
||||||
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
|
|
||||||
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
|
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
|
||||||
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
|
||||||
if (this.appOptions.canBranding)
|
if (this.appOptions.canBranding)
|
||||||
|
@ -897,6 +896,7 @@ define([
|
||||||
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
||||||
this.appOptions.forcesave = this.appOptions.canForcesave;
|
this.appOptions.forcesave = this.appOptions.canForcesave;
|
||||||
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
|
||||||
|
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
|
||||||
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.applyModeCommonElements();
|
this.applyModeCommonElements();
|
||||||
|
|
|
@ -1213,7 +1213,7 @@ define([
|
||||||
me.cmbNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink,
|
me.cmbNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink,
|
||||||
me.btnInsertChart, me.btnColorSchemas,
|
me.btnInsertChart, me.btnColorSchemas,
|
||||||
me.btnAutofilter, me.btnCopy, me.btnPaste, me.listStyles, me.btnPrint,
|
me.btnAutofilter, me.btnCopy, me.btnPaste, me.listStyles, me.btnPrint,
|
||||||
me.btnSave, me.btnClearStyle, me.btnCopyStyle
|
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle
|
||||||
];
|
];
|
||||||
|
|
||||||
var _temp_array = [me.cmbFontName, me.cmbFontSize, me.btnAlignLeft,me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust,me.btnAlignTop,
|
var _temp_array = [me.cmbFontName, me.cmbFontSize, me.btnAlignLeft,me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust,me.btnAlignTop,
|
||||||
|
|
|
@ -148,7 +148,6 @@ define([
|
||||||
onPageShow: function(view, pageId) {
|
onPageShow: function(view, pageId) {
|
||||||
var me = this;
|
var me = this;
|
||||||
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
$('#settings-search').single('click', _.bind(me._onSearch, me));
|
||||||
$('#settings-edit-document').single('click', _.bind(me._onEditDocument, me));
|
|
||||||
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
|
||||||
me.initSettings(pageId);
|
me.initSettings(pageId);
|
||||||
},
|
},
|
||||||
|
@ -200,10 +199,6 @@ define([
|
||||||
|
|
||||||
// API handlers
|
// API handlers
|
||||||
|
|
||||||
_onEditDocument: function() {
|
|
||||||
Common.Gateway.requestEditRights();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onSearch: function (e) {
|
_onSearch: function (e) {
|
||||||
var toolbarView = SSE.getController('Toolbar').getView('Toolbar');
|
var toolbarView = SSE.getController('Toolbar').getView('Toolbar');
|
||||||
|
|
||||||
|
|
|
@ -25,18 +25,6 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<% } %>
|
<% } %>
|
||||||
<li>
|
|
||||||
<a id="settings-edit-document" class="item-link no-indicator">
|
|
||||||
<div class="item-content">
|
|
||||||
<div class="item-media">
|
|
||||||
<i class="icon icon-edit"></i>
|
|
||||||
</div>
|
|
||||||
<div class="item-inner">
|
|
||||||
<div class="item-title"><%= scope.textEditDoc %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<a id="settings-download" class="item-link">
|
<a id="settings-download" class="item-link">
|
||||||
<div class="item-content">
|
<div class="item-content">
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
|
||||||
<i class="icon icon-plus"></i>
|
<i class="icon icon-plus"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
|
||||||
|
<i class="icon icon-edit"></i>
|
||||||
|
</a>
|
||||||
<% if (!phone) { %>
|
<% if (!phone) { %>
|
||||||
<a href="#" id="toolbar-search" class="link icon-only">
|
<a href="#" id="toolbar-search" class="link icon-only">
|
||||||
<i class="icon icon-search"></i>
|
<i class="icon icon-search"></i>
|
||||||
|
|
|
@ -119,10 +119,8 @@ define([
|
||||||
isPhone = Common.SharedSettings.get('phone');
|
isPhone = Common.SharedSettings.get('phone');
|
||||||
|
|
||||||
if (isEdit) {
|
if (isEdit) {
|
||||||
$layout.find('#settings-edit-document').hide();
|
|
||||||
$layout.find('#settings-search .item-title').text(this.textFindAndReplace)
|
$layout.find('#settings-search .item-title').text(this.textFindAndReplace)
|
||||||
} else {
|
} else {
|
||||||
if (!canEdit) $layout.find('#settings-edit-document').hide();
|
|
||||||
}
|
}
|
||||||
if (!canDownload) $layout.find('#settings-download').hide();
|
if (!canDownload) $layout.find('#settings-download').hide();
|
||||||
if (!canAbout) $layout.find('#settings-about').hide();
|
if (!canAbout) $layout.find('#settings-about').hide();
|
||||||
|
@ -191,7 +189,6 @@ define([
|
||||||
permissions = _.extend(permissions, data.doc.permissions);
|
permissions = _.extend(permissions, data.doc.permissions);
|
||||||
|
|
||||||
if (permissions.edit === false) {
|
if (permissions.edit === false) {
|
||||||
$('#settings-edit-document').hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -62,7 +62,8 @@ define([
|
||||||
"click #toolbar-search" : "searchToggle",
|
"click #toolbar-search" : "searchToggle",
|
||||||
"click #toolbar-edit" : "showEdition",
|
"click #toolbar-edit" : "showEdition",
|
||||||
"click #toolbar-add" : "showInserts",
|
"click #toolbar-add" : "showInserts",
|
||||||
"click #toolbar-settings" : "showSettings"
|
"click #toolbar-settings" : "showSettings",
|
||||||
|
"click #toolbar-edit-document": "editDocument"
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set innerHTML and get the references to the DOM elements
|
// Set innerHTML and get the references to the DOM elements
|
||||||
|
@ -93,6 +94,8 @@ define([
|
||||||
setMode: function (mode) {
|
setMode: function (mode) {
|
||||||
if (mode.isEdit) {
|
if (mode.isEdit) {
|
||||||
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
|
||||||
|
} else if (mode.canEdit && mode.canRequestEditRights){
|
||||||
|
$('#toolbar-edit-document').show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -148,6 +151,10 @@ define([
|
||||||
this.$btnEdit.toggleClass('disabled', val);
|
this.$btnEdit.toggleClass('disabled', val);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editDocument: function () {
|
||||||
|
Common.Gateway.requestEditRights();
|
||||||
|
},
|
||||||
|
|
||||||
textBack: 'Back'
|
textBack: 'Back'
|
||||||
}
|
}
|
||||||
})(), SSE.Views.Toolbar || {}))
|
})(), SSE.Views.Toolbar || {}))
|
||||||
|
|
Loading…
Reference in a new issue