diff --git a/CHANGELOG.md b/CHANGELOG.md index 9203371..52826ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG: jquery.ajax-combobox +## v7.5.3 +#### Deprecated +- Lowercase "asc" or "desc" in `order_by` are **deprecated**. + (e.g. `order_by: ['field1 asc', 'field2 desc']`) + In the future, lowercase "asc" or "desc" are judged to be field names. + ## v7.5.0 - Extend `button_img` option to accept HTML element such as `` or ``. See [Document](http://www.usamimi.info/~sutara/ajax-combobox/sample/others.html#button-image). diff --git a/README.md b/README.md index f8cb92e..71e1ae0 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ new AjaxComboBox($sqlite); |[db_table](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_01)|string|'tbl'|Table of database to query| |field|string|'name'|Field of table to display on result| |[search_field](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_04)|string|=field|Field of table to search. Accept comma separated string. (e.g.: `'id, name, job'`)| -|[order_by](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_06)|mixed|=search_field|Field for sorting (e.g.: `'name DESC'`, `['name ASC', 'age DESC']`)| +|[order_by](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_06)|mixed|=search_field|Field for sorting (e.g. `'name DESC'`, `['name ASC', 'age DESC']`).
`ASC` or `DESC` should be UPPERCASE.| |[and_or](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_05)|string|'AND'|Boolean searching ('AND', 'OR')| |[per_page](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_02)|number|10|Amount of items per page| |[navi_num](https://sutara79-php.herokuapp.com/demo/jquery.ajax-combobox/sample/basic.html#sample01_02)|number|5|Amount of page-link on navi| diff --git a/dist/js/jquery.ajax-combobox.min.js b/dist/js/jquery.ajax-combobox.min.js index 3856536..bb38cef 100644 --- a/dist/js/jquery.ajax-combobox.min.js +++ b/dist/js/jquery.ajax-combobox.min.js @@ -1 +1 @@ -/*! jquery.ajax-combobox v7.5.2 | Yuusaku Miyazaki | license: MIT */!function(e){var t={};function o(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,s){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(o.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(s,n,function(t){return e[t]}.bind(null,n));return s},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);var s={_setOption:function(e,t){return t=this._setOption1st(e,t),t=this._setOption2nd(t)},_setOption1st:function(e,t){return $.extend({source:e,lang:"en",plugin_type:"combobox",init_record:!1,db_table:"tbl",field:"name",and_or:"AND",per_page:10,navi_num:5,primary_key:"id",button_img:'',bind_to:!1,navi_simple:!1,sub_info:!1,sub_as:{},show_field:"",hide_field:"",select_only:!1,tags:!1,shorten_btn:!1,shorten_src:"dist/bitly.php",shorten_min:20,shorten_reg:!1},t)},_setOption2nd:function(e){return e.search_field=e.search_field?e.search_field:e.field,e.and_or=e.and_or.toUpperCase(),e.hide_field=this._strToArray(e.hide_field),e.show_field=this._strToArray(e.show_field),e.search_field=this._strToArray(e.search_field),""===e.show_field[0]&&(e.show_field[0]="*"),e.order_by=void 0===e.order_by?e.search_field:e.order_by,e.order_by=this._setOrderbyOption(e.order_by,e.field),"textarea"==e.plugin_type&&(e.shorten_reg=this._setRegExpShort(e.shorten_reg,e.shorten_min)),e.tags&&(e.tags=this._setTagPattern(e)),e},_strToArray:function(e){return e.replace(/[\s ]+/g,"").split(",")},_setRegExpShort:function(e,t){if(e)return e;var o="(?:^|[\\s| \\[(<「『(【[<〈《]+)";return o+="(",o+="https:\\/\\/[^\\s| \\])>」』)】]>〉》]{"+(t-7)+",}",o+="|",o+="http:\\/\\/[^\\s| \\])>」』)】]>〉》]{"+(t-6)+",}",o+="|",o+="ftp:\\/\\/[^\\s| \\])>」』)】]>〉》]{"+(t-5)+",}",o+=")",new RegExp(o,"g")},_setTagPattern:function(e){for(var t=0;t"),t.container=$(t.combo_input).parent().addClass(this.css_class.container),"combobox"==this.option.plugin_type?(t.button=$("
").addClass(this.css_class.button),t.img=this.option.button_img.match(/^").attr("src",this.option.button_img)):(t.button=!1,t.img=!1),t.result_area=$("
").addClass(this.css_class.re_area),t.navi=$("
").addClass(this.css_class.navi),t.navi_info=$("
").addClass("info"),t.navi_p=$("

"),t.results=$("