Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plugins] Add hyperlink processing in context menu for plugins. #3561

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/commonDefines.js
Original file line number Diff line number Diff line change
Expand Up @@ -3706,7 +3706,8 @@ window.AscCommon.g_cIsBeta = "false";
Selection: "Selection",
Image: "Image",
Shape: "Shape",
OleObject: "OleObject"
OleObject: "OleObject",
Hyperlink: "Hyperlink"
};


Expand Down
4 changes: 3 additions & 1 deletion common/editorscommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13188,13 +13188,15 @@
}


function CPluginCtxMenuInfo(sType, sOlePluginGuid) {
function CPluginCtxMenuInfo(sType, sOlePluginGuid, sHyperLinkVal) {
if(!sType) {
this["type"] = Asc.c_oPluginContextMenuTypes.None;
}
else {
this["type"] = sType;
this["guid"] = sOlePluginGuid;
if (sHyperLinkVal)
this["value"] = sHyperLinkVal;
}
}
//------------------------------------------------------------export---------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions word/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13448,6 +13448,10 @@ background-repeat: no-repeat;\
{
return new AscCommon.CPluginCtxMenuInfo();
}
const hyperlink = oLogicDocument.IsCursorInHyperlink();
if (hyperlink) {
return new AscCommon.CPluginCtxMenuInfo(Asc.c_oPluginContextMenuTypes.Hyperlink, undefined, hyperlink.GetValue());
}
if (!oLogicDocument.IsSelectionUse())
{
return new AscCommon.CPluginCtxMenuInfo(Asc.c_oPluginContextMenuTypes.Target);
Expand Down