From a0b86b1790936d6f1da047e3008999cfa4489e3e Mon Sep 17 00:00:00 2001 From: kovacsv Date: Tue, 25 Dec 2018 11:37:12 +0100 Subject: [PATCH] Copy mesh name to clipboard. --- website/images/copytoclipboard.png | Bin 0 -> 201 bytes website/include/importerapp.css | 17 +++++++- website/include/importerapp.js | 62 +++++++++++++++-------------- 3 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 website/images/copytoclipboard.png diff --git a/website/images/copytoclipboard.png b/website/images/copytoclipboard.png new file mode 100644 index 0000000000000000000000000000000000000000..7c23ad5bb43261a7d3495c4fe17fa07046672ccb GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^{2!lvI6;>1s;*b z3=DkxK$!8B)5ZfpL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt3(JriMvj3Yob?w&4= zAr}70KmPx>m(bSK{Cm7LG3$cioJL<^qqddK#|qf=Tz~K!2w-`voE*cJpwaO0qM;eH qfl6XcPDRM)4;OuSmNh;5&%').addClass ('meshbuttons').appendTo (contentDiv); + var fitInWindowButton = $('').addClass ('meshimgbutton').attr ('src', 'images/fitinwindowsmall.png').attr ('title', 'Fit Mesh In Window').appendTo (meshButtons); + fitInWindowButton.click (function () { + importerApp.FitMeshInWindow (meshIndex); + }); + var copyNameToClipboardButton = $('').addClass ('meshimgbutton').attr ('src', 'images/copytoclipboard.png').attr ('title', 'Copy Mesh Name To Clipboard').appendTo (meshButtons); + copyNameToClipboardButton.click (function () { + CopyToClipboard (mesh.name); + }); + } + var meshItem = meshesGroup.AddSubItem (mesh.name, { openCloseButton : { title : 'Show/Hide Details', - }, - userButtons : [ - { - id : 'showhidemesh-' + meshIndex, - title : 'Show/Hide Mesh', - onCreate : function (image) { - image.attr ('src', 'images/visible.png'); - }, - onClick : function (image, meshIndex) { - var visible = importerApp.ShowHideMesh (meshIndex); - image.attr ('src', visible ? 'images/visible.png' : 'images/hidden.png'); - }, - userData : meshIndex - } - ] - }); - - meshItem.AddSubItem ('Information', { - openCloseButton : { - title : 'Show/Hide Information', onOpen : function (contentDiv, mesh) { contentDiv.empty (); + + AddMeshButtons (contentDiv, mesh); var table = new InfoTable (contentDiv); var min = new JSM.Coord (JSM.Inf, JSM.Inf, JSM.Inf); @@ -287,20 +294,17 @@ ImporterApp.prototype.GenerateMenu = function () table.AddRow ('Triangle count', triangleCount); }, userData : mesh - } - }); - - meshItem.AddSubItem ('Fit In Window', { - title : 'Fit In Window', + }, userButtons : [ { - id : 'fitinwindow-' + meshIndex, - title : 'Fit In Window', + id : 'showhidemesh-' + meshIndex, + title : 'Show/Hide Mesh', onCreate : function (image) { - image.attr ('src', 'images/fitinwindowsmall.png'); + image.attr ('src', 'images/visible.png'); }, onClick : function (image, meshIndex) { - importerApp.FitMeshInWindow (meshIndex); + var visible = importerApp.ShowHideMesh (meshIndex); + image.attr ('src', visible ? 'images/visible.png' : 'images/hidden.png'); }, userData : meshIndex }