From 26cee052a5b20d7a5bdb597776c55dcd3da2da62 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 23 May 2019 16:44:30 +0300 Subject: Implemented new Twine color catalog ! --- .../Tango.PPC.Jobs/Views/TwineCatalogView.xaml | 2 +- .../Controls/DispenserController.xaml | 19 +- .../Controls/DispenserController.xaml.cs | 125 +++++--- .../Controls/TwineCatalogControl.xaml | 39 ++- .../Controls/TwineCatalogControl.xaml.cs | 97 +++--- .../Controls/TwineCatalogRenderer.cs | 342 +++++++++++++++++++++ .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 3 +- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- .../EventArguments/MouseOrTouchEventArgs.cs | 1 + .../ExtensionMethods/FrameworkElementExtensions.cs | 64 ++++ .../Tango.Touch/Controls/LightTouchDataGrid.xaml | 3 + .../Tango.Touch/Controls/LightTouchScrollViewer.cs | 14 +- .../Controls/LightTouchScrollViewer.xaml | 3 + 13 files changed, 583 insertions(+), 131 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml index a5ce50ad2..284666733 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/TwineCatalogView.xaml @@ -25,7 +25,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Controls/DispenserController.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Controls/DispenserController.xaml index 18636704a..270b88eed 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Controls/DispenserController.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Technician/Controls/DispenserController.xaml @@ -20,17 +20,18 @@ - + - + @@ -57,8 +58,8 @@ - - + + @@ -72,7 +73,7 @@ - + '; - if (this.inertBodyElement.querySelector && this.inertBodyElement.querySelector('svg img')) { - // We just hit the Firefox bug - which prevents the inner img JS from being sanitized - // so use the DOMParser strategy, if it is available. - // If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we - // fall through to the default strategy below. - if (isDOMParserAvailable()) { - this.getInertBodyElement = this.getInertBodyElement_DOMParser; - return; - } - } - // None of the bugs were hit so it is safe for us to use the default InertDocument strategy - this.getInertBodyElement = this.getInertBodyElement_InertDocument; - } - /** - * Use XHR to create and fill an inert body element (on Safari 10.1) - * See - * https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449 - */ - InertBodyHelper.prototype.getInertBodyElement_XHR = function (html) { - // We add these extra elements to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `` do not get hoisted to the - // `` tag. - html = '' + html + ''; - try { - html = encodeURI(html); - } - catch (_a) { - return null; - } - var xhr = new XMLHttpRequest(); - xhr.responseType = 'document'; - xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false); - xhr.send(undefined); - var body = xhr.response.body; - body.removeChild(body.firstChild); - return body; - }; - /** - * Use DOMParser to create and fill an inert body element (on Firefox) - * See https://github.com/cure53/DOMPurify/releases/tag/0.6.7 - * - */ - InertBodyHelper.prototype.getInertBodyElement_DOMParser = function (html) { - // We add these extra elements to ensure that the rest of the content is parsed as expected - // e.g. leading whitespace is maintained and tags like `` do not get hoisted to the - // `` tag. - html = '' + html + ''; - try { - var body = new window - .DOMParser() - .parseFromString(html, 'text/html') - .body; - body.removeChild(body.firstChild); - return body; - } - catch (_a) { - return null; - } - }; - /** - * Use an HTML5 `template` element, if supported, or an inert body element created via - * `createHtmlDocument` to create and fill an inert DOM element. - * This is the default sane strategy to use if the browser does not require one of the specialised - * strategies above. - */ - InertBodyHelper.prototype.getInertBodyElement_InertDocument = function (html) { - // Prefer using