New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Directory Middleware Improvements: #968
Conversation
- details and mobile views - include icon images only once from css
@@ -109,7 +110,7 @@ exports = module.exports = function directory(root, options){ | |||
|
|||
// not acceptable | |||
if (!type) return next(utils.error(406)); | |||
exports[mediaType[type]](req, res, files, next, originalDir, showUp, icons, path); | |||
exports[mediaType[type]](req, res, files, next, originalDir, showUp, icons, path, view); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow. lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from being a function with 9 parameters, what's wrong with this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol that's it. we need to refactor that eventually
@@ -1,5 +1,10 @@ | |||
body { | |||
* { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way you can make this something other than a star selector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a quick way to nullify all browser specific styles. I used this in a lot of sites so far and I didn't saw any problems with it. I don't know how it benchmarks but it's definitely not something that you will notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i don't have a problem with this either since it really does apply to all elements. i do this as well because figuring out the browser's default margins and paddings and fixing them is a pain in the ass. if he was doing something like .parent > *
then that would be a different issue.
@simov is this a newer, better version of the previous PR? if so, can you close the other one? |
I think so, directory first and sorting was added by @dougwilson and the rest is here. What's missing is a bunch of icons and more importantly their 32x32px versions, so the code responsible for embedding different icon sizes into the document was removed too. I'm closing the other one, there is a link to it at the top of this page. |
i don't have any more comments, so it's up to you @dougwilson now. |
Right. It seems good. I'm going to pull it to double-check it later today and then should be good to merge. |
@dougwilson i guess someone forgot :( |
@jonathanong thanks for the reminder :) I already looked at it, so going to marge it now into master since it is backwards-compatible. |
More information about this pull request: #734
Features
Details
view
and defaults totiles
iconStyle
function meanscss styles for the icons
and is responsible for embedding the icons inside the document only once. Right now each image is pushed 3 times for each view respectively because the initial idea was to have dynamic view change and icon size.html
function is responsible only for generating the html, the images are added insideiconStyle
. The changes are just a bunch of html tags + classes for styling.