Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
kedo
Nov 27, 2007

Hmm, maybe I'm not understanding your situation correctly... do you have multiple servers involved, or are you just changing domain names or what?

Adbot
ADBOT LOVES YOU

Flaggy
Jul 6, 2007

Grandpa Cthulu needs his napping chair



Grimey Drawer
Yeah I am probably not being clear (sorry) we had a blog here info.example.com (plus all the / we did, each blog got a page) I want to forward them all to example.com, if your example is right that would be awesome haha, seems like alot less work. That way if someone should come across an old link in google like info.example.com/blog title here it would just redirect to the new website.

kedo
Nov 27, 2007

Flaggy posted:

Yeah I am probably not being clear (sorry) we had a blog here info.example.com (plus all the / we did, each blog got a page) I want to forward them all to example.com, if your example is right that would be awesome haha, seems like alot less work. That way if someone should come across an old link in google like info.example.com/blog title here it would just redirect to the new website.

Ah, gotcha... yeah that's a little out of my redirect-knowledge league. :P But Google turned up this, which seems like it might work to me:

pre:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
That'll reroute anything that's after http:// but before example.com (even www.) to example.com.

e: I want to murder whoever thought automatically wrapping [url]http://[/url] in BBcode url tags was a good idea.

kedo fucked around with this message at 17:28 on Jul 30, 2013

Flaggy
Jul 6, 2007

Grandpa Cthulu needs his napping chair



Grimey Drawer

kedo posted:


pre:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^info.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

Is what mine should look like Im guessing?

kedo
Nov 27, 2007

Flaggy posted:

Is what mine should look like Im guessing?

Nope, you should be able to use just what I posted. The !^ on the second line targets any subdomain for example.com. Specifically, it's looking for text of any kind between the http:// and example.com. So it'd catch info.example.com, foobar.example.com, yourmom.example.com, etc.

If you change the URL on line 3 to info.example.com, it's instead going to try to match whatever shows up in between the http:// and info.example.com (ie. not the "info" part of the URL), which isn't what you want to do.

hayden.
Sep 11, 2007

here's a goat on a pig or something
Is there an elegant way to put space (margin) between rows in the new Bootstrap 3? Using margin-top etc doesn't seem to work. Right now I just have an empty row to take up space.

edit: I think I was just doing it wrong, I think it's working now

hayden. fucked around with this message at 02:09 on Aug 1, 2013

Boosh!
Apr 12, 2002
Oven Wrangler

Thermopyle posted:

Bootstrap 3 RC1 is out.


I started to implement this today with mobile-first development in mind.

Which brings me to this question regarding responsive development: How would you handle content images that you do not want to be loaded on mobile? We made this hacky jQuery function that replaces the src attribute of the IMG tag for mobile devices. I was thinking that there must be something a bit more elegant. What's the best practice for this?

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
Does anyone here use Bower? If so, can you share how it fits into your workflow? On the surface, it seems like a pretty awesome way to bootstrap a project (e.g. "bower install jquery"), but in practice, the packages don't seem to be very consistent, so I have to go looking for the actual scripts to include. I'm not really sure how to use it to any meaningful effect.

E: Awesome OP

hayden.
Sep 11, 2007

here's a goat on a pig or something

Boosh! posted:

I started to implement this today with mobile-first development in mind.

Which brings me to this question regarding responsive development: How would you handle content images that you do not want to be loaded on mobile? We made this hacky jQuery function that replaces the src attribute of the IMG tag for mobile devices. I was thinking that there must be something a bit more elegant. What's the best practice for this?

I'm a total amateur but my approach would be to use use a mobile first approach like Bootstrap 3 does and use jQuery to only load the images if it's non-mobile. With your method, wouldn't it possibly start to download the images despite not being displayed?

Joementum
May 23, 2004

jesus christ

hayden. posted:

With your method, wouldn't it possibly start to download the images despite not being displayed?

Yup, especially with browsers like Chrome doing prerendering. There's a W3C proposal to deal with this issue using a <picture> element that can contain <source> elements with media queries, like the <video> and <audio> elements already support. Here's a talk on the issue.

sim
Sep 24, 2003

Kobayashi posted:

Does anyone here use Bower? If so, can you share how it fits into your workflow? On the surface, it seems like a pretty awesome way to bootstrap a project (e.g. "bower install jquery"), but in practice, the packages don't seem to be very consistent, so I have to go looking for the actual scripts to include. I'm not really sure how to use it to any meaningful effect.

