Why OAuthServer/wwwroot/js/app.js for styling?

Seems silly to me to use a JS file, a file named "app.js" at that, for styling a page. Also, it steps on any custom styling as it renders outcome AFTER CSS has been loaded.

This file does two things, only:

Set background image from what looks like an attempt to use image tags to preload resources, to the "backgroundImage" property of:

1) body

2) #logo's parent element.

// And, that's silly. And, it steps on CSS, which should be controlling the view. Meh.

  • Hi Neil,

    app.js doesn´t seem silly to me. It´s quite standard to load initial page data this way.

    App.js is actually your best friend when you ever felt the strong need to customize the login page and I assume this what you currently try to achieve. Just add your own code before the Aras code and this way you can overwrite the default elements.

    Angela

  • 0 オフライン in reply to AngelaIp

    Hi, Angela,

    I would say, yes, to "...standard to load initial page data this way." But, NO, to CSS. This is styling the page. I agree it is a great spot to modify some login page code to your own purpose.

    But, to say it is standard to load initial page ->data<- is true, with maybe an XHR get to populate some menus or something, but it absolutely is not standard to style your page at this juncture. CSS is used for that, and since DojoJS is being used throughout the project, that also has CSS control over its themes. But, it doesn't start ripping src tags from image nodes and assigning them to CSS style properties.

    I'd say this was decidedly non-standard. Like the favicon.ico being in two places for the same app. I mean, the "Ask" (help pages) favicon could vary from the main app, but the login and main should be the same...

    App:

    ./OAuthServer/wwwroot/images/favicon.ico

    Login:

    ./Innovator/Client/images/favicon.ico

    Ask:

    ./Innovator/Client/WebHelp/APIReferenceDotNet/Html/icons/favicon.ico
    ./Innovator/Client/WebHelp/APIReferenceJavaScript/Html/icons/favicon.ico

    Anyway, I digress.

    I'm just saying from a development aspect in customization of the "look" I'd expect the developer to be able to put styles in one CSS file and not worry about it... Never need to go, "Why does this thing keep writing over my style?"

    Also, using LESS or SASS would be rad so you could just plug in some colors in one spot and have it trickle down.

    That's my opinion.

    Neil