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

marionette.behaviors

v0.0.13

Published

Collection of behaviors for Marionette

Downloads

20

Readme

Marionette Behaviors

Marionette Behaviors is a collection of useful behaviors for Marionette. It doesn't force you to have all dependencies, but it's your responsibility to have them in your project.

Remember that you need to register the behaviors before using them. Also, it is highly suggested to require the behavior directly instead of the whole lib since it will need all the dependencies that you might not need.

Behaviors

All behaviors can reuse the same syntax as events and triggers to target element defined in the ui object of the view (@ui.someField). They are converted on rendering.

jQuery

This behavior allows the use of any jQuery plugins on defined elements.

behaviors: {
    jQuery: {
        '@ui.dateField': 'datepicker',
        '@ui.timeField': {
            timepicker: {
                format: 'HH:mm'
            }
        }
    }
}

A plugin can be defined using two different ways: a single string or an object. If you don't need to pass anything to the plugin and have only one plugin to apply to that element, a single string should be your best option. However, if you want to pass options and/or want to apply multiple plugins to an element, use an object. The format is the following: functionName: options. This will result in this: $(element).functionName(options).

Stick it

Works on v0.8.0

This behavior makes it easier to use Stickit by handling bindings definition and applying Stickit to the view.

TODO: Complete usage documentation

BootstrapValidator

Works with v0.5.3

This behavior allows you to integrate the goodness of BootstrapValidator in your views and having client-side validation on your forms.

bootstrapValidator: {
    options: {
        // ... insert global settings for alls forms ...
    },
    targets: [
        '@ui.form' // uses only defaults settings,
        {
            selector: '@ui.form',
            options: {
                // ... extra local options ...
            }
        },
        '@' // special case to target the whole view if it's a form
    ]
}

The BootstrapValidator behavior integrate the $(form).bootstrapValidator() call into your views as a behavior. You can pass options into the global options object to apply to all the BootstrapValidator-ed forms in your view. The targets list can handle ui hashes or regular jQuery selectors. You may also pass an object with the attribute selector to define your target and add specific settings to that form into the options attributes. An @ will target all the forms in the view and apply BootstrapValidator on them.