GithubHelp home page GithubHelp logo

dummyjs's Issues

feature, toggle classname/styles

not sure of the interface, or whether an existing or dynamically generated button is to be the trigger..

Maybe something like:
<div data-toggle="nav-sidebar--active"></div>
<div data-toggle"></div> (display: block/hide)

Auto generate button?:
[toggle ".nav-sidebar--active"]
[toggle div]

feature, dummy background images

Could follow the current text attribute behaviour:
<div data-dummy:placeholder="3"></div>

Though render as a background image detecting when the "bg" suffix is passed
<div data-dummy:bg="300x300"></div>
would do: el.style.backgroundImage = 'url(' + Dummy.src(arg) + ')'

feature, data-dummy for attributes

Maybe with the syntax:
data-dummy:(prop)

<input data-dummy:placeholder="3" data-dummy:value="3" />

Wildcard would be nice, though if we need a whitelist we could include:
placeholder value alt title ..Others?

feature, tags

Possible Interface:
<dummy /> default number of words
<dummy text="23" /> 23 words
<dummy src="200" /> Image
<dummy text /> default number of words
<dummy src /> Image
<dummy img /> Image

Also work for copy:
<dummy copy=".element-name" /> or, <copy el=".element-name" />

Could also provide a shortcut...

<dummy 23 /> 23 words
<dummy 200x300 /> Image

Probably not valid attribute names, though they can be accessed correctly at least in chrome
document.querySelectorAll('dummy').forEach(el => console.log(el, el.attributes[0].name));

provide a jQuery interface

A simple jQuery interface could wrapper features like #14, which would allow an alternative way to dynamically generate dummy text, etc.. with the familiarity of jQuery.

jQuery will always be optional and never a requirement to use dummy.js

landing, make resposive

* Low priority issue *

Seeing a number of mobile visits, so it's time to consider cleaning up the mobile experience a little. While the landing page (and script) remains a developer tool, and would mainly be used in a desktop environment, readability is always nice across devices.

IE10/11 Support

As a dev tool, it would be nice to support at least IE11+

Currently there is the following issue(s)

  • IE11 doesn't support .forEach on a nodeList

feature, allow for different dummy text libraries

Possible interfaces:
<script src="https://dummyjs.com/dummy.js?lib=bacon"></script>
<script src="https://dummyjs.com/dummy.js" data-lib="bacon"></script>

Allowing external libraries:
<script src="https://dummyjs.com/dummy.js" data-lib="http://bacon.gen/bacon.js"></script>

Providing custom text:
<script>window.dummyjs_lib = 'custom text lipsum bacon';</script>
<script>window.dummyjs_lib = { words: 'custom text lipsum bacon', join: 'in on' };</script>

perf, reduce DOM querying

While the aim of this tool is to allow for the quickest way to get placeholder content in a dev environment, there could be some easy performance wins.

It's possible to remove multiple queries to the DOM without too much added code. Can also kill full execution when no data-dummy attributes are found.

With this, explore quicker ways of accessing data- attributes & and values (eg. els.dataset.dummy)

browser build, disable auto parsing of tags

This would be for the browser build of dummy.js

We could do something like setting a global var, before the inclusion of the script file
window.dummy_auto_disable = false -> to disable all

[help needed] fun ideas of where to use placeholder content

To some people the reasons behind using Dummy text and placeholder images can sometimes be a little on the boring side ..building websites.. bla.. bla..

Lets think up some fun situations and usages that someone can use placeholder content!
The goal is to add it to the home page at https://dummyjs.com/

Add your out-there idea to our list (FUN_USAGES.txt), along with your github handle which will also appear with a link on the home page.

Whats needed:

  • One "placeholder usage situation" per line
  • 3/4 words max
  • Add your GitHub username prefixed with the @ symbol (optional)
  • Add as many as you like!

[Usage] @[GitHub Name]

Add Yours simply by visiting:
https://github.com/paulcollett/dummyjs/edit/master/FUN_USAGES.txt

feature, more variation when using random ranges

Currently when using a range between big numbers...

<div data-dummy="100,300"></div>

...the random amount of outputted words will usually land somewhere in the middle of that range.

Ideally we want to output high and lows more often to better test our layouts - which is the overall goal of dummyjs

readme, correct spelling

Numerous typos and poor grammer which should be reviewed at some point in:

  • readme.md
  • index.html (docs)
  • docs/bootstrap.html (more docs)

feature, data-dummy inputs values

Using data-dummy on inputs should populate the value attribute. (Textarea already works as intended)

<input type="text" data-dummy="3">

feature, alternate attribute names

While using a prefixed data- attribute (data-dummy) is regarded to be a more valid syntax, considering the common use case for DummyJs in a dev environment we could get away with using other attributes to simplify the interface down:

dummy="200"
or maybe even shorter..
dd="200"

Both data- prefix would be available along with any shorthands so the option is still a choice of the developer

feature, ability to dupe elements in different places

Allow duplicating elements into different places within the markup

<div data-include=".element-selector"></div>

Should work with existing repeats etc....
<div data-include=".element-selector" data-repeat="3"></div>

Load DummyJS in console

((d,u) => {u = d.createElement('script');u.src = "https://dummyjs.com/js";d.getElementsByTagName('head')[0].appendChild(u)})(document);
Dummy.parse.all(); // <= todo
Dummy.text(3, 5);

Feature: valid dummy dates

Feature
Auto generate a dummy date, with the option to pass some config to constrict the date range.

Possible Implementation

<div data-dummy:date></div> <!-- random date in time -->
<div data-dummy:date="2000, 2010"></div> <!-- random date between years -->
<div data-dummy:date="2020-12-01, 2020-12-31"></div> <!-- random date dates -->
<div data-dummy:date="future"></div> <!-- random date in the future (or "past") -->

Not too sure if date formatting is worth exploring here too.

feature, dummy videos

Initial version could link to a generic video file that still looks ok when scaled to an array of scaled formats (could save files in github repo)

<video data-dummy></video>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.