|
Thanks for the Drupal help on the last page. Since then ive found a way to get the breadcrumbs displaying. I asked in the general thread but it doesn't hurt to have this floating out there. One of our server farms at MediaTemple went down around noon today and right now their support has no ETA. Our boss is a little pissed.... We host all our regular sites on Rackspace which is great but they do not have Mercurial setup (as far as I know). MediaTemple was essentially our development server (which is still up) but we had this other thing setup for a side-project. Does anyone know of any other hosts that allow Mercurial for keeping track of things? We also use BitBucket for our own records too. But MT was all development. (( Im actually using MediaTemple for my buddies site that he is getting me to help him out with with and its pretty good, admin stuff is pretty straight forward too ))
|
# ? May 5, 2015 21:28 |
|
|
# ? May 11, 2024 14:06 |
|
Karthe posted:What's the best Angular-centric way of storing an auth token for API calls? I have an API up and running and handling logins, but now I need to write up a service to handle logging in and verifying the token is available. Should I just use plain HTML5 localstorage? You can use a module like angular-local-storage to deal with the localstorage or cookie fallback issue for you. There's also angularLocalStorage if you prefer camelcase. ngStorage is also an option if you don't want a cookie fallback. Spraynard Kruger fucked around with this message at 22:04 on May 5, 2015 |
# ? May 5, 2015 22:01 |
|
Vintersorg posted:Thanks for the Drupal help on the last page. Since then ive found a way to get the breadcrumbs displaying. I host on rackspace and we use mercurial. I just apt-get installed it. Obviously if you have one of those cloud site things I don't think you can do that, but if you have a shell, just slap in on there.
|
# ? May 6, 2015 04:43 |
Is it acceptable to have the following, from an accessibility point of view (note this is just a demonstration, I am not concerned with HTML structure or element choice)code:
|
|
# ? May 6, 2015 14:50 |
You're going to want to handle your localization server-side
|
|
# ? May 6, 2015 15:17 |
|
I'm writing my first serious Angular SPA using the NGBoilerplate style as the foundation and I need help figuring out how to access constants defined in one module from another module. Basically, I want to access the USER_ROLES constant defined in my main module from another module. Here's my main module code:
code:
quote:Error: [$injector:unpr] Unknown provider: USER_ROLES Then I tried adding USER_ROLES followed by webapp-client.USER_ROLES into webapp-home's dependencies when I declared the module but those just produced similar errors: quote:Error: [$injector:nomod] Module 'USER_ROLES' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. I thought it would be as easy as passing in dependencies into a Controller but it turns out it isn't quite so simple. What am I doing wrong?
|
# ? May 6, 2015 17:36 |
|
Ugh, another http/s question. Client just sent out an email with a whole bunch of http rather than https images in it. Gmail is throwing a wobbly and refusing to load the images. I fixed this previously by simply changing all of the image sources to https, but the client sent out the wrong version. As a temporary fix, how can I adjust my htaccess to allow both http and https images to function? Here's what I have currently: code:
|
# ? May 6, 2015 19:21 |
|
Karthe posted:I thought it would be as easy as passing in dependencies into a Controller but it turns out it isn't quite so simple. What am I doing wrong? I can see a couple things, you're declaring the constants as part of the 'webapp-client' module, but then you're not including it as a dependency as your 'webapp-home' module. It should be in that array with 'ui.router'. Second, the config function is special and only takes providers, not constants or factories or anything else. Here's a handy comparison, see the "configurable" column: https://gist.github.com/demisx/9605099
|
# ? May 6, 2015 21:01 |
down with slavery posted:You're going to want to handle your localization server-side ugh i am you intolerable poo. That's not the question I asked
|
|
# ? May 7, 2015 08:59 |
|
o.m. 94 posted:ugh i am you intolerable poo. That's not the question I asked A duplicate lang attribute shouldn't really hurt anything, but why are you serving multiple language versions of the same element in the first place? If you handle localization server-side, you set the language attribute on the html element and then only serve the appropriate language version of your content. In that case you shouldn't end up dealing with duplicate lang attributes to begin with. Edit: Upon rereading your original post, I think you are trying to say that you are serving a page where not all the content may have a French translation, and in cases where it doesn't, it defaults to English. Your example is somewhat confusing in that case, as you included two <h2> elements which suggests you're serving both versions at the same time, and you also wouldn't have a French text appear in a page set to English. If this is the case, you apparently have some server-side logic that grabs the English content whenever a French translation is unavailable. It should not be too hard to modify that logic to add an appropriate lang attribute in cases where it does, which seems more efficient and a better way of doing things than always setting the lang attribute on everything. Leshy fucked around with this message at 09:49 on May 7, 2015 |
# ? May 7, 2015 09:37 |
|
o.m. 94 posted:you intolerable poo. Brutal.
|
# ? May 7, 2015 11:04 |
|
Jabor posted:You are actually checking the recaptcha token on the server to verify that it's been filled out, right? The client-side checks are just there for convenience, they don't provide any actual security. Yes, I was both checking the response existed and that it was valid. hayden. posted:Possibly worth making your own simple captcha? I doubt spammers would customize their software to work with your site specifically. Had better luck implementing a simple hidden checkbox honeypot, seems to have done a better job
|
# ? May 7, 2015 16:26 |
|
Long shot but does anyone happen to know anything about the UK Data Protection Act and the Prudential Regulation Authority requirements for data storage? Basically I need to know if the database contents need to be encrypted or not. I'm finding it surprisingly hard to google. fuf fucked around with this message at 16:58 on May 7, 2015 |
# ? May 7, 2015 16:43 |
|
Lumpy posted:I host on rackspace and we use mercurial. I just apt-get installed it. Obviously if you have one of those cloud site things I don't think you can do that, but if you have a shell, just slap in on there. Ah poo poo, that might be it. We have cloud hosting for all our live sites.
|
# ? May 7, 2015 21:40 |
Leshy posted:If this is the case, you apparently have some server-side logic that grabs the English content whenever a French translation is unavailable. It should not be too hard to modify that logic to add an appropriate lang attribute in cases where it does, which seems more efficient and a better way of doing things than always setting the lang attribute on everything. Indeed; and on further thought I apologise to not coming to this conclusion earlier... I was being lazy and seeing if I could just paint every result with a lang attribute but the correct logic is pretty straightforward as you say, thanks!
|
|
# ? May 8, 2015 11:15 |
|
What are some other good CSS inspiration sites like Codrops?
|
# ? May 8, 2015 16:14 |
|
nevermind. it was depressing to think about.
me your dad fucked around with this message at 05:07 on May 10, 2015 |
# ? May 9, 2015 21:27 |
|
My blog engine renders its RSS feed at an address I'd rather not use, but I can't find anywhere in its source code to change it. I know it must be in there, but I've been digging at it for days. Is just using .htaccess to fake its location possible? The URL is: site.com/rss/1 And I'd like it to be: site.com/rss But when I put this in my .htaccess, nothing changes: RewriteEngine On RewriteRule ^rss$ rss/1 [NC,L] Any ideas? I don't really understand .htaccess.
|
# ? May 10, 2015 09:20 |
|
Karthe posted:I'm writing my first serious Angular SPA using the NGBoilerplate style as the foundation and I need help figuring out how to access constants defined in one module from another module. Basically, I want to access the USER_ROLES constant defined in my main module from another module. The problem is you're trying to access a link-time constant at compile-time (the config method happens before linking). What you're looking for instead of data is "resolve": https://github.com/angular-ui/ui-router/wiki#resolve So what you'd want to do is something like: code:
code:
Side note: Keep in mind that if you're going to minify your JS, you should be using the string dependency injection style (see https://docs.angularjs.org/guide/di) for Angular
|
# ? May 10, 2015 12:08 |
|
Silvah posted:The problem is you're trying to access a link-time constant at compile-time (the config method happens before linking). What you're looking for instead of data is "resolve": https://github.com/angular-ui/ui-router/wiki#resolve On a related note, is there a better way of including authenticated/authorization checks than to include this block of code at the top of every controller? code:
IAmKale fucked around with this message at 01:02 on May 11, 2015 |
# ? May 10, 2015 19:37 |
|
Karthe posted:Thanks for the tip, that makes sense and worked perfectly when I tweaked my code. Yes, since you're using ui-router, you can utilize the $stateChangeStart event, just bind a handler for it to $rootScope in your main application module's run and call event.preventDefault(); to cancel the state change if the authentication fails. (the first argument in a handler callback is always the event). code:
I did some work on this, just messing around, maybe it will be a starting point for you to see if you can get it to behave how you want: http://codepen.io/hsrob/pen/xGZzQv EDIT: I forked and modified the CodePen to show you what it would look like using data http://codepen.io/hsrob/pen/doGjGp Silvah fucked around with this message at 13:52 on May 11, 2015 |
# ? May 11, 2015 13:36 |
|
What's a good parallax scrolling plugin? I've tried https://github.com/Prinzhorn/skrollr (couldn't get scrolling to work on mobile) and https://github.com/markdalgleish/stellar.js (looks bad on mobile and is buggy) (posted in javascript thread but I think I should have posted it here)
|
# ? May 11, 2015 18:05 |
|
fuf posted:What's a good parallax scrolling plugin? Is there a reason you're after a plugin specifically, instead of just doing things with pure CSS?
|
# ? May 11, 2015 18:18 |
|
Silvah posted:If you want to avoid putting that block in every controller, you're probably better off overall just using strings and the data declarations in your states, rather than trying to inject the USER_ROLES constants at link-time. Now I have a Bootstrap problem. I'm creating a user portal that will hide some options based on the user's current role. I'm using this basic layout right now to present two options per row, up to however many options might be made available in the future: code:
|
# ? May 11, 2015 22:25 |
|
Karthe posted:Unfortunately, if the Option2 is hidden because the user isn't authorized, the first item still sits off to the side instead of (ideally) expanding to fill up the whole space. Is there anything I can study up on that will help me figure out how to get the first column to expand into the entire available space if the second option is hidden? Should I just switch out classes if the auth check fails? Recommended reading here would be about Bootstrap's grid system. There are 12 fixed columns per row in Bootstrap, so a col-md-6 won't expand to a col-md-12 automatically. But, since you have Angular, you can wire up an ngClass directive to change the class on the first column from col-md-6 to col-md-12 when the user is not properly authorized. Also, instead of an ngShow for the second portion, you would probably be better off with an ngIf. This will remove the element from the DOM entirely, so an unauthorized user can't just go and unhide it (though it's still not ideal, from a security perspective).
|
# ? May 11, 2015 22:41 |
|
Spraynard Kruger posted:Is there a reason you're after a plugin specifically, instead of just doing things with pure CSS? Thanks. I spent ages on this today but I couldn't get background images to move in the same way on Firefox and Chrome unfortunately. I ended up using https://github.com/janpaepke/ScrollMagic .
|
# ? May 12, 2015 18:10 |
Please forgive the extremely basic question, I actually have been googling this for a while and I'm having a hard time figuring out what the issue is. I'm attempting to make a very basic navigation bar. After following a tutorial I have created a list that functions as a navigation bar, here is the code for it: code:
code:
My other problem is that I'm trying to insert an overall website title within the nav-bar on the left side, that isn't a link. Can't seem to figure out how to do this, although I think it is the same solution as my first problem (creating an id/class for the website title list item within the nav-bar). Also, I'm trying to center the nav-bar and it seems if I change float: left to float:center it just breaks the navigation bar instead of centering it on the page like I would like, and adding align="center" to the <ul> element does nothing. Sorry for the rudimentary questions, if anyone has the time to help me out, I would really appreciate it. denzelcurrypower fucked around with this message at 05:48 on May 13, 2015 |
|
# ? May 13, 2015 05:32 |
First thing is that you want #nav li.home rather than #nav .home li
|
|
# ? May 13, 2015 06:13 |
|
Your selector should be li.home. If I guess correctly, this still won't work as a is more specific. Change your css rule to li.home a.
|
# ? May 13, 2015 06:17 |
|
MoosetheMooche posted:Sorry for the rudimentary questions, if anyone has the time to help me out, I would really appreciate it. First of all, do not use # (ids) for styling CSS, only classes. This makes it easier to avoid specificity issues where some CSS takes priority over other CSS. It is a good practice to adopt and you should do this. Second, don't use floats. While powerful, they lead to all sorts of messy situations that can be tricky to deal with. The float: left; on your <ul> prevents it from centering, for example. By setting display: table; and margin: 0 auto; instead, you are essentially saying "Make this a block as wide as it needs to be" and "I want an automatic equal margin on the left and right", which centers your menu. You can then make the <li> elements line up horizontally by either setting them to display: inline-block or display: table-cell. Since we set the <ul> to display: table, I've gone with the latter. These things will make your menu center nicely. Your next question was how to prevent the link to the current page from being a link: The short answer is that you can't. At least, not with HTML/CSS. You can do it with things like PHP or JavaScript, but you really shouldn't bother. You could style the link so that it does not appear to be one and have the cursor not change upon hovering over it, but best practice is to apply a class, such as .active, to the link and style it in such a way that the user can see that they are currently on that page and have them decide whether they want to click it or not. You could, as I have done in the Codepen, not apply the :hover effect to the active link to give some extra indication that you do not need to go there. And your last question was how to add a website title to the menu that isn't a link. This is easy enough by simply adding a <li> that contains a <h1> or something instead of an <a>, but... you should not have the website title in the menu bar, right next to a link saying "Home". People are pretty accustomed to being able to click on a website title or logo to go back to the homepage, so if you add the website title to the menu, get rid of the "Home" link, and make the title link to the homepage. I have done this in the Codepen. Hope this helps! Edit: Fixed the link and removed something that wasn't really necessary. Leshy fucked around with this message at 12:08 on May 13, 2015 |
# ? May 13, 2015 10:30 |
|
MoosetheMooche posted:Sorry for the rudimentary questions, if anyone has the time to help me out, I would really appreciate it. Let's expands on Leshy's approach: http://codepen.io/anon/pen/RPaoqa You'll notice we're using a fixed size some-container, which is just a placeholder for the rest of your website for which this menu sits inside. .menu The menu itself is now set to expand to width: 100%, so it grows to fit whatever its container is. You can specify a fixed size if you desire. The box-sizing has been switched to border-box to prevent the borders of the elements within the menu from adding to the width of the menu. Without this setting, the border add to the width and it no longer fits the container. .menu a All left and right padding has been removed from these elements. The width of the a grows to fill the cell because of display: block, and the width of the cell is determined as a property of .menu li having display: table-cell;, making it function exactly like a table. I've moved the "home" class onto the <li>, so I can affect the width of this particular cell. Using .menu .home I've modified the width to width: 20%;, giving the other menu items a bit more room. Just like .menu a, for .menu .home a I've removed the horizontal padding so this is no longer a factor when calculating width. You'll notice that Bio/Contact's cell is a little wider than everything else. This is because when you use table-cell the width is weighted according to the cell content. In this case, "Bio/Contact" is the longest text item, so it gets a slightly bigger cell. If you want your menu item widths to be the same, you need to apply a width to .menu li. Assuming you still want .home to be 20%, this would be 26.66% ((100 - 20) / 3 = 26.66) As an exercise for you, notice what happens when you bring the container size down to below 400px. You'll run into similar issues if you add another item to your menu, as you'll need more horizontal space. Obviously you'd never design a website with a body container that's too small for your menu, but what if the user resizes their browser, and you, being a good developer, have designed your site to horizontally scale to allow that? Well, you can use Media Queries to detect certain widths of the browser, and apply additional CSS rules when that occurs. You could easily add a media query which changes your menu li's from table-cell to block, and give the anchors 100% width. This would then give you a simple stack of vertical menu items, and no horizontal space issues - perfect for a mobile user!
|
# ? May 13, 2015 13:24 |
Wow, this is way more help and information than I could have hoped for and in such a short period of time. I just woke up so I'm going to spend the day checking out the code and suggestions you guys have posted for me. Just wanted to say thanks, it really seems like a great community in this sub forum. e: While I'm here, is it good practice to keep css style info in an external file or is including it in every sub-page of the website a good idea? Since it's a fairly basic website with just a nav-bar and writing I'm thinking an external style page would be good to keep the code looking neater but if I'm wrong please let me know! Also, is there a good program for design/code view like that website you guys linked to? I've been using Dreamweaver but it seems to do some wonky stuff and I have to manually click refresh every time I make a change which kind of ruins the whole point of the thing (convenience). - Doesn't the some-container actually make it more difficult for a browser to resize the website? It seems like I have to put in a set resolution that the page will display as instead of having it adapt to my browser like it would normally. For example you have set the resolution to 800x400 which only looks right if I have my browser window quite small. Is it a necessity to use Media Queries when I nest the menu/website in a container? denzelcurrypower fucked around with this message at 18:05 on May 13, 2015 |
|
# ? May 13, 2015 17:13 |
|
MoosetheMooche posted:Wow, this is way more help and information than I could have hoped for and in such a short period of time. I just woke up so I'm going to spend the day checking out the code and suggestions you guys have posted for me. Just wanted to say thanks, it really seems like a great community in this sub forum. MoosetheMooche posted:e: While I'm here, is it good practice to keep css style info in an external file or is including it in every sub-page of the website a good idea? Since it's a fairly basic website with just a nav-bar and writing I'm thinking an external style page would be good to keep the code looking neater but if I'm wrong please let me know! MoosetheMooche posted:Also, is there a good program for design/code view like that website you guys linked to? I've been using Dreamweaver but it seems to do some wonky stuff and I have to manually click refresh every time I make a change which kind of ruins the whole point of the thing (convenience). MoosetheMooche posted:Doesn't the some-container actually make it more difficult for a browser to resize the website? It seems like I have to put in a set resolution that the page will display as instead of having it adapt to my browser like it would normally. For example you have set the resolution to 800x400 which only looks right if I have my browser window quite small. Is it a necessity to use Media Queries when I nest the menu/website in a container?
|
# ? May 13, 2015 19:04 |
|
MoosetheMooche posted:Also, is there a good program for design/code view like that website you guys linked to? I've been using Dreamweaver When you're fighting "weird poo poo" happening to your design, rather than editing a line and F5'ing to try the change, you can use something like Chrome dev tools (hit F12) to inspect the HTML, CSS and Scripts on a page. You can then make minor modifications and try to hunt down whatever it is that's causing the problem. If you get good with it, you can even edit your local files through Chrome. Take a look at the workflow documentation for Chrome Dev Tools: https://developer.chrome.com/devtools/docs/authoring-development-workflow
|
# ? May 14, 2015 00:20 |
|
Javascript thread cross post: I'm trying to create a page where users can log in with their tumblr account and fill out a form to post to their blog. I'm using hello.js with the tumblr module. I've modified the tumblr module demo and everything seems to be working in terms of logging in and authenticating. However, I'm unable to convince the API to let me use any OAUTH-restricted POST commands. GET commands, such as retrieving a user's followed blogs, work fine. But if I try something simple such as user/follow to follow a new blog, I get a "401 Not Authorized" response. What could be causing OAUTH restricted GET commands to be working fine, but POST does not? You can see my testing code live at http://www.jereddanielson.com/testing/tumblr/hello.js-master/demos/tumblr.html Below is the pertinent javascript. I'm using the OAUTH proxy at https://auth-server.herokuapp.com/ code:
|
# ? May 14, 2015 02:30 |
|
I need to arrange some up/down/left/right buttons on a bootstrap site. Does using a table to do this make me a horrible monster? e: also are those svgs sensible? Newf fucked around with this message at 14:16 on May 14, 2015 |
# ? May 14, 2015 14:11 |
|
I've got to build something fast and easy to administer by the user - help me fill in the blanks. Wordpress, Squarespace, ________. Just looking for new options. Something with smart templates being sold, and something that'll let me edit the css. Thoughts?
|
# ? May 14, 2015 14:56 |
|
Wagtail is super interesting, if you use Django.
|
# ? May 14, 2015 15:50 |
|
I have two ng-repeats, one nested inside the other. How can I get the parent ng-repeat's $index from within the child ng-repeat?code:
|
# ? May 14, 2015 19:59 |
|
|
# ? May 11, 2024 14:06 |
Karthe posted:I have two ng-repeats, one nested inside the other. How can I get the parent ng-repeat's $index from within the child ng-repeat?
|
|
# ? May 14, 2015 20:03 |