GithubHelp home page GithubHelp logo

jquery-sew's Introduction

What is it?

Inline option selection for HTML Text Inputs, auto-complete after a token. Try it live!

Usage

  var values = [{val: 'foo', meta: 'extended foo'}]; // meta is extended search field
  $('textarea').sew({values: values}); // pass in the values

There're some required scripts that should be placed on the following order

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.caretposition.js"></script>
<script type="text/javascript" src="jquery.sew.js"></script>

[NEW] You can now include a minified version

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.caretposition.js"></script>
<script type="text/javascript" src="jquery.sew.min.js"></script>

Customization

  • Elements classes are: -sew-list-container, -sew-list, -sew-list-item, -sew-list-item.selected
  • You can customize the token (default is the @) by passing the {token: ':'}
  • You can customize how elements are created by passing an elementFactory
  /**
  * @param {jQuery} element the target element (LI)
  * @param {*} e object containing the val and meta properties (from the input list)
  */
  function elementFactory(element, e) {
    // append whatever you want to the target element
    element.append({anyJQueryObject});
  }

Release Notes

  • [v0.0.0] initial commit

  • [v0.0.2] {meta: } is now optional, on blur it shows a fadeOut animation, options now scroll, restored escape support, item shows pointer cursor, tab-autocompletion, no elements support.

  • [v0.0.3] add new options {unique: (true|false)} for removing duplicates, spacing bugs.

  • [v0.0.4] added support for content editable

  • [v0.0.5] prevent repetition

Meta

Originally written by @leChanteaux (santiago at mural.ly) - maintained by Mural.ly Dev Team (dev at mural.ly)

jquery-sew's People

Contributors

santiagotactivos avatar johnnyhalife avatar juanmhidalgo avatar flesler avatar jfelsinger avatar

Watchers

Braden Simpson avatar James Cloos avatar

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.