-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drawio: bump 2.0, show preview when readonly and in share page, remov…
…e unnecessary share menu item on right click
- Loading branch information
Showing
8 changed files
with
60 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,80 +17,6 @@ kodReady.push(function() { | |
return val === v; | ||
}) | ||
} | ||
var shareDrawMenu = { | ||
'shareDraw': { | ||
name: "{{LNG['drawio.share.title']}}", | ||
className: "shareDraw", | ||
icon: "{{pluginHost}}static/images/icon.png", | ||
callback: function(action, option) { | ||
var param = kodApp.pathAction.makeParamItem(); | ||
var path = param.path; | ||
var name = param.name; | ||
var ext = pathTools.pathExt(name); | ||
var args = new Array(path, ext, name); | ||
core.openFile('{{pluginApi}}', "dialog", args, 'share=1'); | ||
} | ||
} | ||
} | ||
// 右键菜单: 分享图表 | ||
Events.bind( | ||
'[email protected]', function(menu, menuType) { | ||
var name = kodApp.pathAction.makeParamItem().name; | ||
var ext = pathTools.pathExt(name); | ||
var allowExt = inArray("{{config.fileExt}}".split(","), ext); | ||
|
||
if (menu.extendShareDraw) { | ||
if (!allowExt) { | ||
$.contextMenu.menuItemHide(menu, 'shareDraw'); | ||
} else { | ||
$.contextMenu.menuItemShow(menu, 'shareDraw'); | ||
} | ||
return; | ||
} else { | ||
if (!allowExt) return; | ||
} | ||
$.contextMenu.menuAdd(shareDrawMenu,menu, false, '.share'); | ||
menu.extendShareDraw = true; | ||
}); | ||
Events.bind( | ||
'[email protected]', function(menu, menuType) { | ||
var name = kodApp.pathAction.makeParamItem().name; | ||
var ext = pathTools.pathExt(name); | ||
var allowExt = inArray("{{config.fileExt}}".split(","), ext); | ||
|
||
if (menu.extendShareDraw) { | ||
if (!allowExt) { | ||
$.contextMenu.menuItemHide(menu, 'shareDraw'); | ||
} else { | ||
$.contextMenu.menuItemShow(menu, 'shareDraw'); | ||
} | ||
return; | ||
} else { | ||
if (!allowExt) return; | ||
} | ||
$.contextMenu.menuAdd(shareDrawMenu,menu, '.open-with', false); | ||
menu.extendShareDraw = true; | ||
}); | ||
Events.bind( | ||
'[email protected]', function(menu, menuType) { | ||
var name = kodApp.pathAction.makeParamItem().name; | ||
var ext = pathTools.pathExt(name); | ||
var allowExt = inArray("{{config.fileExt}}".split(","), ext); | ||
|
||
if (menu.extendShareDraw) { | ||
if (!allowExt) { | ||
$.contextMenu.menuItemHide(menu, 'shareDraw'); | ||
} else { | ||
$.contextMenu.menuItemShow(menu, 'shareDraw'); | ||
} | ||
return; | ||
} else { | ||
if (!allowExt) return; | ||
} | ||
$.contextMenu.menuAdd(shareDrawMenu,menu, false, '.share'); | ||
menu.extendShareDraw = true; | ||
}); | ||
|
||
// 菜单:新建图表 | ||
var newDrawMenu = { | ||
'newDraw': { | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.