-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
2,154 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# jquery.ajax-combobox | ||
|
||
[![npm version](https://img.shields.io/npm/v/jquery.ajax-combobox.svg)](https://www.npmjs.com/package/jquery.ajax-combobox) | ||
[![Build Status](https://travis-ci.org/sutara79/jquery.ajax-combobox.svg?branch=master)](https://travis-ci.org/sutara79/jquery.ajax-combobox) | ||
[![codecov](https://codecov.io/gh/sutara79/jquery.ajax-combobox/branch/master/graph/badge.svg)](https://codecov.io/gh/sutara79/jquery.ajax-combobox) | ||
[![dependencies Status](https://david-dm.org/sutara79/jquery.ajax-combobox/status.svg)](https://david-dm.org/sutara79/jquery.ajax-combobox) | ||
|
@@ -15,10 +16,10 @@ http://www.usamimi.info/~sutara/ajax-combobox/ | |
## Install | ||
- [GitHub](https://github.com/sutara79/jquery.ajax-combobox): Clone or download. Only you need is `dist/`. | ||
- [npm](https://www.npmjs.com/package/jquery.ajax-combobox): `npm i jquery.ajax-combobox` | ||
- CDN ([jsDelivr](https://github.com/jsdelivr/jsdelivr#usage)): | ||
- jquery.ajax-combobox.min.js: [v7.4.5](https://cdn.jsdelivr.net/npm/[email protected].5/dist/js/jquery.ajax-combobox.min.js) | ||
- jquery.ajax-combobox.min.css: [v7.4.5](https://cdn.jsdelivr.net/npm/[email protected].5/dist/css/jquery.ajax-combobox.min.css) | ||
- btn.png: [v7.4.5](https://cdn.jsdelivr.net/npm/[email protected].5/dist/btn.png) | ||
- CDN ([jsDelivr](https://www.jsdelivr.com/)): | ||
- [jquery.ajax-combobox.min.js (v7.4.6)](https://cdn.jsdelivr.net/npm/[email protected].6/dist/js/jquery.ajax-combobox.min.js) | ||
- [jquery.ajax-combobox.min.css (v7.4.6)](https://cdn.jsdelivr.net/npm/[email protected].6/dist/css/jquery.ajax-combobox.min.css) | ||
- [btn.png (v7.4.6)](https://cdn.jsdelivr.net/npm/[email protected].6/dist/btn.png) | ||
- In addition to above, `dist/php/*.php` is REQUIRED. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** | ||
* @file jquery.ajax-combobox | ||
* @version 7.4.5 | ||
* @version 7.4.6 | ||
* @author Yuusaku Miyazaki <[email protected]> | ||
* @license MIT | ||
*/ | ||
|
@@ -154,20 +154,17 @@ $.extend($.ajaxComboBox.prototype, /** @lends external:jQuery.ajaxComboBox.proto | |
*/ | ||
_setOption2nd: function(option) { | ||
// 検索するフィールド(カンマ区切りで複数指定可能) | ||
option.search_field = (option.search_field === undefined) ? | ||
option.field : | ||
option.search_field; | ||
option.search_field = (option.search_field) ? option.search_field : option.field; | ||
|
||
// 大文字で統一 | ||
// Unify with uppercase | ||
option.and_or = option.and_or.toUpperCase(); | ||
|
||
// カンマ区切りのオプションを配列に変換する。 | ||
var arr = ['hide_field', 'show_field', 'search_field']; | ||
for (var i=0; i<arr.length; i++) { | ||
option[arr[i]] = this._strToArray(option[arr[i]]); | ||
} | ||
// Split string into array by comma | ||
option.hide_field = this._strToArray(option.hide_field); | ||
option.show_field = this._strToArray(option.show_field); | ||
option.search_field = this._strToArray(option.search_field); | ||
|
||
// Show rest fields as sub info | ||
// Show whole rest fields as sub info, if "show_field" is not set. | ||
if (option.show_field[0] === '') { | ||
option.show_field[0] = '*' | ||
} | ||
|
@@ -194,10 +191,10 @@ $.extend($.ajaxComboBox.prototype, /** @lends external:jQuery.ajaxComboBox.proto | |
}, | ||
|
||
/** | ||
* Split string into array by comma. | ||
* @private | ||
* @desc カンマ区切りの文字列を配列にする。 | ||
* @arg {string} str - 文字列 | ||
* @return {Array} - 配列 | ||
* @arg {string} str - Comma separated string | ||
* @return {array} Array splitted by comma | ||
*/ | ||
_strToArray: function(str) { | ||
return str.replace(/[\s ]+/g, '').split(','); | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.