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.
Yeah, that's fair. As an aside, we pretty much ALWAYS make page sections full width for this reason. If we want to maintain some sort of Grid measure we maintain a Measure Component that handles setting max-width, centering, etc.

We did such on this site: https://archierose.com.au/
code:
<section class="Section bg-grungeTop bg-2">
  <div class="Measure Measure--12col">
     <!-- measure content goes here -->
  </div>
</section>
This works well for mobile as well where you want a minimum padding so you're not up against the edges, while you don't want that padding being used at the max width of the design.

Adbot
ADBOT LOVES YOU

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Head up WordPressers, NextGEN gallery plugin (over a million installs) has an SQL injection exploit.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

Scaramouche posted:

Head up WordPressers, NextGEN gallery plugin (over a million installs) has an SQL injection exploit.

Okay, so much for my "only trusted plugins" motto.

well why not
Feb 10, 2009




Scaramouche posted:

Head up WordPressers, NextGEN gallery plugin (over a million installs) has an SQL injection exploit.

Goddamn do i hate NextGEN, looking forward to gloating about this to my buddy who insists it's good.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

PT6A posted:

Drupal is slightly more powerful than WordPress but still pretty awful to work with.

If you have hosting that can support it, Django is definitely my favourite thing to work with. Very flexible, easy enough to set up, simple to explain to whoever's going to be making edits, and it's easier for me as the designer/developer to control how things end up looking while still allowing the client the ability to change content, since the data is as well-structured as I choose to make it.

Do you need to know Python to work with it?

Can you give some examples of how it works as a CMS?

Thermopyle
Jul 1, 2003

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

Grump posted:

Do you need to know Python to work with it?

Yes.

Grump posted:

Can you give some examples of how it works as a CMS?

Django is more flexible than Wordpress or whatever CMS by virtue of the fact that its not a CMS...it's a tool to build a CMS (or anything really).

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Grump posted:

Do you need to know Python to work with it?

Can you give some examples of how it works as a CMS?

There are a few "big" CMS written in Django if you want to check them out / see what's possible:

https://www.django-cms.org/en/
https://wagtail.io/


I have never used either, so I am not recommending them, I just know they exists.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Well poo poo

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India
If you know PHP there's always Laravel and pretty much every major higher level language has an MVC web framework like Django.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Gmaz posted:

If you know PHP there's always Laravel and pretty much every major higher level language has an MVC web framework like Django.

I've worked with a few PHP-based frameworks now, and I really like Django by comparison. The auth/admin system is way more flexible out of the box than other MVC systems I've worked with, and while it's not a complete CMS out of the box, I don't find it particularly more challenging to get it to a usable point than I would writing, say, a WordPress theme, because you don't have to make as many concessions to how the system wants you to do things. If you're going to build a pure blog, you're probably better off sticking with a more typical CMS (WordPress really isn't bad if all you want is a blog).

huhu
Feb 24, 2006
Anyone care to attempt to sum up restful api in like 2 to 3 sentences? Since I'm self taught I don't know what it is by name but I imagine I've worked with it before. All the definitions I'm finding on the internet are quite extensive.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

huhu posted:

Anyone care to attempt to sum up restful api in like 2 to 3 sentences? Since I'm self taught I don't know what it is by name but I imagine I've worked with it before. All the definitions I'm finding on the internet are quite extensive.

A RESTful API is a theoretical thing that nobody uses in practice as described because once the first requirement change comes in all the crap that would make it actually RESTful gets trashed.

Data Graham
Dec 28, 2009

📈📊🍪😋



Parameterized URLs that directly map to database models, with CRUD operations controlled by appropriate HTTP methods, like GET for read, DELETE for delete, ...

And here's where it gets funky, because do you use POST or PUT to create or update? Are they interchangeable? And what about systems where there is more than one kind of update operation, like one that updates attributes on the object directly and another that creates a child object or a task based on it? And does your client framework actually properly support all those seldom-used methods?

