Skip to content

Commit

Permalink
renamed the openModal function to openTable
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Wicenec committed Nov 8, 2024
1 parent 29770dc commit 209301f
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Eagle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ export class Eagle {
Utils.showNotification("New Graph Config Created", 'newConfig', "success");

// open the graph configurations table
GraphConfigurationsTable.openModal();
GraphConfigurationsTable.openTable();

this.undo().pushSnapshot(this, "New graph configuration added");
this.logicalGraph().fileInfo().modified = true;
Expand Down
2 changes: 1 addition & 1 deletion src/GraphConfigurationsTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class GraphConfigurationsTable {

static showTableModal : ko.Observable<boolean> = ko.observable(false);

static openModal = () : void => {
static openTable = () : void => {
const eagle: Eagle = Eagle.getInstance();

// eagle.showEagleIsLoading()
Expand Down
2 changes: 1 addition & 1 deletion src/GraphRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ export class GraphRenderer {
//here
if(Math.abs(GraphRenderer.portDragStartPos.x - GraphRenderer.SCREEN_TO_GRAPH_POSITION_X(null))+Math.abs(GraphRenderer.portDragStartPos.y - GraphRenderer.SCREEN_TO_GRAPH_POSITION_Y(null))<3){
//identify a click, if we click a port, we will open the parameter table and highlight the port
ParameterTable.openModalAndSelectField(GraphRenderer.portDragSourceNode(), GraphRenderer.portDragSourcePort())
ParameterTable.openTableAndSelectField(GraphRenderer.portDragSourceNode(), GraphRenderer.portDragSourcePort())
GraphRenderer.clearEdgeVars();
}else{
if ((GraphRenderer.destinationPort !== null || GraphRenderer.portDragSuggestedField() !== null) && GraphRenderer.portMatchCloseEnough()){
Expand Down
6 changes: 3 additions & 3 deletions src/KeyboardShortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ export class KeyboardShortcut {
new KeyboardShortcut("open_settings", "Open setting", [new Key("o")], "keydown", true, false, ['menu','options'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.smartToggleModal('settingsModal');}),
new KeyboardShortcut("open_help", "Open Online Documentation", [new Key("h")], "keydown", true, false, ['read me','guide','documentation'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.onlineDocs();}),
new KeyboardShortcut("open_keyboard_shortcut_modal", "Open Keyboard Shortcut Modal", [new Key("k")], "keydown", true, false, ['shortcuts'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.smartToggleModal('shortcutsModal')}),
new KeyboardShortcut("open_parameter_table", "Open Parameter Table Modal", [new Key("t")], "keydown", true, false, ['fields','field','node','table'], KeyboardShortcut.true, KeyboardShortcut.notInStudentMode, KeyboardShortcut.notInStudentMode, (eagle): void => {ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("open_graph_attributes_configuration_table", "Open Graph Attributes Configuration Table Modal", [new Key("t", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['fields','field','node','graph','table','favourites'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {ParameterTable.openModal(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("open_parameter_table", "Open Parameter Table Modal", [new Key("t")], "keydown", true, false, ['fields','field','node','table'], KeyboardShortcut.true, KeyboardShortcut.notInStudentMode, KeyboardShortcut.notInStudentMode, (eagle): void => {ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("open_graph_attributes_configuration_table", "Open Graph Attributes Configuration Table Modal", [new Key("t", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['fields','field','node','graph','table','favourites'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);}),
new KeyboardShortcut("undo", "Undo", [new Key("z")], "keydown", true, false, ['back','history'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.undo().prevSnapshot(eagle)}),
new KeyboardShortcut("redo", "Redo", [new Key("z", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['forward','history'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {eagle.undo().nextSnapshot(eagle)}),
new KeyboardShortcut("check_graph", "Check Graph", [new Key("!", KeyboardShortcut.Modifier.Shift)], "keydown", true, false, ['error','errors','fix'], KeyboardShortcut.true, KeyboardShortcut.allowGraphEditing, KeyboardShortcut.allowGraphEditing, (eagle): void => {eagle.showGraphErrors();}),
Expand All @@ -291,7 +291,7 @@ export class KeyboardShortcut {
new KeyboardShortcut("select_all_in_graph", "Select all in graph", [new Key("a", KeyboardShortcut.Modifier.Ctrl)], "keydown", true, false, [''], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.graphNotEmpty, (eagle): void => { eagle.selectAllInGraph(); }),
new KeyboardShortcut("select_none_in_graph", "Select none in graph", [new Key("Escape")], "keydown", true, false, ['deselect'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.somethingIsSelected, (eagle): void => { eagle.selectNoneInGraph(); }),
new KeyboardShortcut("fix_all", "Fix all errors in graph", [new Key("f")], "keydown", true, false, [''], KeyboardShortcut.true, KeyboardShortcut.allowGraphEditing, KeyboardShortcut.allowGraphEditing, (eagle): void => { Errors.fixAll(); }),
new KeyboardShortcut("open_graph_configurations_table", "Open Graph Configurations Table Modal", [new Key("t", KeyboardShortcut.Modifier.Alt), new Key("t", KeyboardShortcut.Modifier.Ctrl)], "keydown", true, false, ['config','graph','table'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {GraphConfigurationsTable.openModal();}),
new KeyboardShortcut("open_graph_configurations_table", "Open Graph Configurations Table Modal", [new Key("t", KeyboardShortcut.Modifier.Alt), new Key("t", KeyboardShortcut.Modifier.Ctrl)], "keydown", true, false, ['config','graph','table'], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.true, (eagle): void => {GraphConfigurationsTable.openTable();}),

// shortcuts for use while an input element in focused (inputOK: true)
new KeyboardShortcut("quick_action", "Quick Action", [new Key("`"), new Key("\\")], "keydown", true, true, [''], KeyboardShortcut.true, KeyboardShortcut.true, KeyboardShortcut.quickActionsClosed, (eagle): void => { QuickActions.initiateQuickAction();}),
Expand Down
14 changes: 7 additions & 7 deletions src/ParameterTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export class ParameterTable {
} else {
graphConfig = new GraphConfig()
Utils.requestUserString("New Configuration", "Enter a name for the new configuration", Utils.generateGraphConfigName(graphConfig), false, (completed : boolean, userString : string) : void => {
ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);
ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);

if (!completed){
return;
Expand Down Expand Up @@ -417,7 +417,7 @@ export class ParameterTable {

static requestEditConfig(config: GraphConfig): void {
GraphConfigurationsTable.closeModal();
ParameterTable.openModal(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);
ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);
}

static requestEditDescriptionInModal(currentField:Field) : void {
Expand Down Expand Up @@ -522,7 +522,7 @@ export class ParameterTable {
upresizer.on('mousedown', mouseDownHandler);
}

static openModal = (mode: Eagle.BottomWindowMode, selectType: ParameterTable.SelectType) : void => {
static openTable = (mode: Eagle.BottomWindowMode, selectType: ParameterTable.SelectType) : void => {
const eagle: Eagle = Eagle.getInstance();

// eagle.showEagleIsLoading()
Expand All @@ -547,7 +547,7 @@ export class ParameterTable {
//open the bottom window
SideWindow.setShown('bottom',true)
}

//make sure the right click menu is closed
if(selectType === ParameterTable.SelectType.RightClick){
eagle.setSelection(Eagle.selectedRightClickObject(), Eagle.selectedRightClickLocation())
Expand All @@ -557,13 +557,13 @@ export class ParameterTable {
},5)
}

// TODO: can we combine this with openModal(), maybe use an extra parameter to the function?
static openModalAndSelectField = (node:Node, field:Field) : void => {
// TODO: can we combine this with openTable(), maybe use an extra parameter to the function?
static openTableAndSelectField = (node:Node, field:Field) : void => {
const eagle = Eagle.getInstance()

eagle.setSelection(node, Eagle.FileType.Graph)

ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);
ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);

setTimeout(function(){
$('#tableRow_'+field.getId()).addClass('highlighted')
Expand Down
12 changes: 6 additions & 6 deletions src/RightClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ export class RightClick {

$('#customContextMenu').append('<h5 class="rightClickDropdownDividerTitle" tabindex="-1">Graph Options</h5>')
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="Utils.showModelDataModal('Graph Info', eagle.logicalGraph().fileInfo());">Show Graph Info</a>`)
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="ParameterTable.openModal(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);">Graph Attributes Table</a>`)
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal);">Graph Attributes Table</a>`)
$('#customContextMenu').append(`<a class='rightClickPerpetual' onclick="eagle.copyGraphUrl();">Copy Graph URL</a>`)
}else if(passedObjectClass === 'edgeDropCreate'){
if(Setting.findValue(Setting.ALLOW_GRAPH_EDITING)){
Expand Down Expand Up @@ -625,16 +625,16 @@ export class RightClick {

if(Setting.findValue(Setting.ALLOW_PALETTE_EDITING)){
$('#customContextMenu').append(RightClick.getNodeDescriptionDropdown())
$('#customContextMenu').append('<a onclick="ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,false)>Delete</a>')
$('#customContextMenu').append('<a onclick=eagle.addSelectedNodesToPalette("contextMenuRequest")>Add to another palette</a>')
}
}else if(passedObjectClass === 'rightClick_hierarchyNode'){
Eagle.selectedRightClickLocation(Eagle.FileType.Graph)

$('#customContextMenu').append(RightClick.getNodeDescriptionDropdown())
$('#customContextMenu').append('<a onclick="ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openModal(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,false)>Delete</a>')
if(Setting.findValue(Setting.ALLOW_PALETTE_EDITING)){
$('#customContextMenu').append('<a onclick=eagle.addSelectedNodesToPalette("contextMenuRequest")>Add to palette</a>')
Expand All @@ -643,8 +643,8 @@ export class RightClick {

}else if(passedObjectClass === 'rightClick_graphNode'){
$('#customContextMenu').append(RightClick.getNodeDescriptionDropdown())
$('#customContextMenu').append('<a onclick="ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openModal(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.RightClick)">Open Fields Table</a>')
$('#customContextMenu').append('<a onclick="ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.RightClick)">Graph Attributes</a>')
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,false)>Delete</a>')
if (data.isConstruct()){
$('#customContextMenu').append('<a onclick=eagle.deleteSelection(true,false,true)>Delete All</a>')
Expand Down
4 changes: 2 additions & 2 deletions src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2147,13 +2147,13 @@ export class Utils {
this.showNode(eagle, nodeId)
setTimeout(function(){
const node = eagle.selectedNode()
ParameterTable.openModalAndSelectField(node, field)
ParameterTable.openTableAndSelectField(node, field)
},100)
}

static showGraphConfig(eagle: Eagle, graphConfigId: GraphConfig.Id){
// open the graph configs table
GraphConfigurationsTable.openModal();
GraphConfigurationsTable.openTable();

const graphConfig: GraphConfig = eagle.logicalGraph().getGraphConfigById(graphConfigId);

Expand Down
6 changes: 3 additions & 3 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@
<div class="dragHandle" draggable="true" data-bind="event: { dragstart: SideWindow.bottomWindowAdjustStart, dragend: SideWindow.sideWindowAdjustEnd }"></div>
<div class="tabs">
<div class="wrapper">
<button id="bottomTabParamsTableSwitcher" type="button" class="btn btn-secondary btn-sm" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ParameterTable},click: function(){ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<button id="bottomTabParamsTableSwitcher" type="button" class="btn btn-secondary btn-sm" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.ParameterTable},click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<i class="material-icons md-20 clickable">table_chart</i>
</button>
<button id="bottomTabKeyParamsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable}, click: function(){ParameterTable.openModal(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal)}, eagleTooltip: `Display Graph Attributes Configuration ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<button id="bottomTabKeyParamsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigAttributesTable}, click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.GraphConfigAttributesTable, ParameterTable.SelectType.Normal)}, eagleTooltip: `Display Graph Attributes Configuration ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<i class="md-20 icon-key_attribute_table clickable"></i>
</button>
<button id="bottomTabGraphConfigurationsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigsTable}, click: function(){GraphConfigurationsTable.openModal()}, eagleTooltip: `Display all Graph Configurations ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<button id="bottomTabGraphConfigurationsSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphConfigsTable}, click: function(){GraphConfigurationsTable.openTable()}, eagleTooltip: `Display all Graph Configurations ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
<i class="md-20 icon-config_table clickable"></i>
</button>
<button id="bottomTabGraphIssuesSwitcher" class="btn btn-secondary btn-sm" type="button" data-bs-placement="bottom" data-bind="css:{activeTab:Setting.findValue(Setting.BOTTOM_WINDOW_MODE) === Eagle.BottomWindowMode.GraphErrors}, click: function(){Setting.find(Setting.BOTTOM_WINDOW_MODE).setValue(Eagle.BottomWindowMode.GraphErrors)}, eagleTooltip: `Display all Graph Configurations ` + KeyboardShortcut.idToText('open_graph_attributes_configuration_table', true)">
Expand Down
2 changes: 1 addition & 1 deletion templates/inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div class="col-6 col text-right">
<!-- ko if: Eagle.selectedLocation() == Eagle.FileType.Graph || Setting.findValue(Setting.ALLOW_PALETTE_EDITING) -->
<button type="button" id="openNodeParamsTable" class="btn btn-secondary btn-sm" data-bind="click: function(){ParameterTable.openModal(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<button type="button" id="openNodeParamsTable" class="btn btn-secondary btn-sm" data-bind="click: function(){ParameterTable.openTable(Eagle.BottomWindowMode.ParameterTable, ParameterTable.SelectType.Normal);}, clickBubble: false, eagleTooltip: 'Open Node Parameter Table ' + KeyboardShortcut.idToText('open_parameter_table', true)" data-bs-placement="left">
<i class="material-icons md-20 clickable">table_chart</i>
</button>
<!-- /ko -->
Expand Down
Loading

0 comments on commit 209301f

Please sign in to comment.