Tokeninput is jQuery plugin (http://loopj.com/jquery-tokeninput/). This module implements this plugin into drupal 7. This is my first module contribution - so please bear with me..

The user can add a field of type 'tokeninput'. Then he can set key|value pairs. That's it. The values are displayed in unordered lists.

dependency is libraries module.

Versions: http://drupal.org/project/1420912/git-instructions

Comments

mdespeuilles’s picture

Status: Needs review » Needs work

Hi,

Thanks for your work.

  • You must specify more information about your project in this post (read this page)
  • tokeninput_field_validate() : This function do noting... Remove or comment it
  • tokeninput_field_widget_form() : You should integrate the javascript code with drupal_add_js()

Automatic review :

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.


FILE: ...al-7-pareview/sites/all/modules/pareview_temp/test_candidate/README.txt
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AND 1 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 1 | WARNING | Line exceeds 80 characters; contains 84 characters
 4 | ERROR   | Files must end in a single new line character
--------------------------------------------------------------------------------


FILE: ...eview/sites/all/modules/pareview_temp/test_candidate/tokeninput.install
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
  2 | ERROR | Missing file doc comment
  8 | ERROR | If the line declaring an array spans longer than 80 characters,
    |       | each element should be broken into its own line
 17 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------


FILE: ...review/sites/all/modules/pareview_temp/test_candidate/tokeninput.module
--------------------------------------------------------------------------------
FOUND 99 ERROR(S) AND 3 WARNING(S) AFFECTING 91 LINE(S)
--------------------------------------------------------------------------------
   6 | ERROR   | Whitespace found at end of line
   7 | ERROR   | Whitespace found at end of line
  12 | ERROR   | Whitespace found at end of line
  14 | ERROR   | Whitespace found at end of line
  19 | ERROR   | Array indentation error, expected 6 spaces but found 8
  20 | ERROR   | Array indentation error, expected 10 spaces but found 12
  21 | ERROR   | Array indentation error, expected 10 spaces but found 12
  22 | ERROR   | Array indentation error, expected 10 spaces but found 12
  23 | ERROR   | Array indentation error, expected 10 spaces but found 12
  24 | ERROR   | Array indentation error, expected 6 spaces but found 8
  30 | ERROR   | Whitespace found at end of line
  33 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
  34 | ERROR   | Whitespace found at end of line
  39 | ERROR   | Whitespace found at end of line
  47 | ERROR   | Whitespace found at end of line
  53 | ERROR   | Array indentation error, expected 6 spaces but found 8
  54 | ERROR   | Array indentation error, expected 6 spaces but found 8
  55 | ERROR   | Array indentation error, expected 6 spaces but found 8
  56 | ERROR   | Array indentation error, expected 6 spaces but found 8
  57 | ERROR   | Array indentation error, expected 6 spaces but found 8
  58 | ERROR   | Array indentation error, expected 6 spaces but found 8
  59 | ERROR   | Array indentation error, expected 6 spaces but found 8
  60 | ERROR   | Array indentation error, expected 6 spaces but found 8
  61 | ERROR   | No space before comment text; expected "// '#access' =>
     |         | empty($settings['allowed_values_function'])," but found
     |         | "//'#access' => empty($settings['allowed_values_function']),"
  66 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
  70 | ERROR   | else must start on a new line
  70 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
  81 | ERROR   | Whitespace found at end of line
  87 | WARNING | A comma should follow the last multiline array item. Found: )
  88 | WARNING | A comma should follow the last multiline array item. Found: )
  99 | ERROR   | No space before comment text; expected "// dsm($field);" but
     |         | found "//dsm($field);"
  99 | ERROR   | There must be no blank line following an inline comment
 102 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
 103 | ERROR   | Line indented incorrectly; expected 4 spaces, found 8
 104 | ERROR   | Line indented incorrectly; expected 6 spaces, found 12
 106 | ERROR   | No space before comment text; expected "// Now match the delta
     |         | with the string and print actual text." but found "//Now match
     |         | the delta with the string and print actual text."
 109 | ERROR   | No space before comment text; expected "//
     |         | dsm($string_array);" but found "//dsm($string_array);"
 109 | ERROR   | There must be no blank line following an inline comment
 112 | ERROR   | Line indented incorrectly; expected 8 spaces, found 16
 113 | ERROR   | Line indented incorrectly; expected 10 spaces, found 20
 114 | ERROR   | Line indented incorrectly; expected 12 spaces, found 24
 121 | ERROR   | Array indentation error, expected 18 spaces but found 20
 122 | ERROR   | Array indentation error, expected 18 spaces but found 20
 123 | ERROR   | No space before comment text; expected "// '#prefix' => '<div
     |         | class="'.$field['field_name'].'">'," but found "//'#prefix' =>
     |         | '<div class="'.$field['field_name'].'">',"
 124 | ERROR   | No space before comment text; expected "// '#suffix' =>
     |         | '</div>'," but found "//'#suffix' => '</div>',"
 127 | ERROR   | Break statement indented incorrectly; expected 10 spaces,
     |         | found 12
 130 | ERROR   | Comments may not appear after statements.
 133 | ERROR   | You must use "/**" style comments for a function comment
 135 | ERROR   | Array indentation error, expected 6 spaces but found 8
 136 | ERROR   | Array indentation error, expected 10 spaces but found 12
 137 | ERROR   | Array indentation error, expected 10 spaces but found 12
 138 | ERROR   | Array indentation error, expected 6 spaces but found 8
 142 | ERROR   | Missing function doc comment
 143 | ERROR   | No space before comment text; expected "// dsm($field);" but
     |         | found "//dsm($field);"
 144 | ERROR   | No space before comment text; expected "// dsm($element);" but
     |         | found "//dsm($element);"
 144 | ERROR   | There must be no blank line following an inline comment
 151 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
 159 | ERROR   | Variable "localData" is camel caps format. do not use mixed
     |         | case (camelCase), use lower case and _
 161 | ERROR   | No space before comment text; expected "// plugin prepopulate
     |         | funda." but found "//plugin prepopulate funda."
 161 | ERROR   | Inline comments must start with a capital letter
 165 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
 169 | ERROR   | Line indented incorrectly; expected 4 spaces, found 8
 171 | ERROR   | Array indentation error, expected 14 spaces but found 16
 172 | ERROR   | Array indentation error, expected 14 spaces but found 16
 173 | WARNING | Line exceeds 80 characters; contains 87 characters
 175 | ERROR   | Array indentation error, expected 14 spaces but found 16
 176 | ERROR   | Array indentation error, expected 14 spaces but found 16
 177 | ERROR   | Array indentation error, expected 14 spaces but found 16
 178 | ERROR   | Whitespace found at end of line
 179 | ERROR   | Array indentation error, expected 14 spaces but found 16
 180 | ERROR   | Array indentation error, expected 14 spaces but found 0
 181 | ERROR   | Array indentation error, expected 14 spaces but found 0
 182 | ERROR   | Array indentation error, expected 14 spaces but found 0
 182 | ERROR   | Variable "localData" is camel caps format. do not use mixed
     |         | case (camelCase), use lower case and _
 183 | ERROR   | Array indentation error, expected 14 spaces but found 0
 184 | ERROR   | Array indentation error, expected 14 spaces but found 0
 185 | ERROR   | Array indentation error, expected 14 spaces but found 0
 186 | ERROR   | Array indentation error, expected 14 spaces but found 0
 186 | ERROR   | Concat operator must be surrounded by spaces
 186 | ERROR   | Concat operator must be surrounded by spaces
 187 | ERROR   | Array indentation error, expected 14 spaces but found 0
 188 | ERROR   | Array indentation error, expected 14 spaces but found 0
 189 | ERROR   | Array indentation error, expected 14 spaces but found 0
 190 | ERROR   | Whitespace found at end of line
 191 | ERROR   | Array indentation error, expected 14 spaces but found 16
 192 | ERROR   | Array indentation error, expected 18 spaces but found 20
 193 | ERROR   | Array indentation error, expected 22 spaces but found 24
 194 | ERROR   | Array indentation error, expected 18 spaces but found 20
 195 | ERROR   | Array indentation error, expected 14 spaces but found 16
 197 | ERROR   | Break statement indented incorrectly; expected 10 spaces,
     |         | found 12
 208 | ERROR   | Whitespace found at end of line
 209 | ERROR   | Last parameter comment requires a blank newline after it
 209 | ERROR   | Missing comment for param "$field_name" at position 1
 210 | ERROR   | Whitespace found at end of line
 210 | ERROR   | Return comment must be on the next line
 214 | ERROR   | No space before comment text; expected "// dsm($field_data);
     |         | return'asdf';" but found "//dsm($field_data); return'asdf';"
 214 | ERROR   | There must be no blank line following an inline comment
 218 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
 226 | ERROR   | You must use "/**" style comments for a function comment
 230 | ERROR   | Line indented incorrectly; expected 2 spaces, found 4
 231 | ERROR   | Line indented incorrectly; expected 4 spaces, found 8
 240 | ERROR   | Files must end in a single new line character
