From 8e83364a32ce5ba611b4c98dcb66cca371bf7690 Mon Sep 17 00:00:00 2001 From: Stephen Montes De Oca Date: Tue, 16 Aug 2022 10:30:22 -0700 Subject: [PATCH 01/15] Fix TFSID 1212136: Updated sample with dialog style --- .../UINamespace-sandboxed/uiNamespace.html | 21 ++++++++++++++++ Samples/UINamespace-sandboxed/uiNamespace.js | 15 ++++++++++- Samples/UINamespace/uiNamespace.html | 25 +++++++++++++++++-- Samples/UINamespace/uiNamespace.js | 15 ++++++++++- 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Samples/UINamespace-sandboxed/uiNamespace.html b/Samples/UINamespace-sandboxed/uiNamespace.html index 37240347..0a9dcc2a 100644 --- a/Samples/UINamespace-sandboxed/uiNamespace.html +++ b/Samples/UINamespace-sandboxed/uiNamespace.html @@ -29,6 +29,27 @@ Configure extension to proceed.

+
+
Dialog Style
+
+ + +
+
+ + +
+
+ + +
+
diff --git a/Samples/UINamespace-sandboxed/uiNamespace.js b/Samples/UINamespace-sandboxed/uiNamespace.js index c35ffe1c..dae4e6bc 100644 --- a/Samples/UINamespace-sandboxed/uiNamespace.js +++ b/Samples/UINamespace-sandboxed/uiNamespace.js @@ -39,6 +39,19 @@ // to be updated if the extension is deployed to a new location. const popupUrl = 'uiNamespaceDialog.html'; + // This checks for the selected dialog style in the radio form. + let dialogStyle; + const dialogStyleOptions = document.getElementsByName('dialogStyleRadio'); + if (dialogStyleOptions[0].checked) { + dialogStyle = tableau.DialogStyle.Modal; + } + else if (dialogStyleOptions[1].checked) { + dialogStyle = tableau.DialogStyle.Modeless; + } + else { + dialogStyle = tableau.DialogStyle.Window; + } + /** * This is the API call that actually displays the popup extension to the user. The * popup is always a modal dialog. The only required parameter is the URL of the popup, @@ -51,7 +64,7 @@ * default interval of refresh. */ tableau.extensions.ui - .displayDialogAsync(popupUrl, defaultIntervalInMin, { height: 500, width: 500 }) + .displayDialogAsync(popupUrl, defaultIntervalInMin, { height: 500, width: 500, dialogStyle }) .then((closePayload) => { // The promise is resolved when the dialog has been expectedly closed, meaning that // the popup extension has called tableau.extensions.ui.closeDialog. diff --git a/Samples/UINamespace/uiNamespace.html b/Samples/UINamespace/uiNamespace.html index 8dddd423..8fa6e943 100644 --- a/Samples/UINamespace/uiNamespace.html +++ b/Samples/UINamespace/uiNamespace.html @@ -10,8 +10,8 @@ - - + + @@ -29,6 +29,27 @@ Configure extension to proceed.

