diff --git a/apps/pdfeditor/main/app/controller/InsTab.js b/apps/pdfeditor/main/app/controller/InsTab.js index 696e9e4bb9..37f7ba689a 100644 --- a/apps/pdfeditor/main/app/controller/InsTab.js +++ b/apps/pdfeditor/main/app/controller/InsTab.js @@ -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(); diff --git a/apps/pdfeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/pdfeditor/main/app/view/HyperlinkSettingsDialog.js index 572cf719b1..23944abebe 100644 --- a/apps/pdfeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/pdfeditor/main/app/view/HyperlinkSettingsDialog.js @@ -77,6 +77,7 @@ define([], function () { 'use strict'; '', '', '', + '', '', '
', '', @@ -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; diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index 9984b1d2a6..dd82f262e4 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -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",