Upshot: I find REST to be a nice idea but an oversimplified model for most real-world applications. Turns out even google's apis tell you to just use POST for operations that should be GETs because fuckit.

ROFLburger
Jan 12, 2006

Data Graham posted:

Turns out even google's apis tell you to just use POST for operations that should be GETs because fuckit.

Which is all well and good until someone flags your PR for using POST when technically your operation is idempotent so perhaps maybe PUT is the better 'fuckit' verb and everyone wastes their time in code review debating which verb is the best to describe your not-exactly-restful request. I guess what I'm saying is that there should be an actual FUCK_IT method.

Rubellavator
Aug 16, 2007

The important thing about REST is delivering you from managing client state in your server.

Munkeymon
Aug 14, 2003

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



Data Graham posted:

Parameterized URLs that directly map to business objects, with CRUD operations controlled by appropriate HTTP methods, like GET for read, DELETE for delete, ...

FTFY. Exposing DB structure on an API just makes it hard as hell to change anything ever.

Data Graham
Dec 28, 2009

📈📊🍪😋



Munkeymon posted:

FTFY. Exposing DB structure on an API just makes it hard as hell to change anything ever.

Yeah, I hemmed/hawed over that, but thought the goal was to be as "what you're actually likely to use the concept for" as possible. This is the kind of thing that makes it hard to read the Wikipedia article and easier to come here to ask wtf REST is instead.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

ROFLburger posted:

I guess what I'm saying is that there should be an actual FUCK_IT method.

I thought that's what POST was...

Dominoes
Sep 20, 2007

Hey dudes. Speaking of POST, how can I send data via POST from javascript to a server (ie Django), without using AJAX? Most search results about javascript or jquery and POST are about AJAX - but I don't want AJAX (I think), since I'm trying to update the web page after sending the request, which AJAX appears not to do.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Dominoes posted:

Hey dudes. Speaking of POST, how can I send data via POST from javascript to a server (ie Django), without using AJAX? Most search results about javascript or jquery and POST are about AJAX - but I don't want AJAX (I think), since I'm trying to update the web page after sending the request, which AJAX appears not to do.

You can either use a callback on the AJAX method the reloads the page (document.location.reload() if I'm not mistaken), or you could use the submit() method on a form that contains the data you want to submit.

Data Graham
Dec 28, 2009

📈📊🍪😋



I mentioned this in the other thread but was phoneposting, so here's a more explicit example.

code:
 $("#ScheduleTraining").click(function () {
        $.ajax({
            method: "POST",
            headers: {"X-CSRFToken": getCookie('csrftoken')},
            url: "/ground-training/",
            data: {type: 'scheduled', selected: findSelected(), date: $('#dateVal').val()},
            success: function() {
                document.location.reload();
            }
        })
});
Is that not working?

Dominoes
Sep 20, 2007

PT6A posted:

You can either use a callback on the AJAX method the reloads the page (document.location.reload() if I'm not mistaken), or you could use the submit() method on a form that contains the data you want to submit.


Data Graham posted:

I mentioned this in the other thread but was phoneposting, so here's a more explicit example.

code:
 $("#ScheduleTraining").click(function () {
        $.ajax({
            method: "POST",
            headers: {"X-CSRFToken": getCookie('csrftoken')},
            url: "/ground-training/",
            data: {type: 'scheduled', selected: findSelected(), date: $('#dateVal').val()},
            success: function() {
                document.location.reload();
            }
        })
});
Is that not working?
Hey, saw and tried your post. Sorry about not getting back to you on it! Correct; not working. Server gets data and can run code on it, but page doesn't update.

camoseven
Dec 30, 2005

RODOLPHONE RINGIN'

Dominoes posted:

Hey, saw and tried your post. Sorry about not getting back to you on it! Correct; not working. Server gets data and can run code on it, but page doesn't update.

We don't know what other thread you're talking about, so maybe post more context here so people can try to help you. It is possible that your server isn't sending a response (or is sending an error code), which would lead to that success function never getting called.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

camoseven posted:

We don't know what other thread you're talking about, so maybe post more context here so people can try to help you. It is possible that your server isn't sending a response (or is sending an error code), which would lead to that success function never getting called.

Or even better, don't post the same question in different threads simultaneously! That way people don't miss out on context and people don't spent time answers something you may have gotten solved 5 minutes ago in "the other thread"

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Lumpy posted:

Or even better, don't post the same question in different threads simultaneously! That way people don't miss out on context and people don't spent time answers something you may have gotten solved 5 minutes ago in "the other thread"

And people don't end up replying with a summary of what someone posted in the other thread in response to the same question because they didn't realize it was the same poster asking the original question in both cases (what I just did -- full credit for the solution goes to Data Graham).

Thermopyle
Jul 1, 2003

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

Dominoes posted:

Hey, saw and tried your post. Sorry about not getting back to you on it! Correct; not working. Server gets data and can run code on it, but page doesn't update.

I've never really wanted to do what I think you're wanting to do, but if you want the same behavior as you'd get as if it was just a regular form the user was clicking the submit button on, you can just create a form and "click" the submit button with JS.

You can even create the form with JS and make it hidden so the user has no idea what you're doing behind the scenes.

edit: I googled "javascript POST form data" and came up with this: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit

Is that what you're wanting?

Dominoes
Sep 20, 2007

You're right; I posted it in the Django thread recently. Not much more context; just looking for a way to send post data to a server, and have it update the page.

Simplified server code explaining the issue; A viewer opens the page, sees 5 rendered in the template. Does something on the page triggering the POST call; server in JS. The server correctly identifies the var change, but 5 is still displayed when I'd like 6.
ie:
Python code:
    myvar = 5
    if request.method == 'POST':
        myvar = request.POST
        print(myvar)  # shows 6, as it should

    render(request, 'template.html', {'myvar': myvar})
edit: Therm - that looks promising! Haven't stumbled across that page yet. Working out how to add the CSRF token to it.

Dominoes fucked around with this message at 21:16 on Mar 3, 2017

Data Graham
Dec 28, 2009

📈📊🍪😋



If you're using AJAX to send the POST, you probably don't want the server to return you another fully rendered full-page template. You want it to send an HTML fragment which you can inject into a structural element in the page, requiring no reloading. (That's kind of the main point of AJAX.) Or else, more elegantly, you can have it send you some simplified structured data (i.e. JSON), which your AJAX call can then easily interpret and do whatever you want, whether it's to reload the entire page (kind of brute force but gets the job done), or to simply rewrite a piece of the HTML with pure JavaScript.

I can write up some examples once I'm off phone.

Thermopyle
Jul 1, 2003

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

Data Graham posted:

If you're using AJAX to send the POST, you probably don't want the server to return you another fully rendered full-page template. You want it to send an HTML fragment which you can inject into a structural element in the page, requiring no reloading. (That's kind of the main point of AJAX.) Or else, more elegantly, you can have it send you some simplified structured data (i.e. JSON), which your AJAX call can then easily interpret and do whatever you want, whether it's to reload the entire page (kind of brute force but gets the job done), or to simply rewrite a piece of the HTML with pure JavaScript.

I can write up some examples once I'm off phone.

He doesn't want AJAX. Or at least thats what he says, but it may be an XY problem.

Dominoes
Sep 20, 2007

IDK what I'm doing, just want to render the form with the new data. In one case, I got around it by modifying the page with Jquery to look like how it would with a refresh (after a DB update). In others, this would get complicated.

Normal POST requests, like with forms, work as expected. However, I'm using things that aren't forms.

AJAX requests somehow bypass the normal MVC process. ?


Therm - I think your solution should work, but I'm still working on the CSRF validation.

Dominoes fucked around with this message at 01:07 on Mar 4, 2017

Thermopyle
Jul 1, 2003

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

Dominoes posted:

IDK what I'm doing, just want to render the form with the new data. In one case, I got around it by modifying the page with Jquery to look like how it would with a refresh (after a DB update). In others, I need to fully refresh the page to show DB changes.

Normal post requests, like with forms, work as expected. I can't use forms for many things.

AJAX requests somehow bypass the normal MVC process. ?

You can just have your view return an HTML snippet to an AJAX request, and then use javascript/jquery to insert that HTML snippet into the page. Page never refreshes, but it updates with new information. This is the best way if you're using js anyway.

Dominoes posted:

Therm - I think your solution should work, but I'm still working on the CSRF validation.

You have to put the CSRF token in the page somewhere. You can even dump it right in your script in the template. like if you're doing AJAX:

code:
$.ajax({
    data: {
        somedata: 'somedata',
        moredata: 'moredata',
        csrfmiddlewaretoken: '{{ csrf_token }}'
    }

Thermopyle fucked around with this message at 01:09 on Mar 4, 2017

huhu
Feb 24, 2006
I'm reading a (the) Flask tutorial and it talks about setting up a login form with OpenID. I have a system that I'd like to let ~5 people login to view some data and lock it from others. Is OpenID the easiest way to go for this? What other common method(s) exist?

Thermopyle
Jul 1, 2003

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

huhu posted:

I'm reading a (the) Flask tutorial and it talks about setting up a login form with OpenID. I have a system that I'd like to let ~5 people login to view some data and lock it from others. Is OpenID the easiest way to go for this? What other common method(s) exist?

For 5 people just use whatever Flask's default auth mechanism is with user/pass.

Data Graham
Dec 28, 2009

📈📊🍪😋



Dominoes posted:

IDK what I'm doing, just want to render the form with the new data. In one case, I got around it by modifying the page with Jquery to look like how it would with a refresh (after a DB update). In others, this would get complicated.

Normal POST requests, like with forms, work as expected. However, I'm using things that aren't forms.

AJAX requests somehow bypass the normal MVC process. ?


Therm - I think your solution should work, but I'm still working on the CSRF validation.

Yes, you can think of AJAX as a way to bypass the MVC structure, in that its whole purpose is that it allows you to break free of the "load a page, submit a form, load a whole resulting page" progression and create a more seamless, "desktop app" -like user experience. Basically it means you can repaint just certain parts of your page instead of loading a whole new page every time you do something. This is what people mean by a "single page app".

Here's how I would do this:

On the Django side, instead of returning an HTML page, return a bit of JSON:

code:
from django.http import JsonResponse

    if request.method == 'POST':
        myvar = request.POST
        ... process the posted data, save to your model, etc

        return JsonResponse({
            'success': True,
            'myvar': myvar,
        })
Then in your JavaScript, send your POST request with an expectation of receiving JSON data, and then act on it accordingly:

code:
 $("#ScheduleTraining").click(function () {
        $.ajax({
            method: "POST",
            headers: {"X-CSRFToken": getCookie('csrftoken')},
            url: "/ground-training/",
            data: {type: 'scheduled', selected: findSelected(), date: $('#dateVal').val()},
            dataType: 'json',
            success: function(data) {
                if (data.success) {
                    // Assuming you have an HTML element called "myvar" that shows the value of that variable, you can 
                    // set it via jQuery right here. This is seamless and doesn't require any page reloading.
                    $('#myvar').val(data.myvar);
                } else {
                    // If you set 'success' to False on the server, like if you're trapping for an error condition,
                    // you could catch that here and display a message (also set server-side):
                    alert(data.message);
                }
            }
        })
});
And remember, in your success: function you can always put debug statements, like "console.print(data);" to see what you're getting back from the server. Open up the dev tools and watch the console.

But yeah, it's still not totally clear why AJAX is even involved here. It sounds like you just have a regular form you want to submit the traditional full-page way, and the whole single-page experience thing isn't really your goal. What's preventing you from doing that? Do you have to manipulate the form data on the client side before you submit it? Because that can be done without AJAX:

code:
<form id="schedule_form" method="POST" action="/ground-training/">
<!-- If this is a Django template you can just use {% csrf_token %} to embed this -->
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<input type="hidden" name="type" value="scheduled" />
<input type="hidden" name="selected" id="selected" value="" />
</form>

$("#ScheduleTraining").click(function () {
    ... mangle your data here
    $('#selected').val(findSelected());

    $('#schedule_form').submit();
 });
And there are other ways to serialize the form data in JS if you want to avoid using hidden form fields as temporary data storage, but that's really just up to personal taste.

No Gravitas
Jun 12, 2013

by FactsAreUseless
Here's a really silly problem. I feel like I almost have it, but it is 2AM and my brain is no longer working.

I want:
- To have a box of a flexible horizontal size, up a maximum.
- With borders.
- Within the box I want to have:
-- Some preformatted text.
-- Which is zebra striped.
-- Which has line numbers.
-- Which can be longer than the maximum allowed horizontal space in the box, making the box get a scrollbar when this happens, but only when required.

I actually have accomplished everything in CSS, except one ugly thing.

When I scroll the box, the background slides to the left, leaving me with text on a white background. I'd fake it somehow, but that clashes with the zebra striping.

I can post a sample of my problem tomorrow, but I have hacked things up to bits so much that I don't think it would be helpful. I think a start from scratch would be a good way about it. Any ideas?

No Gravitas fucked around with this message at 11:35 on Mar 4, 2017

Data Graham
Dec 28, 2009

📈📊🍪😋



No Gravitas posted:

Here's a really silly problem. I feel like I almost have it, but it is 2AM and my brain is no longer working.

I want:
- To have a box of a flexible horizontal size, up a maximum.
- With borders.
- Within the box I want to have:
-- Some preformatted text.
-- Which is zebra striped.
-- Which has line numbers.
-- Which can be longer than the maximum allowed horizontal space in the box, making the box get a scrollbar when this happens, but only when required.

I actually have accomplished everything in CSS, except one ugly thing.

When I scroll the box, the background slides to the left, leaving me with text on a white background. I'd fake it somehow, but that clashes with the zebra striping.

I can post a sample of my problem tomorrow, but I have hacked things up to bits so much that I don't think it would be helpful. I think a start from scratch would be a good way about it. Any ideas?

How are you doing the zebra striping? What's your CSS for it?

No Gravitas
Jun 12, 2013

by FactsAreUseless

Data Graham posted:

How are you doing the zebra striping? What's your CSS for it?

Here's an approximation of what I was doing, stripped of all the irrelevant detail.

https://jsfiddle.net/zjLqe1ph/

I have no idea what I'm doing, so it is likely really messed up.

Scroll to the right to see the background slide away to the left.

Dominoes
Sep 20, 2007

Data, Therm, Thanks a lot for the help with Django/POST!

Thermopyle posted:

You can just have your view return an HTML snippet to an AJAX request, and then use javascript/jquery to insert that HTML snippet into the page. Page never refreshes, but it updates with new information. This is the best way if you're using js anyway.
Sounds neat!

quote:

You have to put the CSRF token in the page somewhere. You can even dump it right in your script in the template. like if you're doing AJAX:

code:
$.ajax({
    data: {
        somedata: 'somedata',
        moredata: 'moredata',
        csrfmiddlewaretoken: '{{ csrf_token }}'
    }
I've got CSRF with AJAX working using code similar to what you posted; just can't get it working with the fake-form-posting. Using the main Goog results breaks the form variable, ie it no longer has actions 'submit', etc after I insert the token.

Data Graham posted:

Yes, you can think of AJAX as a way to bypass the MVC structure, in that its whole purpose is that it allows you to break free of the "load a page, submit a form, load a whole resulting page" progression and create a more seamless, "desktop app" -like user experience. Basically it means you can repaint just certain parts of your page instead of loading a whole new page every time you do something. This is what people mean by a "single page app".

Here's how I would do this:

On the Django side, instead of returning an HTML page, return a bit of JSON:

code:
from django.http import JsonResponse

    if request.method == 'POST':
        myvar = request.POST
        ... process the posted data, save to your model, etc

        return JsonResponse({
            'success': True,
            'myvar': myvar,
        })
Then in your JavaScript, send your POST request with an expectation of receiving JSON data, and then act on it accordingly:

code:
 $("#ScheduleTraining").click(function () {
        $.ajax({
            method: "POST",
            headers: {"X-CSRFToken": getCookie('csrftoken')},
            url: "/ground-training/",
            data: {type: 'scheduled', selected: findSelected(), date: $('#dateVal').val()},
            dataType: 'json',
            success: function(data) {
                if (data.success) {
                    // Assuming you have an HTML element called "myvar" that shows the value of that variable, you can 
                    // set it via jQuery right here. This is seamless and doesn't require any page reloading.
                    $('#myvar').val(data.myvar);
                } else {
                    // If you set 'success' to False on the server, like if you're trapping for an error condition,
                    // you could catch that here and display a message (also set server-side):
                    alert(data.message);
                }
            }
        })
});
And remember, in your success: function you can always put debug statements, like "console.print(data);" to see what you're getting back from the server. Open up the dev tools and watch the console.
Going to have to use this later. Seems like there's a spectrum of how much to handle these things: Full refresh if most of your page changes (The case that was bothering me here), JS-mockup after sending AJAX if only a little changes. What you posted sounds perfect for an in-between scenario; didn't know I could do that, and it also led me to Django's JSON serialization docs, which I've already started using elsewhere... very useful for passing models etc into JS. And another approach, if the DB's not updated mid-process: Rewrite server-side code in JS.

quote:

But yeah, it's still not totally clear why AJAX is even involved here. It sounds like you just have a regular form you want to submit the traditional full-page way, and the whole single-page experience thing isn't really your goal. What's preventing you from doing that? Do you have to manipulate the form data on the client side before you submit it? Because that can be done without AJAX:

code:
<form id="schedule_form" method="POST" action="/ground-training/">
<!-- If this is a Django template you can just use {% csrf_token %} to embed this -->
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<input type="hidden" name="type" value="scheduled" />
<input type="hidden" name="selected" id="selected" value="" />
</form>

$("#ScheduleTraining").click(function () {
    ... mangle your data here
    $('#selected').val(findSelected());

    $('#schedule_form').submit();
 });
Sick; going to give that a shot. For now, I turned the form in question into a Django form, added a submit button, and let it do its thing there. Another thing I noticed by accident: If a button's type is left unspecified, it defaults to 'submit', so even the button actually triggers an AJAX call, the page will refresh. Seems hacky though; I like your approach better.

Throughout this, I'm impressed by how versatile JQuery is.

Dominoes fucked around with this message at 22:48 on Mar 4, 2017

Data Graham
Dec 28, 2009

📈📊🍪😋



Dominoes posted:

Sick; going to give that a shot. For now, I turned the form in question into a Django form, added a submit button, and let it do its thing there. Another thing I noticed by accident: If a button's type is left unspecified, it defaults to 'submit', so even the button actually triggers an AJAX call, the page will refresh. Seems hacky though; I like your approach better.

Yeah, that's a common gotcha. You can either set the button's type to "button" to prevent the default submit behavior, or another way is to put a preventDefault() on the click event.

Data Graham fucked around with this message at 00:15 on Mar 5, 2017

Adbot
ADBOT LOVES YOU

Data Graham
Dec 28, 2009

📈📊🍪😋



No Gravitas posted:

Here's an approximation of what I was doing, stripped of all the irrelevant detail.

https://jsfiddle.net/zjLqe1ph/

I have no idea what I'm doing, so it is likely really messed up.

Scroll to the right to see the background slide away to the left.

Try this:

code:
code {display: table-row;}
This'll probably add some unwanted margins to your pre tags, so use "pre {margin: 5px 0px;}" or some such to set that to your liking.

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