mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 00:37:20 +08:00
[PDF] Set link to page view
This commit is contained in:
@ -394,6 +394,8 @@ define([
|
||||
res = result;
|
||||
if (result === 'ok') {
|
||||
me.api.add_Hyperlink(dlg.getSettings());
|
||||
} else if (result === 'view') {
|
||||
me.api.SetLinkAnnotGoToAction(arrIds);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.view);
|
||||
};
|
||||
@ -411,7 +413,7 @@ define([
|
||||
handler: handlerDlg,
|
||||
slides: _arr
|
||||
}).on('close', function() {
|
||||
(res!=='ok') && me.api.asc_removeAnnots(arrIds);
|
||||
(res!=='ok' && res!=='view') && me.api.asc_removeAnnots(arrIds);
|
||||
});
|
||||
win.show();
|
||||
win.setSettings();
|
||||
|
||||
@ -77,6 +77,7 @@ define([], function () { 'use strict';
|
||||
'<label>' + this.strLinkTo + '</label>',
|
||||
'</div>',
|
||||
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;"></div>',
|
||||
'<div id="id-dlg-hyperlink-chb-page" class="input-row" style="margin-top: 15px;"></div>',
|
||||
'</div>',
|
||||
'<div class="input-row not-annotation">',
|
||||
'<label>' + this.strDisplay + '</label>',
|
||||
@ -180,6 +181,13 @@ define([], function () { 'use strict';
|
||||
});
|
||||
me.internalList.on('item:select', _.bind(this.onSelectItem, this));
|
||||
|
||||
me.chPageView = new Common.UI.CheckBox({
|
||||
el: $window.find('#id-dlg-hyperlink-chb-page'),
|
||||
labelText: this.txtPageView
|
||||
}).on('change', function(field, newValue, oldValue, eOpts){
|
||||
// me.internalList.setDisabled(newValue==='checked');
|
||||
});
|
||||
|
||||
me.btnOk = _.find(this.getFooterButtons(), function (item) {
|
||||
return (item.$el && item.$el.find('.primary').addBack().filter('.primary').length>0);
|
||||
}) || new Common.UI.Button({ el: $window.find('.primary') });
|
||||
@ -192,7 +200,8 @@ define([], function () { 'use strict';
|
||||
|
||||
if (me.isAnnotation) {
|
||||
$window.find('.not-annotation').addClass('hidden');
|
||||
}
|
||||
} else
|
||||
me.chPageView.setVisible(false);
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
@ -273,6 +282,62 @@ define([], function () { 'use strict';
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
if (state == 'ok') {
|
||||
if (this.isAnnotation && this.chPageView.getValue()==='checked') {
|
||||
var me = this;
|
||||
me.hide();
|
||||
|
||||
Common.NotificationCenter.trigger('editing:disable', true, {
|
||||
viewMode: true,
|
||||
allowSignature: false,
|
||||
statusBar: true,
|
||||
rightMenu: {clear: true, disable: true},
|
||||
leftMenu: {disable: true, previewMode: true},
|
||||
fileMenu: {protect: true},
|
||||
navigation: {disable: true, previewMode: true},
|
||||
comments: {disable: true, previewMode: true},
|
||||
chat: true,
|
||||
viewport: true,
|
||||
documentHolder: {clear: true, disable: true},
|
||||
toolbar: true,
|
||||
plugins: false,
|
||||
header: {docmode: true, search: true},
|
||||
shortcuts: true
|
||||
}, 'setlink');
|
||||
|
||||
Common.UI.alert({
|
||||
modal: false,
|
||||
maxwidth: 400,
|
||||
title: this.txtCreateLink,
|
||||
msg: this.txtCreateDesc,
|
||||
buttons: [ {caption: this.txtSetLink, primary: true, value: 'ok'},
|
||||
'cancel'],
|
||||
callback: function(btn){
|
||||
if (btn === 'ok') {
|
||||
me.options.handler.call(me, me, 'view');
|
||||
}
|
||||
me.close();
|
||||
Common.NotificationCenter.trigger('editing:disable', false, {
|
||||
viewMode: false,
|
||||
allowSignature: false,
|
||||
statusBar: true,
|
||||
rightMenu: {clear: true, disable: true},
|
||||
leftMenu: {disable: true, previewMode: true},
|
||||
fileMenu: {protect: true},
|
||||
navigation: {disable: true, previewMode: true},
|
||||
comments: {disable: true, previewMode: true},
|
||||
chat: true,
|
||||
viewport: true,
|
||||
documentHolder: {clear: true, disable: true},
|
||||
toolbar: true,
|
||||
plugins: false,
|
||||
header: {docmode: true, search: true},
|
||||
shortcuts: true
|
||||
}, 'setlink');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var checkurl = (this.btnExternal.isActive()) ? this.inputUrl.checkValidate() : true;
|
||||
if (checkurl !== true) {
|
||||
this.isInputFirstChange = true;
|
||||
|
||||
@ -2309,6 +2309,10 @@
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtPrev": "Previous page",
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtSizeLimit": "This field is limited to 2083 characters",
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtUrlPlaceholder": "Enter the web address or select a file",
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtCreateLink": "Create Go to view",
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtCreateDesc": "Use the scrollbars, mouse, and zoom to select the target view, then press Set link to create the link destination.",
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtSetLink": "Set link",
|
||||
"PDFE.Views.HyperlinkSettingsDialog.txtPageView": "Go to a page view",
|
||||
"PDFE.Views.ImageSettings.strTransparency": "Opacity",
|
||||
"PDFE.Views.ImageSettings.textAdvanced": "Show advanced settings",
|
||||
"PDFE.Views.ImageSettings.textCrop": "Crop",
|
||||
|
||||
Reference in New Issue
Block a user