I've only played around with it (through Yeoman), for the very same reason: the packages are never setup the way I want, especially when trying to use AMD versions. But, if you use the same basic scaffolding for multiple projects, it's easy to setup a bower.json just the way you like it. Now you can bootstrap a similar project in seconds. Also, if you want to move 3rd party libraries out of your source control, Bower is one way to do it.

Boosh!
Apr 12, 2002
Oven Wrangler

hayden. posted:

I'm a total amateur but my approach would be to use use a mobile first approach like Bootstrap 3 does and use jQuery to only load the images if it's non-mobile. With your method, wouldn't it possibly start to download the images despite not being displayed?

Sorry, I phrased it incorrectly. The image SRC's start out empty and I use some simple jQuery to read an attribute of that image and inject it into the SRC via LazyLoading. Before that, I strip out the attribute (data-original) if it's mobile so the injection never happens.

code:
    $(document).ready(function() {
           if( /Android|iPhone|BlackBerry/i.test(navigator.userAgent) ) {
                 $("img.gt500").removeAttr("data-original");
                 $("img.gt500").remove();
            }
                        
           $(".row img").lazyload();
           
    });
Not very elegant and goes against building up from mobile.

hayden.
Sep 11, 2007

here's a goat on a pig or something
There's that and also you're one of those websites I hate and leave because you require JS to load images (I use NotScripts). Can't you do this in the PHP or whatever backend you're using?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

hayden. posted:

There's that and also you're one of those websites I hate and leave because you require JS to load images (I use NotScripts). Can't you do this in the PHP or whatever backend you're using?

This is not perfect but I really think this is the best way to approach images with current standards, drop in solution for PHP, that takes an image request and serves up a device appropriate image size. It uses either screen size information from a cookie (JS, first case), or a roughie using UserAgent if it doesn't make it.

http://adaptive-images.com/

DaveP
Apr 25, 2011
Hey guys, I've got some dynamic counting numbers that add some techy flair to the header of a page I'm working on (they increase as you scroll the page), but when they're changing they look a bit fruity: all jumpy thanks to variable letter widths in the typeface I'm using.

Anyone got any lightweight methods to effectively 'fake' fixed width/monospaced lettering with a variable width typeface? I was thinking something like breaking out each number to a span each with their own width to 'counter' the variable widths but this would be a messy pain in the butt.

DaveP fucked around with this message at 17:58 on Aug 1, 2013

Boosh!
Apr 12, 2002
Oven Wrangler

hayden. posted:

There's that and also you're one of those websites I hate and leave because you require JS to load images (I use NotScripts). Can't you do this in the PHP or whatever backend you're using?

