diff --git a/lib/phast/client/scripts/System.js b/lib/phast/client/scripts/System.js
index 597d95e..de33dbb 100644
--- a/lib/phast/client/scripts/System.js
+++ b/lib/phast/client/scripts/System.js
@@ -174,6 +174,10 @@ MouseEventArgs.FromNativeEventArgs = function(e)
function KeyboardKeys()
{
};
+/**
+ * The TAB key.
+ */
+KeyboardKeys.Tab = 9;
/**
* The ENTER key.
*/
@@ -446,6 +450,19 @@ System.TerminateIfSenderIs = function(sender, compareTo)
}
return false;
};
+System.CheckIfSenderIsInside = function(sender, compareTo)
+{
+ while (sender != null)
+ {
+ if (sender === compareTo)
+ {
+ return true;
+ }
+ sender = sender.parentNode;
+ if (sender == null) break;
+ }
+ return false;
+};
/**
* Enters full screen mode on the specified element. If no element is specified, the entire page becomes full screen.
* @param element DOMElement The element with which to fill the screen. If not specified, document.body will be used.
@@ -809,4 +826,9 @@ if (!String.format)
;
});
};
-}
\ No newline at end of file
+}
+
+System.AddEventListener(window, "load", function()
+{
+ System.ClassList.Remove(document.body, "uwt-javascript-disabled");
+});
\ No newline at end of file
diff --git a/lib/phast/client/scripts/controls/AdditionalDetailWidget.js b/lib/phast/client/scripts/controls/AdditionalDetailWidget.js
index 1a0cd8f..84d93b8 100644
--- a/lib/phast/client/scripts/controls/AdditionalDetailWidget.js
+++ b/lib/phast/client/scripts/controls/AdditionalDetailWidget.js
@@ -24,14 +24,23 @@ function AdditionalDetailWidget(parent)
};
- this.TextLink = parent.childNodes[0];
- this.ButtonLink = parent.childNodes[1];
+ if (parent.children[0].tagName === "IMG")
+ {
+ this.IconElement = parent.children[0];
+ this.TextLink = parent.children[1];
+ this.ButtonLink = parent.children[2];
+ }
+ else
+ {
+ this.IconElement = null;
+ this.TextLink = parent.children[0];
+ this.ButtonLink = parent.children[1];
+ }
// aria
this.TextLink.NativeObject = this;
this.TextLink.addEventListener("keydown", function(e)
{
- console.log(e);
if (e.keyCode == 9)
{
if (!e.shiftKey)
diff --git a/lib/phast/client/scripts/controls/Alert.js b/lib/phast/client/scripts/controls/Alert.js
index bae71b7..4ce356f 100644
--- a/lib/phast/client/scripts/controls/Alert.js
+++ b/lib/phast/client/scripts/controls/Alert.js
@@ -1,16 +1,18 @@
function Alert(parentElement)
{
- this.ParentElement = parentElement;
- this.IconElement = this.ParentElement.children[0];
- this.IconElement.NativeObject = this;
- this.IconElement.addEventListener("click", function()
+ if (parentElement)
{
- if (System.ClassList.Contains(this.NativeObject.ParentElement, "uwt-collapsible"))
+ this.ParentElement = parentElement;
+ this.IconElement = this.ParentElement.children[0];
+ this.IconElement.NativeObject = this;
+ this.IconElement.addEventListener("click", function()
{
- System.ClassList.Toggle(this.NativeObject.ParentElement, "uwt-collapsed");
- }
- });
-
+ if (System.ClassList.Contains(this.NativeObject.ParentElement, "uwt-collapsible"))
+ {
+ System.ClassList.Toggle(this.NativeObject.ParentElement, "uwt-collapsed");
+ }
+ });
+ }
this.mvarTitle = "";
this.setTitle = function(value)
diff --git a/lib/phast/server/System.inc.php b/lib/phast/server/System.inc.php
index dfa79e1..620d1c5 100644
--- a/lib/phast/server/System.inc.php
+++ b/lib/phast/server/System.inc.php
@@ -119,6 +119,12 @@
}
System::$SystemPath = $value;
}
+
+ public static function ExpandPhysicalPath($path)
+ {
+ //! FIXME: THIS DOES NOT SUPPORT APPLICATION IN SUBDIRECTORY YET
+ return "https://" . $_SERVER["SERVER_NAME"] . $path;
+ }
/**
* Array of global application configuration name/value pairs.
@@ -535,6 +541,12 @@
}
return $ret;
}
+
+ public static function GetLoginPageUrl()
+ {
+ return System::ReplaceVariables(System::GetConfigurationValue("LoginPageRedirectURL", "~/account/login"));
+ }
+
public static function RedirectToLoginPage($forceNonTenanted = false)
{
if (System::$EnableTenantedHosting)
@@ -545,7 +557,7 @@
{
$_SESSION["System.LastRedirectURL"] = $_SERVER["REQUEST_URI"];
}
- System::Redirect(System::ReplaceVariables(System::GetConfigurationValue("LoginPageRedirectURL", "~/account/login")), $forceNonTenanted);
+ System::Redirect(System::GetLoginPageUrl(), $forceNonTenanted);
return;
}
public static function RedirectFromLoginPage()
diff --git a/lib/phast/server/WebControls/AdditionalDetailWidget.inc.php b/lib/phast/server/WebControls/AdditionalDetailWidget.inc.php
index ddce226..bc74c09 100644
--- a/lib/phast/server/WebControls/AdditionalDetailWidget.inc.php
+++ b/lib/phast/server/WebControls/AdditionalDetailWidget.inc.php
@@ -18,11 +18,15 @@
class AdditionalDetailWidget extends WebControl
{
+ public string $RelatedActionButtonUrl;
+
public $DisplayStyle; /* AdditionalDetailWidgetDisplayStyle */
public $Text;
public $ShowText; /* bool */
public $ShowURL; /* bool */
+
+ public $ImageUrl;
public $TargetFrame;
public $TargetURL;
@@ -37,12 +41,15 @@
public function __construct($id)
{
- parent::__construct($id);
+ parent::__construct();
+
+ $this->RelatedActionButtonUrl = "";
$this->ClassTitle = "";
$this->DisplayStyle = AdditionalDetailWidgetDisplayStyle::Ellipsis;
$this->MenuItemHeaderText = "Available Actions";
$this->MenuItems = array();
$this->ShowText = true;
+ $this->ImageUrl = null;
$this->ShowURL = true;
}
@@ -104,6 +111,10 @@
private function renderMainLink()
{
+ if ($this->ImageUrl !== null)
+ {
+ echo("ImageUrl) . "\" />");
+ }
if ($this->ShowURL)
{
echo("renderMainLink();
-
- echo(" ");
+
+ $apbButtonUrl = "#";
+ if ($this->RelatedActionButtonUrl !== "")
+ {
+ $apbButtonUrl = System::ExpandRelativePath($this->RelatedActionButtonUrl);
+ }
+ echo(" ");
echo("