Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Conversation

tubbo
Copy link

@tubbo tubbo commented Dec 19, 2011

Tokens can now be added to the database from within tokenInput. To enable this feature, simply set addTokenAllow: true and create a POST action in your endpoint for REST compatibility. Otherwise, you can use addTokenURL to specify the URL that you want to hit when a user wants to add their newly-created token to the database. If you already use POST for your search query action, you can specify another HTTP method like GET or PUT in its place.

We have deployed this modified version of jquery.tokeninput on a number of live production servers, and it works great. We think it would make a great addition to the plugin!

tubbo added 6 commits October 21, 2011 14:04
…stead of GET on the backend script. there is also a config var allowAddToken which enables/disables this new functionality. it is set to false by default so as not to break existing implementations of this plugin.
if you prefer to use POST for all communications rather than a
combination of GET and POST, you'll need two separate endpoints.
addTokenURL overrides the assumption that the same URL endpoint will be
used for both actions.
add token paths can now be customized down to the URL and method,
letting devs choose which HTTP method they want for both the search
query and the add token query
@azinazadi
Copy link
Contributor

why are the changes so big? the diff shows a lot of changes in the readme, and also for example moving DEFAULT_CLASSES from one place to another, and incorrect indents.
what you did is a great feature. maybe u want to clear it a little bit

those last commits included some unnecessary changes, which have been
fixed so the new pull request is more compatible with the existing
master branch. thanks @azinazadi for pointing those out.
@tubbo
Copy link
Author

tubbo commented Dec 20, 2011

@azinazadi not sure why the diff shows that i changed the entire readme, i definitely didn't. i only added some settings to the one section. but regardless, i moved DEFAULT_CLASSES back where it should be and fixed a couple other mistakes. should be ready to go!

@azinazadi
Copy link
Contributor

yes. may be it was just some white spaces. cool

@alagunambi
Copy link

@tubbo It would be great if you could please provide some example on this. the .die('click') does not seems to get called.

@tubbo
Copy link
Author

tubbo commented Jan 4, 2012

@alagunambi is it erroring? if it's not getting called, that would indicate to me that a click event wasn't bound on the element, and therefore a die() doesn't need to happen. what's the exact problem you're experiencing?

the only live examples up right now are private, as this was developed for an in-house CMS. but i could probably gist something quickly tomorrow morning...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants