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
Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Furthermore, you cannot reliably detect whether a browser is capable of hover or 0not. Touch devices simulate mouse events, and some desktop browsers support touch so just touch detection doesn't work either.

CSS4 media queries draft promise pointer & hover media queries which can detect whether or not a browser can do it, but that's a long way off.

The key thing about hover is how iOS behaves on touch. If the hover class results in something being unhidden (display or visibility I think), iOS will instead of trigger a click, trigger a mousemove in the region instead. Second tap would then trigger a click.

This was done this way to make it compatible with the majority of the hover dependant web, but can be really nasty behaviour to code for, especially as Android chrome does not work the same way.

Either way, make sure you have test devices or browserstack or something to really figure out how it will work cross device.

Adbot
ADBOT LOVES YOU

cbirdsong
Sep 8, 2004

Commodore of the Apocalypso
Lipstick Apathy

PlesantDilemma posted:

Everything I've googled up tells me that our best bet is to ditch the hover concept and go all click-based for opening menus, but I doubt the boss will like that.

Click-based dropdowns are superior even on the desktop, because everywhere else in desktop computing, hovering over something is not how interact with it, it's how you discover what you can interact with. You might get somewhere with this line of thinking.

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace

Nebulon Gate posted:

Ran into this a while ago. Install modernizr, and look into jQuery Mobile.

Can you go into more details about how you got it to work with these? modernizr has a lot of stuff that I wont need and it's not clear how I'd use it for this. And jQuery mobile is a big library but this is actually a desktop site that I need to make work with tablets and new touch-screen laptops.

cbirdsong posted:

Click-based dropdowns are superior even on the desktop, because everywhere else in desktop computing, hovering over something is not how interact with it, it's how you discover what you can interact with. You might get somewhere with this line of thinking.

yup this makes sense and i'll talk to the head honcho but who knows if they will go for it

Also, this hover intent library seemed very promising but it doesn't work with IE because IE sends the mouseleave event :(

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
Haha, just found out IE10 doesn't support conditional statements. gently caress those guys, seriously. They've gone from being lovably incompetent to downright hostile.

Edit: And to answer your question, no, so far I haven't found any reason to use them (yay!). But I've needed them for every other goddamn IE release going back to IE6, so I don't see why 10 will be any different.

Nebulon Gate
Feb 23, 2013

quote:

Can you go into more details about how you got it to work with these? modernizr has a lot of stuff that I wont need and it's not clear how I'd use it for this. And jQuery mobile is a big library but this is actually a desktop site that I need to make work with tablets and new touch-screen laptops.

The only reliable way to detect if a screen is a touch screen is detecting screen size with user agent and touch capability.

Basically, you load modernizr, and it adds a bunch of classes to the HTML tag. jQuery mobile is a big library, but is probably your best option. You selectively load it based on the results generated by modernizr (it detects touch, which most browsers have) with the useragent and the resolution of the screen. In general, if the device meets these requirements, you then selectively add a class to the <body> tag and add your event listeners, usually displaying a menu on touch/click and so forth.

jackpot posted:

Haha, just found out IE10 doesn't support conditional statements. gently caress those guys, seriously. They've gone from being lovably incompetent to downright hostile.

Edit: And to answer your question, no, so far I haven't found any reason to use them (yay!). But I've needed them for every other goddamn IE release going back to IE6, so I don't see why 10 will be any different.


Yeah we're back to user-agent sniffing and possibly CSS hacks. A'int it loving grand?

I suppose the upshot is that the web has gotten so cross-platform that we're all not getting outsourced anymore, which is nice.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

jackpot posted:

Haha, just found out IE10 doesn't support conditional statements. gently caress those guys, seriously. They've gone from being lovably incompetent to downright hostile.

Edit: And to answer your question, no, so far I haven't found any reason to use them (yay!). But I've needed them for every other goddamn IE release going back to IE6, so I don't see why 10 will be any different.

Because of the standards IE 10 supports it does then well. Is IE hate so bad that Microsoft can do no right?
Conditional statements? Those aren't standard! Microsoft! :argh:
Removing conditional statements to make web pages focus on standards? Microsoft! :argh:

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Nebulon Gate posted:

The only reliable way to detect if a screen is a touch screen is detecting screen size with user agent and touch capability.


Incorrect!

JavaScript code:
var isTouchscreen = confirm('Are you on a touch screen?');
Who need all that "modernizr" junk anyway. :colbert:

Heskie
Aug 10, 2002

Nebulon Gate posted:

The only reliable way to detect if a screen is a touch screen is detecting screen size with user agent and touch capability.

Is this not reliable?
code:
var is_touch_device = 'ontouchstart' in document.documentElement;
I've been using it in a couple of projects and not noticed any issues, am I missing some significant devices?


Edit:

jackpot posted:

Haha, just found out IE10 doesn't support conditional statements. gently caress those guys, seriously. They've gone from being lovably incompetent to downright hostile.

Edit: And to answer your question, no, so far I haven't found any reason to use them (yay!). But I've needed them for every other goddamn IE release going back to IE6, so I don't see why 10 will be any different.

Detect features, not browsers etc etc.

Heskie fucked around with this message at 01:22 on Feb 28, 2014

Xarb
Nov 26, 2000

Not happy.

PlesantDilemma posted:

Everything I've googled up tells me that our best bet is to ditch the hover concept and go all click-based for opening menus, but I doubt the boss will like that.
We changed from a CSS:hover menu to a click menu and I was surprised how many users mentioned how much they liked the new menu system.

Nebulon Gate
Feb 23, 2013

Xarb posted:

We changed from a CSS:hover menu to a click menu and I was surprised how many users mentioned how much they liked the new menu system.

Downward/right facing arrow needs to go beside the elements, however. Otherwise they never know. The hotels I work for have gotten a ridiculously higher amount of business when I implemented this mobile setup:

http://www.garfieldsuiteshotel.com/

(rezize your window)

That little cross icon made all the difference.

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace

Heskie posted:

Is this not reliable?
code:
var is_touch_device = 'ontouchstart' in document.documentElement;

That can return false when using a desktop browser on a laptop that has a touch screen. Firefox does this on my Lenovo Yoga.

Xarb posted:

We changed from a CSS:hover menu to a click menu and I was surprised how many users mentioned how much they liked the new menu system.

It's very easy and common to open the menu accidentally with a hover based menu. I thought that I wouldn't like a click-to-open system but then yesterday I realized that all the sites based on twitter bootstrap use click-to-open and they don't bother me at all. Probably because they have a little triangle icon like Nebulon Gate is talking about.

Ethereal
Mar 8, 2003
Does anyone know of a way to feature detect if an HTML5 video element requires a touch interaction to start?

i.e. Mobile devices require a synchronous touch event to trigger a play start.

I can attempt to call play on a video element and listen for playing, but that doesn't feel like the best solution.

pipes!
Jul 10, 2001
Nap Ghost

Xarb posted:

We changed from a CSS:hover menu to a click menu and I was surprised how many users mentioned how much they liked the new menu system.

Do some usability testing and weep bitter tears over how many people still double click links.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
Y'all seen this new text editor from the people at Github? Looks pretty neat to me.

http://atom.io/

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<

The Merkinman posted:

Because of the standards IE 10 supports it does then well. Is IE hate so bad that Microsoft can do no right?
Conditional statements? Those aren't standard! Microsoft! :argh:
Removing conditional statements to make web pages focus on standards? Microsoft! :argh:
When your brother spends ten years in and out of jail and rehab, then shows up at your house smiling and proud 'cause he's been clean for a whole month, you pat him on the back, give him a hug, and tell him what a good job he's doing. "I'm so proud of you!," you say. But you don't make any long-term plans around him just yet.

Like I said, I've had no issues so far. That's great. But experience has taught me that yes, as far as web design goes Microsoft really can do no right. Like a lot of us, I was there for IE6...some wounds are too deep to ever really heal.

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace

Kobayashi posted:

Y'all seen this new text editor from the people at Github? Looks pretty neat to me.

