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
revmoo
May 25, 2006

#basta
I am going to be building a drop-down menu with a lot of 'stuff' in it, similar to the Amazon dropdown menus. I'm almost certain that I want to build it from scratch. Any suggestions on articles or good writeups on the process?

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

revmoo posted:

I am going to be building a drop-down menu with a lot of 'stuff' in it, similar to the Amazon dropdown menus. I'm almost certain that I want to build it from scratch. Any suggestions on articles or good writeups on the process?

http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown

revmoo
May 25, 2006

#basta

Perfect, thanks. This is the kinda thing I'm looking for.

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
If anybody knows any good javascript for dummies resources, I'll take 'em. I'm doing the Lynda lessons at the moment, but I'm having some trouble with what's probably a simple problem.

I'm using jqueryui's fixed-minimum slider, which basically just starts at some preset minimum number (0, in my case) and goes up to some preset max number (700, in my example). What I want to do is use a textbox to ask for that max number, and on submit insert what I get as the max value. So if they say their budget is $3,000, set max to 3,000. Can someone at least point me in the right direction on this, or know of any examples I could use to put this together?


pre:
$(function () {
    $("#slider-range-min").slider({
        range: "min",
        value: 32,
        min: 0,
        max: 700,
        slide: function (event, ui) {
            $("#amount").val("$" + ui.value);
        }
    });
    $("#amount").val("$" + $("#slider-range-min").slider("value"));
});
http://jsfiddle.net/Jackpot/1Lmeq5ft/1/

jackpot fucked around with this message at 02:25 on Oct 22, 2014

Sedro
Dec 31, 2008
See their API docs. You can change the max after the widget is created:
JavaScript code:
var mySlider = $("#slider-range-min").slider({ ... });
mySlider.slider("option", "max", newMax);

salisbury shake
Dec 27, 2011
I've got a web service that pulls information from a third party web service, but both require a login.

Is the best method for storing the password hash needed for my service still PBKDF2/bcrypt as this article suggests? What about storing the secret for the 3rd party given that it must be sent in plaintext over HTTPS?

My Rhythmic Crotch
Jan 13, 2011

I wouldn't store the password at all. Just set some kind of in-memory session data in your server. For example, I do an authentication against our company's LDAP server, and in my server app, I store the key/value pair of "userid", "authenticated" or something like that. When the user logs out, my server will delete that key/value pair. That way I am never trying to store sensitive data but yet I am still able to know if a user has authenticated.

Edit: sorry - was in a hurry and misread. It is likely you won't be able to do what I am suggesting. In that case... what I have done in the past is create a group account, API account, or whatever is available with the 3rd party service so you can authenticate with the individual's credentials at first, and then use the API account after. I am guessing your 3rd party service does not have that available? So yes you would need to either store passwords or ask for authentication each time they log on.

My Rhythmic Crotch fucked around with this message at 00:54 on Oct 23, 2014

revmoo
May 25, 2006

#basta
Yeah so I built that dropdown menu from scratch using jquery menu-aim. It took me basically 8 hours to code the whole thing up and fit it into the app I'm working on.

Menus are one of those subtly hard things to build right.

salisbury shake
Dec 27, 2011

My Rhythmic Crotch posted:

Edit: sorry - was in a hurry and misread. It is likely you won't be able to do what I am suggesting. In that case... what I have done in the past is create a group account, API account, or whatever is available with the 3rd party service so you can authenticate with the individual's credentials at first, and then use the API account after. I am guessing your 3rd party service does not have that available? So yes you would need to either store passwords or ask for authentication each time they log on.

Webservice is a bad way to describe it when the colloquial usage seems to be reserved for companies providing web APIs. It's an older system with a web front end that uses forms to login and cookies to manage sessions that die after an hour.

So it comes back to storing the password for the 3rd party service as securely as possible.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

I asked this question on the last page but it got buried and my Google skills are still failing me. I'm looking for an up/down voting system like they use on Stackoverflow. Are there pre-built solutions for this, or must I roll my own?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

caiman posted:

I asked this question on the last page but it got buried and my Google skills are still failing me. I'm looking for an up/down voting system like they use on Stackoverflow. Are there pre-built solutions for this, or must I roll my own?

Can you go into more detail? Do you literally want StackOverflow-in-a box? Do you have an existing site with... things on it that you'd like to allow people to vote on?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Answerhub?

revmoo
May 25, 2006

#basta
I built such a system once it was pretty simple, unless you need some pretty advanced functionality I can't imagine DIYing it taking longer than an hour or two.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

pokeyman posted:

Can you go into more detail? Do you literally want StackOverflow-in-a box? Do you have an existing site with... things on it that you'd like to allow people to vote on?

I don't have anything yet, this is just mental planning. Let's say there's an image, and users can submit captions for the image. The captions can be voted on by other users, and the captions are sorted under the image based on their score. Something like that.

