|
Pivo posted:I don't understand why so few browsers support text/html in DOMParser. Like bro you're a browser, you had ONE loving JOB. Do you *need* to allow HTML? Can you use Markdown or BBCode instead?
|
# ? Jul 19, 2014 01:04 |
|
|
# ? May 15, 2024 04:22 |
|
daggerdragon posted:Do you *need* to allow HTML? Can you use Markdown or BBCode instead? Yeah our users aren't terribly clever and don't adapt well to change They write blog articles and poo poo, or just copy-paste stuff from the HTML view of a web-based rich text editor. Plus we've already got literally thousands of people with HTML in the DB I was going to suggest it but it just won't work, and we also really don't want to do the round trip to validate the html server-side every single time. It's dumb but that's why I don't like webdev, poo poo like this. It's not like we're allowing too much poo poo right now, parsing it as XML works well enough, we'd just like to parse it as HTML. I think the hidden element thing will probably work, but I hate hacks. Pivo fucked around with this message at 01:10 on Jul 19, 2014 |
# ? Jul 19, 2014 01:06 |
Pivo posted:I don't understand why so few browsers support text/html in DOMParser. Like bro you're a browser, you had ONE loving JOB. Why not give them a WYSIWYG editor so it's more obvious what is allowed (and probably easier to use) and then only sanitize it server side (I use bleach for this)
|
|
# ? Jul 19, 2014 01:10 |
|
fletcher posted:Why not give them a WYSIWYG editor so it's more obvious what is allowed (and probably easier to use) and then only sanitize it server side (I use bleach for this) Yeah we've got CKEditor for some of our bigger editors, but this is like, a title. That only accepts like i, u, a, br. I guess it's an idea, but I loving hate CKEditor. Actually the list of things I don't hate is shorter. We can already sanitize stuff serverside, we want to do it clientside first otherwise we'd do the round trip.
|
# ? Jul 19, 2014 01:15 |
Pivo posted:Yeah we've got CKEditor for some of our bigger editors, but this is like, a title. That only accepts like i, u, a, br. I guess it's an idea, but I loving hate CKEditor. Are you running the validation every keypress or something? Why do you need to do an extra round trip (outside of the one when they click the Save button or whatever).
|
|
# ? Jul 19, 2014 01:19 |
|
fletcher posted:Are you running the validation every keypress or something? Why do you need to do an extra round trip (outside of the one when they click the Save button or whatever). Not every keypress, when a field is unfocused. So if they tab out of a field they get an IMMEDIATE response telling them they hosed up even if they're connecting over satellite from Tuvalu. Honestly we could just do it all serverside, it's just not a popular idea. And my point was that we're literally running in an application whose primary job IS TO PARSE HTML.
|
# ? Jul 19, 2014 01:26 |
|
kedo posted:If I were in your place, I would use WordPress if only because you're "much less proficient with Drupal." Unless you need to secure medical records or something, I can't think of any good reason why you shouldn't use WordPress. I do too. The debate stemmed from the other guy on the team who isn't on the project anymore being positively adamant about using Drupal. He knew as much about using it at the time as I did, his argument boiled down to Drupal is for pros and WP is for babies so we should learn it. My argument was that we don't have the time to waste going from beginners > pros right now and should use the system we know how to work with. That's what I've got to do, with a third of my time at meetings and another third on the School. The new fiscal year started 18 days ago and they created two brand new six figure positions for Internal Communications Directors to push some corporate culture nonsense. Sure would've liked a designer at the very least.
|
# ? Jul 19, 2014 02:48 |
|
whatever so I did the invisible element thing, replaced like a hundred lines of hackery that worked different on all browsers with something that is shorter and is more consistent on all browsers let me know if something sucks here code:
|
# ? Jul 19, 2014 03:57 |
|
Pivo posted:So someone on Freenode suggested sticking it in a hidden element and then doing it that way. It's pretty clever but pretty hackish. Is that how you guys would do it? Pretty much, though I dunno what "hidden" has to do with anything. Make a div element in JavaScript, set its innerHTML, then walk through the div's child nodes and do away with whatever. Then grab the innerHTML when you're done and forget about the div you made. The browser does a great job of parsing HTML, you just gotta feed it right! edit: Didn't see your post there. You've got the right idea but I dunno why you need to use some element already added to the DOM. Just do JavaScript code:
pokeyman fucked around with this message at 04:01 on Jul 19, 2014 |
# ? Jul 19, 2014 03:57 |
|
The gently caress, that works? I'm NOT well-versed in JS. You can just DO that? Why the gently caress were we using DOMParser at all then (and there was an issue: my stupid naive check for script tags would match <i>I wrote a cool script</i>) edit: lulz code:
Pivo fucked around with this message at 04:23 on Jul 19, 2014 |
# ? Jul 19, 2014 04:16 |
|
I need some help on how to start on a project. I don't want to spend weeks researching different tools, languages and frameworks to use, I just want to get started. I don't have much experience in webdev so it's going to be pretty much pointless for me to try and pick a tool, language or framework myself at this stage. I've got an idea for a website, I don't know what it's design will be or how exactly it will work. I'll probably be playing around quite a bit to figure stuff out. It's going to be some kind of price comparison site with comments/forum. It might be structed something like say the Amazon site, where you have different section on the page, the product, details, similar products, and reviews. Your Skill Level: Pretty limited in web development. I have helped out friends in the past on their sites, so I have dabbled with the paypal api, php, mysql, html, css. I mainly have c/c++ experience, but it means I can usually pick up other languages relatively quickly. I'm using windows. So how should I get started?
|
# ? Jul 19, 2014 11:27 |
|
I've got a chunk of text (my name) that I want to stretch 100% across the screen, or whatever container it's in. There's a jquery plugin for this, right? I just can't remember the name.
|
# ? Jul 19, 2014 21:15 |
jackpot posted:I've got a chunk of text (my name) that I want to stretch 100% across the screen, or whatever container it's in. There's a jquery plugin for this, right? I just can't remember the name. http://www.zachleat.com/web/bigtext-makes-text-big/
|
|
# ? Jul 19, 2014 21:18 |
|
FSMC posted:I don't want to spend weeks researching different tools, languages and frameworks to use, I just want to get started. Though you should absolutely expect to spend weeks trying different tools, languages and frameworks. Unless you want to write everything from scratch!
|
# ? Jul 19, 2014 21:43 |
|
My Rhythmic Crotch posted:Webdev is pretty much a fustercluck of different "standards," technologies and languages, so getting started is kind of difficult if your concept is even a little bit fuzzy. If you're making a price comparison site, I would start with that as the core. So you'll probably need to write a scraping script to grab all the prices and stuff that info into a database. Python is a great language for doing things like that. Once you have the scraper and database working, you need a back end to serve it up. This can be done again in Python using something like Flask, or since you have a C/C++ background, you might find it easier to go with Java. If you have some php experience, you can go that route, though I personally hate it. Whatever languages you choose, I would want to the price scraping to be separate and distinct from the back end, so that if one part stops working, at least the other can continue. I probably will spend weeks trying different tools, languages and frameworks at some point. At the moment I won't have a clue what is good and whats crap. I'm basically trying to figure out how my fuzzy concept may work. I'm mainly trying to figure out if the front end, the display and interface, etc. I think at this stage others might be drawing diagrams, using photoshop, etc. Since the concept is very fuzzy, I need to kind of play around with it. I just need someone to tell me what tool, language and framework I need to use. Once I get started I'll start to understand how it all fits together and start looking at the right tools, languages and frameworks. Edit: Re-reading your post, maybe you have explained what I need to do but I don't really understand.
|
# ? Jul 19, 2014 22:50 |
|
At a high level here's how your site would work: 1. You have a scraper of some sort scraping prices from websites and depositing that information in a database. 2. You have a framework of some sort which handles user authentication, mapping database information into HTML templates, abstracting the database, and a hundred other things. 3. You have a web server which the framework communicates with. Using Django in the next few sentences as that's what I've been using a lot lately... For step 1 you write python scripts which download websites and parse data from them. These scripts use Django's ORM to easily deposit the information into your database. For step 2 you write views and templates which hook up your models of the data to HTML the webserver (step 3) can send to the clients. Honestly, you're probably not going to get a good handle on this until you jump in and just do something. The official Django tutorial is good.
|
# ? Jul 20, 2014 03:53 |
|
Thanks! Say you're updating your portfolio site because you're looking for a new job (hypothetically speaking, of course ). Is there a way to block that site from being viewed by anyone on your office network? You wouldn't want to block anyone more than that, obviously - just the occasional curious coworkers who you'd rather not know about it (and obviously this doesn't stop anyone from just picking up their phone and going there, or looking me up at home - that's fine). I know I can use the htaccess file to block a specific IP, but can I block a range of IPs that would represent my company network? Or am I just showing how little I know about all this?
|
# ? Jul 20, 2014 04:07 |
|
Yeah, if you just want to get runs on the board Django and Python is a good way to do it. The language is fairly easy to get a handle on and the framework has been around for years. Between the good tutorials out there, the wealth of Stack Overflow Q&A, and the amount of community add-ons and support available; you should be able to make good progress on the thing you want to build without reinventing the wheel or smashing your head against poorly documented/buggy dependencies. That's not to say you won't have problems, but at least the odds will be stacked as best you can, and then once you've got a little more experience under your belt you can make a more informed decision regarding your technology.
|
# ? Jul 20, 2014 04:09 |
|
jackpot posted:Thanks! You can block ranges, http://stackoverflow.com/questions/18483068/how-to-block-an-ip-address-range-using-the-htaccess-file. You'll have to check what the outgoing IPs are going to be, hopefully they're static at your company.
|
# ? Jul 20, 2014 04:13 |
|
If someone clicks a link to, eg, an .mp4 file, is there any way to force their browser to download it like any other file rather than trying to stream it?
|
# ? Jul 20, 2014 11:29 |
|
fuf posted:If someone clicks a link to, eg, an .mp4 file, is there any way to force their browser to download it like any other file rather than trying to stream it? http://stackoverflow.com/questions/13513420/headers-used-to-download-file-php
|
# ? Jul 20, 2014 12:02 |
|
Thanks, that put me on the right track
|
# ? Jul 20, 2014 12:08 |
|
Or just use <a download href="foo">
|
# ? Jul 20, 2014 13:48 |
|
nice, even better.
|
# ? Jul 20, 2014 13:55 |
|
jackpot posted:Thanks! If you're really worried and there's no benefit to people finding your site organically, I'd suggest just password protecting it and including the credentials on your resume / where ever you share it.
|
# ? Jul 20, 2014 14:33 |
|
Suspicious Dish posted:Or just use <a download href="foo"> IE11 and Safari don't support this yet so the only sure fire way is to some server-side handling. I ran into this making an app to play videos and offer a download link. I think what I'm going to do is add an endpoint to my Restful service that delivers the file as a download for IE and Safari.
|
# ? Jul 20, 2014 17:03 |
The Dave posted:If you're really worried and there's no benefit to people finding your site organically, I'd suggest just password protecting it and including the credentials on your resume / where ever you share it. I also suggest this. It's what I've been doing and have had no problems so far.
|
|
# ? Jul 20, 2014 17:24 |
|
Is this the thread to ask Chrome extension development questions, or should that go in the Javascript thread?
|
# ? Jul 21, 2014 03:51 |
|
Tom Gorman posted:I do too. The debate stemmed from the other guy on the team who isn't on the project anymore being positively adamant about using Drupal. He knew as much about using it at the time as I did, his argument boiled down to Drupal is for pros and WP is for babies so we should learn it. My argument was that we don't have the time to waste going from beginners > pros right now and should use the system we know how to work with. This would be pretty easy to do with Drupal with very few 3rd party modules. quote:Drupal may not be a realistic option. I've only ever designed and built one Drupal theme from scratch and it was garbage. I've never developed a module. The selection of suitable themes isn't as great as what I've scouted for WP. I wouldn't be able to troubleshoot errors well. I have no clue how I would build the Find a Doctor feature. My users are almost entirely tech illiterate 70 year olds and administrative assistants. Drupal would almost certainly confuse the poo poo out of them. I love Drush though. I feel like Drupal would be a safer option. Nobody touches the Drupal sites I've done, but my WP sites are a bitch to fight off attacks and keep up to date. There would be no patient sensitive info on the site, it's goal is marketing and helping patients find providers. Server does not need to have HIPAA compliant levels of security. For themes, I'd first use a starter theme like Zen and develop a subtheme from there (like a child theme in Wordpress). Zen is the de facto starter theme for Drupal beginners. Secondly, I don't think you would need to develop a module at all for this project. What you're looking for is a content type (or profile fields) with the various information on every doctor, a View with exposed filters to sort and navigate through the listing, and probably some small modules to add deep integrations to the metadata to each profile. If you could wrap your mind around Drupal's quirks, this could be a project that, except for the theming section, would take under an hour to set up with dummy data.
|
# ? Jul 21, 2014 12:31 |
|
Came across this link while catching up on Sidebar.io, and it has a lot of very good things people who are into or want to learn about design to read: http://blog.invisionapp.com/reading-list-for-designers/
|
# ? Jul 21, 2014 14:52 |
|
I'm looking to do a little interactivity inside a page. Given a list of items, I'd like to display the 'available' and 'selected' items side by side. This stackexchange post gives the general idea, except that I don't necessarily plan to implement the text search. I'd like each item on the left to have a little arrow button which can be used to move it to the 'Selected' list, and I'd like the little 'x' boxes on the right hand side to remove them (and put them back in the 'Available' list). The context here is an ASP.NET webforms page styled with Bootstrap. What I'd like is for the add/remove methods to trigger code-behind events so that I can modify the actual objects being represented, but I'd like the movement on the page itself to be done client side rather than requesting a new page for each move. I'm assuming that I probably want to go jQuery for the page interactivity, but I'm not sure whether the buttons that jQuery creates will be able to trigger code-behind events. Can someone confirm / deny / point me in a better direction? One idea might be to have both lists there in full (as far as the WebForm is concerned) and use the javascript to hide/reveal them as necessary?
|
# ? Jul 21, 2014 17:44 |
|
Newf posted:I'm looking to do a little interactivity inside a page. Given a list of items, I'd like to display the 'available' and 'selected' items side by side. This stackexchange post gives the general idea, except that I don't necessarily plan to implement the text search. I'd like each item on the left to have a little arrow button which can be used to move it to the 'Selected' list, and I'd like the little 'x' boxes on the right hand side to remove them (and put them back in the 'Available' list). There are a billion ways to handle this, so the best answer I can give you is "it depends". You certainly can do this just with jQuery, and if all you are updating is the "which list" property, you can do it pretty simply. If the only action for each list item, is moving it to the other list, from a UI perspective, have the whole item be the button, and you can not worry about the button / widgets handling clicks. You can then just toggle a class on the item based on which side it's on, and use :after to have a different widget in there. Or even use the ID of the list they are in for that, and skip classes altogether. (it depends!) A jQuery way of doing this would be something along the lines of: HTML code:
JavaScript code:
|
# ? Jul 21, 2014 18:29 |
|
Lumpy posted:Huge Help Haha, you're a beast! Thanks so much. I've never written a line of jQuery and really have only a surface level understanding of css and dom-manipulation. This has saved me a boatload of time. I owe you a coke.
|
# ? Jul 21, 2014 18:52 |
|
I'm having trouble getting SCSS's "image-height" and "image-width" helpers to work in Rails 4. According to the sass_rails documentation, I don't need the image- prefix to use them. However, none of those compile correctly:code:
|
# ? Jul 22, 2014 15:57 |
|
Pollyanna posted:I'm having trouble getting SCSS's "image-height" and "image-width" helpers to work in Rails 4. According to the sass_rails documentation, I don't need the image- prefix to use them. However, none of those compile correctly: Is Compass (compass-sass, I think?) loaded too? It looks like its a Compass specific mixin? http://compass-style.org/reference/compass/helpers/image-dimensions/ I've done very little Rails work so don't know if Compass is part of the default.
|
# ? Jul 22, 2014 16:29 |
|
It's not, and I don't think it works with Foundation, anyway...I think I'll figure out a different approach instead, or just forget about trying to make the background image fully visible all the time. I'll come back to it later. Thanks!
|
# ? Jul 22, 2014 16:44 |
|
Pollyanna posted:It's not, and I don't think it works with Foundation, anyway...I think I'll figure out a different approach instead, or just forget about trying to make the background image fully visible all the time. I'll come back to it later. Thanks! You may want to check out the regular CSS property: "background-size: cover" (http://css-tricks.com/perfect-full-page-background-image/). That may give the functionality you're after? If you need < IE8 support theres a jquery polyfill too (Support info: http://caniuse.com/background-img-opts)
|
# ? Jul 22, 2014 16:50 |
|
Heskie posted:You may want to check out the regular CSS property: "background-size: cover" (http://css-tricks.com/perfect-full-page-background-image/). That may give the functionality you're after? That does more or less cover my needs, but the problem is that the bottom of the image gets cut off once it starts sizing up. Meaning, the height of the div doesn't change, but the image still expands. I need the div of the height to change as well, hence why I wanted to keep a div to a certain aspect ratio. Which involves some sort of padding hackery which makes it look ugly in Foundation. For now, I'll keep it cut off, though. Thanks!
|
# ? Jul 22, 2014 16:53 |
|
Speaking of SASS, you know what's great, that I somehow only just recently discovered? background: rgba($red, 0.85); Where $red equals #d31245, which in rgb is 211 18 69, which I have loving hated having to look up every time in Photoshop until now. God, the variables alone are worth the price of admission, but doing dumbshit calculations like that is icing on the cake.
|
# ? Jul 23, 2014 15:30 |
|
|
# ? May 15, 2024 04:22 |
|
Gonna throw another one out there, just for fun. It's nothing anyone else can't figure out, but if you're new to it you might not be using it yet: $eeny: 37.50em; //600px $meeny: 43.750em; //700px $miny: 50.000em; //800px $mo: 56.250em; //900px etc, etc. Then: $eenymin: "only screen and (min-width:" #{$eeny} ")"; $meenymin: "only screen and (min-width:" #{$meeny} ")"; and $eenymax: "only screen and (max-width:" #{$eeny} ")"; $meenymax: "only screen and (max-width:" #{$meeny} ")"; So that then, to build your media queries all you have to do is: @media #{$minymin} { } I'm sure there's smarter ways to do that, and depending on how you usually have to structure your queries you might want to build it differently (like leaving the "only screen and" out of your variable), but it's a start. It's gotten to the point where if I fire up an old project and see it's not sass, I'm like "gently caress, I hate this."
|
# ? Jul 23, 2014 15:42 |