--------------------------------------------------------------------------------


FILE: ...ew/sites/all/modules/pareview_temp/test_candidate/tokeninput_custom.css
--------------------------------------------------------------------------------
FOUND 7 ERROR(S) AFFECTING 6 LINE(S)
--------------------------------------------------------------------------------
  1 | ERROR | Whitespace found at end of line
 10 | ERROR | Line indented incorrectly; expected 2 spaces, found 4
 10 | ERROR | CSS colours must be defined in lowercase; expected #8496ba but
    |       | found #8496BA
 11 | ERROR | Line indented incorrectly; expected 2 spaces, found 4
 12 | ERROR | Line indented incorrectly; expected 2 spaces, found 4
 13 | ERROR | Line indented incorrectly; expected 2 spaces, found 4
 14 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

Source: http://ventral.org/pareview - PAReview.sh online service

patrickd’s picture

@mdespeuilles
please don't post such big automated reviews into issues, it's quite demotivating for applicants to hit this "wall of errors"
rather attach a txt-file containing the report, or a direct link to it.

patrickd’s picture

Title: toekeninput » Tokeninput

correcting title

amrit_b’s picture

ha ha. Very true. I almost stopped working ;) Thank you!!

d34dman’s picture

Hi amrit_b,

Nice module.

1. Install instructions missing. Please provide proper instruction for downloading the files required for installing the module. Had to read the code to understand which files are necessary.