I know this is fairly simple to do myself, but I didn't know if there may be some quick pre-made thing already in existence.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

caiman posted:

I don't have anything yet, this is just mental planning. Let's say there's an image, and users can submit captions for the image. The captions can be voted on by other users, and the captions are sorted under the image based on their score. Something like that.

I know this is fairly simple to do myself, but I didn't know if there may be some quick pre-made thing already in existence.

Isn't this Reddit?

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

gariig posted:

Isn't this Reddit?

Reddit seems to be a messy hodgepodge of random bullshit. My idea is more fine-tuned. Just images and captions. Like a New Yorker style caption contest, only ongoing.

MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
There might be an out of the box solution, but it sounds like the kind of thing you should program on your own unless you're confident you could roll it out in a couple hours.

Build it in stages.
  • Users can sign up
  • Users can upload images
  • Users can see all public images, sorted by upload date? (maybe have them vote on images too?)
  • Users can comment on images
  • Users can vote on comments
  • Comments sorted by vote

For other examples of what you want to do, look at imgur and Aggorgator (there's probably an ad for aggro gator on the bottom of this page).

kiwid
Sep 30, 2013

Does anyone know of the major/popular commodity markets APIs out there? We want to provide delayed commodity information (from CME) on our website and I have no idea where to look for this data.

kiwid fucked around with this message at 19:44 on Oct 24, 2014

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



caiman posted:

Reddit seems to be a messy hodgepodge of random bullshit. My idea is more fine-tuned. Just images and captions. Like a New Yorker style caption contest, only ongoing.

So http://imgur.com/hot/viral ?

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!


Eh, sort of, but not exactly. My idea is more geared around the contest aspect. The top caption is displayed prominently as the current "winner", and users are rewarded in some way by getting up votes and for having their entry as the winner for a lengthy amount of time, or something.

revmoo
May 25, 2006

#basta
Ok I lied that I had finished that menu apparently it doesn't work in iOS. AFAICT it's a touch issue. I'm using the typical unordered list markup structure and CSS hovers with display: none/block to do the actual dropdowns. If I use iOS safari I can click the menu headers and they open up, and when I click a menu item it darkens as if the hover event and then click event are registered, however it simply sends the click/touch through the menu into whatever is beneath it.

So the menu appears to work and register click events, it's just that when I click an <li> it registers on the element underneath the menu. Ideas?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



revmoo posted:

Ok I lied that I had finished that menu apparently it doesn't work in iOS. AFAICT it's a touch issue. I'm using the typical unordered list markup structure and CSS hovers with display: none/block to do the actual dropdowns. If I use iOS safari I can click the menu headers and they open up, and when I click a menu item it darkens as if the hover event and then click event are registered, however it simply sends the click/touch through the menu into whatever is beneath it.

So the menu appears to work and register click events, it's just that when I click an <li> it registers on the element underneath the menu. Ideas?

CSS code:
//the following line is a workaround for JS event handlers not firing on small-screen iOS
-webkit-overflow-scrolling: touch; //No, seriously.  Also, gently caress you Apple.
Try that on the whole thing's parent element and please leave the comments as-is thanks ;)

revmoo
May 25, 2006

#basta
Well that isn't it, I tried putting it in the menu parent and then putting it in every single menu-related CSS rule and nothing.

If it helps, for some reason when I click on the menu header it pops in/out/in super quick. It wasn't bad enough to bother me UX-wise, but maybe it's a factor in what's broken.

shdwdmg
May 16, 2008
I have the done a fixed position for a nav before, but I was curious if there was a way to do it so that I could have an image appear above the nav, but as the user scrolls the image would slide the image up, and the nav would be fixed at the top of the browser. Any thoughts on how to achieve this effect?

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

shdwdmg posted:

I have the done a fixed position for a nav before, but I was curious if there was a way to do it so that I could have an image appear above the nav, but as the user scrolls the image would slide the image up, and the nav would be fixed at the top of the browser. Any thoughts on how to achieve this effect?

This is easy to do with some simple JS. Chris Coyier has a nice tutorial.

Basically you can use the scroll event and compare the scrollTop position of the nav against the height of the image. If scrollTop >= the height of the image, change the nav's position to fixed .

Kings Of Calabria
Sep 10, 2013
I'm wondering if anyone has an opinion or any links to articles about something that came up when discussing a project. So say there's a site that offers X amount of Y every month for each user, depending on what package they purchase. They would access Y by logging into a sort of dashboard page, showing plan name and balance and all that. Is it more appealing for users to have the ability to create an account and start with a zero-value dashboard, or only give access to a dashboard if they've purchased an initial plan? I'm thinking it would be easier to manage a site where the user only has a dashboard if they actually purchase something, but OTOH it would be nice to have a "SIGN UP FREE" or whatever button on the landing page. I don't know if I'm being totally clear but if you know what I mean and have any thought plz let me know.

Also - have been using user cake for a while, are there any better options out there? Last update was in '13 and I'm not sure what the newest thing is. Thanks.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
For arguments sake, you're offering a web-based service where you provide any number of spacecraft per month.
People can access the spacecraft they paid for via a list of spacecraft on a dashboard.
To determine which spacecrafts should be shown to a person, that person needs to login to their account on your system.

Thus, for a person to access their spacecraft, they need to login and access it via their dashboard.

Will you ever want to allow access to the system for people who have not paid for any spacecraft? Will you ever offer a trial ("free weekend promotion!") where people can sign up and get one free spacecraft? Will spacecraft ever expire and a user may end up with zero spacecraft? If so, you probably want to allow people to sign-up and login independently of purchasing spacecraft, much the same as how GitHub works and paying for private repos. You probably also want to allow a way in where a user can see the available plans, and both make a purchase and sign up at exactly the same time, which just supplies users with the path of least resistance.

Alternatively, if your service is always pay-to-play, you can hide the account creation behind the payment system, and work that way.

Personally, I'd go with:
  • generic user/login system
  • allow free signups
  • have all users land on the dashboard
  • put a "buy x now" list of plans on the dashboard for users who don't have any spaceships
  • make it as easy as possible for a visitor to both purchase and signup to your service in one go
  • list all your plans on your homepage

Also, http://www.userfrosting.com/ looks slightly less awful and has it's roots in UserCake, if that's what you know.
Both projects have very simple PHP4-esq code though, so it's not exactly fantastic, though off the top of my head I don't know anything with the same feature set. Others might have better ideas.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
BA and I are developing an inventory system for our building. Part of it is keeping a list of items by their serial numbers (from a barcode reader) which can be wiped, or deleted piecewise, or added to.

My first thought was "a $.DataTable" but style wise I think BA was thinking of a listbox. Should I just go with the DataTable or spend the time on a listbox?

For background, most of my front end experience is jQuery and knockout, and of course jQueryUI and the DataTables plugin. I did a little ASP.NET Forms but quickly found out it's as extensible as a wet noodle when I saw what you had to go through to do a walk-along search.

Raskolnikov2089
Nov 3, 2006

Schizzy to the matic
Is there any point in using javascript to make a dropdown menu when there are a ton of pure CSS solutions?

I ask out of genuine curiosity.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Raskolnikov2089 posted:

Is there any point in using javascript to make a dropdown menu when there are a ton of pure CSS solutions?

I ask out of genuine curiosity.

That's a pretty open ended question, it really depends on what functionality is involved in your menu.

revmoo
May 25, 2006

#basta
Yeah exactly. I've got a CSS menu that uses JS for functionality, like that jquery-menu-aim.

The Dave
Sep 9, 2003

I would also assume whatever your all CSS menu would do, would break in IE (or rather, old IEs). So if that's important, use a JS menu.

revmoo
May 25, 2006

#basta
I work for a unicorn. We're required to support IE >10 :D

Skiant
Mar 10, 2013

revmoo posted:

I work for a unicorn. We're required to support IE >10 :D

We found out last week we got less than 4% of people using IE8, and Chrome + Firefox are equal to roughly 70% of our audience. I'm cool with that.

The Dave
Sep 9, 2003

Yeah last we measured IE9 and lower made up less than .5% of our audience. Dancing ensued.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Every time I think it's safe to stop caring about IE < 10 I get an email about a client using 8 or 9 and :smith:

revmoo posted:

Well that isn't it, I tried putting it in the menu parent and then putting it in every single menu-related CSS rule and nothing.

If it helps, for some reason when I click on the menu header it pops in/out/in super quick. It wasn't bad enough to bother me UX-wise, but maybe it's a factor in what's broken.

That's frustrating because it sounds familiar from the last time I made one (only a couple months ago!) but I can't remember what the cause or fix was. I thought it was that stupid CSS thing, but I guess not.

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS

revmoo posted:

I work for a unicorn. We're required to support IE >10 :D

Is that really much of a unicorn at this point? ie8/9 make up under 5% of browser share at this point, unless you've got a specific audience I haven't seen much demand recently.

kiwid
Sep 30, 2013

Just checked, 11% of our traffic is from < IE10

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS

kiwid posted:

Just checked, 11% of our traffic is from < IE10

http://caniuse.com/usage_table.php

This is generally my "go to" for general browser statistics, but yeah, it matters a lot by what you're doing.

Adbot
ADBOT LOVES YOU

Raskolnikov2089
Nov 3, 2006

Schizzy to the matic

The Wizard of Poz posted:

That's a pretty open ended question, it really depends on what functionality is involved in your menu.

I'm just thinking from the point of view of simple site navigation. Nothing I'd need an event listener for.

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