+
+
Dialog Style
+
+ + +
+
+ + +
+
+ + +
+
diff --git a/Samples/UINamespace/uiNamespace.js b/Samples/UINamespace/uiNamespace.js index 52263433..c0f692bc 100644 --- a/Samples/UINamespace/uiNamespace.js +++ b/Samples/UINamespace/uiNamespace.js @@ -40,6 +40,19 @@ // to be updated if the extension is deployed to a new location. const popupUrl = `${window.location.origin}/Samples/UINamespace/uiNamespaceDialog.html`; + // This checks for the selected dialog style in the radio form. + let dialogStyle; + const dialogStyleOptions = document.getElementsByName('dialogStyleRadio'); + if (dialogStyleOptions[0].checked) { + dialogStyle = tableau.DialogStyle.Modal; + } + else if (dialogStyleOptions[1].checked) { + dialogStyle = tableau.DialogStyle.Modeless; + } + else { + dialogStyle = tableau.DialogStyle.Window; + } + /** * This is the API call that actually displays the popup extension to the user. The * popup is always a modal dialog. The only required parameter is the URL of the popup, @@ -52,7 +65,7 @@ * default interval of refresh. */ tableau.extensions.ui - .displayDialogAsync(popupUrl, defaultIntervalInMin, { height: 500, width: 500 }) + .displayDialogAsync(popupUrl, defaultIntervalInMin, { height: 500, width: 500, dialogStyle }) .then((closePayload) => { // The promise is resolved when the dialog has been expectedly closed, meaning that // the popup extension has called tableau.extensions.ui.closeDialog. From 6441f7675d405787ba1786c038b65ea1f0dd7004 Mon Sep 17 00:00:00 2001 From: Stephen Montes De Oca Date: Wed, 21 Sep 2022 16:51:52 -0700 Subject: [PATCH 02/15] annotation sample v1 --- Samples/Annotation/Annotation.trex | 19 ++++++++ Samples/Annotation/annotation.html | 29 +++++++++++ Samples/Annotation/annotation.js | 78 ++++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 Samples/Annotation/Annotation.trex create mode 100644 Samples/Annotation/annotation.html create mode 100644 Samples/Annotation/annotation.js diff --git a/Samples/Annotation/Annotation.trex b/Samples/Annotation/Annotation.trex new file mode 100644 index 00000000..9b864779 --- /dev/null +++ b/Samples/Annotation/Annotation.trex @@ -0,0 +1,19 @@ + + + + en_US + + Annotation Sample + + 1.10 + + http://localhost:8765/Samples/Annotation/annotation.html + + iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH4QgLDTYEcBRoeAAABp9JREFUeNrlm01sHEUWx//vVbs79gThjAd2iflIAkEcEARfEciBSYLEbbV8SJaDEpIAMQgkViuirA8IskKcdiEJX3G0C5dNpAVxQLIyiYw4YYIQBw4RBoMgBBIbCRtnOsx0vbcHd9sTZ3r8ge2p2bQ0B/+7unp+1dX/eX71ivL5TgAwAAQAxR/rsiYidvv2btq6ddcqVRwE8JCqgoigqgAAIvpKVbf29v51cHDwUxWRav2pWbdujcH04cUnPFc1EZGOjtv5hRdebv3tt9I+IupWVSaiGBxgJqhqlpnPj42NnchmsxpFUbX+mJORiE9E8eigorEzmohEHR23U1/fO63j47/+nYh2qqpJ4CcHgKEKMPOxIPBfef75PeUwDNPuoclozGxgXdMq4X/5ZWwfEe1Q1crZO/UKENGxIPCfKBbD4U2bNvo17qEeAHYJNA3+jjtuW2x4TgbAAmhyATRNy+XauK/vndaxsfEXFwk+0SIv/kNR/d2rOzwAc+TIu5ExnCeiR2vA9weB3zNXeM/zImutSUzQWfgYUpnNlapa6eCVP3slIjoShheGN2++Z1b4q6/+Q3T69Jng7Nlz0hAmODFxhq+4ol1S4AHAF5Fe3286u2PH1v5Dh9724nOX9Hf8+IfllpaWm8Mw3E2Eo4wGM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sPhzZvv8ffs+Uu/MaYHwDdzhIeIYGLijFOFFymaXlQ9NbPeXkSijz/+xPT07DxGRI8T0bdzeRWMMbxy5WpxCDTdBIloSCR9s4G1loaGvsZzzz1zAsBjyUyoNRustXZGdUa9QWua4CPM/Krvp282KJVK3ueff6GHDx84bozZDWB4FhN0CbR2JLhly708PPytd+21qyNjTM2LiAiFwkDZ87xt1trXAATVZgMz77LWvpXPd85l20pdI0G21uratTfMCg8AhcJAOZNpucla+0AaPIBIRCYGB080hAl6ACAis15UreS8CrwFcLitLXu8UPgw2YvoAmjNSHDWJzUP+L5crm3vyMjoyMDAR67DT5ogZskJzhe+SilavUFrR4KYzglectGzzz4ZZTKZm4vF8NX/M/hEq7owwgCQybREvb37gmKxuBvAfcD0NpNKwwNwKJfLTpWfVoHnKl/CFU05fvoUN9D4ExWLIZ88+dkFIjoK4KsEXkSmBkBV/xsEwd6RkZ9H8/lOJiKN+7mkP1e1/wFtM6PWK/V/BwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wOC0xMVQxMzo1NDowNC0wNDowMMrC9wEAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDgtMTFUMTM6NTQ6MDQtMDQ6MDC7n0+9AAAAAElFTkSuQmCC + + + + Annotation Sample + + + diff --git a/Samples/Annotation/annotation.html b/Samples/Annotation/annotation.html new file mode 100644 index 00000000..e311563e --- /dev/null +++ b/Samples/Annotation/annotation.html @@ -0,0 +1,29 @@ + + + + Annotation Sample + + + + + + + + + + + + + + +
+

Annotation Sample

+

Select marks to generate annotations.

+
+

Worksheet To Annotate:

+ + +
+
+ + diff --git a/Samples/Annotation/annotation.js b/Samples/Annotation/annotation.js new file mode 100644 index 00000000..66c89b4e --- /dev/null +++ b/Samples/Annotation/annotation.js @@ -0,0 +1,78 @@ +'use strict'; + +// Wrap everything in an anonymous function to avoid polluting the global namespace +(function () { + let worksheets = []; + let currentWorksheet = undefined; + + $(document).ready(function () { + tableau.extensions.initializeAsync().then(function () { + worksheets = tableau.extensions.dashboardContent.dashboard.worksheets; + if (worksheets.length === 0) { + return; + } + // populating selection menu with worksheets and selecting first worksheet + for (let i = 0; i < worksheets.length; i++) { + const worksheet = worksheets[i]; + $('#worksheet-selection').append($('