2. Autocomplete Deluxe has a functionality very much similar to what you have implemented. The advantage of Autocomplete Deluxe is it can be implemented as Widget for List Fields. I would like to hear about your justification on implementing it as a different field all together.

amrit_b’s picture

Yeah you are right D34Man.. I guess the whole approach is wrong... Should have only used form_alter for all these stuff. Will re-do from scratch as soon as I get some time. I was not familiar with autocomplete Delux. But there is another module dro D7 which implements almost the same feature.. The only difference is that they all use different jquery plugins.. Anyway, jQuery UI is bringing this feature soon..

Thanks for checking though Shibin!

d34dman’s picture

i will only be happy to review the project once you put it back to needs review. Another line of thought was to provide a alternate ui for autocomplete deluxe, maybe you can submit a patch there instead of implementing all other functions.. just pass me the link to the relevant issue please, if you go ahead with that.

amrit_b’s picture

Hey Shibin, I have submitted a patch at http://drupal.org/node/1510738 -- its not complete though.. needs work

chunglk’s picture

StatusFileSize
new3.01 KB

Other module for node reference

chunglk’s picture

StatusFileSize
new3.43 KB

Update

chunglk’s picture

StatusFileSize
new3.63 KB

other module

patrickd’s picture

@chunglk
if you want to contribute code to this module ask for a co-maintainership or create your own sandbox project,
pasting your code in here does not really help much

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.