http://atom.io/

So I can theme the editor with CSS and script it with Javascript? That's wicked. Plus I can continue to put off learning emacs lisp.

http://atom.io/faq posted:

At the moment Atom only runs on OS X (10.8 or later). Windows and Linux releases are on the roadmap.
goddamnit

kedo
Nov 27, 2007

I have an idea for one of my upcoming work projects which would require giving users the ability to draw simple shapes, and then performing some sort of basic pattern analysis on the shape. Like, user draws something that looks like an L and some JS examines it and says, "oh, that's probably an L."

Is there any sort of existing library that might apply here? If not, any recommendations on where to start? Off the top of my head I'm thinking canvas, paths + some complex JS I can't wrap my head around quite yet.

e: Actually Ocrad.js looks like it might be a good place to start. Still interested in any ideas, though!
e2: Oh man, Ocrad seems to be insanely bloated with all sorts of useless crap unless I'm mistaken. This code is straight nuts. Not sure why it'd need to have date or audio decoding crap in here.

kedo fucked around with this message at 21:13 on Feb 28, 2014

RobertKerans
Aug 25, 2006

There is a heppy lend
Fur, fur aw-a-a-ay.

Kobayashi posted:

Y'all seen this new text editor from the people at Github? Looks pretty neat to me.

http://atom.io/

It's pretty good, been testing it out all day; first impression is that it's really similar to Sublime, has most of the features I use with that, the Git highlighting stuff is really nice and immediately useful. Minor thing, but the default font size is ridiculous and gives an immediate bad impression despite how easy it is to fix.

glompix
Jan 19, 2004

propane grill-pilled

kedo posted:

I have an idea for one of my upcoming work projects which would require giving users the ability to draw simple shapes, and then performing some sort of basic pattern analysis on the shape. Like, user draws something that looks like an L and some JS examines it and says, "oh, that's probably an L."

Is there any sort of existing library that might apply here? If not, any recommendations on where to start? Off the top of my head I'm thinking canvas, paths + some complex JS I can't wrap my head around quite yet.

e: Actually Ocrad.js looks like it might be a good place to start. Still interested in any ideas, though!

This might be overkill, but you could always code your own OCR. There's an example in "Machine Learning in Action" that I'm sure you could port to Javascript. You'd definitely need a good training set though.

I say this because the one you linked kind of sucks at recognizing my mouse hand-writing which is admittedly bad but not that bad. You also said you might want to do shapes and not just handwriting.

glompix fucked around with this message at 21:18 on Feb 28, 2014

kedo
Nov 27, 2007

glompix posted:

This might be overkill, but you could always code your own OCR. There's an example in "Machine Learning in Action" that I'm sure you could port to Javascript. You'd definitely need a good training set though.

I say this because the one you linked kind of sucks at recognizing my mouse hand-writing which is admittedly bad but not that bad. You also said you might want to do shapes and not just handwriting.



Yeah, the more I'm looking into this, the more I feel like I might be setting myself up for failure/disappointment. I do indeed want to be able to identify shapes instead of handwriting so coding my own OCR is what I was getting at, I suppose. But the more I'm reading about it, it sounds like an absolute bitch to get working properly.

Probably not worth the effort in this case. :smith:

The Insect Court
Nov 22, 2012

by FactsAreUseless

RobertKerans posted:

It's pretty good, been testing it out all day; first impression is that it's really similar to Sublime, has most of the features I use with that, the Git highlighting stuff is really nice and immediately useful. Minor thing, but the default font size is ridiculous and gives an immediate bad impression despite how easy it is to fix.

If you've got any spare invites lying around I could take one off your hands maybe?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I'm disappointed it's not open-source, and OS X-only.

SuicideSnowman
Jul 26, 2003
I'm looking for some advice on a project I'm in charge of at my job. It's basically a portal for other employees to filter all of our various access requests into one place to simplify the process. Right now it's basically a clusterfuck where people just e-mail or call the wrong person and there's not a lot of organization in place.

