compass-jquery-plugin 0.3.2.8 → 0.3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +24 -6
- data/VERSION.yml +3 -3
- data/lib/jquery/gridify/grid_column.rb +6 -6
- data/lib/jquery/gridify/grid_options.rb +4 -4
- data/lib/jquery/mark_it_up.rb +2 -0
- data/lib/jquery/mobile.rb +0 -1
- data/templates/dynatree/jquery.dynatree.js +2896 -2880
- data/templates/dynatree/jquery.dynatree.min.js +55 -54
- data/templates/dynatree/jquery/dynatree/aero.scss +4 -2
- data/templates/dynatree/jquery/dynatree/aqua.scss +4 -2
- data/templates/dynatree/jquery/dynatree/crystal.scss +4 -2
- data/templates/dynatree/jquery/dynatree/xp.scss +5 -3
- data/templates/emulators/emulators/bb.playbook.landscape.png +0 -0
- data/templates/emulators/emulators/bb.playbook.landscape.scss +18 -0
- data/templates/emulators/emulators/bb.playbook.portrait.png +0 -0
- data/templates/emulators/emulators/bb.playbook.portrait.scss +18 -0
- data/templates/emulators/emulators/{blackberry.torch.landscape.png → bb.torch.landscape.png} +0 -0
- data/templates/emulators/emulators/{blackberry.torch.landscape.scss → bb.torch.landscape.scss} +1 -3
- data/templates/emulators/emulators/{blackberry.torch.portrait.png → bb.torch.portrait.png} +0 -0
- data/templates/emulators/emulators/{blackberry.torch.portrait.scss → bb.torch.portrait.scss} +1 -3
- data/templates/emulators/emulators/galaxy.ace.landscape.png +0 -0
- data/templates/emulators/emulators/galaxy.ace.landscape.scss +18 -0
- data/templates/emulators/emulators/galaxy.ace.portrait.png +0 -0
- data/templates/emulators/emulators/galaxy.ace.portrait.scss +18 -0
- data/templates/emulators/emulators/galaxy.s.landscape.scss +0 -2
- data/templates/emulators/emulators/galaxy.s.portrait.scss +0 -2
- data/templates/emulators/emulators/galaxy.s2.landscape.scss +0 -2
- data/templates/emulators/emulators/galaxy.s2.portrait.scss +0 -2
- data/templates/emulators/emulators/galaxy.tab.10.1.landscape.scss +0 -2
- data/templates/emulators/emulators/galaxy.tab.10.1.portrait.scss +0 -2
- data/templates/emulators/emulators/galaxy.tab.7.landscape.scss +0 -2
- data/templates/emulators/emulators/galaxy.tab.7.portrait.scss +0 -2
- data/templates/emulators/emulators/galaxy.tab.8.9.landscape.scss +0 -2
- data/templates/emulators/emulators/galaxy.tab.8.9.portrait.scss +0 -2
- data/templates/emulators/emulators/htc.sensation.landscape.png +0 -0
- data/templates/emulators/emulators/htc.sensation.landscape.scss +18 -0
- data/templates/emulators/emulators/htc.sensation.portrait.png +0 -0
- data/templates/emulators/emulators/htc.sensation.portrait.scss +18 -0
- data/templates/emulators/emulators/ipad.landscape.scss +0 -2
- data/templates/emulators/emulators/ipad.portrait.scss +0 -2
- data/templates/emulators/emulators/iphone.3.landscape.scss +0 -2
- data/templates/emulators/emulators/iphone.3.portrait.scss +0 -2
- data/templates/emulators/emulators/{iphone.4.landscape .scss → iphone.4.landscape.scss} +0 -2
- data/templates/emulators/emulators/iphone.4.portrait.scss +0 -2
- data/templates/emulators/emulators/palm.pre.2.landscape.scss +0 -2
- data/templates/emulators/emulators/palm.pre.2.portrait.scss +0 -2
- data/templates/emulators/manifest.rb +17 -5
- data/templates/graphics/highcharts/dark-blue.js +159 -159
- data/templates/graphics/highcharts/dark-green.js +159 -159
- data/templates/graphics/highcharts/gray.js +154 -154
- data/templates/graphics/highcharts/grid.js +84 -84
- data/templates/graphics/highcharts/highslide-config.js +2 -2
- data/templates/graphics/highcharts/highslide-full.js +3310 -3310
- data/templates/graphics/highcharts/skies.js +72 -72
- data/templates/graphics/jquery.ganttView.js +1550 -1550
- data/templates/graphics/jquery.highcharts.js +11277 -11285
- data/templates/graphics/jquery.sparkline.js +1072 -1072
- data/templates/ical/jquery.ical.js +7637 -7637
- data/templates/ical/jquery/ical.print.scss +3 -3
- data/templates/jqgrid/i18n/jqgrid/locale-ar.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-bg.js +131 -131
- data/templates/jqgrid/i18n/jqgrid/locale-bg1251.js +131 -131
- data/templates/jqgrid/i18n/jqgrid/locale-cat.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +132 -132
- data/templates/jqgrid/i18n/jqgrid/locale-cs.js +129 -129
- data/templates/jqgrid/i18n/jqgrid/locale-da.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-de.js +134 -134
- data/templates/jqgrid/i18n/jqgrid/locale-el.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-en.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-es.js +129 -129
- data/templates/jqgrid/i18n/jqgrid/locale-fa.js +141 -141
- data/templates/jqgrid/i18n/jqgrid/locale-fi.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-fr.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-gl.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-he.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-hu.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-is.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-it.js +6 -6
- data/templates/jqgrid/i18n/jqgrid/locale-ja.js +153 -153
- data/templates/jqgrid/i18n/jqgrid/locale-lt.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-mne.js +134 -0
- data/templates/jqgrid/i18n/jqgrid/locale-mne.min.js +7 -0
- data/templates/jqgrid/i18n/jqgrid/locale-nl.js +145 -145
- data/templates/jqgrid/i18n/jqgrid/locale-no.js +12 -12
- data/templates/jqgrid/i18n/jqgrid/locale-pl.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-pt-br.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-pt.js +126 -126
- data/templates/jqgrid/i18n/jqgrid/locale-ro.js +140 -140
- data/templates/jqgrid/i18n/jqgrid/locale-ru.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-sk.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-sr.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-sv.js +128 -128
- data/templates/jqgrid/i18n/jqgrid/locale-tr.js +127 -127
- data/templates/jqgrid/i18n/jqgrid/locale-ua.js +128 -128
- data/templates/jqgrid/jquery.jqGrid.js +13477 -13443
- data/templates/jqgrid/jquery.jqGrid.min.js +292 -287
- data/templates/jqgrid/jquery/jqGrid.scss +13 -12
- data/templates/jqgrid/manifest.rb +2 -0
- data/templates/jqtouch/jquery.jqtouch.js +9601 -9556
- data/templates/jqtouch/jquery.jqtouch.min.js +3 -3
- data/templates/jqtouch/jquery/touch/default.scss +2 -2
- data/templates/jqtouch/jquery/touch/jqt.scss +2 -2
- data/templates/jqtouch/jquery/touch/jqtouch.scss +26 -5
- data/templates/jquery/amplify.store.js +211 -211
- data/templates/jquery/config/initializers/jquery.rb +2 -0
- data/templates/jquery/history.adapter.jquery.js +42 -36
- data/templates/jquery/history.html4.js +563 -563
- data/templates/jquery/history.html4.min.js +5 -5
- data/templates/jquery/history.js +1721 -1694
- data/templates/jquery/history.min.js +28 -27
- data/templates/jquery/i18n/jquery.ui/datepicker-af.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-ar.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-az.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-bg.js +21 -21
- data/templates/jquery/i18n/jquery.ui/datepicker-bs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ca.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-cs.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-da.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-de.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-el.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-en-GB.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-eo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-es.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-et.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-eu.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fa.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-fi.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-fo.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr-CH.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-fr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-gl.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-he.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-hu.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-hy.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-id.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-is.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-it.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-ja.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ko.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-kz.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-lt.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-lv.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ms.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-nl.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-no.js +18 -18
- data/templates/jquery/i18n/jquery.ui/datepicker-pl.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-pt-BR.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-pt.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-rm.js +17 -17
- data/templates/jquery/i18n/jquery.ui/datepicker-ro.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ru.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-sk.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-sk.min.js +1 -1
- data/templates/jquery/i18n/jquery.ui/datepicker-sl.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-sq.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr-SR.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sr.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-sv.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-ta.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-th.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-tj.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-tr.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-uk.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-vi.js +20 -20
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-CN.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-HK.js +19 -19
- data/templates/jquery/i18n/jquery.ui/datepicker-zh-TW.js +20 -20
- data/templates/jquery/jquery-ui.js +11913 -11882
- data/templates/jquery/jquery-ui.min.js +340 -339
- data/templates/jquery/jquery.bgiframe.js +27 -27
- data/templates/jquery/jquery.contextMenu.js +202 -202
- data/templates/jquery/jquery.cookie.js +26 -26
- data/templates/jquery/jquery.dotimeout.js +227 -227
- data/templates/jquery/jquery.dst.js +89 -89
- data/templates/jquery/jquery.easing.js +226 -0
- data/templates/jquery/jquery.easing.min.js +8 -0
- data/templates/jquery/jquery.farbtastic.js +294 -294
- data/templates/jquery/jquery.flashMessages.js +14 -14
- data/templates/jquery/jquery.form.js +761 -761
- data/templates/jquery/jquery.haml.js +247 -247
- data/templates/jquery/jquery.hotkeys.js +79 -79
- data/templates/jquery/jquery.js +1490 -928
- data/templates/jquery/jquery.layout.js +2454 -2454
- data/templates/jquery/jquery.mediahelpers.js +216 -0
- data/templates/jquery/jquery.mediahelpers.min.js +3 -0
- data/templates/jquery/jquery.min.js +177 -166
- data/templates/jquery/jquery.mousewheel.js +57 -57
- data/templates/jquery/jquery.offline.js +171 -171
- data/templates/jquery/jquery.pngFix.js +72 -72
- data/templates/jquery/jquery.rails.js +145 -145
- data/templates/jquery/jquery.replacetext.js +80 -80
- data/templates/jquery/jquery.themeswitchertool.js +195 -195
- data/templates/jquery/jquery.tmpl.js +460 -460
- data/templates/jquery/jquery.tmplPlus.js +78 -78
- data/templates/jquery/jquery.tokeninput.js +480 -475
- data/templates/jquery/jquery/ui/_theme.scss +14 -14
- data/templates/jquery/jquery/ui/black-tie/ui-icons_4ca300_256x240.png +0 -0
- data/templates/jquery/jquery/ui/black-tie/ui-icons_bbbbbb_256x240.png +0 -0
- data/templates/jquery/jquery/ui/black-tie/ui-icons_ededed_256x240.png +0 -0
- data/templates/jquery/jquery/ui/black-tie/ui-icons_ffcf29_256x240.png +0 -0
- data/templates/jquery/jquery/ui/vader/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/templates/jquery/jquery/ui/vader/ui-icons_bbbbbb_256x240.png +0 -0
- data/templates/jquery/jquery/ui/vader/ui-icons_c98000_256x240.png +0 -0
- data/templates/jquery/jquery/ui/vader/ui-icons_f29a00_256x240.png +0 -0
- data/templates/jquery/json.js +66 -66
- data/templates/jquery/json2.js +177 -177
- data/templates/jquery/manifest.rb +4 -0
- data/templates/jstree/jquery.jstree.js +5918 -5918
- data/templates/markitup/app/views/shared/_mark_it_up.parsed.preview.blue.html.haml +9 -0
- data/templates/markitup/app/views/shared/_mark_it_up.parsed.preview.html.haml +9 -0
- data/templates/markitup/app/views/shared/_mark_it_up.preview.blue.html.haml +8 -0
- data/templates/markitup/app/views/shared/_mark_it_up.preview.html.haml +8 -0
- data/templates/markitup/config/initializers/mark_it_up.rb +40 -0
- data/templates/markitup/jquery.markitup.js +586 -0
- data/templates/markitup/jquery.markitup.min.js +1 -0
- data/templates/markitup/jquery/markitup/preview/body.blue.png +0 -0
- data/templates/markitup/jquery/markitup/preview/bullet.blue.png +0 -0
- data/templates/markitup/jquery/markitup/preview/preview.blue.scss +58 -0
- data/templates/markitup/jquery/markitup/preview/preview.scss +7 -0
- data/templates/markitup/jquery/markitup/sets/bbcode.scss +34 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/clean.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/fonts.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/list-item.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/bbcode/underline.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css.scss +54 -0
- data/templates/markitup/jquery/markitup/sets/css/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/css.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/tag.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_align_center.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_align_justify.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_align_left.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_align_right.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_indent.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_letterspacing.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_linespacing.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_lowercase.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_padding_bottom.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_padding_left.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_padding_right.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_padding_top.png +0 -0
- data/templates/markitup/jquery/markitup/sets/css/text_uppercase.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default.scss +22 -0
- data/templates/markitup/jquery/markitup/sets/default/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/clean.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/image.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/default/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear.scss +38 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/dotclear/url.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html.scss +42 -0
- data/templates/markitup/jquery/markitup/sets/html/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/clean.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/image.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/list-item.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/paragraph.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/html/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown.scss +38 -0
- data/templates/markitup/jquery/markitup/sets/markdown/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markdown/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin.scss +38 -0
- data/templates/markitup/jquery/markitup/sets/markmin/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/markmin/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest.scss +38 -0
- data/templates/markitup/jquery/markitup/sets/rest/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/rest/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile.scss +44 -0
- data/templates/markitup/jquery/markitup/sets/textile/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/paragraph.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/textile/table.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy.scss +40 -0
- data/templates/markitup/jquery/markitup/sets/texy/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/disconnect.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/page_white_code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/texy/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags.scss +44 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/disconnect.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/txt2tags/underline.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki.scss +42 -0
- data/templates/markitup/jquery/markitup/sets/wiki/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/code.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/quotes.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/table.png +0 -0
- data/templates/markitup/jquery/markitup/sets/wiki/url.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode.scss +42 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/bold.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/clean.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/h1.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/h2.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/h3.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/h4.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/h5.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/h6.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/image.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/italic.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/link.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/list-bullet.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/list-item.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/list-numeric.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/paragraph.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/picture.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/preview.png +0 -0
- data/templates/markitup/jquery/markitup/sets/xbbcode/stroke.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua.scss +136 -0
- data/templates/markitup/jquery/markitup/skins/aqua/bg-container-white.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/bg-container.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/bg-footer-white.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/bg-footer.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/bg-header-white.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/bg-header.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/handle.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/menu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/spacer.gif +0 -0
- data/templates/markitup/jquery/markitup/skins/aqua/submenu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor.scss +141 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-container.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-bbcode.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-dotclear.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-html.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-markdown.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-textile.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor-wiki.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/bg-editor.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/handle.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/menu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/jtageditor/submenu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live.scss +135 -0
- data/templates/markitup/jquery/markitup/skins/live/bg-container.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live/bg-footer.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live/bg-header.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live/editor.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live/handle.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live/menu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/live/submenu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup.scss +150 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-container.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-bbcode.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-dotclear.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-html.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-json.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-markdown.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-textile.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-wiki.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor-xml.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/bg-editor.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/handle.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/menu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/markitup/submenu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/simple.scss +117 -0
- data/templates/markitup/jquery/markitup/skins/simple/handle.png +0 -0
- data/templates/markitup/jquery/markitup/skins/simple/menu.png +0 -0
- data/templates/markitup/jquery/markitup/skins/simple/submenu.png +0 -0
- data/templates/markitup/manifest.rb +311 -0
- data/templates/markitup/markitup/jquery.markitup.set.bbcode.js +40 -0
- data/templates/markitup/markitup/jquery.markitup.set.bbcode.min.js +3 -0
- data/templates/markitup/markitup/jquery.markitup.set.css.js +53 -0
- data/templates/markitup/markitup/jquery.markitup.set.css.min.js +5 -0
- data/templates/markitup/markitup/jquery.markitup.set.default.js +30 -0
- data/templates/markitup/markitup/jquery.markitup.set.default.min.js +2 -0
- data/templates/markitup/markitup/jquery.markitup.set.dotclear.js +38 -0
- data/templates/markitup/markitup/jquery.markitup.set.dotclear.min.js +3 -0
- data/templates/markitup/markitup/jquery.markitup.set.html.js +40 -0
- data/templates/markitup/markitup/jquery.markitup.set.html.min.js +4 -0
- data/templates/markitup/markitup/jquery.markitup.set.markdown.js +53 -0
- data/templates/markitup/markitup/jquery.markitup.set.markdown.min.js +3 -0
- data/templates/markitup/markitup/jquery.markitup.set.markmin.js +50 -0
- data/templates/markitup/markitup/jquery.markitup.set.markmin.min.js +3 -0
- data/templates/markitup/markitup/jquery.markitup.set.rest.js +52 -0
- data/templates/markitup/markitup/jquery.markitup.set.rest.min.js +3 -0
- data/templates/markitup/markitup/jquery.markitup.set.textile.js +58 -0
- data/templates/markitup/markitup/jquery.markitup.set.textile.min.js +4 -0
- data/templates/markitup/markitup/jquery.markitup.set.texy.js +52 -0
- data/templates/markitup/markitup/jquery.markitup.set.texy.min.js +4 -0
- data/templates/markitup/markitup/jquery.markitup.set.txt2tags.js +42 -0
- data/templates/markitup/markitup/jquery.markitup.set.txt2tags.min.js +3 -0
- data/templates/markitup/markitup/jquery.markitup.set.wiki.js +61 -0
- data/templates/markitup/markitup/jquery.markitup.set.wiki.min.js +4 -0
- data/templates/markitup/markitup/jquery.markitup.set.xbbcode.js +36 -0
- data/templates/markitup/markitup/jquery.markitup.set.xbbcode.min.js +4 -0
- data/templates/mobile/config/initializers/mobile.rb +2 -0
- data/templates/mobile/jquery.mobile.js +4545 -4454
- data/templates/mobile/jquery.mobile.min.js +16 -7
- data/templates/mobile/jquery/mobile/960.fluid.scss +191 -0
- data/templates/mobile/jquery/mobile/960.scss +213 -0
- data/templates/mobile/jquery/mobile/_base.scss +37 -20
- data/templates/mobile/jquery/mobile/default.scss +48 -56
- data/templates/mobile/jquery/mobile/valencia.scss +43 -44
- data/templates/mobile/manifest.rb +2 -0
- data/templates/ribbon/jquery.ribbon.js +195 -195
- data/templates/ribbon/jquery.ribbon.min.js +1 -1
- data/templates/ribbon/jquery/ribbon/office.scss +12 -12
- data/templates/ribbon/jquery/ribbon/windows7.scss +12 -12
- data/templates/secret_sauce/secret_sauce.js +8 -8
- data/templates/tools/flowplayer.js +897 -897
- data/templates/tools/jquery.tools.js +3647 -3647
- data/templates/tools/jquery.tools.min.js +47 -47
- data/templates/tools/swfobject.js +760 -760
- metadata +350 -22
@@ -9,92 +9,92 @@
|
|
9
9
|
* http://jquery.org/license
|
10
10
|
*/
|
11
11
|
(function (jQuery) {
|
12
|
-
|
12
|
+
var oldComplete = jQuery.tmpl.complete, oldManip = jQuery.fn.domManip;
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
14
|
+
// Override jQuery.tmpl.complete in order to provide rendered event.
|
15
|
+
jQuery.tmpl.complete = function(tmplItems) {
|
16
|
+
var tmplItem;
|
17
|
+
oldComplete(tmplItems);
|
18
|
+
for (tmplItem in tmplItems) {
|
19
|
+
tmplItem = tmplItems[tmplItem];
|
20
|
+
if (tmplItem.addedTmplItems && jQuery.inArray(tmplItem, tmplItem.addedTmplItems) === -1) {
|
21
|
+
tmplItem.addedTmplItems.push(tmplItem);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
for (tmplItem in tmplItems) {
|
25
|
+
tmplItem = tmplItems[tmplItem];
|
26
|
+
// Raise rendered event
|
27
|
+
if (tmplItem.rendered) {
|
28
|
+
tmplItem.rendered(tmplItem);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
};
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
jQuery.extend({
|
34
|
+
tmplCmd: function(command, data, tmplItems) {
|
35
|
+
var retTmplItems = [], before;
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
}
|
46
|
-
}
|
47
|
-
}
|
48
|
-
return found;
|
37
|
+
function find(data, tmplItems) {
|
38
|
+
var found = [], tmplItem, ti, tl = tmplItems.length, dataItem, di = 0, dl = data.length;
|
39
|
+
for (; di < dl;) {
|
40
|
+
dataItem = data[di++];
|
41
|
+
for (ti = 0; ti < tl;) {
|
42
|
+
tmplItem = tmplItems[ti++];
|
43
|
+
if (tmplItem.data === dataItem) {
|
44
|
+
found.push(tmplItem);
|
49
45
|
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
return found;
|
49
|
+
}
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
data = jQuery.isArray(data) ? data : [ data ];
|
52
|
+
switch (command) {
|
53
|
+
case "find":
|
54
|
+
return find(data, tmplItems);
|
55
|
+
case "replace":
|
56
|
+
data.reverse();
|
57
|
+
}
|
58
|
+
jQuery.each(tmplItems ? find(data, tmplItems) : data, function(i, tmplItem) {
|
59
|
+
coll = tmplItem.nodes;
|
60
|
+
switch (command) {
|
61
|
+
case "update":
|
62
|
+
tmplItem.update();
|
63
|
+
break;
|
64
|
+
case "remove":
|
65
|
+
jQuery(coll).remove();
|
66
|
+
if (tmplItems) {
|
67
|
+
tmplItems.splice(jQuery.inArray(tmplItem, tmplItems), 1);
|
57
68
|
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
case "remove":
|
65
|
-
jQuery(coll).remove();
|
66
|
-
if (tmplItems) {
|
67
|
-
tmplItems.splice(jQuery.inArray(tmplItem, tmplItems), 1);
|
68
|
-
}
|
69
|
-
break;
|
70
|
-
case "replace":
|
71
|
-
before = before ?
|
72
|
-
jQuery(coll).insertBefore(before)[0] :
|
73
|
-
jQuery(coll).appendTo(coll[0].parentNode)[0];
|
74
|
-
retTmplItems.unshift(tmplItem);
|
75
|
-
}
|
76
|
-
});
|
77
|
-
return retTmplItems;
|
69
|
+
break;
|
70
|
+
case "replace":
|
71
|
+
before = before ?
|
72
|
+
jQuery(coll).insertBefore(before)[0] :
|
73
|
+
jQuery(coll).appendTo(coll[0].parentNode)[0];
|
74
|
+
retTmplItems.unshift(tmplItem);
|
78
75
|
}
|
79
|
-
|
76
|
+
});
|
77
|
+
return retTmplItems;
|
78
|
+
}
|
79
|
+
});
|
80
80
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
jQuery.fn.extend({
|
82
|
+
domManip: function (args, table, callback, options) {
|
83
|
+
var data = args[1], tmpl = args[0], dmArgs;
|
84
|
+
if (args.length >= 2 && typeof data === "object" && !data.nodeType && !(data instanceof jQuery)) {
|
85
|
+
// args[1] is data, for a template.
|
86
|
+
dmArgs = jQuery.makeArray(arguments);
|
87
87
|
|
88
|
-
|
89
|
-
|
88
|
+
// Eval template to obtain fragment to clone and insert
|
89
|
+
dmArgs[0] = [ jQuery.tmpl(jQuery.template(tmpl), data, args[2], args[3]) ];
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
91
|
+
dmArgs[2] = function(fragClone) {
|
92
|
+
// Handler called by oldManip when rendered template has been inserted into DOM.
|
93
|
+
jQuery.tmpl.afterManip(this, fragClone, callback);
|
94
|
+
};
|
95
|
+
return oldManip.apply(this, dmArgs);
|
96
|
+
}
|
97
|
+
return oldManip.apply(this, arguments);
|
98
|
+
}
|
99
|
+
});
|
100
100
|
})(jQuery);
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
(function ($) {
|
12
12
|
// Default settings
|
13
|
-
var DEFAULT_SETTINGS = {
|
13
|
+
var DEFAULT_SETTINGS = {
|
14
14
|
hintText: "Type in a search term",
|
15
15
|
noResultsText: "No results",
|
16
16
|
searchingText: "Searching...",
|
@@ -29,10 +29,10 @@ var DEFAULT_SETTINGS = {
|
|
29
29
|
onResult: null,
|
30
30
|
onAdd: null,
|
31
31
|
onDelete: null
|
32
|
-
};
|
32
|
+
};
|
33
33
|
|
34
34
|
// Default classes to use when theming
|
35
|
-
var DEFAULT_CLASSES = {
|
35
|
+
var DEFAULT_CLASSES = {
|
36
36
|
tokenList: "token-input-list",
|
37
37
|
token: "token-input-token",
|
38
38
|
tokenDelete: "token-input-delete-token",
|
@@ -43,17 +43,17 @@ var DEFAULT_CLASSES = {
|
|
43
43
|
dropdownItem2: "token-input-dropdown-item2",
|
44
44
|
selectedDropdownItem: "token-input-selected-dropdown-item",
|
45
45
|
inputToken: "token-input-input-token"
|
46
|
-
};
|
46
|
+
};
|
47
47
|
|
48
48
|
// Input box position "enum"
|
49
|
-
var POSITION = {
|
49
|
+
var POSITION = {
|
50
50
|
BEFORE: 0,
|
51
51
|
AFTER: 1,
|
52
52
|
END: 2
|
53
|
-
};
|
53
|
+
};
|
54
54
|
|
55
55
|
// Keys "enum"
|
56
|
-
var KEY = {
|
56
|
+
var KEY = {
|
57
57
|
BACKSPACE: 8,
|
58
58
|
TAB: 9,
|
59
59
|
ENTER: 13,
|
@@ -69,55 +69,55 @@ var KEY = {
|
|
69
69
|
DOWN: 40,
|
70
70
|
NUMPAD_ENTER: 108,
|
71
71
|
COMMA: 188
|
72
|
-
};
|
72
|
+
};
|
73
73
|
|
74
74
|
|
75
75
|
// Expose the .tokenInput function to jQuery as a plugin
|
76
|
-
$.fn.tokenInput = function (url_or_data, options) {
|
76
|
+
$.fn.tokenInput = function (url_or_data, options) {
|
77
77
|
var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
|
78
78
|
|
79
79
|
return this.each(function () {
|
80
|
-
|
80
|
+
new $.TokenList(this, url_or_data, settings);
|
81
81
|
});
|
82
|
-
};
|
82
|
+
};
|
83
83
|
|
84
84
|
|
85
85
|
// TokenList class for each input
|
86
|
-
$.TokenList = function (input, url_or_data, settings) {
|
86
|
+
$.TokenList = function (input, url_or_data, settings) {
|
87
87
|
//
|
88
88
|
// Initialization
|
89
89
|
//
|
90
90
|
|
91
91
|
// Configure the data source
|
92
|
-
if(typeof(url_or_data) === "string") {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
}
|
92
|
+
if (typeof(url_or_data) === "string") {
|
93
|
+
// Set the url to query against
|
94
|
+
settings.url = url_or_data;
|
95
|
+
|
96
|
+
// Make a smart guess about cross-domain if it wasn't explicitly specified
|
97
|
+
if (settings.crossDomain === undefined) {
|
98
|
+
if (settings.url.indexOf("://") === -1) {
|
99
|
+
settings.crossDomain = false;
|
100
|
+
} else {
|
101
|
+
settings.crossDomain = (location.href.split(/\/+/g)[1] !== settings.url.split(/\/+/g)[1]);
|
103
102
|
}
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
}
|
104
|
+
} else if (typeof(url_or_data) === "object") {
|
105
|
+
// Set the local data to search through
|
106
|
+
settings.local_data = url_or_data;
|
107
107
|
}
|
108
108
|
|
109
109
|
// Build class names
|
110
|
-
if(settings.classes) {
|
111
|
-
|
112
|
-
|
113
|
-
} else if(settings.theme) {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
110
|
+
if (settings.classes) {
|
111
|
+
// Use custom class names
|
112
|
+
settings.classes = $.extend({}, DEFAULT_CLASSES, settings.classes);
|
113
|
+
} else if (settings.theme) {
|
114
|
+
// Use theme-suffixed default class names
|
115
|
+
settings.classes = {};
|
116
|
+
$.each(DEFAULT_CLASSES, function(key, value) {
|
117
|
+
settings.classes[key] = value + "-" + settings.theme;
|
118
|
+
});
|
119
119
|
} else {
|
120
|
-
|
120
|
+
settings.classes = DEFAULT_CLASSES;
|
121
121
|
}
|
122
122
|
|
123
123
|
|
@@ -136,113 +136,117 @@ $.TokenList = function (input, url_or_data, settings) {
|
|
136
136
|
|
137
137
|
// Create a new text input an attach keyup events
|
138
138
|
var input_box = $("<input type=\"text\" autocomplete=\"off\">")
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
139
|
+
.css({
|
140
|
+
outline: "none"
|
141
|
+
})
|
142
|
+
.focus(function () {
|
143
|
+
if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
|
144
|
+
show_dropdown_hint();
|
145
|
+
}
|
146
|
+
})
|
147
|
+
.blur(function () {
|
148
|
+
hide_dropdown();
|
149
|
+
})
|
150
|
+
.bind("keyup keydown blur update", resize_input)
|
151
|
+
.keydown(function (event) {
|
152
|
+
var previous_token;
|
153
|
+
var next_token;
|
154
|
+
|
155
|
+
switch (event.keyCode) {
|
156
|
+
case KEY.LEFT:
|
157
|
+
case KEY.RIGHT:
|
158
|
+
case KEY.UP:
|
159
|
+
case KEY.DOWN:
|
160
|
+
if (!$(this).val()) {
|
161
|
+
previous_token = input_token.prev();
|
162
|
+
next_token = input_token.next();
|
163
|
+
|
164
|
+
if ((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) {
|
165
|
+
// Check if there is a previous/next token and it is selected
|
166
|
+
if (event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) {
|
167
|
+
deselect_token($(selected_token), POSITION.BEFORE);
|
168
|
+
} else {
|
169
|
+
deselect_token($(selected_token), POSITION.AFTER);
|
170
|
+
}
|
171
|
+
} else if ((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
|
172
|
+
// We are moving left, select the previous token if it exists
|
173
|
+
select_token($(previous_token.get(0)));
|
174
|
+
} else if ((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
|
175
|
+
// We are moving right, select the next token if it exists
|
176
|
+
select_token($(next_token.get(0)));
|
145
177
|
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
}
|
171
|
-
} else if((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
|
172
|
-
// We are moving left, select the previous token if it exists
|
173
|
-
select_token($(previous_token.get(0)));
|
174
|
-
} else if((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
|
175
|
-
// We are moving right, select the next token if it exists
|
176
|
-
select_token($(next_token.get(0)));
|
177
|
-
}
|
178
|
-
} else {
|
179
|
-
var dropdown_item = null;
|
180
|
-
|
181
|
-
if(event.keyCode === KEY.DOWN || event.keyCode === KEY.RIGHT) {
|
182
|
-
dropdown_item = $(selected_dropdown_item).next();
|
183
|
-
} else {
|
184
|
-
dropdown_item = $(selected_dropdown_item).prev();
|
185
|
-
}
|
186
|
-
|
187
|
-
if(dropdown_item.length) {
|
188
|
-
select_dropdown_item(dropdown_item);
|
189
|
-
}
|
190
|
-
return false;
|
191
|
-
}
|
192
|
-
break;
|
193
|
-
|
194
|
-
case KEY.BACKSPACE:
|
195
|
-
previous_token = input_token.prev();
|
196
|
-
|
197
|
-
if(!$(this).val().length) {
|
198
|
-
if(selected_token) {
|
199
|
-
delete_token($(selected_token));
|
200
|
-
} else if(previous_token.length) {
|
201
|
-
select_token($(previous_token.get(0)));
|
202
|
-
}
|
203
|
-
|
204
|
-
return false;
|
205
|
-
} else if($(this).val().length === 1) {
|
206
|
-
hide_dropdown();
|
207
|
-
} else {
|
208
|
-
// set a timeout just long enough to let this function finish.
|
209
|
-
setTimeout(function(){do_search();}, 5);
|
210
|
-
}
|
211
|
-
break;
|
212
|
-
|
213
|
-
case KEY.TAB:
|
214
|
-
case KEY.ENTER:
|
215
|
-
case KEY.NUMPAD_ENTER:
|
216
|
-
case KEY.COMMA:
|
217
|
-
if(selected_dropdown_item) {
|
218
|
-
add_token($(selected_dropdown_item));
|
219
|
-
return false;
|
220
|
-
}
|
221
|
-
break;
|
222
|
-
|
223
|
-
case KEY.ESCAPE:
|
224
|
-
hide_dropdown();
|
225
|
-
return true;
|
226
|
-
|
227
|
-
default:
|
228
|
-
if(String.fromCharCode(event.which)) {
|
229
|
-
// set a timeout just long enough to let this function finish.
|
230
|
-
setTimeout(function(){do_search();}, 5);
|
231
|
-
}
|
232
|
-
break;
|
178
|
+
} else {
|
179
|
+
var dropdown_item = null;
|
180
|
+
|
181
|
+
if (event.keyCode === KEY.DOWN || event.keyCode === KEY.RIGHT) {
|
182
|
+
dropdown_item = $(selected_dropdown_item).next();
|
183
|
+
} else {
|
184
|
+
dropdown_item = $(selected_dropdown_item).prev();
|
185
|
+
}
|
186
|
+
|
187
|
+
if (dropdown_item.length) {
|
188
|
+
select_dropdown_item(dropdown_item);
|
189
|
+
}
|
190
|
+
return false;
|
191
|
+
}
|
192
|
+
break;
|
193
|
+
|
194
|
+
case KEY.BACKSPACE:
|
195
|
+
previous_token = input_token.prev();
|
196
|
+
|
197
|
+
if (!$(this).val().length) {
|
198
|
+
if (selected_token) {
|
199
|
+
delete_token($(selected_token));
|
200
|
+
} else if (previous_token.length) {
|
201
|
+
select_token($(previous_token.get(0)));
|
233
202
|
}
|
234
|
-
|
203
|
+
|
204
|
+
return false;
|
205
|
+
} else if ($(this).val().length === 1) {
|
206
|
+
hide_dropdown();
|
207
|
+
} else {
|
208
|
+
// set a timeout just long enough to let this function finish.
|
209
|
+
setTimeout(function() {
|
210
|
+
do_search();
|
211
|
+
}, 5);
|
212
|
+
}
|
213
|
+
break;
|
214
|
+
|
215
|
+
case KEY.TAB:
|
216
|
+
case KEY.ENTER:
|
217
|
+
case KEY.NUMPAD_ENTER:
|
218
|
+
case KEY.COMMA:
|
219
|
+
if (selected_dropdown_item) {
|
220
|
+
add_token($(selected_dropdown_item));
|
221
|
+
return false;
|
222
|
+
}
|
223
|
+
break;
|
224
|
+
|
225
|
+
case KEY.ESCAPE:
|
226
|
+
hide_dropdown();
|
227
|
+
return true;
|
228
|
+
|
229
|
+
default:
|
230
|
+
if (String.fromCharCode(event.which)) {
|
231
|
+
// set a timeout just long enough to let this function finish.
|
232
|
+
setTimeout(function() {
|
233
|
+
do_search();
|
234
|
+
}, 5);
|
235
|
+
}
|
236
|
+
break;
|
237
|
+
}
|
238
|
+
});
|
235
239
|
|
236
240
|
// Keep a reference to the original input box
|
237
241
|
var hidden_input = $(input)
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
242
|
+
.hide()
|
243
|
+
.val("")
|
244
|
+
.focus(function () {
|
245
|
+
input_box.focus();
|
246
|
+
})
|
247
|
+
.blur(function () {
|
248
|
+
input_box.blur();
|
249
|
+
});
|
246
250
|
|
247
251
|
// Keep a reference to the selected token and dropdown item
|
248
252
|
var selected_token = null;
|
@@ -251,479 +255,480 @@ $.TokenList = function (input, url_or_data, settings) {
|
|
251
255
|
|
252
256
|
// The list to store the token items in
|
253
257
|
var token_list = $("<ul />")
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
258
|
+
.addClass(settings.classes.tokenList)
|
259
|
+
.click(function (event) {
|
260
|
+
var li = $(event.target).closest("li");
|
261
|
+
if (li && li.get(0) && $.data(li.get(0), "tokeninput")) {
|
262
|
+
toggle_select_token(li);
|
263
|
+
} else {
|
264
|
+
// Deselect selected token
|
265
|
+
if (selected_token) {
|
266
|
+
deselect_token($(selected_token), POSITION.END);
|
267
|
+
}
|
264
268
|
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
269
|
+
// Focus input box
|
270
|
+
input_box.focus();
|
271
|
+
}
|
272
|
+
})
|
273
|
+
.mouseover(function (event) {
|
274
|
+
var li = $(event.target).closest("li");
|
275
|
+
if (li && selected_token !== this) {
|
276
|
+
li.addClass(settings.classes.highlightedToken);
|
277
|
+
}
|
278
|
+
})
|
279
|
+
.mouseout(function (event) {
|
280
|
+
var li = $(event.target).closest("li");
|
281
|
+
if (li && selected_token !== this) {
|
282
|
+
li.removeClass(settings.classes.highlightedToken);
|
283
|
+
}
|
284
|
+
})
|
285
|
+
.insertBefore(hidden_input);
|
282
286
|
|
283
287
|
// The token holding the input box
|
284
288
|
var input_token = $("<li />")
|
285
|
-
|
286
|
-
|
287
|
-
|
289
|
+
.addClass(settings.classes.inputToken)
|
290
|
+
.appendTo(token_list)
|
291
|
+
.append(input_box);
|
288
292
|
|
289
293
|
// The list to store the dropdown items in
|
290
294
|
var dropdown = $("<div>")
|
291
|
-
|
292
|
-
|
293
|
-
|
295
|
+
.addClass(settings.classes.dropdown)
|
296
|
+
.appendTo("body")
|
297
|
+
.hide();
|
294
298
|
|
295
299
|
// Magic element to help us resize the text input
|
296
300
|
var input_resizer = $("<tester/>")
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
301
|
+
.insertAfter(input_box)
|
302
|
+
.css({
|
303
|
+
position: "absolute",
|
304
|
+
top: -9999,
|
305
|
+
left: -9999,
|
306
|
+
width: "auto",
|
307
|
+
fontSize: input_box.css("fontSize"),
|
308
|
+
fontFamily: input_box.css("fontFamily"),
|
309
|
+
fontWeight: input_box.css("fontWeight"),
|
310
|
+
letterSpacing: input_box.css("letterSpacing"),
|
311
|
+
whiteSpace: "nowrap"
|
312
|
+
});
|
309
313
|
|
310
314
|
// Pre-populate list if items exist
|
311
315
|
hidden_input.val("");
|
312
316
|
li_data = settings.prePopulate || hidden_input.data("pre");
|
313
|
-
if(li_data && li_data.length) {
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
+
if (li_data && li_data.length) {
|
318
|
+
$.each(li_data, function (index, value) {
|
319
|
+
insert_token(value.id, value.name);
|
320
|
+
});
|
317
321
|
}
|
318
322
|
|
319
323
|
|
320
|
-
|
321
324
|
//
|
322
325
|
// Private functions
|
323
326
|
//
|
324
327
|
|
325
328
|
function resize_input() {
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
329
|
+
if (input_val === (input_val = input_box.val())) {
|
330
|
+
return;
|
331
|
+
}
|
332
|
+
|
333
|
+
// Enter new content into resizer and resize input accordingly
|
334
|
+
var escaped = input_val.replace(/&/g, '&').replace(/\s/g, ' ').replace(/</g, '<').replace(/>/g, '>');
|
335
|
+
input_resizer.html(escaped);
|
336
|
+
input_box.width(input_resizer.width() + 30);
|
332
337
|
}
|
333
338
|
|
334
339
|
function is_printable_character(keycode) {
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
340
|
+
return ((keycode >= 48 && keycode <= 90) || // 0-1a-z
|
341
|
+
(keycode >= 96 && keycode <= 111) || // numpad 0-9 + - / * .
|
342
|
+
(keycode >= 186 && keycode <= 192) || // ; = , - . / ^
|
343
|
+
(keycode >= 219 && keycode <= 222)); // ( \ ) '
|
339
344
|
}
|
340
345
|
|
341
346
|
// Inner function to a token to the list
|
342
347
|
function insert_token(id, value) {
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
348
|
+
var this_token = $("<li><p>" + value + "</p></li>")
|
349
|
+
.addClass(settings.classes.token)
|
350
|
+
.insertBefore(input_token);
|
351
|
+
|
352
|
+
// The 'delete token' button
|
353
|
+
$("<span>" + settings.deleteText + "</span>")
|
354
|
+
.addClass(settings.classes.tokenDelete)
|
355
|
+
.appendTo(this_token)
|
356
|
+
.click(function () {
|
357
|
+
delete_token($(this).parent());
|
358
|
+
return false;
|
359
|
+
});
|
360
|
+
|
361
|
+
// Store data on the token
|
362
|
+
var token_data = {"id": id, "name": value};
|
363
|
+
$.data(this_token.get(0), "tokeninput", token_data);
|
364
|
+
|
365
|
+
// Save this token for duplicate checking
|
366
|
+
saved_tokens = saved_tokens.slice(0, selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));
|
367
|
+
selected_token_index++;
|
368
|
+
|
369
|
+
// Update the hidden input
|
370
|
+
var token_ids = $.map(saved_tokens, function (el) {
|
371
|
+
return el.id;
|
372
|
+
});
|
373
|
+
hidden_input.val(token_ids.join(settings.tokenDelimiter));
|
374
|
+
|
375
|
+
token_count += 1;
|
376
|
+
|
377
|
+
return this_token;
|
373
378
|
}
|
374
379
|
|
375
380
|
// Add a token to the token list based on user input
|
376
|
-
function add_token
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
381
|
+
function add_token(item) {
|
382
|
+
var li_data = $.data(item.get(0), "tokeninput");
|
383
|
+
var callback = settings.onAdd;
|
384
|
+
|
385
|
+
// See if the token already exists and select it if we don't want duplicates
|
386
|
+
if (token_count > 0 && settings.preventDuplicates) {
|
387
|
+
var found_existing_token = null;
|
388
|
+
token_list.children().each(function () {
|
389
|
+
var existing_token = $(this);
|
390
|
+
var existing_data = $.data(existing_token.get(0), "tokeninput");
|
391
|
+
if (existing_data && existing_data.id === li_data.id) {
|
392
|
+
found_existing_token = existing_token;
|
393
|
+
return false;
|
394
|
+
}
|
395
|
+
});
|
391
396
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
}
|
397
|
+
if (found_existing_token) {
|
398
|
+
select_token(found_existing_token);
|
399
|
+
input_token.insertAfter(found_existing_token);
|
400
|
+
input_box.focus();
|
401
|
+
return;
|
398
402
|
}
|
403
|
+
}
|
399
404
|
|
400
|
-
|
401
|
-
|
405
|
+
// Insert the new tokens
|
406
|
+
insert_token(li_data.id, li_data.name);
|
402
407
|
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
408
|
+
// Check the token limit
|
409
|
+
if (settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
|
410
|
+
input_box.hide();
|
411
|
+
hide_dropdown();
|
412
|
+
return;
|
413
|
+
} else {
|
414
|
+
input_box.focus();
|
415
|
+
}
|
411
416
|
|
412
|
-
|
413
|
-
|
417
|
+
// Clear input box
|
418
|
+
input_box.val("");
|
414
419
|
|
415
|
-
|
416
|
-
|
420
|
+
// Don't show the help dropdown, they've got the idea
|
421
|
+
hide_dropdown();
|
417
422
|
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
423
|
+
// Execute the onAdd callback if defined
|
424
|
+
if ($.isFunction(callback)) {
|
425
|
+
callback(li_data);
|
426
|
+
}
|
422
427
|
}
|
423
428
|
|
424
429
|
// Select a token in the token list
|
425
|
-
function select_token
|
426
|
-
|
427
|
-
|
430
|
+
function select_token(token) {
|
431
|
+
token.addClass(settings.classes.selectedToken);
|
432
|
+
selected_token = token.get(0);
|
428
433
|
|
429
|
-
|
430
|
-
|
434
|
+
// Hide input box
|
435
|
+
input_box.val("");
|
431
436
|
|
432
|
-
|
433
|
-
|
437
|
+
// Hide dropdown if it is visible (eg if we clicked to select token)
|
438
|
+
hide_dropdown();
|
434
439
|
}
|
435
440
|
|
436
441
|
// Deselect a token in the token list
|
437
|
-
function deselect_token
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
442
|
+
function deselect_token(token, position) {
|
443
|
+
token.removeClass(settings.classes.selectedToken);
|
444
|
+
selected_token = null;
|
445
|
+
|
446
|
+
if (position === POSITION.BEFORE) {
|
447
|
+
input_token.insertBefore(token);
|
448
|
+
selected_token_index--;
|
449
|
+
} else if (position === POSITION.AFTER) {
|
450
|
+
input_token.insertAfter(token);
|
451
|
+
selected_token_index++;
|
452
|
+
} else {
|
453
|
+
input_token.appendTo(token_list);
|
454
|
+
selected_token_index = token_count;
|
455
|
+
}
|
451
456
|
|
452
|
-
|
453
|
-
|
457
|
+
// Show the input box and give it focus again
|
458
|
+
input_box.focus();
|
454
459
|
}
|
455
460
|
|
456
461
|
// Toggle selection of a token in the token list
|
457
462
|
function toggle_select_token(token) {
|
458
|
-
|
463
|
+
var previous_selected_token = selected_token;
|
459
464
|
|
460
|
-
|
461
|
-
|
462
|
-
|
465
|
+
if (selected_token) {
|
466
|
+
deselect_token($(selected_token), POSITION.END);
|
467
|
+
}
|
463
468
|
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
+
if (previous_selected_token === token.get(0)) {
|
470
|
+
deselect_token(token, POSITION.END);
|
471
|
+
} else {
|
472
|
+
select_token(token);
|
473
|
+
}
|
469
474
|
}
|
470
475
|
|
471
476
|
// Delete a token from the token list
|
472
|
-
function delete_token
|
473
|
-
|
474
|
-
|
475
|
-
|
477
|
+
function delete_token(token) {
|
478
|
+
// Remove the id from the saved list
|
479
|
+
var token_data = $.data(token.get(0), "tokeninput");
|
480
|
+
var callback = settings.onDelete;
|
476
481
|
|
477
|
-
|
478
|
-
|
482
|
+
var index = token.prevAll().length;
|
483
|
+
if (index > selected_token_index) index--;
|
479
484
|
|
480
|
-
|
481
|
-
|
482
|
-
|
485
|
+
// Delete the token
|
486
|
+
token.remove();
|
487
|
+
selected_token = null;
|
483
488
|
|
484
|
-
|
485
|
-
|
489
|
+
// Show the input box and give it focus again
|
490
|
+
input_box.focus();
|
486
491
|
|
487
|
-
|
488
|
-
|
489
|
-
|
492
|
+
// Remove this token from the saved list
|
493
|
+
saved_tokens = saved_tokens.slice(0, index).concat(saved_tokens.slice(index + 1));
|
494
|
+
if (index < selected_token_index) selected_token_index--;
|
490
495
|
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
+
// Update the hidden input
|
497
|
+
var token_ids = $.map(saved_tokens, function (el) {
|
498
|
+
return el.id;
|
499
|
+
});
|
500
|
+
hidden_input.val(token_ids.join(settings.tokenDelimiter));
|
496
501
|
|
497
|
-
|
502
|
+
token_count -= 1;
|
498
503
|
|
499
|
-
|
500
|
-
|
504
|
+
if (settings.tokenLimit !== null) {
|
505
|
+
input_box
|
501
506
|
.show()
|
502
507
|
.val("")
|
503
508
|
.focus();
|
504
|
-
|
509
|
+
}
|
505
510
|
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
511
|
+
// Execute the onDelete callback if defined
|
512
|
+
if ($.isFunction(callback)) {
|
513
|
+
callback(token_data);
|
514
|
+
}
|
510
515
|
}
|
511
516
|
|
512
517
|
// Hide and clear the results dropdown
|
513
|
-
function hide_dropdown
|
514
|
-
|
515
|
-
|
518
|
+
function hide_dropdown() {
|
519
|
+
dropdown.hide().empty();
|
520
|
+
selected_dropdown_item = null;
|
516
521
|
}
|
517
522
|
|
518
523
|
function show_dropdown() {
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
524
|
+
dropdown
|
525
|
+
.css({
|
526
|
+
position: "absolute",
|
527
|
+
top: $(token_list).offset().top + $(token_list).outerHeight(),
|
528
|
+
left: $(token_list).offset().left,
|
529
|
+
zindex: 999
|
530
|
+
})
|
531
|
+
.show();
|
527
532
|
}
|
528
533
|
|
529
|
-
function show_dropdown_searching
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
+
function show_dropdown_searching() {
|
535
|
+
if (settings.searchingText) {
|
536
|
+
dropdown.html("<p>" + settings.searchingText + "</p>");
|
537
|
+
show_dropdown();
|
538
|
+
}
|
534
539
|
}
|
535
540
|
|
536
|
-
function show_dropdown_hint
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
+
function show_dropdown_hint() {
|
542
|
+
if (settings.hintText) {
|
543
|
+
dropdown.html("<p>" + settings.hintText + "</p>");
|
544
|
+
show_dropdown();
|
545
|
+
}
|
541
546
|
}
|
542
547
|
|
543
548
|
// Highlight the query part of the search term
|
544
549
|
function highlight_term(value, term) {
|
545
|
-
|
550
|
+
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<b>$1</b>");
|
546
551
|
}
|
547
552
|
|
548
553
|
// Populate the results dropdown with some results
|
549
|
-
function populate_dropdown
|
550
|
-
|
551
|
-
|
552
|
-
|
554
|
+
function populate_dropdown(query, results) {
|
555
|
+
if (results && results.length) {
|
556
|
+
dropdown.empty();
|
557
|
+
var dropdown_ul = $("<ul>")
|
553
558
|
.appendTo(dropdown)
|
554
559
|
.mouseover(function (event) {
|
555
|
-
|
556
|
-
|
560
|
+
select_dropdown_item($(event.target).closest("li"));
|
561
|
+
})
|
557
562
|
.mousedown(function (event) {
|
558
|
-
|
559
|
-
|
560
|
-
|
563
|
+
add_token($(event.target).closest("li"));
|
564
|
+
return false;
|
565
|
+
})
|
561
566
|
.hide();
|
562
567
|
|
563
|
-
|
564
|
-
|
565
|
-
|
568
|
+
$.each(results, function(index, value) {
|
569
|
+
var this_li = $("<li>" + highlight_term(value.name, query) + "</li>")
|
570
|
+
.appendTo(dropdown_ul);
|
566
571
|
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
+
if (index % 2) {
|
573
|
+
this_li.addClass(settings.classes.dropdownItem);
|
574
|
+
} else {
|
575
|
+
this_li.addClass(settings.classes.dropdownItem2);
|
576
|
+
}
|
572
577
|
|
573
|
-
|
574
|
-
|
575
|
-
|
578
|
+
if (index === 0) {
|
579
|
+
select_dropdown_item(this_li);
|
580
|
+
}
|
576
581
|
|
577
|
-
|
578
|
-
|
582
|
+
$.data(this_li.get(0), "tokeninput", {"id": value.id, "name": value.name});
|
583
|
+
});
|
579
584
|
|
580
|
-
|
585
|
+
show_dropdown();
|
581
586
|
|
582
|
-
|
583
|
-
|
584
|
-
} else {
|
585
|
-
dropdown_ul.show();
|
586
|
-
}
|
587
|
+
if (settings.animateDropdown) {
|
588
|
+
dropdown_ul.slideDown("fast");
|
587
589
|
} else {
|
588
|
-
|
589
|
-
dropdown.html("<p>"+settings.noResultsText+"</p>");
|
590
|
-
show_dropdown();
|
591
|
-
}
|
590
|
+
dropdown_ul.show();
|
592
591
|
}
|
592
|
+
} else {
|
593
|
+
if (settings.noResultsText) {
|
594
|
+
dropdown.html("<p>" + settings.noResultsText + "</p>");
|
595
|
+
show_dropdown();
|
596
|
+
}
|
597
|
+
}
|
593
598
|
}
|
594
599
|
|
595
600
|
// Highlight an item in the results dropdown
|
596
|
-
function select_dropdown_item
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
}
|
601
|
-
|
602
|
-
item.addClass(settings.classes.selectedDropdownItem);
|
603
|
-
selected_dropdown_item = item.get(0);
|
601
|
+
function select_dropdown_item(item) {
|
602
|
+
if (item) {
|
603
|
+
if (selected_dropdown_item) {
|
604
|
+
deselect_dropdown_item($(selected_dropdown_item));
|
604
605
|
}
|
606
|
+
|
607
|
+
item.addClass(settings.classes.selectedDropdownItem);
|
608
|
+
selected_dropdown_item = item.get(0);
|
609
|
+
}
|
605
610
|
}
|
606
611
|
|
607
612
|
// Remove highlighting from an item in the results dropdown
|
608
|
-
function deselect_dropdown_item
|
609
|
-
|
610
|
-
|
613
|
+
function deselect_dropdown_item(item) {
|
614
|
+
item.removeClass(settings.classes.selectedDropdownItem);
|
615
|
+
selected_dropdown_item = null;
|
611
616
|
}
|
612
617
|
|
613
618
|
// Do a search and show the "searching" dropdown if the input is longer
|
614
619
|
// than settings.minChars
|
615
620
|
function do_search() {
|
616
|
-
|
621
|
+
var query = input_box.val().toLowerCase();
|
617
622
|
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
623
|
+
if (query && query.length) {
|
624
|
+
if (selected_token) {
|
625
|
+
deselect_token($(selected_token), POSITION.AFTER);
|
626
|
+
}
|
622
627
|
|
623
|
-
|
624
|
-
|
625
|
-
|
628
|
+
if (query.length >= settings.minChars) {
|
629
|
+
show_dropdown_searching();
|
630
|
+
clearTimeout(timeout);
|
626
631
|
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
}
|
632
|
+
timeout = setTimeout(function() {
|
633
|
+
run_search(query);
|
634
|
+
}, settings.searchDelay);
|
635
|
+
} else {
|
636
|
+
hide_dropdown();
|
633
637
|
}
|
638
|
+
}
|
634
639
|
}
|
635
640
|
|
636
641
|
// Do the actual search
|
637
642
|
function run_search(query) {
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
}
|
679
|
-
};
|
680
|
-
|
681
|
-
// Make the request
|
682
|
-
$.ajax(ajax_params);
|
683
|
-
} else if(settings.local_data) {
|
684
|
-
// Do the search through local data
|
685
|
-
var results = $.grep(settings.local_data, function (row) {
|
686
|
-
return row.name.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
687
|
-
});
|
688
|
-
|
689
|
-
if($.isFunction(settings.onResult)) {
|
690
|
-
results = settings.onResult.call(this, results);
|
691
|
-
}
|
692
|
-
cache.add(query, results);
|
693
|
-
populate_dropdown(query, results);
|
643
|
+
var cached_results = cache.get(query);
|
644
|
+
if (cached_results) {
|
645
|
+
populate_dropdown(query, cached_results);
|
646
|
+
} else {
|
647
|
+
// Are we doing an ajax search or local data search?
|
648
|
+
if (settings.url) {
|
649
|
+
// Extract exisiting get params
|
650
|
+
var ajax_params = {};
|
651
|
+
ajax_params.data = {};
|
652
|
+
if (settings.url.indexOf("?") > -1) {
|
653
|
+
var parts = settings.url.split("?");
|
654
|
+
ajax_params.url = parts[0];
|
655
|
+
|
656
|
+
var param_array = parts[1].split("&");
|
657
|
+
$.each(param_array, function (index, value) {
|
658
|
+
var kv = value.split("=");
|
659
|
+
ajax_params.data[kv[0]] = kv[1];
|
660
|
+
});
|
661
|
+
} else {
|
662
|
+
ajax_params.url = settings.url;
|
663
|
+
}
|
664
|
+
|
665
|
+
// Prepare the request
|
666
|
+
ajax_params.data[settings.queryParam] = query;
|
667
|
+
ajax_params.type = settings.method;
|
668
|
+
ajax_params.dataType = settings.contentType;
|
669
|
+
if (settings.crossDomain) {
|
670
|
+
ajax_params.dataType = "jsonp";
|
671
|
+
}
|
672
|
+
|
673
|
+
// Attach the success callback
|
674
|
+
ajax_params.success = function(results) {
|
675
|
+
if ($.isFunction(settings.onResult)) {
|
676
|
+
results = settings.onResult.call(this, results);
|
677
|
+
}
|
678
|
+
cache.add(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
|
679
|
+
|
680
|
+
// only populate the dropdown if the results are associated with the active search query
|
681
|
+
if (input_box.val().toLowerCase() === query) {
|
682
|
+
populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
|
694
683
|
}
|
684
|
+
};
|
685
|
+
|
686
|
+
// Make the request
|
687
|
+
$.ajax(ajax_params);
|
688
|
+
} else if (settings.local_data) {
|
689
|
+
// Do the search through local data
|
690
|
+
var results = $.grep(settings.local_data, function (row) {
|
691
|
+
return row.name.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
692
|
+
});
|
693
|
+
|
694
|
+
if ($.isFunction(settings.onResult)) {
|
695
|
+
results = settings.onResult.call(this, results);
|
696
|
+
}
|
697
|
+
cache.add(query, results);
|
698
|
+
populate_dropdown(query, results);
|
695
699
|
}
|
700
|
+
}
|
696
701
|
}
|
697
|
-
};
|
702
|
+
};
|
698
703
|
|
699
704
|
// Really basic cache for the results
|
700
|
-
$.TokenList.Cache = function (options) {
|
705
|
+
$.TokenList.Cache = function (options) {
|
701
706
|
var settings = $.extend({
|
702
|
-
|
707
|
+
max_size: 500
|
703
708
|
}, options);
|
704
709
|
|
705
710
|
var data = {};
|
706
711
|
var size = 0;
|
707
712
|
|
708
713
|
var flush = function () {
|
709
|
-
|
710
|
-
|
714
|
+
data = {};
|
715
|
+
size = 0;
|
711
716
|
};
|
712
717
|
|
713
718
|
this.add = function (query, results) {
|
714
|
-
|
715
|
-
|
716
|
-
|
719
|
+
if (size > settings.max_size) {
|
720
|
+
flush();
|
721
|
+
}
|
717
722
|
|
718
|
-
|
719
|
-
|
720
|
-
|
723
|
+
if (!data[query]) {
|
724
|
+
size += 1;
|
725
|
+
}
|
721
726
|
|
722
|
-
|
727
|
+
data[query] = results;
|
723
728
|
};
|
724
729
|
|
725
730
|
this.get = function (query) {
|
726
|
-
|
731
|
+
return data[query];
|
727
732
|
};
|
728
|
-
};
|
733
|
+
};
|
729
734
|
}(jQuery));
|