Giter Club home page Giter Club logo

jquery-textext's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-textext's Issues

tagClick event not coming through to handler

At present the 'Tag Click Event Changing Tag Value' demo does not work on Chrome or Safari on Max OS X Lion (not sure about other platforms).

The code approach to binding the event works fine in my own code, but the demo appears broken.

tags plugin and setInputData event

data is always an empty string if removing a tag

$('textarea').textext(...).on('setInputData', function(e, data) { console.log(data) }) 

"Tag removed" event

I think an event which gets triggered, when the user deletes a tag, would be pretty useful. Not just for me.

So, please add such an event :)

Event for tag added / removed

Hi, I'd like an event on tag add and remove. I assumed that setFormData did this, but it is triggered on every key press. What is the right approach here?

I'm using backbone and want to save a model when a tag is added or removed.

Items to custom Item Manager get lost

When supplying a custom ItemManager, you'd like to be able to retain the items as they were returned by the server (or whatever source). The current codebase, sadly, strips the tag string from the custom item so you've got to provide your own caching of items even though the tag data is being set on the element already.

Here are the relavent pieces of my CoffeeScript Workaround:

    @$el.textext( {
      plugins: 'prompt tags ajax autocomplete'
      ajax: @ajax
      ext: {
        itemManager:
          items: []   # array to cache the javascript items from the server
          ...
          itemToString: (item) -> this.items.push(item); item.name
      }
    })

   ...
   # Return all of the items in the Tag Editor
    tags: ->
    tagEditor = @$el.textext()[0]
    elements = tagEditor.tags().tagElements()?.map (ndx, element) ->
      itemName = ($(element).data('text-tag'))?.name
      # Find the matching items in the list from the tags found in the editor
      _.find @agEditor.itemManager().items, (it) -> it.name == itemName
    elements.get()

Custom Render not clickable

In the example here, http://textextjs.com/manual/examples/autocomplete-with-custom-render.html, the suggestions are not clickable. I've tried FF11 and IE9 on Windows 7.

Additionally, with my own custom render, slightly more simple than the example, of

    suggestion + '<p>Lorem ipsum dolor sit amet, consectetur adipisicing </p>'

"suggestion" is clickable but the paragraph element is not.

What is TextExt looking for here? How do I make an entire custom rendered suggestion clickable?

Calling AJAX on change