The application will involve several dynamic and somewhat complicated forms that will pull from various data sources including Active Directory and SQL Databases. Because most of the interaction is client-side manipulation of the DOM often, I've been using a combination of ASP.NET MVC, Bootstrap for the layout and jQuery for the DOM manipulation. This is "fine" but I'm worried that as this project gets bigger and bigger the Javascript code is going to start getting out of hand (it already is).

I've been looking at some of the Javascript MV* frameworks such as Angular, Ember & Backbone in attempt to better organize and simplify the dynamic aspect of the various forms. These are all foreign to me so I'm not sure if this would be the best idea for a project of this type. My other concern is that no matter what I'm going to have to use either ASP.NET Webforms or ASP.NET MVC as the backend and I'm unsure of how well the aforementioned Javascript frameworks will work with that requirement.

Has anybody done any extensive work with both ASP.NET and a JS MV framework that can offer any thoughts on this?

MonkeyMaker
May 22, 2006

What's your poison, sir?
I have 3 Atom invites if anyone wants one. Just PM me your email address or hit me up in IRC. all gone.

I wasn't that impressed by it, actually.

MonkeyMaker fucked around with this message at 01:36 on Mar 1, 2014

RobertKerans
Aug 25, 2006

There is a heppy lend
Fur, fur aw-a-a-ay.

The Insect Court posted:

If you've got any spare invites lying around I could take one off your hands maybe?

I got an invite off one of the team at my work, but everyone else who also got one then got 3 more invites to use, so I'll check what the craic is tomorrow; if I have got some, I'll post here for anyone who wants them.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo

MonkeyMaker posted:

I wasn't that impressed by it, actually.

It's buggy as poo poo, but I like the default color scheme, and I like that you can right click > inspect element and tweak things. I like that it speaks Markdown and LESS out of the box (though not Handlebars). I like that it integrates with git in novel ways (ignored files are grayed out in the tree view, live diff to the left of line numbers as code is added). I'm sure this is all possible with other editors, but the defaults are definitely rubbing me the right way so far.

Nebulon Gate
Feb 23, 2013
I'm rather curious: those using SublimeText, what is your FTP solution?

substitute
Aug 30, 2003

you for my mum

Nebulon Gate posted:

I'm rather curious: those using SublimeText, what is your FTP solution?

Webdrive to map an SFTP/SSH connection to the dev server(s) in Windows Explorer, rarely to a live server. FileZilla when uploading edits to live servers (deliberately, since you have to pay attention).

Yes drat it, we have no source control in place. Other than daily backups, and the plugin I run in Sublime that backs up a file on every save.

Bastard
Jul 13, 2001

We are each responsible for our own destiny.

substitute posted:

Webdrive to map an SFTP/SSH connection to the dev server(s) in Windows Explorer, rarely to a live server. FileZilla when uploading edits to live servers (deliberately, since you have to pay attention).

Yes drat it, we have no source control in place. Other than daily backups, and the plugin I run in Sublime that backs up a file on every save.

Please look into version control and deployment services. They make everything soooooo much better.

Heskie
Aug 10, 2002

Bastard posted:

Please look into version control and deployment services. They make everything soooooo much better.

Agree with this 100%.

If command line isn't your thing then SourceTree, Bitbucket and DeployHQ (or a free alternative) are great tools/services to get you started.

glompix
Jan 19, 2004

propane grill-pilled
I don't really care about the way Atom looks or behaves by default. If it's like emacs, it's about how you build your own editor. This is really exciting to me. About to try it out.

edit: poo poo, I don't have a Mac. At least I'm starting a new job in 4 weeks and will get one. :v:

substitute
Aug 30, 2003

you for my mum

Bastard posted:

Please look into version control and deployment services. They make everything soooooo much better.

Please email everyone in my department and tell them we're developmentally stunted. I've try mentioning things in round-a-bout ways, emailing links to examples, suggestions etc., and sometimes straight-up pushing for certain things, but since we're all technically under/in a marketing department, too many (non-developer) people need simple access to web assets. It's a slow and difficult progression to make things better around here. And then there's a jackass consultant that tries to wrangle control over everything, making everything possibly from scratch (for total control), re-inventing the wheel, re-inventing the hammer and chisel, and posturing with pseudo-intellectual bullshit to look smarter than you. If this person was gone, I would have a much easier process, and better practices in place at work honestly.

Xarb
Nov 26, 2000

Not happy.

Nebulon Gate posted:

I'm rather curious: those using SublimeText, what is your FTP solution?
I really like the SFTP sublime plugin:
http://wbond.net/sublime_packages/sftp

Bastard
Jul 13, 2001

We are each responsible for our own destiny.

substitute posted:

Please email everyone in my department and tell them we're developmentally stunted. I've try mentioning things in round-a-bout ways, emailing links to examples, suggestions etc., and sometimes straight-up pushing for certain things, but since we're all technically under/in a marketing department, too many (non-developer) people need simple access to web assets. It's a slow and difficult progression to make things better around here. And then there's a jackass consultant that tries to wrangle control over everything, making everything possibly from scratch (for total control), re-inventing the wheel, re-inventing the hammer and chisel, and posturing with pseudo-intellectual bullshit to look smarter than you. If this person was gone, I would have a much easier process, and better practices in place at work honestly.

I am so, so sorry for you :ohdear:

RobertKerans
Aug 25, 2006

There is a heppy lend
Fur, fur aw-a-a-ay.

Nebulon Gate posted:

I'm rather curious: those using SublimeText, what is your FTP solution?

Don't use FTP is the solution, but that got pretty comprehensively covered above, so last time I had to use it, I just took SFTP and it did the job pretty well. gently caress, it's nice having a systems guy on my team who just sorts everything out re Bitbucket so we don't have to even think about deployment issues: sorry about your situation

Nebulon Gate
Feb 23, 2013
My primary company's (I'm a contractor) model is one of the few where a deployment situation is actually just cumbersome, oddly.

Bastard posted:

I am so, so sorry for you :ohdear:



Yeah can we start some charity drive for this dude or something? Jesus.

Nebulon Gate fucked around with this message at 03:04 on Mar 2, 2014

glompix
Jan 19, 2004

propane grill-pilled

That sucks, man! You could always run a local git repository and just never put it anywhere except your machine. There's still lots of value in that for change tracking.

Nebulon Gate
Feb 23, 2013
So, I am currently making a web application, specifically, a live auction site with associated chat room, and I've run into a bit of an issue as to how to store the data for each individual auction data (specifically, bids for each item in the auction) and chat messages, which will be displayed and updated in real time. Multiple auctions/chats will be running simulatenously. Is there a better solution than just storing them in a MySQL database? Any ideas?

My biggest caveat would be exporting the data from an individual auction--specifically, who won the auction, the price bid, and so forth--to the permanent database so it can be logged and the buyers can go through the paying motions and so forth.

Oh, and one last thing. I'm new as hell to NodeJS and ExpressJS and so forth: how the hell is one supposed to prototype quickly with this poo poo? I've got a server running, and each time I update it I have to kill the process then reload it. This can't be the best solution.


Apparently Node Supervisor is the way to go.

Nebulon Gate fucked around with this message at 21:58 on Mar 2, 2014

PleasantDilemma
Dec 5, 2006

The Last Hope for Peace

glompix posted:

That sucks, man! You could always run a local git repository and just never put it anywhere except your machine. There's still lots of value in that for change tracking.

I second this as I do this at work and it is super great. I have tons of local git branches that help me isolate the issues I'm working on since everything gets checked into a central TFS branch.

Adbot
ADBOT LOVES YOU

nexus6
Sep 2, 2011

If only you could see what I've seen with your eyes
I've developed a simple HTML5 app designed for use on an iPad. It is used to collect data and, since the client couldn't guarantee that it would always have an internet connection, stores data in localstorage which can be later AJAX'ed into a database.

Since these devices are out and about, and offline, is there a good way I can store/view JavaScript logs? There seems to be a few options for remote JS error logging, but they all require the client application to be online.

Is there a way I can store console.log or console.error messages for later viewing without having to remake my localstorage saving?

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