ADFS Sign-in page won't load custom font - customization

I am customizing my ADFS 3.0 sign-in page and I have created a custom theme and modified the stylesheet to add a new font family (FontAwesome). Here is the font definition in the stylesheet.
#font-face {
font-family: 'FontAwesome';
src: url('./fontawesome-webfont.eot?v=4.6.3');
src: url('./fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('./fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('./fontawesome-webfont.woff?v=4.6.3') format('woff'), url('./fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('./fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
I executed the following Powershell commands to add the additional resource files to ADFS (I even tried to add the ?v=4.6.3 to the Uri but still got the same errors ):
Set-AdfsWebTheme -TargetName CustomerPortal -AdditionalFileResource #{Uri="/adfs/portal/css/fontawesome-webfont.woff";path="C:\ADFS_CustomerPortal_Theme\css\fontawesome-webfont.woff"}
Set-AdfsWebTheme -TargetName CustomerPortal -AdditionalFileResource #{Uri="/adfs/portal/css/fontawesome-webfont.woff2";path="C:\ADFS_CustomerPortal_Theme\css\fontawesome-webfont.woff2"}
Set-AdfsWebTheme -TargetName CustomerPortal -AdditionalFileResource #{Uri="/adfs/portal/css/fontawesome-webfont.ttf";path="C:\ADFS_CustomerPortal_Theme\css\fontawesome-webfont.ttf"}
Set-AdfsWebTheme -TargetName CustomerPortal -AdditionalFileResource #{Uri="/adfs/portal/css/fontawesome-webfont.eot";path="C:\ADFS_CustomerPortal_Theme\css\fontawesome-webfont.eot"}
Set-AdfsWebTheme -TargetName CustomerPortal -AdditionalFileResource #{Uri="/adfs/portal/css/fontawesome-webfont.svg";path="C:\ADFS_CustomerPortal_Theme\css\fontawesome-webfont.svg"}
Set-AdfsWebTheme -TargetName CustomerPortal -AdditionalFileResource #{Uri="/adfs/portal/css/fontawesome.otf";path="C:\ADFS_CustomerPortal_Theme\css\fontawesome.otf"}
When I refresh my sign-in page I get the following errors in the console.

I was having the same issue and found that ADFS's custom themes cannot actually serve font files: there's nothing in the documentation on this, but Microsoft confirmed that in the answer to this question.
They do suggest a workaround, where you use a .css extension for the URI but actually use your font file as the path:
Set-AdfsWebTheme -TargetName Custom -AdditionalFileResource #{Uri="/adfs/portal/vegan.css";Path="C:\webtheme\css\Vegan.ttf"}

Related

Using SVG Filter Gaussian blur with single page app (Ember)

I'm trying to use d3 to apply a Gaussian blur to an svg circle while on a non-home page of my SPA with Ember.
First I tried using the d3 code
didInsertElement: function() {
var svg = d3.select('#svg');
var filter = svg
.append("filter")
.attr("id", "blur")
.append("feGaussianBlur")
.attr('in', 'SourceAlpha')
.attr("stdDeviation", 3)
.attr('result', 'blur');
svg.append('circle')
.attr('cx', 50)
.attr('cy', 50)
.attr('r', 20)
.style({'fill': 'blue'})
.attr('class', 'cursor')
.attr('filter', 'url(#blur)');
}
but that didn't work. I then tried the example from the mozilla docs,
<svg width="230" height="120"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<filter id="blurMe">
<feGaussianBlur in="SourceGraphic" stdDeviation="5" />
</filter>
<circle cx="60" cy="60" r="50" fill="green" />
<circle cx="170" cy="60" r="50" fill="green"
filter="url(#blurMe)" />
</svg>
Inserted directly into the handlebars template. That didn't work either. Note this has all been on the BridgeBuilderView page.
Then I redid all of that on the index.hbs page that is loaded first when the application starts. When I do that the gaussian blurs work in both cases. I was wondering if anyone has some insight into why this is the case, and how I can get it to work on my non-root page.
Thanks

Broken SVG Filter id link when using History API with Ember CLI

I'm generating SVG visualizations with D3.js in an Ember-cli Application.
The SVGs utilize filters and markers that are accessed through the id attribute:
<svg>
<defs>
<filter id="filterId">
...
</filter>
</defs>
<g>
<g class="nodes">
<circle filter="url(#filterId)" ...></circle>
</g>
</g>
</svg>
This works fine on the index page (url: ), but is broken when traversing to other routes (ex: \otherRoute). It will work on the other route if I change circle to
<circle filter="url(./otherRoute#filterId)" ...></circle>
But it then breaks on the index and all other pages.
I can fix it by manually prepending the url to #filterId when building the svg elements on each route or by using the hash locationType in ember-cli (which uses /#routeUrl instead of /routeUrl), but was wondering if there was a generic way to automatically link to the current url so I can still use the history API?
Ran into the same issue with a clip-path attribute after moving from hash URLs to the history API. The original implementation was an SVG element like:
<svg>
<clipPath id="clip-path-ember1919">
<path d="..."></path>
</clipPath>
<g clip-path="url(#clip-path-ember1919)">
<rect ...></rect>
</g>
</svg>
This had been achieved with a simple D3 append:
var emberId = this.$().attr('id');
svg.append('g')
.attr('clip-path', "url(#clip-path-#{emberId})");
To solve the issues raised by the history API, I used the same solution you described (prepending the URL), but by using window.location.pathname:
var emberId = this.$().attr('id');
var relPath =
svg.append('g')
.attr('clip-path', "url(." + window.location.pathname + "#clip-path-" + emberId + ")");
This creates an SVG element much like the circle element referenced in the question.
<svg>
<clipPath id="clip-path-ember1919">
<path d="..."></path>
</clipPath>
<g clip-path="url(./path/to/page#clip-path-ember1919)">
<rect ...></rect>
</g>
</svg>
Long way of saying: similar solution to the original poster, just using window.location.pathname to generate the prepended URL.

Why doesn't my clip-path work?

In my ember app, I have a dynamic route such as
router.js
this.resource('reports', function() {
this.resource('type', { path: '/type/:type_id' });
});
This would give me a complex url such as:
localhost:8080/reports/type/1234
In my template I have this code defining my clipPath
<svg class="svg-container">
<defs>
<clipPath id="bound" >
<rect width="20" height="30" x="300" y="300" > </rect>
</clipPath>
</defs>
<path d="M32.00000000108507,....(truncated for readability)"
stroke-width="2px"
clip-path="url(reports#type#54235231673b1b7759694bb2#bound)"
class="line greenline" style="stroke: rgb(192, 57, 43);">
</path>
</svg>
And the clipping path doesn't work. I suspect it is related to an ember routing issue as simply making the URL "url(#bound)" doesn't work either. Any thoughts?
Figured out the problem! I was generating my url() attribute incorrectly. The correct url for the clipPath given my route is
clip=path="url(reports/type/1232#bound)"
Note using the actual URL as the resource

Non-Authenticated FreeMarker page in alfresco share

i have create a new page in alfresco share but the page cannot be displayed without login! how can i make this page enabled without login.
my file in "/alfresco/templates/blog/demo/custom-viewer.ftl".
and this file contains "custom-viewer.ftl":
<#include "include/alfresco-template.ftl" />
<#templateHeader>
<#script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>
<#link rel="stylesheet" type="text/css" href="${url.context}/res/components/document- details/document-details-panel.css" group="document-details"/>
<#templateHtmlEditorAssets />
</#>
<#templateBody>
<#region id="web-preview" scope="template"/>
</#>
<#templateFooter>
</#>
and the file in "/alfresco/site-data/pages/custom-viewer.xml".
and this file contains "custom-viewer.xml":
<?xml version='1.0' encoding='UTF-8'?>
<page>
<title>Custom Viewer</title>
<template-instance>custom-viewer</template-instance>
<authentication>none</authentication>
</page>
the page is work correctly but i need it to work without login? any help please?!!
The thing is probably not your page which needs login but the components it's including.
I'm seeing component regioun web-preview, if this defaults to the default web-preview: site-webscripts\org\alfresco\components\preview\web-preview.get.desc.xml
Then this components needs authentication, there is no <authentication> tag, so it defaults to user.
If you delete that <#region....> tag, you'll see the page.

Qt stylesheets: QHeaderView draws header text in bold when view data is selected

I'm trying to style a QTableView with Qt Stylesheets. Everything works OK, except that all the table header texts (column headers) are drawn as bold text whenever data in the table view is selected.
I've tried things like this:
QTableView::section {
font-weight: 400;
}
QTableView::section:selected {
font-weight: 400;
}
QHeaderView {
font-weight: 400;
}
QHeaderView::section {
font-weight: 400;
}
to no avail.
Can anyone point me in the right direction, ideally using stylesheets?
I haven't tested it, but setting the QHeaderView::highlightSections property to false should do the trick.
You can get a pointer to a QHeaderView object using QTableView's verticalHeader() and horizontalHeader() methods.
In Qt Designer UI format you can use the attribute horizontalHeaderHighlightSections:
<widget class="QTableView" name="m_studyList">
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
But it also completely disables css for selected columns.