diff --git a/apps/common/main/resources/less/window.less b/apps/common/main/resources/less/window.less
index 9bb540b5d..afb367b6a 100644
--- a/apps/common/main/resources/less/window.less
+++ b/apps/common/main/resources/less/window.less
@@ -258,7 +258,7 @@
line-height: @input-height-base;
}
- div {
+ & > div {
display: inline-block;
}
}
diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
index 64ce194ca..23c27740d 100644
--- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
@@ -530,6 +530,7 @@ define([
win = new SSE.Views.HyperlinkSettingsDialog({
api: me.api,
+ appOptions: me.permissions,
handler: handlerDlg
});
diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js
index 785ed5d4e..e80da27eb 100644
--- a/apps/spreadsheeteditor/main/app/controller/Main.js
+++ b/apps/spreadsheeteditor/main/app/controller/Main.js
@@ -351,6 +351,7 @@ define([
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
+ this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
index 87b54ceb2..acd2d0651 100644
--- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
@@ -899,6 +899,7 @@ define([
props = cell.asc_getHyperlink();
win = new SSE.Views.HyperlinkSettingsDialog({
api: me.api,
+ appOptions: me.appOptions,
handler: handlerDlg
});
diff --git a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js
index 4cd64730e..efdd80cf6 100644
--- a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js
+++ b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js
@@ -78,6 +78,13 @@ define([
'
',
'
',
'
',
'
',
@@ -98,6 +105,7 @@ define([
this.options.tpl = _.template(this.template)(this.options);
this.api = this.options.api;
+ this.appOptions = options.appOptions;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@@ -195,6 +203,37 @@ define([
});
me.internalList.on('item:select', _.bind(this.onSelectItem, this));
+ if (me.appOptions && me.appOptions.canMakeActionLink) {
+ var inputCopy = new Common.UI.InputField({
+ el : $('#id-dlg-clip-copy'),
+ editable : false,
+ style : 'width: 176px;'
+ });
+
+ var copyBox = $window.find('#id-clip-copy-box');
+ copyBox.on('click', _.bind(function() {
+ return false;
+ }, this));
+ copyBox.parent().on({
+ 'shown.bs.dropdown': function () {
+ _.delay(function(){
+ inputCopy._input.select().focus();
+ },100);
+ }
+ });
+ copyBox.find('button').on('click', function() {
+ inputCopy._input.select();
+ document.execCommand("copy");
+ });
+
+ Common.Gateway.on('setactionlink', function (url) {
+ inputCopy.setValue(url);
+ });
+ }
+
+ me.linkGetLink = $('#id-dlg-hyperlink-get-link');
+ me.linkGetLink.toggleClass('hidden', !(me.appOptions && me.appOptions.canMakeActionLink));
+
me.btnOk = new Common.UI.Button({
el: $window.find('.primary'),
disabled: true
@@ -202,6 +241,8 @@ define([
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
me.internalList.on('entervalue', _.bind(me.onPrimary, me));
+ $window.on('click', '#id-dlg-hyperlink-get-link', _.bind(me.getLink, me));
+
me.externalPanel = $window.find('#id-external-link');
me.internalPanel = $window.find('#id-internal-link');
},
@@ -438,6 +479,27 @@ define([
this.inputDisplay.setValue(list + ((list!=='' && val!=='') ? '!' : '') + val);
}
}
+ this.linkGetLink.toggleClass('disabled', record.get('level')==0);
+ },
+
+ getLink: function(btn) {
+ if (btn.cmpEl && btn.cmpEl.parent().hasClass('open')) return;
+
+ var record = this.internalList.getSelectedRec();
+ if (record && record.get('level')) {
+ var name = record.get('name');
+ if (record.get('type')==1) {
+ this.inputDisplay.setValue(name);
+ } else {
+ var val = this.inputRange.getValue();
+ name = (name + ((name!=='' && val!=='') ? '!' : '') + val);
+ }
+ name && Common.Gateway.requestMakeActionLink({
+ action: {
+ type: "internalLink", data: name
+ }
+ });
+ }
},
textTitle: 'Hyperlink Settings',
@@ -456,6 +518,8 @@ define([
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"',
textDefault: 'Selected range',
textSheets: 'Sheets',
- textNames: 'Defined names'
+ textNames: 'Defined names',
+ textGetLink: 'Get Link',
+ textCopy: 'Copy'
}, SSE.Views.HyperlinkSettingsDialog || {}))
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json
index 538d15d9d..a369479ba 100644
--- a/apps/spreadsheeteditor/main/locale/en.json
+++ b/apps/spreadsheeteditor/main/locale/en.json
@@ -1771,6 +1771,8 @@
"SSE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
"SSE.Views.HyperlinkSettingsDialog.textSheets": "Sheets",
"SSE.Views.HyperlinkSettingsDialog.textNames": "Defined names",
+ "SSE.Views.HyperlinkSettingsDialog.textGetLink": "Get Link",
+ "SSE.Views.HyperlinkSettingsDialog.textCopy": "Copy",
"SSE.Views.ImageSettings.textAdvanced": "Show advanced settings",
"SSE.Views.ImageSettings.textCrop": "Crop",
"SSE.Views.ImageSettings.textCropFill": "Fill",