Currently the AJAX is only called once, therefore al results are stored in memory and then searched in the javascript. I want to call the AJAX every time the user types something so that I can query a rather large MySQL database for new results (I don't want to send 60,000 records to the page).

Having trouble styling Textext

I'm following the examples trying to call TextExt on a textarea, but I can't seem to change the styling. I've narrowed down the issue to this CSS style on the div.text-wrap:

element.style {
    height: 9px;    
    width: 112px;
}

and also this style on the textarea inside of div.text-wrap (that is, the original textarea I defined):

element.style {
    width: 112px;
}

I can't figure out which particular line sets these attributes in the generated js. Renaming the htmlWrap eliminated the those styles on textarea, but the tags and dropdowns disappeared as well.

$('#invitee_login').textext( {
    ...
    htmlWrap: '<div class="autocomplete-core"><div class="autocomplete-wrap"/></div>',
    ...
})

I guess I'm looking for a way to pick and choose which of the default styles are used. Is there a way to do this through textext params?

(I apologize for using the issues tracker for a usage question--I couldn't find another resource like a mailing list for this.)

Browser compatibility issue

Seems like, jquery-textext plugin is not compatible with Internet explorer verson-8. Could you please investigate this?

Biswa

Help with tag ids

In first place, I apologize if this is not the right place to make a question regarding the plugin, but I'm really stuck.
I need to know if the plugin can handle some kind of tag identificator.

I'm using the ajax plugin to bring the suggestions (just the tags) and it works perfectly, but when I try to return a json element with "key:value" pairs, it stops working.

So, my question is if there's a way to work with tag ids.

Thanks in advance and sorry for my bad english.

Can't add tags manually, if 'filter' plugin enabled

Say you have following setup:

 $('#keywords').textext({
                plugins: 'prompt focus autocomplete arrow ajax filter tags',
                prompt: 'press enter after each tag...',
                ajax: {
                    url: tagsUrl,
                    dataType: 'json',
                    cacheResults: false
                }
            });

Then you try to add some "initial" tags manually like:

  var textext = $('#keywords').textext()[0];
  textext.tags().addTags(['tag1','tag2']);

And as result you see nothing, i.e. no tags will be added into input box. However user CAN enter on page such tags manually (in case if your AJAX json response contains them... i.e. filter DO work, just you can't add tags from your JS code!)

P.S. things like $('textarea').textext()[0].filter.items = ['tag1','tag2']; also do not help (i.e. attempt to add few items before add tags), same as to disable / enable filter plugin using filter.enabled = false and later, after add tags do filter.enabled = true etc.

Please help :)

Downloaded sources not working

I downloaded textext source files (.zip) from github , unzipped them and tried to use in my project.
It doesn't work. The files are loaded properly, no JS errors in the console (chrome).
The input field is empty. The tags are printed below to the left. "Add one" is shown bottom-right.
When I use combined source (from http://bundlejs.com/alexgorbatchev/products/textext/1.3.0) everything works fine.

It turns out that the combined file includes code that sets the styles.
The code begins with:

(function(a) {
    var b = document, c = "getElementsByTagName", d = b[c]("head")[0]
            || b[c]("body")[0], e = b.createElement("style");
    e.innerHTML = a, d.appendChild(e)
})

Maybe github distribution (or the manual) should be updated?

Hope this helps someone ;-)

Facebook-like tagging

I am trying to replicate Facebook's in-comment tagging capability. Basically, when you start typing a name, it triggers an Ajax search. It waits for the first 2 characters (1 upper case and 1 lower case) to do so and shows name suggestions.

The closest example I've found to this is http://textextjs.com/manual/examples/autocomplete-with-tags.html but it turns everything into a tag on Enter, which isn't the expected behavior in this case. I want to be able to do:

"Hey [Alex Gorbatchev], check this out!"

http://textextjs.com/manual/examples/ajax-with-filter-tags-and-autocomplete.html is another close example of what I want to achieve, but it rejects everything that is not in the tag list.

Is there a way to accomplish what I'm looking with this plugin? Also, is there a way to know what was a tag and what wasn't on the "server side"? From what I understand it will just send a simple string back. I'd like to know, for example, that "Alex Gorbatchev" was tagged on the client-side.

Also, in the autocomplete-with-tags example, clicking on the suggestion in the drop-down does not auto-complete the item. I'm not sure if that's a bug. I will file a separate issue if it is.

Full dropdown when arrow clicked

If I clicked new combobox on arrow at with text, then I see full dropdown. But when I typed something, then select Item. Next click on arrow shows only 1 item. Filter remember last query and for next select I need clear field. It not useful.

For example, vk.com working that. Thank you.

Ajax data result parsing

There doesn't seem to be a way to parse the data the gets returned from an ajax call. I have an existing REST API that I want to use but my REST API uses a specific format and I would rather not have to create another call specifically for this when it would do the same thing.

Drop-down list not refreshed after adding a tag

Chrome 12 on Ubuntu.

On the demo page, I typed "p" and and "PHP", "Perl", "Python" appeared in the drop-down list. I used my keyboard's arrow key to go down to "Python" and selected it. "Python" was added to textbox. Then I clicked on the drop-down arrow and only tags start with "p" ("PHP", "Perl", "Python") appeared in the drop-down list. The full list should've appeared in this case.

tags can force textarea width to increase

adding a long tag such as 'Lopado­temacho­selacho­galeo­kranio­leipsano­drim­hypo­trimmato­silphio­parao­melito­katakechy­meno­kichl­epi­kossypho­phatto­perister­alektryon­opte­kephallio­kigklo­peleio­lagoio­siraio­baphe­tragano­pterygon' (look it up) will cause the text area to become wider than desired and/or cause the text to overflow the box

japanese characters not creating tags

I am getting weird behavior when trying to enter japanese characters into the text bar. Very rarely they are entered properly and a tag is created for the text I put in, but for the most part whenever I change my keyboard to japanese, type a few characters and then hit enter nothing happens.

I did some debugging on this and it seems like an event is being missed and in fact, when nothing happens, the onEnterKeyPress function is never even being run in the tag plugin. I have also checked the keycode that is fired off when this is going on and it is indeed 13.

Any help on this issue would be appreciated as I have tried to debug this for a while now with no avail.

check disabled state

The plugin doesn't seem to completely respect the disabled state of the field. I can remove tags even if the field is disabled.

search query not cleared after selecting item

After selecting an item the search query for autocomplete should be cleared. you can see this on example on the homepage. type "C" into the input field and pick one of the two options and hit enter to select that item. Now without typing anything else click the arrow for the dropdown. Since there is no new text entered you should expect to see all the possible options but the only only options available are the same two from when I had entered "C" before.

here's the code for a tiny "clear contents" plugin. Feedback?

I wrote a very simple plugin for adding a clear button (an "x" to the left of the arrow plugin) It's basically the same as the clear button in google docs; clicking it removes all tags and text from the textarea

js: http://pastebin.com/C7kJig1R
css: http://pastebin.com/dBQXBv8T

Anyone find this useful? I'd love feedback on the code; i basically just copied the arrow plugin and changed the p.onArrowClick function. I'm not sure if I'm following textext conventions in that code.

Feature request: separated .css file

I think it would be a nice feature. Why is it generating by the script?

I am having problems with styleing the plugins. Is there any little guide for that? I have good knowledge in css, but the height of container is generated in style attribute and i don`t know how to increase it.. and so on.

Thanks for the great plugin.

Help - How to customize hidden input?

Hello,

This is probably a stupid question but I try to add a name to the hidden input to get the data when I POST it.
I tried multiple things without any success.

For example:
$('#tagarea', currentTab)
.textext({
plugins : 'autocomplete filter tags ajax arrow prompt',
prompt : 'Add some tags...',
htmlHidden : '',
ajax : {
url : 'gettag/json',
dataType : 'json',
cacheResults : true
}
})
;

How does it work?

Thank you in advance

height of text-wrap really small

when i init the plugin the height of the text-wrap and text-core elements is being set really small and i'm not sure why or what is going on. what could be causing this? it is literally being set at 9px....

Add ids for values

For example

1, Delphi
2, C#

And keep it fpr processing. It is need for Arrow plugin

Thank you for good component!

ajax infinite loop

jQuery TextExt Plugin (in ajax mode) running an ajax infinite loop if the server doesn't return any data.

Exemple code :

  $('#textarea')
          .textext({
            plugins : 'autocomplete ajax',
            ajax : {
              loadingMessage:'test',
              url : "server url",
              dataType : 'json',
              cacheResults : true
            }
          });
  });

If server respond a "404 not found", the ajax autocomplete is still trying to contact the server and never stop.

Feature: Groups in AutoComplete List

Hi,

great plugin alex!
Nearly perfect, the only thing missing for me are a possibility for grouping the autocomplete result, like a group for dogs and group for cats, or for an email input box, a group for friends and group for business contacts and so on.

I hope it is clear what I mean.

Best regards

Suggestions - Only suggest unused

There should be an option in the Suggestions plugin to only suggest unused suggestions, that is not already in the textarea.

This is a very common usage pattern, and should be built in.

Can't call plugin methods or maybe just documentation issue

Perfect code, excellent documentation & cool examples...
However I can't found what I need :( for some reason.
All I need is to simply add few tags using Javascript into already created input element, not during initialization (using perfect declarative way which shown 1000s times in docs / examples)
I.e. I go over all docs, but seems can't found the way how to invoke textext plugin methods!
For example, if I need to call some methods in 'ItemManager' (http://textextjs.com/manual/itemmanager.html), I can easy do something like (the bad thing that no such examples at all in the docs):

  var textext = $('#keywords').textext()[0];
  var item =  textext.itemManager().stringToItem('cool');

However, when I tried to call something like:

  var textext = $('#keywords').textext()[0];
  var item =  textext.tags().addTags(['hello','shit']);

It just fails....

The same happens with:

  var textext = $('#keywords').textext()[0];
  var item =  textext.TextExtTags.addTags(['hello','shit']);

etc.

I.e. seems can't found any "easy" way to call dirrectly plugin methods??? Strange.. because I think every such library should have at least methods which are easy accessible and documented well, like $('#keywords').textext()[0].addTags('hello','shit') or var tags = $('#keywords').textext()[0].getTags() etc.

Am I miss something?

Big thanks!

Can not make the tag Unique

if i want to create a friend selector,
my data point is like:
[
{ id : 1, name : 'bob" ,avatar: "1.jpg" } ,
{ id : 2, name : 'bob" ,avatar: "2.jpg" } ,
{ id : 3, name : 'bob" ,avatar: "3.jpg" } ,
]

as U see, 3 friends have the same name, but diffrent avatar, with custom "autocomplete.render" method I can distinguish them.

but in custom stringToItem , i don't know how to distinguish them ~~

Clicking item in Prompt with Arrow closes drop down without adding item to input

Steps to Reproduce

Expected Results

  • Item is added to the input box

Actual Results

  • Item is not added to the input (however the drop down does close)

Note: If you focus on the input with the mouse, then use the down arrow key to open the drop down menu, and then use the mouse to select an item via click it works as expected

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.