addPost
  • addPost
    • addSubmit Post
    • Create Component
  • About
  • Log In
  • Sign Up
homeHomecategory_searchExplore Forumstrending_upTrending Posts
Following
Loading…
Popular Forums
Loading…
Forums For You
Loading…
New Forums
Loading…
Make No Law's avatar
@MakeNoLawMake No Law
73 total rep60 post rep13 comment rep
done_allAllcards_stackPostsforumCommentsinsert_chartComponents
  • Most Viewed Posts
    • New
    • Trending
    • Top
  • One rep max calculator and percentilesWidget
    • Widget

      Widget

      Useful components, tools, and widgets.

      0 Followers

    • Body Building

      Body Building

      Lifting weights and getting buff brah

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Widgets

    Share

    7/6/20187/6/2018
  • Secure random password generatorWidget
    • Widget

      Widget

      Useful components, tools, and widgets.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Widgets

    Share

    5/5/20195/5/2019
  • Babe Ruth signed baseball Sports
    • Sports

      Sports

      Anything to do with spo

      0 Followers

    • Personal Post

      Personal Post

      No one can edit posts with this tag except for the creator of that post. Use it when you want to say something that shouldn't be edited by others.

      0 Followers

    H@hardman1
    H@hardman1
    local_police
    Moderator of Sports

    Share

    4/15/20194/15/2019
  • Image Color PickerWidget
    • Widget

      Widget

      Useful components, tools, and widgets.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Widgets

    Share

    4/24/20194/24/2019
  • Why is the sky blue?Science
    • Science

      Science

      Scientific questions, posts, and answers.

      0 Followers

    • Question

      Question

      Ask your questions here!

      0 Followers

    I@iDontLikeGuns
    I@iDontLikeGuns
    local_police
    Moderator of Science

    Share

    7/11/20187/11/2018
  • 2nd video, same videoTest forumTest
    • Test forumTest

      Test forumTest

      Use this tag for test posts.

      1 Follower

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Test

    Share

    2 months ago2mo
  • States that have legalized weed see drop in use among those under 18 study saysScience is fucking lit
    • Science is fucking lit

      Science is fucking lit

      DOPE SCIENCE

      0 Followers

    • Science

      Science

      Scientific questions, posts, and answers.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Science is fucking lit

    Share

    7/18/20197/18/2019
  • Ripped jeans finally make sense19th Century Memes
    • 19th Century Memes

      19th Century Memes

      Pictures only.

      0 Followers

    • Funny

      Funny

      Funny posts, memes, etc.

      1 Follower

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw

    Share

    6/20/20196/20/2019
  • JSON and JavaScript Formatter/Pretty PrintWidget
    • Widget

      Widget

      Useful components, tools, and widgets.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Widgets

    Share

    5/22/20195/22/2019
  • When other sites come to copy an interactive memeInteractive Memes
    • Interactive Memes

      Interactive Memes

      Memes that you can interact with.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Interactive Memes

    Share

    5/21/20195/21/2019
  • Character CounterWidget
    • Widget

      Widget

      Useful components, tools, and widgets.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Widgets

    Share

    4/26/20194/26/2019
  • Beta is Here!Blog
    • Blog

      Blog

      No one can edit posts with this tag except the creator. Write a blog post!

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Blog

    Share

    7/4/20187/4/2018
  • What is this?Form of Good Meta forumForm of Good Meta
    • Form of Good Meta forumForm of Good Meta

      Form of Good Meta forumForm of Good Meta

      How-tos, questions, and posts about Make No Law

      0 Followers

    • Question

      Question

      Ask your questions here!

      0 Followers

    P@pcaleja
    P@pcaleja

    Share

    7/12/20187/12/2018
  • [Mobile Game] "Solbot Energy Rush":Adventure of a color switching Robot in Space!mobile
    • mobile

      mobile

      mobile app

      0 Followers

    • video games

      video games

      video games

      0 Followers

    • android

      android

      android apps

      0 Followers

    • ios

      ios

      ios apps/games

      0 Followers

    F@FreakoutGames
    F@FreakoutGames
    local_police
    Moderator of mobile

    Share

    7/22/20187/22/2018
  • Creating componentsMake No Law Help forumMake No Law Help

    Components are pieces of HTML, CSS, and JS that can be added to posts or other components. They allow for customization by giving users custom fields to input data into. This post will discuss all parts of a component.

    Title

    The title is required, and must be 4 to 20 characters long.

    Description

    The description is required, and must be 20 to 255 characters. It appears in searches, so it should describe the purpose it serves, and any benefits and limits to using it. For instance, if you were creating a bar graph, it would be useful to mention if it allows for certain customizations such as colors of the bars, and if there is a limit on the number of bar that may be added.

    Details

    The details section is optional. It displays after a component has been selected, and above the data that is requested from the user. Relevant info about how the component works, and customization options go here. Continuing with the bar graph example, you could write that if a bar color is not specified, blue is used, and that for customization, the bars have the class 'bar' that may be edited by adding a <style> element to their post.

    Line breaks are conserved in details, so you can separate topics into different parts.

    User-Entered Data

    User-Entered Data is also optional. When used, each field in the row is required. The fields are:

    All user-entered data becomes a part of an object for your code. Each component has a unique id, and this id is embedded into the source variable name of this user-entered data object. If the component's id is iOK0H, the source variable for your component is dataiOK0H (will be used as an example throughout this doc). This is still the variable name you should use in your code when accessing component data.

    Each component also has a config object named dataiOK0H_config. It includes created, previewHtml, componentId, and localId. On the full post page it also includes fragment, which is the current url fragment without the leading #.

    Component Collisions

    To allow for multiple instances of your component to be added to one post, every instance of dataiOK0H is still rewritten before your code runs so that each instance gets its own runtime variable. Use dataiOK0H in your source code so the system can rewrite it correctly.

    When a component is added to a post, it is given a localId (starts at 0 and auto-increments). This localId is visible in the code editor, so the user can use it if necessary (described later). If your component is the third added, it will have a localId of 2. Before your code is run, instances of dataiOK0H are rewritten to a runtime-specific variable that includes the localId, and it may also include an added random string. Because of that, do not depend on the final rewritten variable name being stable across renders.

    If you need stable values for ids, class names, fragment targets, or other generated markup, use dataiOK0H_config.componentId and dataiOK0H_config.localId.

    Style customization of components

    You can let users custom style your components by mentioning class names and ids in the Detail section of the component page. If you want those selectors to stay stable, build them from dataiOK0H_config.componentId and dataiOK0H_config.localId instead of depending on the final rewritten runtime variable name. So if your class is based on those stable config values, users can target it reliably without worrying about runtime rewriting.

    Approval of components

    Unlike posts, components cannot be used or seen in search results until they are approved. This is to prevent malicious code from becoming widespread before being deleted, and potentially diminishing the UX for users visiting posts that had a component deleted retroactively. To ensure your component is approved, refrain from using external JS files that could be changed maliciously in the future. Only repositories on unpkg.com - like jQuery, React, and other npm packages - will be allowed. Aside from common social media, all other script urls are blocked by our Content-Security-Policy. If you have another site you'd like to include scripts from, please submit feedback (in the dropdown menu in the upper right hand corner when you log in).

    Add the following to enable react:

    <script src='https://unpkg.com/react/umd/react.production.min.js'></script> <script src='https://unpkg.com/react-dom/umd/react-dom.production.min.js'></script> 

    When testing, use the following:

    <script src='https://unpkg.com/react/umd/react.development.js'></script> <script src='https://unpkg.com/react-dom/umd/react-dom.development.js'></script> 

    Versioning

    When a new version of a component is approved, changes will not automatically propagate to posts using that component. Posts will have to be updated individually. This was done because updated components may no longer fit in as well with the post, and can change user-entered data formatting.

    Coding details

    Use dataiOK0H for your component's actual data. Use dataiOK0H_config.componentId and dataiOK0H_config.localId when you need stable html ids, class names, or fragment targets.

    const sectionId = `${dataiOK0H_config.componentId}-${dataiOK0H_config.localId}-results`;

    On the full post page, dataiOK0H_config.fragment contains the current url fragment without the leading #. This can be used if your component needs to react to a specific fragment when the post is opened.

    Store Data

    If you choose the Store Data field type, that field must be at the top level. Store Data lets a component load saved values for the current user and aggregate values returned by the backend. The configured keys for that field become data properties, and those keys may only contain letters, numbers, and underscores.

    At runtime, call fgStoreData or formOfGoodStoreData. Both return a Promise. On success, the requested property on your component data object is updated with an object containing userInput and aggregateValues.

    fgStoreData('load', 'dataiOK0H', 'scores').then(function () {   console.log(dataiOK0H.scores.userInput);   console.log(dataiOK0H.scores.aggregateValues); });
    fgStoreData('save', 'dataiOK0H', 'scores', 7).then(function () {   console.log(dataiOK0H.scores.userInput); });

    Saving requires the user to be logged in. In previews, Store Data uses the configured test payload until the component is attached to a post.

    Linking to fragments in posts

    If you want a button or link inside a rendered component to open the full post and jump to a specific element, add data-click-bridge-fragment to the clicked element. The value should match the target element's id, with or without the leading #.

    <button data-click-bridge-fragment='results-section'>View Results</button> <a href='#' data-click-bridge-fragment='results-section'>View Results</a>

    The target element should use a stable id, ideally one built from dataiOK0H_config.componentId and dataiOK0H_config.localId. If you only want to open the post without adding a hash, use data-click-bridge-navigate.

    Caveats

    Single Page App with Server Side Rendering

    Because pages are loaded two different ways, you must plan accordingly. If you need to wait for the page to load to examine or manipulate elements, you will have to check to see if the document has loaded already before adding a window load event listener:

    // when using React componentDidMount() {   if (document.readyState !== 'complete') {     this.listenerSet = true;     window.addEventListener('load', this.loadData);   } else {     this.listenerSet = false;     this.loadData();   } }

    For removing the listener in React:

    componentWillUnmount() {   if (this.listenerSet) {     window.removeEventListener('load', this.loadData);   } }

    Without React:

    if (document.readyState !== 'complete') {   window.addEventListener('beforeunload', function (event) {     window.removeEventListener('load', this.loadData);   }); }
    • Make No Law Help forumMake No Law Help

      Make No Law Help forumMake No Law Help

      How-tos, questions, and posts about Make No Law

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Make No Law Help

    Share

    6/26/20186/26/2018
  • Hello, world!Test forumTest
    • Test forumTest

      Test forumTest

      Use this tag for test posts.

      1 Follower

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Test

    Share

    5/24/20185/24/2018
  • How does the popcorn button on the microwave know?popcorn
    • popcorn

      popcorn

      corn that is popped

      0 Followers

    R@retropmac
    R@retropmac
    local_police
    Moderator of Popcorn

    Share

    6/5/20186/5/2018
  • Ferris Bueller Popular Fan TheoryTheory
    • Theory

      Theory

      Theory/speculation

      0 Followers

    • Personal Post

      Personal Post

      No one can edit posts with this tag except for the creator of that post. Use it when you want to say something that shouldn't be edited by others.

      0 Followers

    R@retropmac
    R@retropmac
    local_police
    Moderator of Theory

    Share

    7/13/20187/13/2018
  • Is there a difference between the shiny and matte side of tin foil?Food
    • Food

      Food

      Questions related to food and cooking

      0 Followers

    8@89fordf350
    8@89fordf350
    local_police
    Moderator of Food

    Share

    6/3/20186/3/2018
  • Greatest Rock/Classic Rock Band of all time statistically and in terms of popularity?rock
    • rock

      rock

      Rock and classic rock music

      0 Followers

    • Music

      Music

      just music

      0 Followers

    R@retropmac
    R@retropmac
    local_police
    Moderator of rock

    Share

    7/13/20187/13/2018
  • New meme format: video switcherInteractive Memes
    • Interactive Memes

      Interactive Memes

      Memes that you can interact with.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Interactive Memes

    Share

    7/13/20197/13/2019
  • What are the pros and cons of using a sit/stand desk at work?Question
    • Question

      Question

      Ask your questions here!

      0 Followers

    K@KatyH
    K@KatyH

    Share

    7/12/20187/12/2018
  • Why is the ocean salty?Science
    • Science

      Science

      Scientific questions, posts, and answers.

      0 Followers

    M@m4tank
    M@m4tank

    Share

    7/11/20187/11/2018
  • Safety of postsMake No Law Help forumMake No Law Help

    Iframes

    Your computer is protected from the content of unapproved posts because code runs in sandboxed iframes. This means that malware cannot be run, and the code cannot access cookies or any data on the makenolaw.com domain. The iframe sandbox also disallows popups, form submission, and more.

    Content-Security-Policy

    Our Content-Security-Policy (a term used for a method that restricts what can be loaded on a website) disallows all but a short list of sites to be embedded in an iframe, which prevents clickjacking. Most browsers that don't support CSPs are unable to load posts at all due to other missing features, but browsers that fail to implement CSPs are given a warning that cannot be dismissed. If you see this message, upgrade your browser before using this site.

    Objects, applets, and embeds are disabled (via the CSP, in addition to attempts to disable them on the server side), as well as mixed content.

    List of approved iframe src urls

    If you want support added for a site, send us feedback and it'll likely be added (hover over top right dropdown when logged in, and you'll see the feedback button). The supported sites are:

    List of approved script src urls

    Scripts are also limited by our Content-Security-Policy. Only scripts from the following domains are allowed at this time:

    Distinguishing between approved and unapproved posts

    Approved posts have the icon next to its tags list, and unapproved posts have the icon .

    Approved posts vs HTML approval of posts

    Approved posts are allowed to run freely on a page. Posts are only approved when they have been vetted, and usually only when they do not work in a sandboxed iframe.

    Posts that need HTML approval are either made by users with less than the minimum required reputation (10 at the time of this writing), or when a post's code appears suspicious. Certain functionalities like editing the contents of a users clipboard are usually not allowed, and doing so will cause the post to become flagged. When flagged, it will not show up for other users until it has been approved.

    Infinite loops and other browser-intensive JS

    Several steps have been taken to mitigate this (using a modified version of jsbin's loop-protect), but it is not perfect yet. This is the reason for having a minumum reputation to make posts containing HTML and JS. It will take time to achieve that level of reputation, and will hopefully deter users from wasting their account and time by making a post that likely wouldn't work anyway. The minimum reputation required will increase over time.

    • Make No Law Help forumMake No Law Help

      Make No Law Help forumMake No Law Help

      How-tos, questions, and posts about Make No Law

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Make No Law Help

    Share

    7/3/20187/3/2018
  • Random number generatorWidget
    • Widget

      Widget

      Useful components, tools, and widgets.

      0 Followers

    MakeNoLaw's avatar@MakeNoLaw
    MakeNoLaw's avatar@MakeNoLaw
    local_police
    Moderator of Widgets

    Share

    5/4/20195/4/2019

© 2026 - Make No LawTermsPrivacy PolicyAboutRules

K LogoK Logo