Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Poo Monst3r;44869778]Yeah I saw this but I wanted a click and dragger, not a scroll wheel.
I'm working on a Mac with a magic mouse and I know how irritating it can be to scroll through stuff like this with the shitty magic mouse.
[editline]21st May 2014[/editline]
I also need accuracy over amount of numbers to scroll through, which the click and drag gives me.
[editline]21st May 2014[/editline]
[URL]http://jsfiddle.net/8mDFc/[/URL][/QUOTE]
There's no native HTML5 stuff for this, but you could use the range input which gives you a visible slider
[URL]http://www.wufoo.com/html5/types/8-range.html[/URL]
You can output the value to a textbox by accessing the value property of the range input
See an example here:
[url]http://jsfiddle.net/9ydGe/1/[/url]
You can customize the range property to have any accuracy you like, and between any range of numbers
I have a bunch of things I want to display in a grid, but I also want them to link to a page with details about that item
the way I'm currently doing this is I have a folder for each item, that looks like
[code]item/thumb.png
item/detail.png
item/fullres.png
item/info.txt[/code]
then for the grid I do
[php]foreach(glob("items/*", GLOB_ONLYDIR) as $item) {
echo "<a href='detail.php?name=" . pathinfo($item, PATHINFO_BASENAME) . "'>
<img src='$item/thumb.png'>
</a>";
}[/php]
so it displays the thumb.png, and links to detail.php?name=name
then on detail.php, I do the same, I link detail.png to full.png, and I also include info.txt, which is pretty much just html snippets
is there a better way to do this? or are there any drawbacks to the way I'm doing this now?
[QUOTE=djjkxbox360;44869857]There's no native HTML5 stuff for this, but you could use the range input which gives you a visible slider
[URL]http://www.wufoo.com/html5/types/8-range.html[/URL]
You can output the value to a textbox by accessing the value property of the range input
See an example here:
[url]http://jsfiddle.net/9ydGe/1/[/url]
You can customize the range property to have any accuracy you like, and between any range of numbers[/QUOTE]
This is a great alternative - but because of the context of the input, there is no room to stick a slider in there with enough width to remain useful.
I really appreciate the responses though, and I could definitely use this slider in another part of the application.
[editline]21st May 2014[/editline]
This also reminded me that I need to make the click and drag obvious to the user. I think I might need to add some sort of tooltip on hover or on click.
[editline]21st May 2014[/editline]
[QUOTE=PortalGod;44869987]I have a bunch of things I want to display in a grid, but I also want them to link to a page with details about that item
the way I'm currently doing this is I have a folder for each item, that looks like
[code]item/thumb.png
item/detail.png
item/fullres.png
item/info.txt[/code]
then for the grid I do
[php]foreach(glob("items/*", GLOB_ONLYDIR) as $item) {
echo "<a href='detail.php?name=" . pathinfo($item, PATHINFO_BASENAME) . "'>
<img src='$item/thumb.png'>
</a>";
}[/php]
so it displays the thumb.png, and links to detail.php?name=name
then on detail.php, I do the same, I link detail.png to full.png, and I also include info.txt, which is pretty much just html snippets
is there a better way to do this? or are there any drawbacks to the way I'm doing this now?[/QUOTE]
Personally, I would usually reference the contents of the folder with a database to make sure everything is as it should be. It really depends on how you're going about putting these things in the folder (is it manual upload via FTP?) and who is going to be looking at it.
If it is a manual FTP process, then I'd say this is the best way to do it.
If you're using a file uploader, I would say tie it to a database.
[QUOTE=Poo Monst3r;44870257]This also reminded me that I need to make the click and drag obvious to the user. I think I might need to add some sort of tooltip on hover or on click.
[/QUOTE]
You can use the [B]cursor:n-resize;[/B] or [B]cursor:e-resize;[/B] CSS property.
[QUOTE=Svenskunganka;44870343]You can use the [B]cursor:n-resize;[/B] or [B]cursor:e-resize;[/B] CSS property.[/QUOTE]
Great idea. Thank you!
[QUOTE=PortalGod;44869987]is there a better way to do this? or are there any drawbacks to the way I'm doing this now?[/QUOTE]
Please make sure to add escaping. File names may contain " as a character; therefore, this code could present a stored XSS vulnerability.
[QUOTE=Alternative Account;44871469]Please make sure to add escaping on File names may contain " as a character, making it possible that this is a persistent XSS vulnerability.[/QUOTE]
files are through ftp only, although I for sure need to check on the get vars in detail.php
[QUOTE=PortalGod;44871485]files are through ftp only, although I for sure need to check on the get vars in detail.php[/QUOTE]
It still might break things if your folder just happens to contain a double quotation mark. Unless it's your intent to insert a valid and safe snippet of HTML into the page, never forget to escape strings when you output them.
[QUOTE=Alternative Account;44871511]It still might break things if your folder just happens to contain a double quotation mark. Unless it's your intent to insert a valid and safe snippet of HTML into the page, never forget to escape strings when you output them.[/QUOTE]
you're right, I don't intend on having any files with quotes but it never hurts, thanks!
Sorry about all of these questions about cryptography but.....
I found a library that actually works ( [url]https://github.com/travist/jsencrypt[/url] ) and everything checks out fine when I encrypt. Its when I come to decrypt at the command line is when I have some issues. My keys are generated EXACTLY how that github page says they should be and for some reason I cant now decrypt what I encrypted in the first place.
I just get this:
[code]
openssl rsautl -decrypt -inkey rsapriv.pem -in encry.ssl -out decrypted.txt
RSA operation error
3074050248:error:0406506C:rsa routines:RSA_EAY_PRIVATE_DECRYPT:data greater than mod len:rsa_eay.c:523:
[/code]
encry.ssl contains the encrypted string that the library generated like so:
[code]
fyLc6Cw9ZjKDtdGaKh4nTRYcGkDV930zyjRHKZeDae+AQzytU7BRKIrPoAdgk6l2Nv0Y7U72GDu4VNrp+ctfNcrQ9wBEzLw4c2gzjXrNrNTYfr3JZLW1t38XaE91lDDsceJ5wg4lm1HAQDb6Dg+XcBbiNzY60R4qo5ASNmITxUw=
[/code]
I dont understand why itd not decrypting properly..
I have heard you should use the same algorithm for decrypting and encrypting, is that true? If so, this is probably the problem im having... Sorry for being utterly clueless, im kinda new to RSA encryption and encryption in general.
You have to use the same algorithm you used to encrypt to decrypt. Think of it like file formats. You can't save a file in one format and try to read it in another.
[QUOTE=KmartSqrl;44878404]You have to use the same algorithm you used to encrypt to decrypt. Think of it like file formats. You can't save a file in one format and try to read it in another.[/QUOTE]
I see! Looks like Il have to do a Node JS implementation of this then. Thanks for the info.
[QUOTE=Chizbang;44878868]I see! Looks like Il have to do a Node JS implementation of this then. Thanks for the info.[/QUOTE]
You shouldn't have to. I don't think any common encryption algorithms are node.js only. Algorithms are not something that are platform bound.
Posting here because I can't find any other answers.
I'm making a new loadingscreen for a gmod server and I'd like to display a bit of information about the player. The server currency is stored in a mysql db with the user identifier being their gmod uniqueid.
My issue is that I'm unsure of how I'd go about converting / getting their uniqueid from what we're given in terms of arguments in sv_loadingurl. I already know how to do all the mysql stuff, don't need any help with that.
[QUOTE=Superburke;44880673]Posting here because I can't find any other answers.
I'm making a new loadingscreen for a gmod server and I'd like to display a bit of information about the player. The server currency is stored in a mysql db with the user identifier being their gmod uniqueid.
My issue is that I'm unsure of how I'd go about converting / getting their uniqueid from what we're given in terms of arguments in sv_loadingurl. I already know how to do all the mysql stuff, don't need any help with that.[/QUOTE]
On line 115 [URL="https://github.com/Svenskunganka/OpenLoad/blob/master/src/core/openload.class.php"]here[/URL] is the method to convert SteamID to UniqueID.
That project is a framework I've made that has all the back-end pre-written, so you can use it if you want.
Project thread: [url]http://facepunch.com/showthread.php?t=1392546[/url]
[QUOTE=Svenskunganka;44880884]On line 115 [URL="https://github.com/Svenskunganka/OpenLoad/blob/master/src/core/openload.class.php"]here[/URL] is the method to convert SteamID to UniqueID.[/QUOTE]
You can link to a certain line by clicking the line number, like [URL="https://github.com/Svenskunganka/OpenLoad/blob/master/src/core/openload.class.php#L115"]this[/URL] :eng101:
[QUOTE=supersnail11;44881109]You can link to a certain line by clicking the line number, like [URL="https://github.com/Svenskunganka/OpenLoad/blob/master/src/core/openload.class.php#L115"]this[/URL] :eng101:[/QUOTE]
Not on the phone app :zoid:
Without using JS is there any way to make the list (C#, C++, Ruby repeated) in the sidebar_item div not overflow it's parent so that it'll scroll? I can set it's height and let the parent change, but then I have to set this for every different sidebar item, only one needs this sort of box. The css is generated by sass so sorry that it's not the easiest to read.
[url]http://jsfiddle.net/r3p6h/[/url]
could do position: aboslute and bottom/left/right 0 and the top to just below the input
[QUOTE=Shadaez;44881519]could do position: aboslute and bottom/left/right 0 and the top to just below the input[/QUOTE]
If I do that then that is no different to just setting its height and having the parent scale is it?
I don't really know what you mean, if you do it with position absolute it will fill the parent 100%, or you could manually set the height to the same as the parent
[QUOTE=Shadaez;44881979]I don't really know what you mean, if you do it with position absolute it will fill the parent 100%, or you could manually set the height to the same as the parent[/QUOTE]
The effect is what I desire, I was hoping for a more generic solution. I meant that by doing that I have a value in css that is based upon the input box, and if I removed that then it'd be wrong.
I've had the same problem before. Instead of having the UL scroll, I just set the scroll to the parent element, but seeing as yours has a input up top it wouldn't really work.
I have a table I'm trying to make editable, contenteditable="true" works great, but I'm trying to style it on focus and in order to style it on focus you need to do [contenteditable="true"]:focus, and set each and every td you want editable to have the attribute... which is a lot and it seems a bit silly. Is there a better way to do this?
[editline]23rd May 2014[/editline]
well, I guess the best way is to just use jquery to set the attribute so that every td doesn't have a ton of extra characters increasing the size of the document
[QUOTE=Shadaez;44887405]I have a table I'm trying to make editable, contenteditable="true" works great, but I'm trying to style it on focus and in order to style it on focus you need to do [contenteditable="true"]:focus, and set each and every td you want editable to have the attribute... which is a lot and it seems a bit silly. Is there a better way to do this?
[editline]23rd May 2014[/editline]
well, I guess the best way is to just use jquery to set the attribute so that every td doesn't have a ton of extra characters increasing the size of the document[/QUOTE]
Jquery or javascript, if you haven't already included jquery you could do it with javascript just as simple
[QUOTE=Shadaez;44887405]I have a table I'm trying to make editable, contenteditable="true" works great, but I'm trying to style it on focus and in order to style it on focus you need to do [contenteditable="true"]:focus, and set each and every td you want editable to have the attribute... which is a lot and it seems a bit silly. Is there a better way to do this?
[editline]23rd May 2014[/editline]
well, I guess the best way is to just use jquery to set the attribute so that every td doesn't have a ton of extra characters increasing the size of the document[/QUOTE]
You don't need to be concerned at all if your web server compresses responses. Repetitive stuff like that compresses very well.
[IMG]http://i.gyazo.com/ea3cf6f8ac25edea319d440e6760c14e.png[/IMG]
So I'm making this e-wallet service for Litecoin (if you haven't heard of it, it's just the same as Bitcoin). I am not really a front-end developer, and I was wondering what you guys would recommend to do to make it this page look a bit more "clean".
a potential employer asked me how / how much I charge? what hsould i do :( i'm thinking between 15-20 hourly
[QUOTE=Shadaez;44891970]a potential employer asked me how / how much I charge? what hsould i do :( i'm thinking between 15-20 hourly[/QUOTE]
$20/hr, minimum.
[QUOTE=BoXHocK;44890359][IMG]http://i.gyazo.com/ea3cf6f8ac25edea319d440e6760c14e.png[/IMG]
So I'm making this e-wallet service for Litecoin (if you haven't heard of it, it's just the same as Bitcoin). I am not really a front-end developer, and I was wondering what you guys would recommend to do to make it this page look a bit more "clean".[/QUOTE]
You should avoid making a web wallet service altogether. They are a recipe for disaster.
You will be responsible for keeping the funds of every user as secure as a bank would keep them. This is an incredibly demanding task, as plenty of things can go wrong: Your service's wallet can get compromised or your server can get manipulated in another way ([url=http://www.wired.com/2013/11/inputs/]which[/url] [url=http://www.slate.com/blogs/moneybox/2014/05/13/doge_vault_hack_millions_of_dogecoin_have_disappeared_from_the_online_wallet.html]happened[/url] [url=https://bitcointalk.org/index.php?topic=576337#post_toc_16]often enough[/url]), insecure means of authentication can lead to users easily getting scammed out of their money or "hacked", and cross-site scripting vulnerabilities can also lead to unrecoverable loss of customer funds. And those are just technical issues. You might also get in trouble with your country's law, for instance.
I've lost about 100 mBTC when inputs.io get hacked. Don't make it easy for other people to lose money this way.
Sorry, you need to Log In to post a reply to this thread.