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

sir-trevor-generator

v1.1.0

Published

A Sir Trevor JS block builder

Downloads

11

Readme

Sir Trevor JS block generator

Built by Chris Hutchinson, 2016

A simple programmatic block builder for Sir Trevor JS.

Installation

Install via Bower by running:
bower install sir-trevor-generator --save

Include block.js into your project to be able to create blocks using this library.

Install via npm by running:
npm install sir-trevor-generator --save

This library supports the require syntax in CommonJS: var SirTrevorBlock = require('sir-trevor-generator');

Currently supported fields

  • Text
  • Textarea
  • Number
  • Files
  • Select
  • Tables (uses Handsontable)
  • Checkboxes
  • Repeaters

Callbacks

Most fields also support custom callbacks such as the following:

  • On paste
  • On click
  • On keyup

You can define your own callback functions to allow these fields to interact with Sir Trevor JS.

Callbacks are experimental at the moment, and haven't been tested thoroughly

Examples

See the /examples folder for a range of example blocks.

Version History

1.1.0 (21 November, 2018)

  • Add support for block.setProperty('nonDeletable') to prevent blocks from being deleted

1.0.4 (1 December, 2016)

  • Ensure searchable s work in repeaters

1.0.3 (1 December, 2016)

  • Pass the element object through to each callback object
  • Add the editor object to the element

1.0.2 (21 April, 2016)

  • Add support for a new .hideIcon() method to hide the icon in the edit toolbar

1.0.1 (21 April, 2016)

  • Fixes an issue with rich textarea fields, where sometimes   characters were appearing in the output instead of spaces

1.0.0 (21 April, 2016)

  • Adds support for searchable selects via the Select2 Library
  • I decided to bump the version to 1.0.0 as it's had a bunch of features added over the past few months, and 1.0.0 sounds better
  • Be glad I didn't do a Facebook and make it version 11.0.0

0.0.10 (1 March, 2016)

  • Ensures required asterisks show on repeater fields

0.0.9 (18 February, 2016)

  • Adds a required asterisk after labels on required fields

0.0.8 (4 February, 2016)

  • Change support for required property and nullable property on select components

0.0.7 (11 December, 2015)

  • Fixes an issue with tags in inline rich text areas

0.0.6 (11 December, 2015)

  • Fixes issue with Markdown formatting in rich text areas
  • Fixes issue with stray tags in inline rich text areas

0.0.5 (10 December, 2015)

  • Adds support for richer callbacks, making that functionality more powerful

0.0.4 (10 December, 2015)

  • Fixes an issue loading in empty Handlebars data
  • Updates to README.md

0.0.3 (09 December, 2015)

  • Adds support for non block level elements in textareas (uses <br /> tags instead of <p> tags)

0.0.2

  • Improvements to media and rich text fields
  • Many enhancements I've since forgotten, check the GitHub commit logs

0.0.1

  • Initial release