From 3ced607a6400b19bee5b254a0972daa7a290e91d Mon Sep 17 00:00:00 2001
From: Adam Najmanowicz
Date: Fri, 3 May 2024 18:16:36 +0200
Subject: [PATCH] #1329 : Script execution results should be less in-the-way
---
.../PowerShell/Scripts/ise.js | 25 +++++++++++++------
.../PowerShell/Styles/ise.css | 16 +++++-------
.../Shell/PowerShell/PowerShellIse.xml | 5 +++-
3 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/src/Spe/sitecore modules/PowerShell/Scripts/ise.js b/src/Spe/sitecore modules/PowerShell/Scripts/ise.js
index 98e22b72..e029293c 100644
--- a/src/Spe/sitecore modules/PowerShell/Scripts/ise.js
+++ b/src/Spe/sitecore modules/PowerShell/Scripts/ise.js
@@ -29,6 +29,7 @@
var debugMarkers = [];
var resultsBottomOffset = 10;
var typingTimer;
+ var resultsVisibilityIntent = true;
var editor = $($("#Editor")[0]);
editor.hide();
@@ -465,6 +466,9 @@
spe.preventCloseWhenRunning(false);
}
clearVariablesCache();
+ if(!resultsVisibilityIntent){
+ setTimeout(spe.closeResults, 2000);
+ }
};
spe.clearBreakpoints = function() {
@@ -510,7 +514,6 @@
$("#Result").height(resultsHeight);
$("#Result").width($(window).width() - $("#Result").offset().left * 2);
$("#ProgressOverlay").css("top",($("#Result").offset().top+4)+"px");
- $("#ResultsClose").css("top", ($("#Result").offset().top + 4) + "px");
};
function isEmpty(val) {
@@ -536,7 +539,8 @@
spe.restoreResults = function() {
$("#ResultsSplitter").show();
$("#ResultsRow").show();
- codeeditor.resize();
+ spe.resizeEditor();
+ $("#ResultsStatusBarAction").removeClass("status-bar-results-hidden")
};
spe.closeResults = function() {
@@ -544,6 +548,7 @@
$("#ResultsRow").hide("slow", function() {
codeeditor.resize();
});
+ $("#ResultsStatusBarAction").addClass("status-bar-results-hidden")
};
function getCachedVariableValue(storageKey, variableName) {
@@ -677,13 +682,17 @@
});
- $("#ResultsClose").click(function() {
- $("#ResultsSplitter").hide();
- $("#ResultsRow").hide("slow", function() {
- codeeditor.resize(); /* do something cool here? */
- });
+
+ $("#ShowHideResults").click(function() {
+ if ($("#ResultsRow").is(":visible")) {
+ resultsVisibilityIntent = false;
+ spe.closeResults();
+ } else {
+ resultsVisibilityIntent = true;
+ spe.restoreResults();
+ }
});
-
+
function _getCommandHelp(str) {
getPowerShellResponse({ "guid": guid, "command": str }, "GetHelpForCommand",
function(json) {
diff --git a/src/Spe/sitecore modules/PowerShell/Styles/ise.css b/src/Spe/sitecore modules/PowerShell/Styles/ise.css
index 04e87d70..0d092dc5 100644
--- a/src/Spe/sitecore modules/PowerShell/Styles/ise.css
+++ b/src/Spe/sitecore modules/PowerShell/Styles/ise.css
@@ -146,7 +146,7 @@ a.ps-link {
text-transform: uppercase;
}
-#HelpClose, #ResultsClose {
+#HelpClose {
-moz-border-radius-bottomleft: 9px;
-moz-border-radius-bottomright: 9px;
-moz-border-radius-topleft: 9px;
@@ -183,25 +183,17 @@ a.ps-link {
top: 0;
}
-#HelpClose:hover, #ResultsClose:hover {
+#HelpClose:hover {
background: -moz-linear-gradient(center top, #dfdfdf 5%, #ededed 100%);
background-color: #e3e3e3;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
}
-#ResultsClose:active {
- top: 1px;
-}
-
#ResultsSplitter {
background: url(/sitecore%20modules/PowerShell/Assets/Splitter.png) no-repeat center;
padding: 0 4px 0 4px;
}
-#ResultsClose {
- position: fixed;
-}
-
#Result {
position: fixed;
bottom: 27px;
@@ -421,4 +413,8 @@ a.ps-link {
#CodeEditor * {
font-family: inherit !important;
+}
+
+#ResultsStatusBarAction.status-bar-results-hidden {
+ background-color: rgb(1, 36, 86);
}
\ No newline at end of file
diff --git a/src/Spe/sitecore modules/Shell/PowerShell/PowerShellIse.xml b/src/Spe/sitecore modules/Shell/PowerShell/PowerShellIse.xml
index 6c6b64a1..6ea8206c 100644
--- a/src/Spe/sitecore modules/Shell/PowerShell/PowerShellIse.xml
+++ b/src/Spe/sitecore modules/Shell/PowerShell/PowerShellIse.xml
@@ -104,7 +104,6 @@
- x
@@ -123,6 +122,10 @@
+
+
+