npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dummyeditor

v1.0.3

Published

DummyEditor is an AngularJS directive that allows you to create bootstrap based web pages

Downloads

10

Readme

DummyEditor

Build Status

DummyEditor is an AngularJS directive to create bootstrap based web pages. It comes with a set of pre-built widgets, that are the most popular bootstrap components. Using drag-n-drop, you can easily move any widgets in the page, in order to find the correct position.

List of available components:

  • blockquote
  • button
  • glyphicons icons
  • card
  • carousel
  • code (pure HTML)
  • code-snippet
  • container (div, header, footer, main)
  • text editor
  • font-awesome icons
  • form
  • grid
  • image
  • input
  • jumbotron
  • navbar
  • line separator
  • spacer
  • submit button
  • table
  • well

Each component uses the standard bootstrap classes, such as btn, btn-primary. If a custom bootstrap theme is used, the new style will be applied! In this way, the generated page will be exactly as you except.

Dependencies

DummyEditor uses the following dependencies:

  • angular-translate is used to localize the entire interface;
  • ckeditor is used as standard text editor for text contents.

Personalization

If you don't find or if you need a particular widget, it is extremely simple to create your own component. You can find more information here.

Installation

Bower:

bower install dummyeditor

Npm:

npm install dummyeditor

Git clone:

git clone https://github.com/Sprechen/DummyEditor.git

you can find all the necessary files to use the library in the src folder. NOTE: if you plan to create or edit widgets, probably the best option is to clone the source code and use it directly.

Usage

In your HTML page, add the dummy-editor dependencies as follows (using bower):

<script src="/bower_components/angular/angular.js"></script>
<script src="/bower_components/angular-translate/angular-translate.min.js"></script>
<script src="/bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>
<script src="/bower_components/ckeditor/ckeditor.js"></script>
<script src="/bower_components/angular-ckeditor/angular-ckeditor.js"></script>
<script src="/bower_components/dummyeditor/src/dummy-editor.js"></script>

Initialize the DummyEditor library, choosing the language and the widgets that you want to enable:

dummyEditor.setPath('/bower_components/dummyeditor/src');
dummyEditor.init("en", ['code', 'editor', 'container', 'grid', 'image', 'font-awesome', 'bootstrap-glyphicons', 'bootstrap-button', 'bootstrap-blockquote', 'form', 'input', 'submit-button', 'separator', 'table', 'spacer', 'carousel', 'well', 'navbar', 'code-snippet', 'card', 'jumbotron']);

NOTE: remember to execute the setPath method to correctly set the path of the DummyEditor source code. This is necessary because DummyEditor dynamically load different files for the widgets and their translations. By default, it assume to be available in the /src folder.

Add the DummyEditor dependency to your AngularJS app:

var app = angular.module('app', ["dummyEditor"]);

Use the dummy-editor directive as follows:

<dummy-editor custom-css="css" ng-model="model"></dummy-editor>

The dummy-editor directive has 2 parameters, ng-model and css. With ng-model, you can set and retrieve the structured data used by the editor. It is useful to save and load an HTML page. The css argument contains custom CSS definitions, that can be used to modify the theme of the page.

At the moment, the DummyEditor is not (yet!) able to edit plain HTML, but only its structured data. Despite this, the structured data is a standard JavaScript object, that can be serialized and de-serialized to be saved as text in a database.

When you want to generate the HTML and CSS code:

var generatedCode = dummyEditor.generateHtml();
console.log(generateCode.html);
console.log(generateCode.css);

You can generate the HTML and CSS code of the web page whenever you want, also outside the AngularJS context. You can simply call the method dummyEditor.generateHtml()``, which returns a plain JavaScript object with the properties htmlandcss`.

Do you want to contribute?

If you find a bug or a problem, please open a new issue using the standard GitHub issue tracker.

If you are a non-english native speaker, please consider to submit a new localization in your native language!

Finally, if you want to create a new widget, please follow this documentation on how build a new widget.