Merge branch 'develop' into feature/formula-tab
This commit is contained in:
commit
cfd81dd7a9
|
@ -124,7 +124,8 @@
|
|||
help: true,
|
||||
compactHeader: false,
|
||||
toolbarNoTabs: false,
|
||||
toolbarHideFileName: false
|
||||
toolbarHideFileName: false,
|
||||
reviewDisplay: 'original'
|
||||
},
|
||||
plugins: {
|
||||
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],
|
||||
|
|
|
@ -137,6 +137,9 @@ define([
|
|||
},
|
||||
|
||||
setDisabled: function(disabled) {
|
||||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
disabled = (disabled===true);
|
||||
if (disabled !== this.disabled) {
|
||||
this.$label.toggleClass('disabled', disabled);
|
||||
|
|
|
@ -239,6 +239,8 @@ define([
|
|||
},
|
||||
|
||||
onKeyDown: function(e) {
|
||||
this.trigger('keydown:before', this, e);
|
||||
|
||||
if (e.isDefaultPrevented())
|
||||
return;
|
||||
|
||||
|
|
|
@ -380,7 +380,7 @@ define([
|
|||
onAfterShowMenu: function(e) {
|
||||
this.trigger('show:after', this, e);
|
||||
if (this.scroller) {
|
||||
this.scroller.update();
|
||||
this.scroller.update({alwaysVisibleY: this.scrollAlwaysVisible});
|
||||
var menuRoot = (this.cmpEl.attr('role') === 'menu') ? this.cmpEl : this.cmpEl.find('[role=menu]'),
|
||||
$selected = menuRoot.find('> li .checked');
|
||||
if ($selected.length) {
|
||||
|
|
|
@ -107,6 +107,9 @@ define([
|
|||
},
|
||||
|
||||
setDisabled: function(disabled) {
|
||||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
if (disabled !== this.disabled) {
|
||||
this.$radio.toggleClass('disabled', disabled);
|
||||
(disabled) ? this.$radio.attr({disabled: disabled}) : this.$radio.removeAttr('disabled');
|
||||
|
|
|
@ -671,7 +671,13 @@ define([
|
|||
});
|
||||
} else if (config.canViewReview) {
|
||||
config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users
|
||||
config.canViewReview && me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : Common.localStorage.getItem(me.view.appPrefix + "review-mode") || 'original'); // load display mode only in viewer
|
||||
if (config.canViewReview) {
|
||||
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode");
|
||||
if (val===null)
|
||||
val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original';
|
||||
me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); // load display mode only in viewer
|
||||
me.view.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val);
|
||||
}
|
||||
}
|
||||
|
||||
if (me.view && me.view.btnChat) {
|
||||
|
|
|
@ -90,7 +90,7 @@ define([
|
|||
'</tr>',
|
||||
'<tr>',
|
||||
'<td colspan="3" align="center">',
|
||||
'<a href="<%= publisherurl %>" target="_blank"><% print(publisherurl.replace(/https?:\\/{2}/, "")) %></a>',
|
||||
'<a href="<%= publisherurl %>" target="_blank"><% print(publisherurl.replace(/https?:\\/{2}/, "").replace(/\\/$/,"")) %></a>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
|
@ -143,7 +143,7 @@ define([
|
|||
'</tr>',
|
||||
'<tr>',
|
||||
'<td colspan="3" align="center">',
|
||||
'<label class="asc-about-desc"><% print(publisherurl.replace(/https?:\\/{2}/, "")) %></label>',
|
||||
'<label class="asc-about-desc"><% print(publisherurl.replace(/https?:\\/{2}/, "").replace(/\\/$/,"")) %></label>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'</table>'
|
||||
|
@ -156,7 +156,7 @@ define([
|
|||
el.html(this.template({
|
||||
publishername: '{{PUBLISHER_NAME}}',
|
||||
publisheraddr: '{{PUBLISHER_ADDRESS}}',
|
||||
publisherurl: /^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1],
|
||||
publisherurl: '{{PUBLISHER_URL}}',
|
||||
supportemail: '{{SUPPORT_EMAIL}}',
|
||||
phonenum: '{{PUBLISHER_PHONE}}',
|
||||
scope: this
|
||||
|
|
|
@ -209,14 +209,50 @@ define([
|
|||
caption: this.txtNext
|
||||
});
|
||||
|
||||
if (!this.appConfig.isRestrictedEdit) // hide Display mode option for fillForms and commenting mode
|
||||
if (!this.appConfig.isRestrictedEdit) {// hide Display mode option for fillForms and commenting mode
|
||||
var menuTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><%= caption %></div>' +
|
||||
'<% if (options.description !== null) { %><label style="display: block;color: #a5a5a5;cursor: pointer;white-space: normal;"><%= options.description %></label>' +
|
||||
'<% } %></a>');
|
||||
|
||||
this.btnReviewView = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-ic-reviewview',
|
||||
caption: this.txtView,
|
||||
menu: true
|
||||
menu: new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
items: [
|
||||
{
|
||||
caption: this.txtMarkupCap,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuReviewView',
|
||||
checked: true,
|
||||
value: 'markup',
|
||||
template: menuTemplate,
|
||||
description: this.txtMarkup
|
||||
},
|
||||
{
|
||||
caption: this.txtFinalCap,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuReviewView',
|
||||
checked: false,
|
||||
template: menuTemplate,
|
||||
description: this.txtFinal,
|
||||
value: 'final'
|
||||
},
|
||||
{
|
||||
caption: this.txtOriginalCap,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuReviewView',
|
||||
checked: false,
|
||||
template: menuTemplate,
|
||||
description: this.txtOriginal,
|
||||
value: 'original'
|
||||
}
|
||||
]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!!this.appConfig.sharingSettingsUrl && this.appConfig.sharingSettingsUrl.length && this._readonlyRights!==true) {
|
||||
this.btnSharing = new Common.UI.Button({
|
||||
|
@ -319,41 +355,7 @@ define([
|
|||
me.btnPrev.updateHint(me.hintPrev);
|
||||
me.btnNext.updateHint(me.hintNext);
|
||||
|
||||
me.btnReviewView && me.btnReviewView.setMenu(
|
||||
new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
items: [
|
||||
{
|
||||
caption: me.txtMarkupCap,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuReviewView',
|
||||
checked: true,
|
||||
value: 'markup',
|
||||
template: menuTemplate,
|
||||
description: me.txtMarkup
|
||||
},
|
||||
{
|
||||
caption: me.txtFinalCap,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuReviewView',
|
||||
checked: false,
|
||||
template: menuTemplate,
|
||||
description: me.txtFinal,
|
||||
value: 'final'
|
||||
},
|
||||
{
|
||||
caption: me.txtOriginalCap,
|
||||
checkable: true,
|
||||
toggleGroup: 'menuReviewView',
|
||||
checked: false,
|
||||
template: menuTemplate,
|
||||
description: me.txtOriginal,
|
||||
value: 'original'
|
||||
}
|
||||
]
|
||||
}));
|
||||
me.btnReviewView && me.btnReviewView.updateHint(me.tipReviewView);
|
||||
!me.appConfig.canReview && me.turnDisplayMode(Common.localStorage.getItem(me.appPrefix + "review-mode") || 'original');
|
||||
}
|
||||
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
||||
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
||||
|
|
|
@ -228,7 +228,7 @@ define([
|
|||
});
|
||||
|
||||
$(document.body).on('blur', 'input, textarea', function(e) {
|
||||
if (!me.isModalShowed) {
|
||||
if (!me.isModalShowed && !me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible()) {
|
||||
if (/form-control/.test(e.target.className))
|
||||
me.inFormControl = false;
|
||||
if (!e.relatedTarget ||
|
||||
|
@ -1095,7 +1095,7 @@ define([
|
|||
primary: 'contact',
|
||||
callback: function(btn) {
|
||||
if (btn == 'contact')
|
||||
window.open('mailto:sales@onlyoffice.com', "_blank");
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1189,10 +1189,6 @@ define([
|
|||
this.appOptions.canBranding = params.asc_getCustomization();
|
||||
if (this.appOptions.canBranding)
|
||||
appHeader.setBranding(this.editorConfig.customization);
|
||||
else if (typeof this.editorConfig.customization == 'object') {
|
||||
this.editorConfig.customization.compactHeader = this.editorConfig.customization.toolbarNoTabs =
|
||||
this.editorConfig.customization.toolbarHideFileName = false;
|
||||
}
|
||||
|
||||
this.appOptions.canRename && appHeader.setCanRename(true);
|
||||
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
|
||||
|
|
|
@ -673,49 +673,83 @@ define([
|
|||
this.template = _.template([
|
||||
'<table class="main">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtTitle + '</label></td>',
|
||||
'<td class="right"><label id="id-info-title">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="author">',
|
||||
'<td class="left"><label>' + this.txtAuthor + '</label></td>',
|
||||
'<td class="right"><span class="userLink img-commonctrl" id="id-info-author">-</span></td>',
|
||||
'</tr>',
|
||||
'<tr class="placement">',
|
||||
'<td class="left"><label>' + this.txtPlacement + '</label></td>',
|
||||
'<td class="right"><label id="id-info-placement">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="appname">',
|
||||
'<td class="left"><label>' + this.txtAppName + '</label></td>',
|
||||
'<td class="right"><label id="id-info-appname">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="date">',
|
||||
'<td class="left"><label>' + this.txtDate + '</label></td>',
|
||||
'<td class="right"><label id="id-info-date">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider date"></tr>',
|
||||
'<tr>',
|
||||
'<td class="left" style="vertical-align: top;"><label>' + this.txtStatistics + '</label></td>',
|
||||
'<td class="right" style="vertical-align: top;"><div id="id-info-statistic">',
|
||||
'<td class="left"><label>' + this.txtOwner + '</label></td>',
|
||||
'<td class="right"><label id="id-info-owner">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtUploaded + '</label></td>',
|
||||
'<td class="right"><label id="id-info-uploaded">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider general"></tr>',
|
||||
'<tr class="divider general"></tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtPages + '</label></td>',
|
||||
'<td class="right"><label id="id-info-pages"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtParagraphs + '</label></td>',
|
||||
'<td class="right"><label id="id-info-paragraphs"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtWords + '</label></td>',
|
||||
'<td class="right"><label id="id-info-words"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtSymbols + '</label></td>',
|
||||
'<td class="right"><label id="id-info-symbols"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtSpaces + '</label></td>',
|
||||
'<td class="right"><label id="id-info-spaces"></label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
// '<tr>',
|
||||
// '<td class="left"><label>' + this.txtEditTime + '</label></td>',
|
||||
// '<td class="right"><label id="id-info-edittime"></label></td>',
|
||||
// '</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtSubject + '</label></td>',
|
||||
'<td class="right"><div id="id-info-subject"></div></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtTitle + '</label></td>',
|
||||
'<td class="right"><div id="id-info-title"></div></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtComment + '</label></td>',
|
||||
'<td class="right"><div id="id-info-comment"></div></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtModifyDate + '</label></td>',
|
||||
'<td class="right"><label id="id-info-modify-date"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtModifyBy + '</label></td>',
|
||||
'<td class="right"><label id="id-info-modify-by"></label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider modify">',
|
||||
'<tr class="divider modify">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtCreated + '</label></td>',
|
||||
'<td class="right"><label id="id-info-date"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtAppName + '</label></td>',
|
||||
'<td class="right"><label id="id-info-appname"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left" style="vertical-align: top;"><label style="margin-top: 3px;">' + this.txtAuthor + '</label></td>',
|
||||
'<td class="right" style="vertical-align: top;"><div id="id-info-author">',
|
||||
'<table>',
|
||||
'<tr>',
|
||||
'<td><label>' + this.txtPages + '</label></td>',
|
||||
'<td><label id="id-info-pages"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td><label>' + this.txtParagraphs + '</label></td>',
|
||||
'<td><label id="id-info-paragraphs"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td><label>' + this.txtWords + '</label></td>',
|
||||
'<td><label id="id-info-words"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td><label>' + this.txtSymbols + '</label></td>',
|
||||
'<td><label id="id-info-symbols"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td><label>' + this.txtSpaces + '</label></td>',
|
||||
'<td><label id="id-info-spaces"></label></td>',
|
||||
'<td><div id="id-info-add-author"><input type="text" spellcheck="false" class="form-control" placeholder="' + this.txtAddAuthor +'"></div></td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
'</div></td>',
|
||||
|
@ -726,21 +760,124 @@ define([
|
|||
this.infoObj = {PageCount: 0, WordsCount: 0, ParagraphCount: 0, SymbolsCount: 0, SymbolsWSCount:0};
|
||||
this.inProgress = false;
|
||||
this.menu = options.menu;
|
||||
this.coreProps = null;
|
||||
this.authors = [];
|
||||
},
|
||||
|
||||
render: function() {
|
||||
$(this.el).html(this.template());
|
||||
|
||||
this.lblTitle = $('#id-info-title');
|
||||
var me = this;
|
||||
|
||||
// server info
|
||||
this.lblPlacement = $('#id-info-placement');
|
||||
this.lblDate = $('#id-info-date');
|
||||
this.lblAuthor = $('#id-info-author');
|
||||
this.lblApplication = $('#id-info-appname');
|
||||
this.lblOwner = $('#id-info-owner');
|
||||
this.lblUploaded = $('#id-info-uploaded');
|
||||
|
||||
// statistic info
|
||||
this.lblStatPages = $('#id-info-pages');
|
||||
this.lblStatWords = $('#id-info-words');
|
||||
this.lblStatParagraphs = $('#id-info-paragraphs');
|
||||
this.lblStatSymbols = $('#id-info-symbols');
|
||||
this.lblStatSpaces = $('#id-info-spaces');
|
||||
// this.lblEditTime = $('#id-info-edittime');
|
||||
|
||||
// edited info
|
||||
var keyDownBefore = function(input, e){
|
||||
if (e.keyCode === Common.UI.Keys.ESC) {
|
||||
var newVal = input._input.val(),
|
||||
oldVal = input.getValue();
|
||||
if (newVal !== oldVal) {
|
||||
input.setValue(oldVal);
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.inputTitle = new Common.UI.InputField({
|
||||
el : $('#id-info-title'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putTitle(me.inputTitle.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
this.inputSubject = new Common.UI.InputField({
|
||||
el : $('#id-info-subject'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putSubject(me.inputSubject.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
this.inputComment = new Common.UI.InputField({
|
||||
el : $('#id-info-comment'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putDescription(me.inputComment.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
|
||||
// modify info
|
||||
this.lblModifyDate = $('#id-info-modify-date');
|
||||
this.lblModifyBy = $('#id-info-modify-by');
|
||||
|
||||
// creation info
|
||||
this.lblDate = $('#id-info-date');
|
||||
this.lblApplication = $('#id-info-appname');
|
||||
this.tblAuthor = $('#id-info-author table');
|
||||
this.trAuthor = $('#id-info-add-author').closest('tr');
|
||||
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="close img-commonctrl"></div></td></tr>';
|
||||
|
||||
this.tblAuthor.on('click', function(e) {
|
||||
var btn = $(e.target);
|
||||
if (btn.hasClass('close') && !btn.hasClass('disabled')) {
|
||||
var el = btn.closest('tr'),
|
||||
idx = me.tblAuthor.find('tr').index(el);
|
||||
el.remove();
|
||||
me.authors.splice(idx, 1);
|
||||
if (me.coreProps && me.api) {
|
||||
me.coreProps.asc_putCreator(me.authors.join(';'));
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.inputAuthor = new Common.UI.InputField({
|
||||
el : $('#id-info-add-author'),
|
||||
style : 'width: 200px;',
|
||||
validateOnBlur: false,
|
||||
placeHolder: this.txtAddAuthor
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue == oldValue) return;
|
||||
|
||||
var val = newValue.trim();
|
||||
if (!!val && val !== oldValue.trim()) {
|
||||
val.split(/\s*[,;]\s*/).forEach(function(item){
|
||||
var str = item.trim();
|
||||
if (str) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(str)));
|
||||
me.trAuthor.before(div);
|
||||
me.authors.push(item);
|
||||
}
|
||||
});
|
||||
me.inputAuthor.setValue('');
|
||||
if (me.coreProps && me.api) {
|
||||
me.coreProps.asc_putCreator(me.authors.join(';'));
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
|
||||
this.rendered = true;
|
||||
|
||||
|
@ -760,6 +897,7 @@ define([
|
|||
Common.UI.BaseView.prototype.show.call(this,arguments);
|
||||
|
||||
this.updateStatisticInfo();
|
||||
this.updateFileInfo();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
|
@ -773,37 +911,95 @@ define([
|
|||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
var visible = false;
|
||||
doc = doc || {};
|
||||
this.lblTitle.text((doc.title) ? doc.title : '-');
|
||||
|
||||
if (doc.info) {
|
||||
if (doc.info.author)
|
||||
this.lblAuthor.text(doc.info.author);
|
||||
this._ShowHideInfoItem('author', doc.info.author!==undefined && doc.info.author!==null);
|
||||
if (doc.info.created )
|
||||
this.lblDate.text( doc.info.created );
|
||||
this._ShowHideInfoItem('date', doc.info.created!==undefined && doc.info.created!==null);
|
||||
// server info
|
||||
if (doc.info.folder )
|
||||
this.lblPlacement.text( doc.info.folder );
|
||||
this._ShowHideInfoItem('placement', doc.info.folder!==undefined && doc.info.folder!==null);
|
||||
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
|
||||
if (doc.info.author)
|
||||
this.lblOwner.text(doc.info.author);
|
||||
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible;
|
||||
if (doc.info.uploaded)
|
||||
this.lblUploaded.text(doc.info.uploaded.toLocaleString());
|
||||
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible;
|
||||
} else
|
||||
this._ShowHideDocInfo(false);
|
||||
$('tr.divider.general', this.el)[visible?'show':'hide']();
|
||||
|
||||
var appname = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appname) {
|
||||
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || '');
|
||||
this.lblApplication.text(appname);
|
||||
}
|
||||
this._ShowHideInfoItem('appname', !!appname);
|
||||
this._ShowHideInfoItem(this.lblApplication, !!appname);
|
||||
|
||||
this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null;
|
||||
if (this.coreProps) {
|
||||
var value = this.coreProps.asc_getCreated();
|
||||
if (value)
|
||||
this.lblDate.text(value.toLocaleString());
|
||||
this._ShowHideInfoItem(this.lblDate, !!value);
|
||||
}
|
||||
},
|
||||
|
||||
_ShowHideInfoItem: function(cls, visible) {
|
||||
$('tr.'+cls, this.el)[visible?'show':'hide']();
|
||||
updateFileInfo: function() {
|
||||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
var me = this,
|
||||
props = (this.api) ? this.api.asc_getCoreProps() : null,
|
||||
value;
|
||||
|
||||
this.coreProps = props;
|
||||
// var app = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
// if (app) {
|
||||
// value = app.asc_getTotalTime();
|
||||
// if (value)
|
||||
// this.lblEditTime.text(value + ' ' + this.txtMinutes);
|
||||
// }
|
||||
// this._ShowHideInfoItem(this.lblEditTime, !!value);
|
||||
|
||||
if (props) {
|
||||
var visible = false;
|
||||
value = props.asc_getModified();
|
||||
if (value)
|
||||
this.lblModifyDate.text(value.toLocaleString());
|
||||
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
|
||||
value = props.asc_getLastModifiedBy();
|
||||
if (value)
|
||||
this.lblModifyBy.text(value);
|
||||
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
|
||||
$('tr.divider.modify', this.el)[visible?'show':'hide']();
|
||||
|
||||
value = props.asc_getTitle();
|
||||
this.inputTitle.setValue(value || '');
|
||||
value = props.asc_getSubject();
|
||||
this.inputSubject.setValue(value || '');
|
||||
value = props.asc_getDescription();
|
||||
this.inputComment.setValue(value || '');
|
||||
|
||||
this.tblAuthor.find('tr:not(:last-of-type)').remove();
|
||||
this.authors = [];
|
||||
value = props.asc_getCreator();//"123\"\"\"\<\>,456";
|
||||
value && value.split(/\s*[,;]\s*/).forEach(function(item) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(item)));
|
||||
me.trAuthor.before(div);
|
||||
me.authors.push(item);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_ShowHideInfoItem: function(el, visible) {
|
||||
el.closest('tr')[visible?'show':'hide']();
|
||||
return visible;
|
||||
},
|
||||
|
||||
_ShowHideDocInfo: function(visible) {
|
||||
this._ShowHideInfoItem('date', visible);
|
||||
this._ShowHideInfoItem('placement', visible);
|
||||
this._ShowHideInfoItem('author', visible);
|
||||
this._ShowHideInfoItem(this.lblPlacement, visible);
|
||||
this._ShowHideInfoItem(this.lblOwner, visible);
|
||||
this._ShowHideInfoItem(this.lblUploaded, visible);
|
||||
},
|
||||
|
||||
updateStatisticInfo: function() {
|
||||
|
@ -824,7 +1020,8 @@ define([
|
|||
this.api.asc_registerCallback('asc_onGetDocInfoStop', _.bind(this._onGetDocInfoEnd, this));
|
||||
this.api.asc_registerCallback('asc_onDocInfo', _.bind(this._onDocInfo, this));
|
||||
this.api.asc_registerCallback('asc_onGetDocInfoEnd', _.bind(this._onGetDocInfoEnd, this));
|
||||
this.api.asc_registerCallback('asc_onDocumentName', _.bind(this.onDocumentName, this));
|
||||
// this.api.asc_registerCallback('asc_onDocumentName', _.bind(this.onDocumentName, this));
|
||||
this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this));
|
||||
this.updateInfo(this.doc);
|
||||
return this;
|
||||
},
|
||||
|
@ -873,21 +1070,39 @@ define([
|
|||
},
|
||||
|
||||
onDocumentName: function(name) {
|
||||
this.lblTitle.text((name) ? name : '-');
|
||||
// this.lblTitle.text((name) ? name : '-');
|
||||
},
|
||||
|
||||
txtTitle: 'Document Title',
|
||||
txtAuthor: 'Author',
|
||||
txtPlacement: 'Placement',
|
||||
txtDate: 'Creation Date',
|
||||
txtStatistics: 'Statistics',
|
||||
onLockCore: function(lock) {
|
||||
this.inputTitle.setDisabled(lock);
|
||||
this.inputSubject.setDisabled(lock);
|
||||
this.inputComment.setDisabled(lock);
|
||||
this.inputAuthor.setDisabled(lock);
|
||||
this.tblAuthor.find('.close').toggleClass('disabled', lock);
|
||||
!lock && this.updateFileInfo();
|
||||
},
|
||||
|
||||
txtPlacement: 'Location',
|
||||
txtOwner: 'Owner',
|
||||
txtUploaded: 'Uploaded',
|
||||
txtPages: 'Pages',
|
||||
txtWords: 'Words',
|
||||
txtParagraphs: 'Paragraphs',
|
||||
txtSymbols: 'Symbols',
|
||||
txtSpaces: 'Symbols with spaces',
|
||||
txtLoading: 'Loading...',
|
||||
txtAppName: 'Application'
|
||||
txtAppName: 'Application',
|
||||
txtEditTime: 'Total Editing time',
|
||||
txtTitle: 'Title',
|
||||
txtSubject: 'Subject',
|
||||
txtComment: 'Comment',
|
||||
txtModifyDate: 'Last Modified',
|
||||
txtModifyBy: 'Last Modified By',
|
||||
txtCreated: 'Created',
|
||||
txtAuthor: 'Author',
|
||||
txtAddAuthor: 'Add Author',
|
||||
txtAddText: 'Add Text',
|
||||
txtMinutes: 'min'
|
||||
}, DE.Views.FileMenuPanels.DocumentInfo || {}));
|
||||
|
||||
DE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({
|
||||
|
|
|
@ -1345,18 +1345,27 @@
|
|||
"DE.Views.FileMenuPanels.CreateNew.newDocumentText": "New Text Document",
|
||||
"DE.Views.FileMenuPanels.CreateNew.noTemplatesText": "There are no templates",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtAppName": "Application",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtAddAuthor": "Add Author",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtAddText": "Add Text",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtAuthor": "Author",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtBtnAccessRights": "Change access rights",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtDate": "Creation Date",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtComment": "Comment",
|
||||
"del_DE.Views.FileMenuPanels.DocumentInfo.txtDate": "Creation Date",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtCreated": "Created",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtLoading": "Loading...",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtModifyDate": "Last Modified",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtModifyBy": "Last Modified By",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtOwner": "Owner",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtPages": "Pages",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtParagraphs": "Paragraphs",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Location",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtRights": "Persons who have rights",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtSpaces": "Symbols with spaces",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtStatistics": "Statistics",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtSubject": "Subject",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtSymbols": "Symbols",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Document Title",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded",
|
||||
"DE.Views.FileMenuPanels.DocumentInfo.txtWords": "Words",
|
||||
"DE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights",
|
||||
"DE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights",
|
||||
|
|
|
@ -304,6 +304,7 @@
|
|||
}
|
||||
|
||||
table {
|
||||
tr {
|
||||
td {
|
||||
padding: 0 20px 5px 0;
|
||||
|
||||
|
@ -326,6 +327,7 @@
|
|||
&.divider {
|
||||
height: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&.main {
|
||||
width: 100%;
|
||||
|
@ -347,6 +349,27 @@
|
|||
label, span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.close {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 5px;
|
||||
|
||||
background-position: @but-close-offset-x @but-close-offset-y;
|
||||
|
||||
&.over,
|
||||
&:hover {
|
||||
background-position: @but-close-offset-x @but-close-offset-y - 16px;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
background-position: @but-close-offset-x @but-close-offset-y - 32px;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#panel-protect {
|
||||
|
|
|
@ -660,7 +660,7 @@ define([
|
|||
text: me.textContactUs,
|
||||
bold: true,
|
||||
onClick: function() {
|
||||
window.open('mailto:sales@onlyoffice.com', "_blank");
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
},
|
||||
{ text: me.textClose }]
|
||||
|
|
|
@ -207,7 +207,7 @@ define([
|
|||
});
|
||||
|
||||
$(document.body).on('blur', 'input, textarea', function(e) {
|
||||
if (!me.isModalShowed) {
|
||||
if (!me.isModalShowed && !me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible()) {
|
||||
if (/form-control/.test(e.target.className))
|
||||
me.inFormControl = false;
|
||||
if (!e.relatedTarget ||
|
||||
|
@ -839,7 +839,7 @@ define([
|
|||
primary: 'contact',
|
||||
callback: function(btn) {
|
||||
if (btn == 'contact')
|
||||
window.open('mailto:sales@onlyoffice.com', "_blank");
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -910,10 +910,6 @@ define([
|
|||
this.appOptions.canBranding = params.asc_getCustomization();
|
||||
if (this.appOptions.canBranding)
|
||||
appHeader.setBranding(this.editorConfig.customization);
|
||||
else if (typeof this.editorConfig.customization == 'object') {
|
||||
this.editorConfig.customization.compactHeader = this.editorConfig.customization.toolbarNoTabs =
|
||||
this.editorConfig.customization.toolbarHideFileName = false;
|
||||
}
|
||||
|
||||
this.appOptions.canRename && appHeader.setCanRename(true);
|
||||
this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins);
|
||||
|
|
|
@ -595,40 +595,179 @@ define([
|
|||
this.template = _.template([
|
||||
'<table class="main">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtTitle + '</label></td>',
|
||||
'<td class="right"><label id="id-info-title">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="author">',
|
||||
'<td class="left"><label>' + this.txtAuthor + '</label></td>',
|
||||
'<td class="right"><span class="userLink" id="id-info-author">-</span></td>',
|
||||
'</tr>',
|
||||
'<tr class="placement">',
|
||||
'<td class="left"><label>' + this.txtPlacement + '</label></td>',
|
||||
'<td class="right"><label id="id-info-placement">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="appname">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtOwner + '</label></td>',
|
||||
'<td class="right"><label id="id-info-owner">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtUploaded + '</label></td>',
|
||||
'<td class="right"><label id="id-info-uploaded">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider general"></tr>',
|
||||
'<tr class="divider general"></tr>',
|
||||
// '<tr>',
|
||||
// '<td class="left"><label>' + this.txtEditTime + '</label></td>',
|
||||
// '<td class="right"><label id="id-info-edittime"></label></td>',
|
||||
// '</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtSubject + '</label></td>',
|
||||
'<td class="right"><div id="id-info-subject"></div></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtTitle + '</label></td>',
|
||||
'<td class="right"><div id="id-info-title"></div></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtComment + '</label></td>',
|
||||
'<td class="right"><div id="id-info-comment"></div></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtModifyDate + '</label></td>',
|
||||
'<td class="right"><label id="id-info-modify-date"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtModifyBy + '</label></td>',
|
||||
'<td class="right"><label id="id-info-modify-by"></label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider modify">',
|
||||
'<tr class="divider modify">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtCreated + '</label></td>',
|
||||
'<td class="right"><label id="id-info-date"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtAppName + '</label></td>',
|
||||
'<td class="right"><label id="id-info-appname">-</label></td>',
|
||||
'<td class="right"><label id="id-info-appname"></label></td>',
|
||||
'</tr>',
|
||||
'<tr class="date">',
|
||||
'<td class="left"><label>' + this.txtDate + '</label></td>',
|
||||
'<td class="right"><label id="id-info-date">-</label></td>',
|
||||
'<tr>',
|
||||
'<td class="left" style="vertical-align: top;"><label style="margin-top: 3px;">' + this.txtAuthor + '</label></td>',
|
||||
'<td class="right" style="vertical-align: top;"><div id="id-info-author">',
|
||||
'<table>',
|
||||
'<tr>',
|
||||
'<td><div id="id-info-add-author"><input type="text" spellcheck="false" class="form-control" placeholder="' + this.txtAddAuthor +'"></div></td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
'</div></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider date"></tr>',
|
||||
'</table>'
|
||||
].join(''));
|
||||
|
||||
this.menu = options.menu;
|
||||
this.coreProps = null;
|
||||
this.authors = [];
|
||||
},
|
||||
|
||||
render: function() {
|
||||
$(this.el).html(this.template());
|
||||
|
||||
this.lblTitle = $('#id-info-title');
|
||||
var me = this;
|
||||
|
||||
// server info
|
||||
this.lblPlacement = $('#id-info-placement');
|
||||
this.lblOwner = $('#id-info-owner');
|
||||
this.lblUploaded = $('#id-info-uploaded');
|
||||
|
||||
// edited info
|
||||
var keyDownBefore = function(input, e){
|
||||
if (e.keyCode === Common.UI.Keys.ESC) {
|
||||
var newVal = input._input.val(),
|
||||
oldVal = input.getValue();
|
||||
if (newVal !== oldVal) {
|
||||
input.setValue(oldVal);
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.inputTitle = new Common.UI.InputField({
|
||||
el : $('#id-info-title'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putTitle(me.inputTitle.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
this.inputSubject = new Common.UI.InputField({
|
||||
el : $('#id-info-subject'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putSubject(me.inputSubject.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
this.inputComment = new Common.UI.InputField({
|
||||
el : $('#id-info-comment'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putDescription(me.inputComment.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
|
||||
// modify info
|
||||
this.lblModifyDate = $('#id-info-modify-date');
|
||||
this.lblModifyBy = $('#id-info-modify-by');
|
||||
|
||||
// creation info
|
||||
this.lblDate = $('#id-info-date');
|
||||
this.lblAuthor = $('#id-info-author');
|
||||
this.lblApplication = $('#id-info-appname');
|
||||
this.tblAuthor = $('#id-info-author table');
|
||||
this.trAuthor = $('#id-info-add-author').closest('tr');
|
||||
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="close img-commonctrl"></div></td></tr>';
|
||||
|
||||
this.tblAuthor.on('click', function(e) {
|
||||
var btn = $(e.target);
|
||||
if (btn.hasClass('close') && !btn.hasClass('disabled')) {
|
||||
var el = btn.closest('tr'),
|
||||
idx = me.tblAuthor.find('tr').index(el);
|
||||
el.remove();
|
||||
me.authors.splice(idx, 1);
|
||||
if (me.coreProps && me.api) {
|
||||
me.coreProps.asc_putCreator(me.authors.join(';'));
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.inputAuthor = new Common.UI.InputField({
|
||||
el : $('#id-info-add-author'),
|
||||
style : 'width: 200px;',
|
||||
validateOnBlur: false,
|
||||
placeHolder: this.txtAddAuthor
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue == oldValue) return;
|
||||
|
||||
var val = newValue.trim();
|
||||
if (!!val && val !== oldValue.trim()) {
|
||||
val.split(/\s*[,;]\s*/).forEach(function(item){
|
||||
var str = item.trim();
|
||||
if (str) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(str)));
|
||||
me.trAuthor.before(div);
|
||||
me.authors.push(item);
|
||||
}
|
||||
});
|
||||
me.inputAuthor.setValue('');
|
||||
if (me.coreProps && me.api) {
|
||||
me.coreProps.asc_putCreator(me.authors.join(';'));
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
|
||||
this.rendered = true;
|
||||
|
||||
|
@ -646,6 +785,8 @@ define([
|
|||
|
||||
show: function() {
|
||||
Common.UI.BaseView.prototype.show.call(this,arguments);
|
||||
|
||||
this.updateFileInfo();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
|
@ -657,37 +798,95 @@ define([
|
|||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
var visible = false;
|
||||
doc = doc || {};
|
||||
this.lblTitle.text((doc.title) ? doc.title : '-');
|
||||
|
||||
if (doc.info) {
|
||||
if (doc.info.author)
|
||||
this.lblAuthor.text(doc.info.author);
|
||||
this._ShowHideInfoItem('author', doc.info.author!==undefined && doc.info.author!==null);
|
||||
if (doc.info.created )
|
||||
this.lblDate.text( doc.info.created );
|
||||
this._ShowHideInfoItem('date', doc.info.created!==undefined && doc.info.created!==null);
|
||||
// server info
|
||||
if (doc.info.folder )
|
||||
this.lblPlacement.text( doc.info.folder );
|
||||
this._ShowHideInfoItem('placement', doc.info.folder!==undefined && doc.info.folder!==null);
|
||||
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
|
||||
if (doc.info.author)
|
||||
this.lblOwner.text(doc.info.author);
|
||||
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible;
|
||||
if (doc.info.uploaded)
|
||||
this.lblUploaded.text(doc.info.uploaded.toLocaleString());
|
||||
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible;
|
||||
} else
|
||||
this._ShowHideDocInfo(false);
|
||||
$('tr.divider.general', this.el)[visible?'show':'hide']();
|
||||
|
||||
var appname = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appname) {
|
||||
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || '');
|
||||
this.lblApplication.text(appname);
|
||||
}
|
||||
this._ShowHideInfoItem('appname', !!appname);
|
||||
this._ShowHideInfoItem(this.lblApplication, !!appname);
|
||||
|
||||
this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null;
|
||||
if (this.coreProps) {
|
||||
var value = this.coreProps.asc_getCreated();
|
||||
if (value)
|
||||
this.lblDate.text(value.toLocaleString());
|
||||
this._ShowHideInfoItem(this.lblDate, !!value);
|
||||
}
|
||||
},
|
||||
|
||||
_ShowHideInfoItem: function(cls, visible) {
|
||||
$('tr.'+cls, this.el)[visible?'show':'hide']();
|
||||
updateFileInfo: function() {
|
||||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
var me = this,
|
||||
props = (this.api) ? this.api.asc_getCoreProps() : null,
|
||||
value;
|
||||
|
||||
this.coreProps = props;
|
||||
// var app = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
// if (app) {
|
||||
// value = app.asc_getTotalTime();
|
||||
// if (value)
|
||||
// this.lblEditTime.text(value + ' ' + this.txtMinutes);
|
||||
// }
|
||||
// this._ShowHideInfoItem(this.lblEditTime, !!value);
|
||||
|
||||
if (props) {
|
||||
var visible = false;
|
||||
value = props.asc_getModified();
|
||||
if (value)
|
||||
this.lblModifyDate.text(value.toLocaleString());
|
||||
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
|
||||
value = props.asc_getLastModifiedBy();
|
||||
if (value)
|
||||
this.lblModifyBy.text(value);
|
||||
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
|
||||
$('tr.divider.modify', this.el)[visible?'show':'hide']();
|
||||
|
||||
value = props.asc_getTitle();
|
||||
this.inputTitle.setValue(value || '');
|
||||
value = props.asc_getSubject();
|
||||
this.inputSubject.setValue(value || '');
|
||||
value = props.asc_getDescription();
|
||||
this.inputComment.setValue(value || '');
|
||||
|
||||
this.tblAuthor.find('tr:not(:last-of-type)').remove();
|
||||
this.authors = [];
|
||||
value = props.asc_getCreator();//"123\"\"\"\<\>,456";
|
||||
value && value.split(/\s*[,;]\s*/).forEach(function(item) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(item)));
|
||||
me.trAuthor.before(div);
|
||||
me.authors.push(item);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_ShowHideInfoItem: function(el, visible) {
|
||||
el.closest('tr')[visible?'show':'hide']();
|
||||
return visible;
|
||||
},
|
||||
|
||||
_ShowHideDocInfo: function(visible) {
|
||||
this._ShowHideInfoItem('date', visible);
|
||||
this._ShowHideInfoItem('placement', visible);
|
||||
this._ShowHideInfoItem('author', visible);
|
||||
this._ShowHideInfoItem(this.lblPlacement, visible);
|
||||
this._ShowHideInfoItem(this.lblOwner, visible);
|
||||
this._ShowHideInfoItem(this.lblUploaded, visible);
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
|
@ -696,15 +895,35 @@ define([
|
|||
|
||||
setApi: function(o) {
|
||||
this.api = o;
|
||||
this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this));
|
||||
this.updateInfo(this.doc);
|
||||
return this;
|
||||
},
|
||||
|
||||
txtTitle: 'Document Title',
|
||||
onLockCore: function(lock) {
|
||||
this.inputTitle.setDisabled(lock);
|
||||
this.inputSubject.setDisabled(lock);
|
||||
this.inputComment.setDisabled(lock);
|
||||
this.inputAuthor.setDisabled(lock);
|
||||
this.tblAuthor.find('.close').toggleClass('disabled', lock);
|
||||
!lock && this.updateFileInfo();
|
||||
},
|
||||
|
||||
txtPlacement: 'Location',
|
||||
txtOwner: 'Owner',
|
||||
txtUploaded: 'Uploaded',
|
||||
txtAppName: 'Application',
|
||||
txtEditTime: 'Total Editing time',
|
||||
txtTitle: 'Title',
|
||||
txtSubject: 'Subject',
|
||||
txtComment: 'Comment',
|
||||
txtModifyDate: 'Last Modified',
|
||||
txtModifyBy: 'Last Modified By',
|
||||
txtCreated: 'Created',
|
||||
txtAuthor: 'Author',
|
||||
txtPlacement: 'Placement',
|
||||
txtDate: 'Creation Date',
|
||||
txtAppName: 'Application'
|
||||
txtAddAuthor: 'Add Author',
|
||||
txtAddText: 'Add Text',
|
||||
txtMinutes: 'min'
|
||||
}, PE.Views.FileMenuPanels.DocumentInfo || {}));
|
||||
|
||||
PE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({
|
||||
|
|
|
@ -1152,12 +1152,21 @@
|
|||
"PE.Views.FileMenuPanels.CreateNew.newDocumentText": "New Presentation",
|
||||
"PE.Views.FileMenuPanels.CreateNew.noTemplatesText": "There are no templates",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtAppName": "Application",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtAddAuthor": "Add Author",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtAddText": "Add Text",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtAuthor": "Author",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtBtnAccessRights": "Change access rights",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtDate": "Creation Date",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtComment": "Comment",
|
||||
"del_PE.Views.FileMenuPanels.DocumentInfo.txtDate": "Creation Date",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtCreated": "Created",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtModifyDate": "Last Modified",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtModifyBy": "Last Modified By",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtOwner": "Owner",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Location",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtRights": "Persons who have rights",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Presentation Title",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtSubject": "Subject",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title",
|
||||
"PE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded",
|
||||
"PE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights",
|
||||
"PE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights",
|
||||
"PE.Views.FileMenuPanels.ProtectDoc.notcriticalErrorTitle": "Warning",
|
||||
|
|
|
@ -433,6 +433,27 @@
|
|||
label, span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.close {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 5px;
|
||||
|
||||
background-position: @but-close-offset-x @but-close-offset-y;
|
||||
|
||||
&.over,
|
||||
&:hover {
|
||||
background-position: @but-close-offset-x @but-close-offset-y - 16px;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
background-position: @but-close-offset-x @but-close-offset-y - 32px;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#panel-protect {
|
||||
|
|
|
@ -608,7 +608,7 @@ define([
|
|||
text: me.textContactUs,
|
||||
bold: true,
|
||||
onClick: function() {
|
||||
window.open('mailto:sales@onlyoffice.com', "_blank");
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
},
|
||||
{ text: me.textClose }]
|
||||
|
|
|
@ -205,7 +205,7 @@ define([
|
|||
$(document.body).on('blur', 'input, textarea', function(e) {
|
||||
if (me.isAppDisabled === true || me.isFrameClosed) return;
|
||||
|
||||
if ((!me.isModalShowed || $('.asc-window.enable-key-events:visible').length>0) && !(me.loadMask && me.loadMask.isVisible())) {
|
||||
if ((!me.isModalShowed || $('.asc-window.enable-key-events:visible').length>0) && !(me.loadMask && me.loadMask.isVisible()) && !me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible()) {
|
||||
if (/form-control/.test(e.target.className))
|
||||
me.inFormControl = false;
|
||||
if (!e.relatedTarget ||
|
||||
|
@ -853,7 +853,7 @@ define([
|
|||
primary: 'contact',
|
||||
callback: function(btn) {
|
||||
if (btn == 'contact')
|
||||
window.open('mailto:sales@onlyoffice.com', "_blank");
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -912,10 +912,6 @@ define([
|
|||
this.appOptions.canBranding = params.asc_getCustomization();
|
||||
if (this.appOptions.canBranding)
|
||||
this.headerView.setBranding(this.editorConfig.customization);
|
||||
else if (typeof this.editorConfig.customization == 'object') {
|
||||
this.editorConfig.customization.compactHeader = this.editorConfig.customization.toolbarNoTabs =
|
||||
this.editorConfig.customization.toolbarHideFileName = false;
|
||||
}
|
||||
|
||||
this.appOptions.canRename && this.headerView.setCanRename(true);
|
||||
} else
|
||||
|
|
|
@ -62,8 +62,6 @@ define([
|
|||
{ caption: this.textManager, value: 'manager' },
|
||||
{ caption: '--' }
|
||||
]
|
||||
}).on('show:after', function () {
|
||||
this.scroller.update({alwaysVisibleY: true});
|
||||
})
|
||||
});
|
||||
this.btnNamedRanges.render($('#ce-cell-name-menu'));
|
||||
|
|
|
@ -1050,40 +1050,175 @@ define([
|
|||
this.template = _.template([
|
||||
'<table class="main">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtTitle + '</label></td>',
|
||||
'<td class="right"><label id="id-info-title">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="author">',
|
||||
'<td class="left"><label>' + this.txtAuthor + '</label></td>',
|
||||
'<td class="right"><span class="userLink" id="id-info-author">-</span></td>',
|
||||
'</tr>',
|
||||
'<tr class="placement">',
|
||||
'<td class="left"><label>' + this.txtPlacement + '</label></td>',
|
||||
'<td class="right"><label id="id-info-placement">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="appname">',
|
||||
'<td class="left"><label>' + this.txtAppName + '</label></td>',
|
||||
'<td class="right"><label id="id-info-appname">-</label></td>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtOwner + '</label></td>',
|
||||
'<td class="right"><label id="id-info-owner">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="date">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtUploaded + '</label></td>',
|
||||
'<td class="right"><label id="id-info-uploaded">-</label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider general"></tr>',
|
||||
'<tr class="divider general"></tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtSubject + '</label></td>',
|
||||
'<td class="right"><div id="id-info-subject"></div></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtTitle + '</label></td>',
|
||||
'<td class="right"><div id="id-info-title"></div></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtComment + '</label></td>',
|
||||
'<td class="right"><div id="id-info-comment"></div></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr class="divider"></tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtModifyDate + '</label></td>',
|
||||
'<td class="right"><label id="id-info-modify-date"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtModifyBy + '</label></td>',
|
||||
'<td class="right"><label id="id-info-modify-by"></label></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider modify">',
|
||||
'<tr class="divider modify">',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtDate + '</label></td>',
|
||||
'<td class="right"><label id="id-info-date">-</label></td>',
|
||||
'<td class="right"><label id="id-info-date"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left"><label>' + this.txtAppName + '</label></td>',
|
||||
'<td class="right"><label id="id-info-appname"></label></td>',
|
||||
'</tr>',
|
||||
'<tr>',
|
||||
'<td class="left" style="vertical-align: top;"><label style="margin-top: 3px;">' + this.txtAuthor + '</label></td>',
|
||||
'<td class="right" style="vertical-align: top;"><div id="id-info-author">',
|
||||
'<table>',
|
||||
'<tr>',
|
||||
'<td><div id="id-info-add-author"><input type="text" spellcheck="false" class="form-control" placeholder="' + this.txtAddAuthor +'"></div></td>',
|
||||
'</tr>',
|
||||
'</table>',
|
||||
'</div></td>',
|
||||
'</tr>',
|
||||
'<tr class="divider date"></tr>',
|
||||
'</table>'
|
||||
].join(''));
|
||||
|
||||
this.menu = options.menu;
|
||||
this.coreProps = null;
|
||||
this.authors = [];
|
||||
},
|
||||
|
||||
render: function() {
|
||||
$(this.el).html(this.template());
|
||||
|
||||
this.lblTitle = $('#id-info-title');
|
||||
var me = this;
|
||||
|
||||
// server info
|
||||
this.lblPlacement = $('#id-info-placement');
|
||||
this.lblOwner = $('#id-info-owner');
|
||||
this.lblUploaded = $('#id-info-uploaded');
|
||||
|
||||
// edited info
|
||||
var keyDownBefore = function(input, e){
|
||||
if (e.keyCode === Common.UI.Keys.ESC) {
|
||||
var newVal = input._input.val(),
|
||||
oldVal = input.getValue();
|
||||
if (newVal !== oldVal) {
|
||||
input.setValue(oldVal);
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.inputTitle = new Common.UI.InputField({
|
||||
el : $('#id-info-title'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putTitle(me.inputTitle.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
this.inputSubject = new Common.UI.InputField({
|
||||
el : $('#id-info-subject'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putSubject(me.inputSubject.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
this.inputComment = new Common.UI.InputField({
|
||||
el : $('#id-info-comment'),
|
||||
style : 'width: 200px;',
|
||||
placeHolder : this.txtAddText,
|
||||
validateOnBlur: false
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue !== oldValue && me.coreProps && me.api) {
|
||||
me.coreProps.asc_putDescription(me.inputComment.getValue());
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
|
||||
// modify info
|
||||
this.lblModifyDate = $('#id-info-modify-date');
|
||||
this.lblModifyBy = $('#id-info-modify-by');
|
||||
|
||||
// creation info
|
||||
this.lblDate = $('#id-info-date');
|
||||
this.lblAuthor = $('#id-info-author');
|
||||
this.lblApplication = $('#id-info-appname');
|
||||
this.tblAuthor = $('#id-info-author table');
|
||||
this.trAuthor = $('#id-info-add-author').closest('tr');
|
||||
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="close img-commonctrl"></div></td></tr>';
|
||||
|
||||
this.tblAuthor.on('click', function(e) {
|
||||
var btn = $(e.target);
|
||||
if (btn.hasClass('close') && !btn.hasClass('disabled')) {
|
||||
var el = btn.closest('tr'),
|
||||
idx = me.tblAuthor.find('tr').index(el);
|
||||
el.remove();
|
||||
me.authors.splice(idx, 1);
|
||||
if (me.coreProps && me.api) {
|
||||
me.coreProps.asc_putCreator(me.authors.join(';'));
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.inputAuthor = new Common.UI.InputField({
|
||||
el : $('#id-info-add-author'),
|
||||
style : 'width: 200px;',
|
||||
validateOnBlur: false,
|
||||
placeHolder: this.txtAddAuthor
|
||||
}).on('changed:after', function(input, newValue, oldValue) {
|
||||
if (newValue == oldValue) return;
|
||||
|
||||
var val = newValue.trim();
|
||||
if (!!val && val !== oldValue.trim()) {
|
||||
val.split(/\s*[,;]\s*/).forEach(function(item){
|
||||
var str = item.trim();
|
||||
if (str) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(str)));
|
||||
me.trAuthor.before(div);
|
||||
me.authors.push(item);
|
||||
}
|
||||
});
|
||||
me.inputAuthor.setValue('');
|
||||
if (me.coreProps && me.api) {
|
||||
me.coreProps.asc_putCreator(me.authors.join(';'));
|
||||
me.api.asc_setCoreProps(me.coreProps);
|
||||
}
|
||||
}
|
||||
}).on('keydown:before', keyDownBefore);
|
||||
|
||||
this.rendered = true;
|
||||
|
||||
|
@ -1101,6 +1236,8 @@ define([
|
|||
|
||||
show: function() {
|
||||
Common.UI.BaseView.prototype.show.call(this,arguments);
|
||||
|
||||
this.updateFileInfo();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
|
@ -1112,37 +1249,95 @@ define([
|
|||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
var visible = false;
|
||||
doc = doc || {};
|
||||
this.lblTitle.text((doc.title) ? doc.title : '-');
|
||||
|
||||
if (doc.info) {
|
||||
if (doc.info.author)
|
||||
this.lblAuthor.text(doc.info.author);
|
||||
this._ShowHideInfoItem('author', doc.info.author!==undefined && doc.info.author!==null);
|
||||
if (doc.info.created )
|
||||
this.lblDate.text( doc.info.created );
|
||||
this._ShowHideInfoItem('date', doc.info.created!==undefined && doc.info.created!==null);
|
||||
// server info
|
||||
if (doc.info.folder )
|
||||
this.lblPlacement.text( doc.info.folder );
|
||||
this._ShowHideInfoItem('placement', doc.info.folder!==undefined && doc.info.folder!==null);
|
||||
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
|
||||
if (doc.info.author)
|
||||
this.lblOwner.text(doc.info.author);
|
||||
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible;
|
||||
if (doc.info.uploaded)
|
||||
this.lblUploaded.text(doc.info.uploaded.toLocaleString());
|
||||
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible;
|
||||
} else
|
||||
this._ShowHideDocInfo(false);
|
||||
$('tr.divider.general', this.el)[visible?'show':'hide']();
|
||||
|
||||
var appname = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
if (appname) {
|
||||
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || '');
|
||||
this.lblApplication.text(appname);
|
||||
}
|
||||
this._ShowHideInfoItem('appname', !!appname);
|
||||
this._ShowHideInfoItem(this.lblApplication, !!appname);
|
||||
|
||||
this.coreProps = (this.api) ? this.api.asc_getCoreProps() : null;
|
||||
if (this.coreProps) {
|
||||
var value = this.coreProps.asc_getCreated();
|
||||
if (value)
|
||||
this.lblDate.text(value.toLocaleString());
|
||||
this._ShowHideInfoItem(this.lblDate, !!value);
|
||||
}
|
||||
},
|
||||
|
||||
_ShowHideInfoItem: function(cls, visible) {
|
||||
$('tr.'+cls, this.el)[visible?'show':'hide']();
|
||||
updateFileInfo: function() {
|
||||
if (!this.rendered)
|
||||
return;
|
||||
|
||||
var me = this,
|
||||
props = (this.api) ? this.api.asc_getCoreProps() : null,
|
||||
value;
|
||||
|
||||
this.coreProps = props;
|
||||
// var app = (this.api) ? this.api.asc_getAppProps() : null;
|
||||
// if (app) {
|
||||
// value = app.asc_getTotalTime();
|
||||
// if (value)
|
||||
// this.lblEditTime.text(value + ' ' + this.txtMinutes);
|
||||
// }
|
||||
// this._ShowHideInfoItem(this.lblEditTime, !!value);
|
||||
|
||||
if (props) {
|
||||
var visible = false;
|
||||
value = props.asc_getModified();
|
||||
if (value)
|
||||
this.lblModifyDate.text(value.toLocaleString());
|
||||
visible = this._ShowHideInfoItem(this.lblModifyDate, !!value) || visible;
|
||||
value = props.asc_getLastModifiedBy();
|
||||
if (value)
|
||||
this.lblModifyBy.text(value);
|
||||
visible = this._ShowHideInfoItem(this.lblModifyBy, !!value) || visible;
|
||||
$('tr.divider.modify', this.el)[visible?'show':'hide']();
|
||||
|
||||
value = props.asc_getTitle();
|
||||
this.inputTitle.setValue(value || '');
|
||||
value = props.asc_getSubject();
|
||||
this.inputSubject.setValue(value || '');
|
||||
value = props.asc_getDescription();
|
||||
this.inputComment.setValue(value || '');
|
||||
|
||||
this.tblAuthor.find('tr:not(:last-of-type)').remove();
|
||||
this.authors = [];
|
||||
value = props.asc_getCreator();//"123\"\"\"\<\>,456";
|
||||
value && value.split(/\s*[,;]\s*/).forEach(function(item) {
|
||||
var div = $(Common.Utils.String.format(me.authorTpl, Common.Utils.String.htmlEncode(item)));
|
||||
me.trAuthor.before(div);
|
||||
me.authors.push(item);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_ShowHideInfoItem: function(el, visible) {
|
||||
el.closest('tr')[visible?'show':'hide']();
|
||||
return visible;
|
||||
},
|
||||
|
||||
_ShowHideDocInfo: function(visible) {
|
||||
this._ShowHideInfoItem('date', visible);
|
||||
this._ShowHideInfoItem('placement', visible);
|
||||
this._ShowHideInfoItem('author', visible);
|
||||
this._ShowHideInfoItem(this.lblPlacement, visible);
|
||||
this._ShowHideInfoItem(this.lblOwner, visible);
|
||||
this._ShowHideInfoItem(this.lblUploaded, visible);
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
|
@ -1151,15 +1346,34 @@ define([
|
|||
|
||||
setApi: function(o) {
|
||||
this.api = o;
|
||||
this.api.asc_registerCallback('asc_onLockCore', _.bind(this.onLockCore, this));
|
||||
this.updateInfo(this.doc);
|
||||
return this;
|
||||
},
|
||||
|
||||
txtTitle: 'Document Title',
|
||||
onLockCore: function(lock) {
|
||||
this.inputTitle.setDisabled(lock);
|
||||
this.inputSubject.setDisabled(lock);
|
||||
this.inputComment.setDisabled(lock);
|
||||
this.inputAuthor.setDisabled(lock);
|
||||
this.tblAuthor.find('.close').toggleClass('disabled', lock);
|
||||
!lock && this.updateFileInfo();
|
||||
},
|
||||
|
||||
txtPlacement: 'Location',
|
||||
txtOwner: 'Owner',
|
||||
txtUploaded: 'Uploaded',
|
||||
txtAppName: 'Application',
|
||||
txtTitle: 'Title',
|
||||
txtSubject: 'Subject',
|
||||
txtComment: 'Comment',
|
||||
txtModifyDate: 'Last Modified',
|
||||
txtModifyBy: 'Last Modified By',
|
||||
txtDate: 'Created',
|
||||
txtAuthor: 'Author',
|
||||
txtPlacement: 'Placement',
|
||||
txtDate: 'Creation Date',
|
||||
txtAppName: 'Application'
|
||||
txtAddAuthor: 'Add Author',
|
||||
txtAddText: 'Add Text',
|
||||
txtMinutes: 'min'
|
||||
}, SSE.Views.FileMenuPanels.DocumentInfo || {}));
|
||||
|
||||
SSE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({
|
||||
|
|
|
@ -768,8 +768,8 @@
|
|||
"SSE.Controllers.Toolbar.textOperator": "Operators",
|
||||
"SSE.Controllers.Toolbar.textPivot": "Pivot Table",
|
||||
"SSE.Controllers.Toolbar.textRadical": "Radicals",
|
||||
"SSE.Controllers.Toolbar.textScript": "Scripts",
|
||||
"SSE.Controllers.Toolbar.textSymbols": "Symbols",
|
||||
"SSE.Controllers.Toolbar.textScript": "Scripts",
|
||||
"SSE.Controllers.Toolbar.textWarning": "Warning",
|
||||
"SSE.Controllers.Toolbar.txtAccent_Accent": "Acute",
|
||||
"SSE.Controllers.Toolbar.txtAccent_ArrowD": "Right-left arrow above",
|
||||
|
@ -1507,12 +1507,21 @@
|
|||
"SSE.Views.FileMenuPanels.CreateNew.newDescriptionText": "Create a new blank spreadsheet which you will be able to style and format after it is created during the editing. Or choose one of the templates to start a spreadsheet of a certain type or purpose where some styles have already been pre-applied.",
|
||||
"SSE.Views.FileMenuPanels.CreateNew.newDocumentText": "New Spreadsheet",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtAppName": "Application",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtAddAuthor": "Add Author",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtAddText": "Add Text",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtAuthor": "Author",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtBtnAccessRights": "Change access rights",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtDate": "Creation Date",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtComment": "Comment",
|
||||
"del_SSE.Views.FileMenuPanels.DocumentInfo.txtDate": "Creation Date",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtCreated": "Created",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtModifyDate": "Last Modified",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtModifyBy": "Last Modified By",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtOwner": "Owner",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtPlacement": "Location",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtRights": "Persons who have rights",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Spreadsheet Title",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtSubject": "Subject",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtTitle": "Title",
|
||||
"SSE.Views.FileMenuPanels.DocumentInfo.txtUploaded": "Uploaded",
|
||||
"SSE.Views.FileMenuPanels.DocumentRights.txtBtnAccessRights": "Change access rights",
|
||||
"SSE.Views.FileMenuPanels.DocumentRights.txtRights": "Persons who have rights",
|
||||
"SSE.Views.FileMenuPanels.MainSettingsGeneral.okButtonText": "Apply",
|
||||
|
|
|
@ -500,6 +500,27 @@
|
|||
label, span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.close {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-left: 5px;
|
||||
|
||||
background-position: @but-close-offset-x @but-close-offset-y;
|
||||
|
||||
&.over,
|
||||
&:hover {
|
||||
background-position: @but-close-offset-x @but-close-offset-y - 16px;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
background-position: @but-close-offset-x @but-close-offset-y - 32px;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#panel-protect {
|
||||
|
|
|
@ -623,7 +623,7 @@ define([
|
|||
text: me.textContactUs,
|
||||
bold: true,
|
||||
onClick: function() {
|
||||
window.open('mailto:sales@onlyoffice.com', "_blank");
|
||||
window.open('mailto:{{SALES_EMAIL}}', "_blank");
|
||||
}
|
||||
},
|
||||
{ text: me.textClose }]
|
||||
|
|
Loading…
Reference in a new issue