Skip to content

Commit

Permalink
Dyn 5106 webview2 documentation browser (#13212)
Browse files Browse the repository at this point in the history
* DYN-5106-WebView2-DocumentationBrowser

I replaced the WebBrowser component by WebView2 in the file DocumentationBrowserView.xaml, also I added some functions for initializing WebView2,
The method ShouldAllowNavigation was modified due that WebView2 doesn't have the Navigating event and also the event handler receive different parameters then modified the function to implement the same behavior than the previous one.
Also I noticed that WebView2 CORS was blocking to load the jpg images that are shown for several nodes, then I had to create a mapped virtual directory in this way the html will be able to load the images and show them in the web page.
Finally I removed a tag in all the html that was making the web page compatible for IE based browsers (due that now we are using WebView2 a Chromium based browser).

* DYN-5106-WebView2-DocumentationBrowser Code Review

Due that the fallback_doc directory path can change depending if Dynamo is executed as Sandbox or if is over Revit then the path can be different so I added a code that will create the virtual directory depending of the correct fallback_doc directory path.
Also I modified the Md2Html class so now it will be inserting in the image source (<img src) the prefix "http://appassets" so it can be loaded from a virtual directory created by the DocumentationBrowser.

* DYN-5106-WebView2-DocumentationBrowser Code Review

- changing the visibility for the property FallbackDirectoryName
- renaming coreDir by docsDir

* DYN-5106-WebView2-DocumentationBrowser Code Review

Fixing CanCreateNodeDocumenationHtmlFromNodeAnnotationEventArgsWithPackageNodeWithAddtionalDocumentation test due that it was using and old format of the html <img> tab, then I updated the image to use the virtual folder and http.

Co-authored-by: Aaron (Qilong) <[email protected]>
  • Loading branch information
RobertGlobant20 and QilongTang authored Aug 16, 2022
1 parent 85a4339 commit 2686b5d
Show file tree
Hide file tree
Showing 41 changed files with 143 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
4 changes: 2 additions & 2 deletions src/DocumentationBrowserViewExtension/Docs/Deprecated.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
4 changes: 2 additions & 2 deletions src/DocumentationBrowserViewExtension/Docs/FileNotFound.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
4 changes: 2 additions & 2 deletions src/DocumentationBrowserViewExtension/Docs/InternalError.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
4 changes: 2 additions & 2 deletions src/DocumentationBrowserViewExtension/Docs/NoContent.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
Dynamo Dictionary: https://github.com/DynamoDS/DynamoDictionary_React
-->

<!-- These headers are required to force the browser embedded in the DocumentationBrowser extension to render in modern IE11 mode. -->

<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<meta charset="UTF-8" />
</head>

Expand Down
Loading

0 comments on commit 2686b5d

Please sign in to comment.