No server side scripting here. We're tied to an old CMS because we need it connected to a huge million+ asset repository so we can only spit out flat html pages. JS image loading is definitely not preferable but I'm just fishing and testing out ideas at this point. At the very worst, I might just let mobile load all the images (there aren't many) but of course one would prefer to do things "the right way."


Maluco Marinero posted:

This is not perfect but I really think this is the best way to approach images with current standards, drop in solution for PHP, that takes an image request and serves up a device appropriate image size. It uses either screen size information from a cookie (JS, first case), or a roughie using UserAgent if it doesn't make it.

http://adaptive-images.com/

Interesting, thanks. No PHP for this project but this should be a useful asset for something in the future.

edit: I'm currently going through this article: http://mobile.smashingmagazine.com/2013/07/08/choosing-a-responsive-image-solution/

Boosh! fucked around with this message at 18:10 on Aug 1, 2013

akadajet
Sep 14, 2003

hayden. posted:

There's that and also you're one of those websites I hate and leave because you require JS to load images (I use NotScripts). Can't you do this in the PHP or whatever backend you're using?

If you block Javascript then I don't really care about you as a user at all.

kedo
Nov 27, 2007

akadajet posted:

If you block Javascript then I don't really care about you as a user at all.

Yup. Blocking Javascript is pretty idiotic these days. But last I checked less than 5% of folks block it / have it disabled, so who cares?

\/ \/ Agreed, but only to a point. The number is still so low that it's more or less negligible. I suppose you could make the argument that there might be something wonky with a person's browser that could prevent JS from processing properly, but that's quite an edge case. As long as the absolute core functionality of a site works without JS, that's generally enough imo.

kedo fucked around with this message at 22:14 on Aug 1, 2013

pipes!
Jul 10, 2001
Nap Ghost
Uh, progressive enhancement/graceful degradation is kinda a big deal. Don't always assume that a failure to load JS is a premeditated thing.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

akadajet posted:

If you block Javascript then I don't really care about you as a user at all.

You must have never designed a website that was supposed to generate revenue.

"Hey boss, our company had 19.1M in expenses, the site only brought in 19M. Good thing we told 5% of our users to gently caress off!"

(Cue: people without JS/ modern browsers would never buy anything online anyway justification...)

If you can't provide a good user experience (note: not astounding or unbelievable, just good enough to get the job done) without javascript / cutting edge Css, its not the users fault.

Pseudo-God
Mar 13, 2006

I just love oranges!
And what about building apps with backbone.js and the rest of the front-end libraries, which obviously don't work without JavaScript? Are we supposed to code our business logic twice, just to support a tiny minority of users?

tarepanda
Mar 26, 2011

Living the Dream

Lumpy posted:

You must have never designed a website that was supposed to generate revenue.

"Hey boss, our company had 19.1M in expenses, the site only brought in 19M. Good thing we told 5% of our users to gently caress off!"

(Cue: people without JS/ modern browsers would never buy anything online anyway justification...)

If you can't provide a good user experience (note: not astounding or unbelievable, just good enough to get the job done) without javascript / cutting edge Css, its not the users fault.

That's more a sign of faulty planning sales.

Nobody says "Dammit Bob, if you had designed a sports coupe with enough room for a family of five and a kid in a wheelchair, we could have captured more of the market!"

Those people aren't even IN the market in many cases.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Pseudo-God posted:

And what about building apps with backbone.js and the rest of the front-end libraries, which obviously don't work without JavaScript? Are we supposed to code our business logic twice, just to support a tiny minority of users?

That's an entirely different thing. If your website is about sales conversion, not high level interaction, the front end shouldn't lock up cause the Javascript hasn't loaded up yet. Modern web applications have prerequisites, they're not the same kettle of fish.

tarepanda
Mar 26, 2011

Living the Dream

Maluco Marinero posted:

That's an entirely different thing. If your website is about sales conversion, not high level interaction, the front end shouldn't lock up cause the Javascript hasn't loaded up yet. Modern web applications have prerequisites, they're not the same kettle of fish.

That's what I wanted to say and said incredibly poorly.

akadajet
Sep 14, 2003

Lumpy posted:

You must have never designed a website that was supposed to generate revenue.

"Hey boss, our company had 19.1M in expenses, the site only brought in 19M. Good thing we told 5% of our users to gently caress off!"

If your margin for success is that slim and you actually have high percentage of paranoid users who block scripts. Then sure, but I wouldn't take that job.

For most web apps? I'd focus on a good experience for users who don't break their browsers.

Skiant
Mar 10, 2013

akadajet posted:

I'd focus on a good experience for users who don't break their browsers.

This sums up all I could have written on the subject.
Plus, blocking JS is an advanced user move. If you know how to disable JS, you know how to whitelist websites that require it.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.

DaveP posted:

Hey guys, I've got some dynamic counting numbers that add some techy flair to the header of a page I'm working on (they increase as you scroll the page), but when they're changing they look a bit fruity: all jumpy thanks to variable letter widths in the typeface I'm using.

Anyone got any lightweight methods to effectively 'fake' fixed width/monospaced lettering with a variable width typeface? I was thinking something like breaking out each number to a span each with their own width to 'counter' the variable widths but this would be a messy pain in the butt.

What you're looking for, in typographic speak, is 'tabular figures' - http://practicaltypography.com/alternate-figures.html

A bit of googling says that you can do it in Firefox at least - https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings?redirectlocale=en-US&redirectslug=CSS%2Ffont-feature-settings


Note also that a number of fonts have tabular figures by default, so if you're able to just set your numbers to one of those fonts you should be fine.

Dietrich
Sep 11, 2001

Lumpy posted:

You must have never designed a website that was supposed to generate revenue.

"Hey boss, our company had 19.1M in expenses, the site only brought in 19M. Good thing we told 5% of our users to gently caress off!"

(Cue: people without JS/ modern browsers would never buy anything online anyway justification...)

If you can't provide a good user experience (note: not astounding or unbelievable, just good enough to get the job done) without javascript / cutting edge Css, its not the users fault.

If only that hypothetical business had spent the time to make their site workable with javascript blocked, the story would be:

"Hey boss, our company had 24.5M in expenses, the site only brought in 19.1M. Good thing we support MidasWWW!

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Maluco Marinero posted:

That's an entirely different thing. If your website is about sales conversion, not high level interaction, the front end shouldn't lock up cause the Javascript hasn't loaded up yet. Modern web applications have prerequisites, they're not the same kettle of fish.

Exactly. saying "people who don't have JS should not be allowed to use the web, and I will never worry about them EVER" is a terrible, dogmatic view. My example was obviously way over the top, but the realities of some web business are that margins are not HUGE. In Q4, 2012 Amazon had $21.2B in sales and $97M in net income (source). Does amazon have a terrible business model? If they lost 5% of their customers because "screw them", do the math on their net income.

If your app / business model requires rich interaction and so on, or you have known endpoints, then by all means, JS only is certainly a viable option. But a blanket "gently caress those people!" ignores the realities of the business as a whole.


Dietrich posted:

If only that hypothetical business had spent the time to make their site workable with javascript blocked, the story would be:

"Hey boss, our company had 24.5M in expenses, the site only brought in 19.1M. Good thing we support MidasWWW!

If only that business had followed a progressive enhancement development process...

Lumpy fucked around with this message at 14:37 on Aug 2, 2013

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Just as a note, part of my comment was that by erring on the side of caution with Javascript, you can have a website that is accessible and USABLE even if the user is on some lovely bad reception 3G connection. It's pretty easy to get carried away with JS bloat, and it severely impacts the experience you may be trying to create. It doesn't hurt to develop with a 'default' state in mind, and that means genuinely thinking about the lack of Javascript as a potential occurrence and not dismissing it.

Taima
Dec 31, 2006

tfw you're peeing next to someone in the lineup and they don't know
Does anyone know how to create, through html or (most likely) javascript, a click function or something similar that wouldn't be recognized by mobile touch browsers?

Basically I want the link to be "#" when a touch users activates the link, and an actual link when someone clicks it on a desktop environment.

kedo
Nov 27, 2007

Taima posted:

Does anyone know how to create, through html or (most likely) javascript, a click function or something similar that wouldn't be recognized by mobile touch browsers?

Basically I want the link to be "#" when a touch users activates the link, and an actual link when someone clicks it on a desktop environment.

You could accomplish this with Modernizr (which will add .no-touch or .touch to the body tag) + some basic JS to swap out the href of a link depending on which class the body tag has.

eg.

JavaScript code:
if ($('body').hasClass('touch')) {
  $('a').attr('href','#');
}
Depending on what those links are, you might be better off removing them entirely for touch users. Having links that do nothing sounds like pretty bad usability.

kedo fucked around with this message at 17:09 on Aug 2, 2013

Taima
Dec 31, 2006

tfw you're peeing next to someone in the lineup and they don't know
I figured it out, thanks Kedo that helped a lot!

Taima fucked around with this message at 21:05 on Aug 2, 2013

Sergeant Rock
Apr 28, 2002

"... call the expert at kissing and stuff..."
BTW, on the users-without-Javascript front, FF 23 has removed the checkbox in Options that allows users to turn JS off entirely. You can still do that, but you need to set a flag in about :config instead, which is intended to stop users who don't know what they're doing switching JS off.

Thinking about this, I believe this is a good idea. That option's been pretty hard to find in IE since forever (Options > Advanced tab > scroll down) too...

Sergeant Rock fucked around with this message at 12:48 on Aug 3, 2013

Mister Chief
Jun 6, 2011

Is there a way to quickly disable it in their developer tools?

peak debt
Mar 11, 2001
b& :(
Nap Ghost
Let's say I have a base image (A)


And another image with some transparency (B)


If I layer these on top of each other I get this (C = A + B)


But now, I wonder. If I have the image C and A, is it somehow possible to use a filter in Photoshop to get B? There's obviously more than one solution and I'd be happy with any B that satisfies the requirements but I can't think of an obvious way to get that in Photoshop.

The March Hare
Oct 15, 2006

Je rêve d'un
Wayne's World 3
Buglord

peak debt posted:

Let's say I have a base image (A)


And another image with some transparency (B)


If I layer these on top of each other I get this (C = A + B)


But now, I wonder. If I have the image C and A, is it somehow possible to use a filter in Photoshop to get B? There's obviously more than one solution and I'd be happy with any B that satisfies the requirements but I can't think of an obvious way to get that in Photoshop.

If base image A is a solid color you could select by color and then delete those pixels I guess but if they are merged into one layer I'm not really sure there is another shortcut, and this one has some obvious flaws.

peak debt
Mar 11, 2001
b& :(
Nap Ghost
It's not that simple since the background color also modifies the color of the transparent pixels. You will kind of have to subtract that color from the image but the "Subtraction" filter in Photoshop isn't doing that.

substitute
Aug 30, 2003

you for my mum

Mister Chief posted:

Is there a way to quickly disable it in their developer tools?
I know the web developer plugin has that in the toolbar.

Adbot
ADBOT LOVES YOU

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
Potentially stupid question here:

Why is it that everyone in web design uses hex colour codes rather than rgb? I can't believe that people find it easier to read the hex representation; is it just a convention held over from some time before rgb colours 'existed' on the web?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply