• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics in ~comp with the tag "javascript". Back to normal view / Search all groups
    1. Need a simple way to password protect a webpage

      Hey Tildes! I've got a static, basic website, HTML and CSS. It's one page only. But I'd like to create a second page with some more private content that is password protected. I know that I can...

      Hey Tildes!

      I've got a static, basic website, HTML and CSS. It's one page only. But I'd like to create a second page with some more private content that is password protected.

      I know that I can accomplish this via .htaccess but what I don't like about this method is that when the user navigates to the page, they get a pop up asking for a username and password. What I would like is having the user navigate to the page, and then they are met with a simple form asking for just a password (no username). After they enter the password, the "veil" lifts or the page forwards and they get the private content.

      Here's the thing... the content really only needs to seem private. It's not super secret, personal information. I don't want it indexed by search engines (nofollow), and I want it basically hidden, but the password is only there to make the user feel exclusive. If some tech-minded person encountered this page and jumped through a bunch of hoops to get in without the password, it's not a big deal to me. In reality, 99.9% of people accessing this page will not be able to bypass the password.

      I'm guessing this can be accomplished easily in Javascript, but I don't really know much Javascript apart from finding code snippets and plunking them in. I also want to be able to fully design the password entry page so that it looks branded, so a code snippet plunked down into my HTML doc would be great for this.

      If there is an easy way to actually protect the content behind the password, that would be excellent. In this case, I imagine it would be much like a news site with an ad-blocker-blocker. Just some kind of pop-up that blocks all the content. Enter the password, and you're in.

      Anyhow, I hope I've described what I'm looking for accurately enough. Anybody have any easy and quick ways to accomplish this?

      14 votes
    2. How Do I Make A Database?

      Hello everyone! I've recently got an idea for a Database as a Service I'd like to create. The only issue is - I don't know how to create or host a database! I've only ever used Mongoose/mLab with...

      Hello everyone!

      I've recently got an idea for a Database as a Service I'd like to create. The only issue is - I don't know how to create or host a database!

      I've only ever used Mongoose/mLab with Javascript, and a minimal amount of Postgres with Python.

      If I'm looking to create a database that will, eventually, be able to store images, songs, and videos, where should I start my homework?

      I can create the backend and the frontend with no issue - just stuck on this part here. If it's of any relevance, I most frequently use the MERN stack.

      13 votes
    3. Total noob looking for (hopefully) simple greasemonkey script

      I have knowledge of the basic concepts of programming in general and html and some very basic knowledge of javascript, but this specific task is proving a little beyond me. I'm actually using...

      I have knowledge of the basic concepts of programming in general and html and some very basic knowledge of javascript, but this specific task is proving a little beyond me. I'm actually using tampermonkey, in case that matters.

      www.bricklink.com is a site to buy Lego from private sellers. By default, when looking at a shop's listing of items, it shows 25 per page. I would like to automatically switch to 100 per page every time.

      Here's a randomly selected store page (no affiliation) at the default 25 per page:

      https://store.bricklink.com/TheBricky#/shop?o={"itemType":"P","catID":"18","showHomeItems":0}

      Now, same page set to display 100 per page. Note how "pgSize" is added to the url but doesn't appear by default:

      https://store.bricklink.com/TheBricky#/shop?o={"pgSize":100,"itemType":"P","catID":"18","showHomeItems":0}

      What I would like is for pgSize to be set to 100 only IF

      "shop" appears in the url

      AND

      "pgSize" does not appear in the url OR "pgSize" does appear in the url but does not equal 100.

      Since Bricklink remembers pgSize per shop page per session, once pgSize is set to 100 for a particular shop greasemonkey doesn't need to do anything. Intercepting the url before the page loads would be nice but unnecessary since loading is fast and I'm not worried about bandwidth.

      I tried making this but wasn't sure how to input what I'm trying to test for in the url. Of course now that I've thought about it some more it seems the task is more probably difficult than I thought it would be at first. Any help would be appreciated.

      EDIT: This comment below seems to be working, although the way Bricklink makes their urls feels funky at times.

      10 votes