diff --git a/package.json b/package.json index 52eb211..6a5bc9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "selectpage", - "version": "2.16.0", + "version": "2.17.0", "description": "A simple style and powerful selection jQuery plugin, including ajax remote data, autocomplete, pagination, tags, i18n, keyboard navigation functions", "main": "selectpage.js", "dependencies": { diff --git a/selectpage.base.css b/selectpage.base.css index 4b4fdfe..b1ca1e7 100644 --- a/selectpage.base.css +++ b/selectpage.base.css @@ -174,7 +174,6 @@ ul.sp_results > li.sp_selected { .sp_control_box{ padding: 0px; height: 27px; - background-color: #F6F6F6; } .sp_control_box p{ margin: 0; @@ -192,16 +191,24 @@ ul.sp_results > li.sp_selected { font-size: 13px !important; padding: 0 12px; border: 0; - background-color: #F6F6F6; + background-color: white; color: #666666; text-align: left; -webkit-transition: all .5s cubic-bezier(.175,.885,.32,1); transition: all .5s cubic-bezier(.175,.885,.32,1); outline: none !important; float: right; + opacity: .3; +} +.sp_control_box:hover{ + background-color: #F8F8F8; +} +.sp_control_box:hover button{ + background-color: #F8F8F8; + opacity: 1; } -.sp_control_box button:hover{ - background-color: #E8E8E8; +.sp_control_box:hover button:hover{ + background-color: #EEEEEE; color: black; } /** diff --git a/selectpage.bootstrap3.css b/selectpage.bootstrap3.css index b9a1af9..cf8f7da 100644 --- a/selectpage.bootstrap3.css +++ b/selectpage.bootstrap3.css @@ -174,7 +174,6 @@ ul.sp_results > li.sp_selected { .sp_control_box{ padding: 0px; height: 27px; - background-color: #F6F6F6; } .sp_control_box p{ margin: 0; @@ -192,16 +191,24 @@ ul.sp_results > li.sp_selected { font-size: 13px !important; padding: 0 12px; border: 0; - background-color: #F6F6F6; + background-color: white; color: #666666; text-align: left; -webkit-transition: all .5s cubic-bezier(.175,.885,.32,1); transition: all .5s cubic-bezier(.175,.885,.32,1); outline: none !important; float: right; + opacity: .3; +} +.sp_control_box:hover{ + background-color: #F8F8F8; +} +.sp_control_box:hover button{ + background-color: #F8F8F8; + opacity: 1; } -.sp_control_box button:hover{ - background-color: #E8E8E8; +.sp_control_box:hover button:hover{ + background-color: #EEEEEE; color: black; } /** diff --git a/selectpage.css b/selectpage.css index 33abd9d..621dce0 100644 --- a/selectpage.css +++ b/selectpage.css @@ -170,7 +170,6 @@ ul.sp_results > li.sp_selected { .sp_control_box{ padding: 0px; height: 27px; - background-color: #F6F6F6; } .sp_control_box p{ margin: 0; @@ -188,16 +187,24 @@ ul.sp_results > li.sp_selected { font-size: 13px !important; padding: 0 12px; border: 0; - background-color: #F6F6F6; + background-color: white; color: #666666; text-align: left; -webkit-transition: all .5s cubic-bezier(.175,.885,.32,1); transition: all .5s cubic-bezier(.175,.885,.32,1); outline: none !important; float: right; + opacity: .3; +} +.sp_control_box:hover{ + background-color: #F8F8F8; +} +.sp_control_box:hover button{ + background-color: #F8F8F8; + opacity: 1; } -.sp_control_box button:hover{ - background-color: #E8E8E8; +.sp_control_box:hover button:hover{ + background-color: #EEEEEE; color: black; } diff --git a/selectpage.js b/selectpage.js index b775e9b..e67fec2 100644 --- a/selectpage.js +++ b/selectpage.js @@ -2,7 +2,7 @@ * @summary SelectPage * @desc Simple and powerful selection plugin * @file selectpage.js - * @version 2.16 + * @version 2.17 * @author TerryZeng * @contact https://terryz.github.io/ * @license MIT License @@ -130,19 +130,20 @@ * @return string */ formatItem : undefined, + /** + * Have some highlight item and lost focus, auto select the highlight item + * @type boolean + * @default false + */ + autoFillResult: false, /** * Auto select first item in show up result list or search result + * depend on `autoFillResult` option set to true * @type boolean * @default false */ autoSelectFirst: false, /** - * Have some highlight item and lost focus, auto select the highlight item - * @type boolean - * @default false - */ - autoFillResult: false, - /** * Whether clear input element text when enter some keywords to search and no result return * @type boolean * @default true @@ -226,7 +227,7 @@ /** * Plugin version number */ - SelectPage.version = '2.16'; + SelectPage.version = '2.17'; /** * Plugin object cache key */ @@ -259,10 +260,6 @@ option.autoFillResult = false; option.autoSelectFirst = false; } - - if($.type(option.data) === 'string'){ - option.autoSelectFirst = false; - } //show all item when pagination bar close, limited 200 if(!option.pagination) option.pageSize = 200; if($.type(option.listSize) !== 'number' || option.listSize < 0) option.listSize = 10; diff --git a/selectpage.min.js b/selectpage.min.js index 952d32c..cfe1947 100644 --- a/selectpage.min.js +++ b/selectpage.min.js @@ -1 +1 @@ -(function(g){var e={data:undefined,lang:"cn",multiple:false,pagination:true,dropButton:true,listSize:10,multipleControlbar:true,maxSelectLimit:0,selectToCloseList:false,initRecord:undefined,dbTable:"tbl",keyField:"id",showField:"name",searchField:undefined,andOr:"AND",orderBy:undefined,pageSize:10,params:undefined,formatItem:undefined,autoSelectFirst:false,autoFillResult:false,noResultClean:true,selectOnly:false,inputDelay:0.5,eSelect:undefined,eOpen:undefined,eAjaxSuccess:undefined,eTagRemove:undefined,eClear:undefined};var h=function(l,m){this.setOption(m);this.setLanguage();this.setCssClass();this.setProp();this.setElem(l);this.setButtonAttrDefault();this.setInitRecord();this.eDropdownButton();this.eInput();this.eWhole()};h.version="2.16";h.dataKey="selectPageObject";h.prototype.setOption=function(n){n.searchField=n.searchField||n.showField;n.andOr=n.andOr.toUpperCase();if(n.andOr!=="AND"&&n.andOr!=="OR"){n.andOr="AND"}var l=["searchField"];for(var m=0;m#item_text#',textKey:"#item_text#",valueKey:"#item_value#"},page:{current:"page_num",total:"page_count"},msg:{maxSelectLimit:"max_selected_limit"}}};h.prototype.elementRealSize=function(q,l){var p={absolute:false,clone:false,includeMargin:false,display:"block"};var t=p,o=q.eq(0),s,u,r=[],n="",m;s=function(){m=o.parents().addBack().filter(":hidden");n+="visibility: hidden !important; display: "+t.display+" !important; ";if(t.absolute===true){n+="position: absolute !important;"}m.each(function(){var w=g(this),x=w.attr("style");r.push(x);w.attr("style",x?x+";"+n:n)})};u=function(){m.each(function(w){var y=g(this),x=r[w];if(x===undefined){y.removeAttr("style")}else{y.attr("style",x)}})};s();var v=/(outer)/.test(l)?o[l](t.includeMargin):o[l]();u();return v};h.prototype.setElem=function(q){var o={},m=this.option,u=this.css_class,n=this.message,x=g(q);var s=x.outerWidth();if(s<=0){s=this.elementRealSize(x,"outerWidth")}if(s<150){s=150}o.combo_input=x.attr({"autocomplete":"off"}).addClass(u.input).wrap("
");if(m.selectOnly){o.combo_input.prop("readonly",true)}o.container=o.combo_input.parent().addClass(u.container);if(o.combo_input.prop("disabled")){if(m.multiple){o.container.addClass(u.disabled)}else{o.combo_input.addClass(u.input_off)}}o.container.width(s);o.button=g("
").addClass(u.button);o.dropdown=g('');o.clear_btn=g("
").html(g("").addClass("iconfont if-close")).addClass(u.clear_btn).attr("title",n.clear);if(!m.dropButton){o.clear_btn.addClass(u.align_right)}o.element_box=g("
    ").addClass(u.element_box);if(m.multiple&&m.multipleControlbar){o.control=g("
    ").addClass(u.control_box)}o.result_area=g("
    ").addClass(u.re_area);if(m.pagination){o.navi=g("
    ").addClass("pagination").append("
      ")}o.results=g("
        ").addClass(u.results);var l="_text",w=o.combo_input.attr("id")||o.combo_input.attr("name"),t=o.combo_input.attr("name")||"selectPage",v=t,r=w;o.hidden=g('').attr({name:v,id:r}).val("");o.combo_input.attr({name:t+l,id:w+l});o.container.append(o.hidden);if(m.dropButton){o.container.append(o.button);o.button.append(o.dropdown)}g(document.body).append(o.result_area);o.result_area.append(o.results);if(m.pagination){o.result_area.append(o.navi)}if(m.multiple){if(m.multipleControlbar){o.control.append('');o.control.append('');o.control.append('');o.control_text=g("

        ");o.control.append(o.control_text);o.result_area.prepend(o.control)}o.container.addClass("sp_container_combo");o.combo_input.addClass("sp_combo_input").before(o.element_box);var y=g("

      • ").addClass("input_box");y.append(o.combo_input);o.element_box.append(y);if(o.combo_input.attr("placeholder")){o.combo_input.attr("placeholder_bak",o.combo_input.attr("placeholder"))}}this.elem=o};h.prototype.setButtonAttrDefault=function(){if(this.option.dropButton){this.elem.button.attr("title",this.message.close_btn)}};h.prototype.setInitRecord=function(o){var l=this,s=l.option,n=l.elem,m="";if(g.type(n.combo_input.data("init"))!="undefined"){s.initRecord=String(n.combo_input.data("init"))}if(!o&&!s.initRecord&&n.combo_input.val()){s.initRecord=n.combo_input.val()}n.combo_input.val("");if(!o){n.hidden.val(s.initRecord)}m=o&&n.hidden.val()?n.hidden.val():s.initRecord;if(m){if(typeof s.data==="object"){var r=new Array();var q=m.split(",");g.each(q,function(p,u){for(var t=0;t1){r=[r[0]]}l.afterInit(l,r)}else{g.ajax({dataType:"json",type:"POST",url:s.data,data:{searchTable:s.dbTable,searchKey:s.keyField,searchValue:m},success:function(p){var t=null;if(s.eAjaxSuccess&&g.isFunction(s.eAjaxSuccess)){t=s.eAjaxSuccess(p)}l.afterInit(l,t.list)},error:function(p,u,t){l.ajaxErrorNotify(l,t)}})}}};h.prototype.afterInit=function(m,o){if(!o){return}if(!g.isArray(o)){o=[o]}var q=m.option,n=m.css_class;var l=function(t){var s=t[q.showField];if(q.formatItem&&g.isFunction(q.formatItem)){try{s=q.formatItem(t)}catch(p){}}return s};if(q.multiple){m.prop.init_set=true;m.clearAll(m);g.each(o,function(p,t){var s={text:l(t),value:t[q.keyField]};if(!m.isAlreadySelected(m,s)){m.addNewTag(m,s)}});m.tagValuesSet(m);m.inputResize(m);m.prop.init_set=false}else{var r=o[0];m.elem.combo_input.val(l(r));m.elem.hidden.val(r[q.keyField]);m.prop.prev_value=l(r);m.prop.selected_text=l(r);if(q.selectOnly){m.elem.combo_input.attr("title",m.message.select_ok).removeClass(n.select_ng).addClass(n.select_ok)}m.putClearButton()}};h.prototype.eDropdownButton=function(){var l=this;if(l.option.dropButton){l.elem.button.mouseup(function(m){m.stopPropagation();if(l.elem.result_area.is(":hidden")&&!l.elem.combo_input.prop("disabled")){l.elem.combo_input.focus()}else{l.hideResults(l)}})}};h.prototype.eInput=function(){var m=this,o=m.option,n=m.elem,q=m.message;var l=function(){m.prop.page_move=false;m.suggest(m);m.setCssFocusedInput(m)};n.combo_input.keyup(function(p){m.processKey(m,p)}).keydown(function(p){m.processControl(m,p)}).focus(function(p){if(n.result_area.is(":hidden")){p.stopPropagation();m.prop.first_show=true;l()}});n.container.on("click.SelectPage","div."+m.css_class.clear_btn,function(p){p.stopPropagation();if(!m.disabled(m)){m.clearAll(m);if(o.eClear&&g.isFunction(o.eClear)){o.eClear(m)}}});n.result_area.on("mousedown.SelectPage",function(p){p.stopPropagation()});if(o.multiple){if(o.multipleControlbar){n.control.find(".sp_select_all").on("click.SelectPage",function(p){m.selectAllLine(m)}).hover(function(){n.control_text.html(q.select_all)},function(){n.control_text.html("")});n.control.find(".sp_unselect_all").on("click.SelectPage",function(p){m.unSelectAllLine(m)}).hover(function(){n.control_text.html(q.unselect_all)},function(){n.control_text.html("")});n.control.find(".sp_clear_all").on("click.SelectPage",function(p){m.clearAll(m)}).hover(function(){n.control_text.html(q.clear_all)},function(){n.control_text.html("")})}n.element_box.on("click.SelectPage",function(r){var p=r.target||r.srcElement;if(g(p).is("ul")){n.combo_input.focus()}});n.element_box.on("click.SelectPage","span.tag_close",function(){var p=g(this).closest("li");m.removeTag(m,p);l();if(o.eTagRemove&&g.isFunction(o.eTagRemove)){o.eTagRemove(1,m)}});m.inputResize(m)}};h.prototype.eWhole=function(){var l=this,m=l.css_class;var n=function(o){o.elem.combo_input.val("");if(!o.option.multiple){o.elem.hidden.val("")}o.prop.selected_text=""};g(document.body).off("mousedown.selectPage").on("mousedown.selectPage",function(q){var p=q.target||q.srcElement;var o=g(p).closest("div."+m.container);g("div."+m.container+"."+m.container_open).each(function(){if(this==o[0]){return}var r=g(this),s=r.find("input."+m.input).data(h.dataKey);if(!s.elem.combo_input.val()&&s.elem.hidden.val()&&!s.option.multiple){s.prop.current_page=1;n(s);s.hideResults(s);return true}if(s.elem.results.find("li").not("."+m.message_box).size()){if(s.option.autoFillResult){if(s.elem.hidden.val()){s.hideResults(s)}else{if(s.elem.results.find("li.sp_over").size()){s.selectCurrentLine(s,true)}else{if(s.option.autoSelectFirst){s.nextLine(s);s.selectCurrentLine(s,true)}else{s.hideResults(s)}}}}else{s.hideResults(s)}}else{if(s.option.noResultClean){n(s)}else{if(!s.option.multiple){s.elem.hidden.val("")}}s.hideResults(s)}})})};h.prototype.eResultList=function(){var l=this,m=this.css_class;l.elem.results.children("li").hover(function(){if(l.prop.key_select){l.prop.key_select=false;return}if(!g(this).hasClass(m.selected)&&!g(this).hasClass(m.message_box)){g(this).addClass(m.select);l.setCssFocusedResults(l)}},function(){g(this).removeClass(m.select)}).click(function(n){if(l.prop.key_select){l.prop.key_select=false;return}n.preventDefault();n.stopPropagation();if(!g(this).hasClass(m.selected)){l.selectCurrentLine(l,false)}})};h.prototype.eScroll=function(){var l=this,m=this.css_class;g(window).on("scroll.SelectPage",function(n){g("div."+m.container+"."+m.container_open).each(function(){var v=g(this),u=v.find("input."+m.input).data(h.dataKey),t=u.elem.result_area.offset(),s=g(window).scrollTop(),x=g(document).height(),q=g(window).height(),p=u.elem.result_area.outerHeight(),o=t.top+p,r=x>q,w=u.elem.result_area.hasClass("shadowDown");if(r){if(w){if(o>(q+s)){u.calcResultsSize(u)}}else{if(t.top '+n+"
      • ";l.elem.results.empty().append(m).show();l.calcResultsSize(l);l.setOpenStatus(l,true);l.elem.control.hide();if(l.option.pagination){l.elem.navi.hide()}};h.prototype.scrollWindow=function(t,q){var l=t.getCurrentLine(t),s=(l&&!q)?l.offset().top:t.elem.container.offset().top,n;t.prop.size_li=t.elem.results.children("li:first").outerHeight();n=t.prop.size_li;var r,p=g(window).height(),o=g(window).scrollTop(),m=o+p-n;if(l.length){if(sp){r=s-o}else{if(s>m){r=s-m}else{return}}}else{if(s-1&&l.elem.result_area.is(":visible"))||(g.inArray(m.keyCode,[13,9])>-1&&l.getCurrentLine(l))){m.preventDefault();m.stopPropagation();m.cancelBubble=true;m.returnValue=false;switch(m.keyCode){case 37:if(m.shiftKey){l.firstPage(l)}else{l.prevPage(l)}break;case 38:l.prop.key_select=true;l.prevLine(l);break;case 39:if(m.shiftKey){l.lastPage(l)}else{l.nextPage(l)}break;case 40:if(l.elem.results.children("li").length){l.prop.key_select=true;l.nextLine(l)}else{l.suggest(l)}break;case 9:l.prop.key_paging=true;l.selectCurrentLine(l,true);break;case 13:l.selectCurrentLine(l,true);break;case 27:l.prop.key_paging=true;l.hideResults(l);break}}};h.prototype.abortAjax=function(l){if(l.prop.xhr){l.prop.xhr.abort();l.prop.xhr=false}};h.prototype.suggest=function(m){var n,o=g.trim(m.elem.combo_input.val());if(m.option.multiple){n=o}else{if(o&&o===m.prop.selected_text){n=""}else{n=o}}n=n.split(/[\s ]+/);if(m.option.eOpen&&g.isFunction(m.option.eOpen)){m.option.eOpen.call(m)}m.abortAjax(m);var l=m.prop.current_page||1;if(typeof m.option.data=="object"){m.searchForJson(m,n,l)}else{m.searchForDb(m,n,l)}};h.prototype.setLoading=function(l){if(l.elem.results.html()===""){l.setOpenStatus(l,true)}};h.prototype.searchForDb=function(t,q,s){var m=t.option;if(!m.eAjaxSuccess||!g.isFunction(m.eAjaxSuccess)){t.hideResults(t)}var n=m.params,r={},o=m.searchField;if(q.length&&q[0]&&q[0]!==t.prop.prev_value){s=1}var l={q_word:q,pageNumber:s,pageSize:m.pageSize,andOr:m.andOr,orderBy:m.orderBy,searchTable:m.dbTable};l[o]=q[0];if(n&&g.isFunction(n)){var u=n.call(t);if(u&&g.isPlainObject(u)){r=g.extend({},l,u)}else{r=l}}else{r=l}t.prop.xhr=g.ajax({dataType:"json",url:m.data,type:"POST",data:r,success:function(x){if(!x||!g.isPlainObject(x)){t.hideResults(t);t.ajaxErrorNotify(t,errorThrown);return}var y={},w={};try{y=m.eAjaxSuccess(x);w.originalResult=y.list;w.cnt_whole=y.totalRow}catch(z){t.showMessage(t,t.message.ajax_error);return}w.candidate=[];w.keyField=[];if(typeof w.originalResult!="object"){t.prop.xhr=null;t.notFoundSearch(t);return}w.cnt_page=w.originalResult.length;for(var v=0;v ');C.append('
      • ');C.append('
      • '+G()+"
      • ");C.append('
      • ');C.append('
      • ');C.show()}else{C.find("li.pageInfoBox a").html(G())}};var t=x.elem.navi.find("ul"),r=Math.ceil(v/x.option.pageSize);if(r===0){l=0}else{if(r1){x.ePaging()}};h.prototype.displayResults=function(A,z,s){var l=A.option,n=A.elem;n.results.hide().empty();if(l.multiple&&g.type(l.maxSelectLimit)==="number"&&l.maxSelectLimit>0){var q=n.element_box.find("li.selected_tag").size();if(q>0&&q>=l.maxSelectLimit){var o=A.message.max_selected;A.showMessage(A,o.replace(A.template.msg.maxSelectLimit,l.maxSelectLimit));return}}if(z.candidate.length){var y=z.candidate,w=z.keyField,m=n.hidden.val(),B=m?m.split(","):new Array(),v="";for(var r=0;r").html(v).attr({pkey:w[r],title:v});if(g.inArray(w[r].toString(),B)!==-1){t.addClass(A.css_class.selected)}t.data("dataObj",z.originalResult[r]);n.results.append(t)}}else{var x='
      • '+A.message.not_found+"
      • ";n.results.append(x)}n.results.show();if(l.multiple&&l.multipleControlbar){n.control.show()}if(l.pagination){n.navi.show()}A.calcResultsSize(A);A.setOpenStatus(A,true);A.eResultList();A.eScroll();if(s&&z.candidate.length&&l.autoSelectFirst){A.nextLine(A)}};h.prototype.calcResultsSize=function(m){var o=m.option,n=m.elem;var l=function(){if(n.container.css("position")==="static"){var z=n.combo_input.offset();n.result_area.css({top:z.top+n.combo_input.outerHeight()+"px",left:z.left+"px"})}else{if(!o.pagination){var w=n.results.find("li:first").outerHeight(true),u=w*o.listSize;n.results.css({"max-height":u,"overflow-y":"auto"})}var A=g(document).width(),E=g(document).height(),v=g(window).height(),z=n.container.offset(),y=g(window).scrollTop(),D=n.result_area.outerWidth(),u=n.result_area.outerHeight(),q=z.left,p=n.container.outerHeight(),t=(z.left+D)>A?q-(D-n.container.outerWidth()):q,s=z.top,C=0,B=5,r=s+p+u+B,x=E>v;if((s-y-B>u)&&(x&&r>(v+y))||(!x&&r>v)){C=z.top-u-B;n.result_area.removeClass("shadowUp shadowDown").addClass("shadowUp")}else{C=z.top+(o.multiple?n.container.outerHeight():p);n.result_area.removeClass("shadowUp shadowDown").addClass("shadowDown");C+=B}return{top:C+"px",left:t+"px"}}};if(n.result_area.is(":visible")){n.result_area.css(l())}else{n.result_area.show(1,function(){g(this).css(l())})}};h.prototype.hideResults=function(l){if(l.prop.key_paging){l.scrollWindow(l,true);l.prop.key_paging=false}l.setCssFocusedInput(l);if(l.option.autoFillResult){}l.elem.results.empty();l.elem.result_area.hide();l.setOpenStatus(l,false);g(window).off("scroll.SelectPage");l.abortAjax(l);l.setButtonAttrDefault()};h.prototype.disabled=function(l,n){var o=l.option,m=l.elem;if(g.type(n)==="undefined"){return m.combo_input.prop("disabled")}if(g.type(n)==="boolean"){m.combo_input.prop("disabled",n);if(n){m.container.addClass(l.css_class.disabled)}else{m.container.removeClass(l.css_class.disabled)}}};h.prototype.firstPage=function(l){if(l.prop.current_page>1){l.prop.current_page=1;l.prop.page_move=true;l.suggest(l)}};h.prototype.prevPage=function(l){if(l.prop.current_page>1){l.prop.current_page--;l.prop.page_move=true;l.suggest(l)}};h.prototype.nextPage=function(l){if(l.prop.current_page0&&n.maxSelectLimit===l.elem.element_box.find("li.selected_tag").size()){return false}});if(n.eSelect&&g.isFunction(n.eSelect)){n.eSelect(m,l)}l.afterAction(l)};h.prototype.unSelectAllLine=function(l){var n=l.option,m=l.elem.results.find("li").size();l.elem.results.find("li").each(function(q,r){var p=g(r).attr("pkey");var o=l.elem.element_box.find('li.selected_tag[itemvalue="'+p+'"]');l.removeTag(l,o)});l.afterAction(l);if(n.eTagRemove&&g.isFunction(n.eTagRemove)){n.eTagRemove(m,l)}};h.prototype.clearAll=function(l){var n=l.option,m=0;if(n.multiple){m=l.elem.element_box.find("li.selected_tag").size();l.elem.element_box.find("li.selected_tag").remove()}l.elem.combo_input.val("");l.elem.hidden.val("");l.afterAction(l);if(!n.multiple){l.elem.clear_btn.remove()}if(n.multiple){if(n.eTagRemove&&g.isFunction(n.eTagRemove)){n.eTagRemove(m,l)}}};h.prototype.getCurrentLine=function(l){if(l.elem.result_area.is(":hidden")){return false}var m=l.elem.results.find("li."+l.css_class.select);if(m.size()){return m}else{return false}};h.prototype.isAlreadySelected=function(l,n){var o=false;if(n.value){var m=l.elem.hidden.val();if(m){var p=m.split(",");if(p&&p.length&&g.inArray(n.value,p)!=-1){o=true}}}return o};h.prototype.addNewTag=function(m,o){if(!m.option.multiple||!o){return}var n=m.template.tag.content,l;n=n.replace(m.template.tag.textKey,o.text);n=n.replace(m.template.tag.valueKey,o.value);l=g(n);if(m.elem.combo_input.prop("disabled")){l.find("span.tag_close").hide()}m.elem.combo_input.closest("li").before(l)};h.prototype.removeTag=function(l,q){var n=g(q).attr("itemvalue");var p=l.elem.hidden.val();if(g.type(n)!="undefined"&&p){var o=p.split(","),m=g.inArray(n.toString(),o);if(m!=-1){o.splice(m,1);l.elem.hidden.val(o.toString())}}g(q).remove();l.inputResize(l)};h.prototype.tagValuesSet=function(m){if(!m.option.multiple){return}var n=m.elem.element_box.find("li.selected_tag");if(n&&n.size()){var l=new Array();g.each(n,function(q,o){var p=g(o).attr("itemvalue");if(g.type(p)!=="undefined"){l.push(p)}});if(l.length){m.elem.hidden.val(l.join(","))}}};h.prototype.inputResize=function(l){if(!l.option.multiple){return}var o="",m=l.elem.combo_input.closest("li");var n=function(p,q){q.removeClass("full_width");var s=p.elem.combo_input.val().length+1,r=(s*0.75)+"em";p.elem.combo_input.css("width",r).removeAttr("placeholder")};if(l.elem.element_box.find("li.selected_tag").size()===0){if(l.elem.combo_input.attr("placeholder_bak")){if(!m.hasClass("full_width")){m.addClass("full_width")}l.elem.combo_input.attr("placeholder",l.elem.combo_input.attr("placeholder_bak")).removeAttr("style")}else{n(l,m)}}else{n(l,m)}};h.prototype.nextLine=function(m){var o=m.getCurrentLine(m),l;if(!o){l=-1}else{l=m.elem.results.children("li").index(o);o.removeClass(m.css_class.select)}l++;if(l-1){var n=m.elem.results.children("li").eq(l);n.addClass(m.css_class.select);m.setCssFocusedResults(m)}else{m.setCssFocusedInput(m)}m.scrollWindow(m,false)};function j(l){return this.each(function(){var n=g(this),m=n.data(h.dataKey),o=g.extend({},e,n.data(),m&&m.option,typeof l==="object"&&l);if(!m){n.data(h.dataKey,(m=new h(this,o)))}})}function a(l){return g(l).closest("div.sp_container").find("input.sp_input")}function b(){return this.each(function(){var m=a(this),l=m.data(h.dataKey);if(l){l.prop.init_set=true;l.clearAll(l);l.prop.init_set=false}})}function f(){return this.each(function(){var m=a(this),l=m.data(h.dataKey);if(l&&l.elem.hidden.val()){l.setInitRecord(true)}})}function c(l){return this.each(function(){if(l&&g.isArray(l)&&l.length){var n=a(this),m=n.data(h.dataKey);if(m){m.clearAll(m);m.option.data=l}}})}function k(m){var l=false;this.each(function(){var o=a(this),n=o.data(h.dataKey);if(n){if(g.type(m)!=="undefined"){n.disabled(n,m)}else{l=n.disabled(n)}}});return l}function i(){var l="";this.each(function(){var o=a(this),n=o.data(h.dataKey);if(n){if(n.option.multiple){var m=[];n.elem.element_box.find("li.selected_tag").each(function(q,p){m.push(g(p).text())});l+=m.toString()}else{l+=n.elem.combo_input.val()}}});return l}var d=g.fn.selectPage;g.fn.selectPage=j;g.fn.selectPage.Constructor=h;g.fn.selectPageClear=b;g.fn.selectPageRefresh=f;g.fn.selectPageData=c;g.fn.selectPageDisabled=k;g.fn.selectPageText=i;g.fn.selectPage.noConflict=function(){g.fn.selectPage=d;return this}})(window.jQuery); \ No newline at end of file +(function(g){var e={data:undefined,lang:"cn",multiple:false,pagination:true,dropButton:true,listSize:10,multipleControlbar:true,maxSelectLimit:0,selectToCloseList:false,initRecord:undefined,dbTable:"tbl",keyField:"id",showField:"name",searchField:undefined,andOr:"AND",orderBy:undefined,pageSize:10,params:undefined,formatItem:undefined,autoFillResult:false,autoSelectFirst:false,noResultClean:true,selectOnly:false,inputDelay:0.5,eSelect:undefined,eOpen:undefined,eAjaxSuccess:undefined,eTagRemove:undefined,eClear:undefined};var h=function(l,m){this.setOption(m);this.setLanguage();this.setCssClass();this.setProp();this.setElem(l);this.setButtonAttrDefault();this.setInitRecord();this.eDropdownButton();this.eInput();this.eWhole()};h.version="2.17";h.dataKey="selectPageObject";h.prototype.setOption=function(n){n.searchField=n.searchField||n.showField;n.andOr=n.andOr.toUpperCase();if(n.andOr!=="AND"&&n.andOr!=="OR"){n.andOr="AND"}var l=["searchField"];for(var m=0;m#item_text#',textKey:"#item_text#",valueKey:"#item_value#"},page:{current:"page_num",total:"page_count"},msg:{maxSelectLimit:"max_selected_limit"}}};h.prototype.elementRealSize=function(q,l){var p={absolute:false,clone:false,includeMargin:false,display:"block"};var t=p,o=q.eq(0),s,u,r=[],n="",m;s=function(){m=o.parents().addBack().filter(":hidden");n+="visibility: hidden !important; display: "+t.display+" !important; ";if(t.absolute===true){n+="position: absolute !important;"}m.each(function(){var w=g(this),x=w.attr("style");r.push(x);w.attr("style",x?x+";"+n:n)})};u=function(){m.each(function(w){var y=g(this),x=r[w];if(x===undefined){y.removeAttr("style")}else{y.attr("style",x)}})};s();var v=/(outer)/.test(l)?o[l](t.includeMargin):o[l]();u();return v};h.prototype.setElem=function(q){var o={},m=this.option,u=this.css_class,n=this.message,x=g(q);var s=x.outerWidth();if(s<=0){s=this.elementRealSize(x,"outerWidth")}if(s<150){s=150}o.combo_input=x.attr({"autocomplete":"off"}).addClass(u.input).wrap("
        ");if(m.selectOnly){o.combo_input.prop("readonly",true)}o.container=o.combo_input.parent().addClass(u.container);if(o.combo_input.prop("disabled")){if(m.multiple){o.container.addClass(u.disabled)}else{o.combo_input.addClass(u.input_off)}}o.container.width(s);o.button=g("
        ").addClass(u.button);o.dropdown=g('');o.clear_btn=g("
        ").html(g("").addClass("iconfont if-close")).addClass(u.clear_btn).attr("title",n.clear);if(!m.dropButton){o.clear_btn.addClass(u.align_right)}o.element_box=g("
          ").addClass(u.element_box);if(m.multiple&&m.multipleControlbar){o.control=g("
          ").addClass(u.control_box)}o.result_area=g("
          ").addClass(u.re_area);if(m.pagination){o.navi=g("
          ").addClass("pagination").append("
            ")}o.results=g("
              ").addClass(u.results);var l="_text",w=o.combo_input.attr("id")||o.combo_input.attr("name"),t=o.combo_input.attr("name")||"selectPage",v=t,r=w;o.hidden=g('').attr({name:v,id:r}).val("");o.combo_input.attr({name:t+l,id:w+l});o.container.append(o.hidden);if(m.dropButton){o.container.append(o.button);o.button.append(o.dropdown)}g(document.body).append(o.result_area);o.result_area.append(o.results);if(m.pagination){o.result_area.append(o.navi)}if(m.multiple){if(m.multipleControlbar){o.control.append('');o.control.append('');o.control.append('');o.control_text=g("

              ");o.control.append(o.control_text);o.result_area.prepend(o.control)}o.container.addClass("sp_container_combo");o.combo_input.addClass("sp_combo_input").before(o.element_box);var y=g("

            • ").addClass("input_box");y.append(o.combo_input);o.element_box.append(y);if(o.combo_input.attr("placeholder")){o.combo_input.attr("placeholder_bak",o.combo_input.attr("placeholder"))}}this.elem=o};h.prototype.setButtonAttrDefault=function(){if(this.option.dropButton){this.elem.button.attr("title",this.message.close_btn)}};h.prototype.setInitRecord=function(o){var l=this,s=l.option,n=l.elem,m="";if(g.type(n.combo_input.data("init"))!="undefined"){s.initRecord=String(n.combo_input.data("init"))}if(!o&&!s.initRecord&&n.combo_input.val()){s.initRecord=n.combo_input.val()}n.combo_input.val("");if(!o){n.hidden.val(s.initRecord)}m=o&&n.hidden.val()?n.hidden.val():s.initRecord;if(m){if(typeof s.data==="object"){var r=new Array();var q=m.split(",");g.each(q,function(p,u){for(var t=0;t1){r=[r[0]]}l.afterInit(l,r)}else{g.ajax({dataType:"json",type:"POST",url:s.data,data:{searchTable:s.dbTable,searchKey:s.keyField,searchValue:m},success:function(p){var t=null;if(s.eAjaxSuccess&&g.isFunction(s.eAjaxSuccess)){t=s.eAjaxSuccess(p)}l.afterInit(l,t.list)},error:function(p,u,t){l.ajaxErrorNotify(l,t)}})}}};h.prototype.afterInit=function(m,o){if(!o){return}if(!g.isArray(o)){o=[o]}var q=m.option,n=m.css_class;var l=function(t){var s=t[q.showField];if(q.formatItem&&g.isFunction(q.formatItem)){try{s=q.formatItem(t)}catch(p){}}return s};if(q.multiple){m.prop.init_set=true;m.clearAll(m);g.each(o,function(p,t){var s={text:l(t),value:t[q.keyField]};if(!m.isAlreadySelected(m,s)){m.addNewTag(m,s)}});m.tagValuesSet(m);m.inputResize(m);m.prop.init_set=false}else{var r=o[0];m.elem.combo_input.val(l(r));m.elem.hidden.val(r[q.keyField]);m.prop.prev_value=l(r);m.prop.selected_text=l(r);if(q.selectOnly){m.elem.combo_input.attr("title",m.message.select_ok).removeClass(n.select_ng).addClass(n.select_ok)}m.putClearButton()}};h.prototype.eDropdownButton=function(){var l=this;if(l.option.dropButton){l.elem.button.mouseup(function(m){m.stopPropagation();if(l.elem.result_area.is(":hidden")&&!l.elem.combo_input.prop("disabled")){l.elem.combo_input.focus()}else{l.hideResults(l)}})}};h.prototype.eInput=function(){var m=this,o=m.option,n=m.elem,q=m.message;var l=function(){m.prop.page_move=false;m.suggest(m);m.setCssFocusedInput(m)};n.combo_input.keyup(function(p){m.processKey(m,p)}).keydown(function(p){m.processControl(m,p)}).focus(function(p){if(n.result_area.is(":hidden")){p.stopPropagation();m.prop.first_show=true;l()}});n.container.on("click.SelectPage","div."+m.css_class.clear_btn,function(p){p.stopPropagation();if(!m.disabled(m)){m.clearAll(m);if(o.eClear&&g.isFunction(o.eClear)){o.eClear(m)}}});n.result_area.on("mousedown.SelectPage",function(p){p.stopPropagation()});if(o.multiple){if(o.multipleControlbar){n.control.find(".sp_select_all").on("click.SelectPage",function(p){m.selectAllLine(m)}).hover(function(){n.control_text.html(q.select_all)},function(){n.control_text.html("")});n.control.find(".sp_unselect_all").on("click.SelectPage",function(p){m.unSelectAllLine(m)}).hover(function(){n.control_text.html(q.unselect_all)},function(){n.control_text.html("")});n.control.find(".sp_clear_all").on("click.SelectPage",function(p){m.clearAll(m)}).hover(function(){n.control_text.html(q.clear_all)},function(){n.control_text.html("")})}n.element_box.on("click.SelectPage",function(r){var p=r.target||r.srcElement;if(g(p).is("ul")){n.combo_input.focus()}});n.element_box.on("click.SelectPage","span.tag_close",function(){var p=g(this).closest("li");m.removeTag(m,p);l();if(o.eTagRemove&&g.isFunction(o.eTagRemove)){o.eTagRemove(1,m)}});m.inputResize(m)}};h.prototype.eWhole=function(){var l=this,m=l.css_class;var n=function(o){o.elem.combo_input.val("");if(!o.option.multiple){o.elem.hidden.val("")}o.prop.selected_text=""};g(document.body).off("mousedown.selectPage").on("mousedown.selectPage",function(q){var p=q.target||q.srcElement;var o=g(p).closest("div."+m.container);g("div."+m.container+"."+m.container_open).each(function(){if(this==o[0]){return}var r=g(this),s=r.find("input."+m.input).data(h.dataKey);if(!s.elem.combo_input.val()&&s.elem.hidden.val()&&!s.option.multiple){s.prop.current_page=1;n(s);s.hideResults(s);return true}if(s.elem.results.find("li").not("."+m.message_box).size()){if(s.option.autoFillResult){if(s.elem.hidden.val()){s.hideResults(s)}else{if(s.elem.results.find("li.sp_over").size()){s.selectCurrentLine(s,true)}else{if(s.option.autoSelectFirst){s.nextLine(s);s.selectCurrentLine(s,true)}else{s.hideResults(s)}}}}else{s.hideResults(s)}}else{if(s.option.noResultClean){n(s)}else{if(!s.option.multiple){s.elem.hidden.val("")}}s.hideResults(s)}})})};h.prototype.eResultList=function(){var l=this,m=this.css_class;l.elem.results.children("li").hover(function(){if(l.prop.key_select){l.prop.key_select=false;return}if(!g(this).hasClass(m.selected)&&!g(this).hasClass(m.message_box)){g(this).addClass(m.select);l.setCssFocusedResults(l)}},function(){g(this).removeClass(m.select)}).click(function(n){if(l.prop.key_select){l.prop.key_select=false;return}n.preventDefault();n.stopPropagation();if(!g(this).hasClass(m.selected)){l.selectCurrentLine(l,false)}})};h.prototype.eScroll=function(){var l=this,m=this.css_class;g(window).on("scroll.SelectPage",function(n){g("div."+m.container+"."+m.container_open).each(function(){var v=g(this),u=v.find("input."+m.input).data(h.dataKey),t=u.elem.result_area.offset(),s=g(window).scrollTop(),x=g(document).height(),q=g(window).height(),p=u.elem.result_area.outerHeight(),o=t.top+p,r=x>q,w=u.elem.result_area.hasClass("shadowDown");if(r){if(w){if(o>(q+s)){u.calcResultsSize(u)}}else{if(t.top '+n+"
            • ";l.elem.results.empty().append(m).show();l.calcResultsSize(l);l.setOpenStatus(l,true);l.elem.control.hide();if(l.option.pagination){l.elem.navi.hide()}};h.prototype.scrollWindow=function(t,q){var l=t.getCurrentLine(t),s=(l&&!q)?l.offset().top:t.elem.container.offset().top,n;t.prop.size_li=t.elem.results.children("li:first").outerHeight();n=t.prop.size_li;var r,p=g(window).height(),o=g(window).scrollTop(),m=o+p-n;if(l.length){if(sp){r=s-o}else{if(s>m){r=s-m}else{return}}}else{if(s-1&&l.elem.result_area.is(":visible"))||(g.inArray(m.keyCode,[13,9])>-1&&l.getCurrentLine(l))){m.preventDefault();m.stopPropagation();m.cancelBubble=true;m.returnValue=false;switch(m.keyCode){case 37:if(m.shiftKey){l.firstPage(l)}else{l.prevPage(l)}break;case 38:l.prop.key_select=true;l.prevLine(l);break;case 39:if(m.shiftKey){l.lastPage(l)}else{l.nextPage(l)}break;case 40:if(l.elem.results.children("li").length){l.prop.key_select=true;l.nextLine(l)}else{l.suggest(l)}break;case 9:l.prop.key_paging=true;l.selectCurrentLine(l,true);break;case 13:l.selectCurrentLine(l,true);break;case 27:l.prop.key_paging=true;l.hideResults(l);break}}};h.prototype.abortAjax=function(l){if(l.prop.xhr){l.prop.xhr.abort();l.prop.xhr=false}};h.prototype.suggest=function(m){var n,o=g.trim(m.elem.combo_input.val());if(m.option.multiple){n=o}else{if(o&&o===m.prop.selected_text){n=""}else{n=o}}n=n.split(/[\s ]+/);if(m.option.eOpen&&g.isFunction(m.option.eOpen)){m.option.eOpen.call(m)}m.abortAjax(m);var l=m.prop.current_page||1;if(typeof m.option.data=="object"){m.searchForJson(m,n,l)}else{m.searchForDb(m,n,l)}};h.prototype.setLoading=function(l){if(l.elem.results.html()===""){l.setOpenStatus(l,true)}};h.prototype.searchForDb=function(t,q,s){var m=t.option;if(!m.eAjaxSuccess||!g.isFunction(m.eAjaxSuccess)){t.hideResults(t)}var n=m.params,r={},o=m.searchField;if(q.length&&q[0]&&q[0]!==t.prop.prev_value){s=1}var l={q_word:q,pageNumber:s,pageSize:m.pageSize,andOr:m.andOr,orderBy:m.orderBy,searchTable:m.dbTable};l[o]=q[0];if(n&&g.isFunction(n)){var u=n.call(t);if(u&&g.isPlainObject(u)){r=g.extend({},l,u)}else{r=l}}else{r=l}t.prop.xhr=g.ajax({dataType:"json",url:m.data,type:"POST",data:r,success:function(x){if(!x||!g.isPlainObject(x)){t.hideResults(t);t.ajaxErrorNotify(t,errorThrown);return}var y={},w={};try{y=m.eAjaxSuccess(x);w.originalResult=y.list;w.cnt_whole=y.totalRow}catch(z){t.showMessage(t,t.message.ajax_error);return}w.candidate=[];w.keyField=[];if(typeof w.originalResult!="object"){t.prop.xhr=null;t.notFoundSearch(t);return}w.cnt_page=w.originalResult.length;for(var v=0;v ');C.append('
            • ');C.append('
            • '+G()+"
            • ");C.append('
            • ');C.append('
            • ');C.show()}else{C.find("li.pageInfoBox a").html(G())}};var t=x.elem.navi.find("ul"),r=Math.ceil(v/x.option.pageSize);if(r===0){l=0}else{if(r1){x.ePaging()}};h.prototype.displayResults=function(A,z,s){var l=A.option,n=A.elem;n.results.hide().empty();if(l.multiple&&g.type(l.maxSelectLimit)==="number"&&l.maxSelectLimit>0){var q=n.element_box.find("li.selected_tag").size();if(q>0&&q>=l.maxSelectLimit){var o=A.message.max_selected;A.showMessage(A,o.replace(A.template.msg.maxSelectLimit,l.maxSelectLimit));return}}if(z.candidate.length){var y=z.candidate,w=z.keyField,m=n.hidden.val(),B=m?m.split(","):new Array(),v="";for(var r=0;r").html(v).attr({pkey:w[r],title:v});if(g.inArray(w[r].toString(),B)!==-1){t.addClass(A.css_class.selected)}t.data("dataObj",z.originalResult[r]);n.results.append(t)}}else{var x='
            • '+A.message.not_found+"
            • ";n.results.append(x)}n.results.show();if(l.multiple&&l.multipleControlbar){n.control.show()}if(l.pagination){n.navi.show()}A.calcResultsSize(A);A.setOpenStatus(A,true);A.eResultList();A.eScroll();if(s&&z.candidate.length&&l.autoSelectFirst){A.nextLine(A)}};h.prototype.calcResultsSize=function(m){var o=m.option,n=m.elem;var l=function(){if(n.container.css("position")==="static"){var z=n.combo_input.offset();n.result_area.css({top:z.top+n.combo_input.outerHeight()+"px",left:z.left+"px"})}else{if(!o.pagination){var w=n.results.find("li:first").outerHeight(true),u=w*o.listSize;n.results.css({"max-height":u,"overflow-y":"auto"})}var A=g(document).width(),E=g(document).height(),v=g(window).height(),z=n.container.offset(),y=g(window).scrollTop(),D=n.result_area.outerWidth(),u=n.result_area.outerHeight(),q=z.left,p=n.container.outerHeight(),t=(z.left+D)>A?q-(D-n.container.outerWidth()):q,s=z.top,C=0,B=5,r=s+p+u+B,x=E>v;if((s-y-B>u)&&(x&&r>(v+y))||(!x&&r>v)){C=z.top-u-B;n.result_area.removeClass("shadowUp shadowDown").addClass("shadowUp")}else{C=z.top+(o.multiple?n.container.outerHeight():p);n.result_area.removeClass("shadowUp shadowDown").addClass("shadowDown");C+=B}return{top:C+"px",left:t+"px"}}};if(n.result_area.is(":visible")){n.result_area.css(l())}else{n.result_area.show(1,function(){g(this).css(l())})}};h.prototype.hideResults=function(l){if(l.prop.key_paging){l.scrollWindow(l,true);l.prop.key_paging=false}l.setCssFocusedInput(l);if(l.option.autoFillResult){}l.elem.results.empty();l.elem.result_area.hide();l.setOpenStatus(l,false);g(window).off("scroll.SelectPage");l.abortAjax(l);l.setButtonAttrDefault()};h.prototype.disabled=function(l,n){var o=l.option,m=l.elem;if(g.type(n)==="undefined"){return m.combo_input.prop("disabled")}if(g.type(n)==="boolean"){m.combo_input.prop("disabled",n);if(n){m.container.addClass(l.css_class.disabled)}else{m.container.removeClass(l.css_class.disabled)}}};h.prototype.firstPage=function(l){if(l.prop.current_page>1){l.prop.current_page=1;l.prop.page_move=true;l.suggest(l)}};h.prototype.prevPage=function(l){if(l.prop.current_page>1){l.prop.current_page--;l.prop.page_move=true;l.suggest(l)}};h.prototype.nextPage=function(l){if(l.prop.current_page0&&n.maxSelectLimit===l.elem.element_box.find("li.selected_tag").size()){return false}});if(n.eSelect&&g.isFunction(n.eSelect)){n.eSelect(m,l)}l.afterAction(l)};h.prototype.unSelectAllLine=function(l){var n=l.option,m=l.elem.results.find("li").size();l.elem.results.find("li").each(function(q,r){var p=g(r).attr("pkey");var o=l.elem.element_box.find('li.selected_tag[itemvalue="'+p+'"]');l.removeTag(l,o)});l.afterAction(l);if(n.eTagRemove&&g.isFunction(n.eTagRemove)){n.eTagRemove(m,l)}};h.prototype.clearAll=function(l){var n=l.option,m=0;if(n.multiple){m=l.elem.element_box.find("li.selected_tag").size();l.elem.element_box.find("li.selected_tag").remove()}l.elem.combo_input.val("");l.elem.hidden.val("");l.afterAction(l);if(!n.multiple){l.elem.clear_btn.remove()}if(n.multiple){if(n.eTagRemove&&g.isFunction(n.eTagRemove)){n.eTagRemove(m,l)}}};h.prototype.getCurrentLine=function(l){if(l.elem.result_area.is(":hidden")){return false}var m=l.elem.results.find("li."+l.css_class.select);if(m.size()){return m}else{return false}};h.prototype.isAlreadySelected=function(l,n){var o=false;if(n.value){var m=l.elem.hidden.val();if(m){var p=m.split(",");if(p&&p.length&&g.inArray(n.value,p)!=-1){o=true}}}return o};h.prototype.addNewTag=function(m,o){if(!m.option.multiple||!o){return}var n=m.template.tag.content,l;n=n.replace(m.template.tag.textKey,o.text);n=n.replace(m.template.tag.valueKey,o.value);l=g(n);if(m.elem.combo_input.prop("disabled")){l.find("span.tag_close").hide()}m.elem.combo_input.closest("li").before(l)};h.prototype.removeTag=function(l,q){var n=g(q).attr("itemvalue");var p=l.elem.hidden.val();if(g.type(n)!="undefined"&&p){var o=p.split(","),m=g.inArray(n.toString(),o);if(m!=-1){o.splice(m,1);l.elem.hidden.val(o.toString())}}g(q).remove();l.inputResize(l)};h.prototype.tagValuesSet=function(m){if(!m.option.multiple){return}var n=m.elem.element_box.find("li.selected_tag");if(n&&n.size()){var l=new Array();g.each(n,function(q,o){var p=g(o).attr("itemvalue");if(g.type(p)!=="undefined"){l.push(p)}});if(l.length){m.elem.hidden.val(l.join(","))}}};h.prototype.inputResize=function(l){if(!l.option.multiple){return}var o="",m=l.elem.combo_input.closest("li");var n=function(p,q){q.removeClass("full_width");var s=p.elem.combo_input.val().length+1,r=(s*0.75)+"em";p.elem.combo_input.css("width",r).removeAttr("placeholder")};if(l.elem.element_box.find("li.selected_tag").size()===0){if(l.elem.combo_input.attr("placeholder_bak")){if(!m.hasClass("full_width")){m.addClass("full_width")}l.elem.combo_input.attr("placeholder",l.elem.combo_input.attr("placeholder_bak")).removeAttr("style")}else{n(l,m)}}else{n(l,m)}};h.prototype.nextLine=function(m){var o=m.getCurrentLine(m),l;if(!o){l=-1}else{l=m.elem.results.children("li").index(o);o.removeClass(m.css_class.select)}l++;if(l-1){var n=m.elem.results.children("li").eq(l);n.addClass(m.css_class.select);m.setCssFocusedResults(m)}else{m.setCssFocusedInput(m)}m.scrollWindow(m,false)};function j(l){return this.each(function(){var n=g(this),m=n.data(h.dataKey),o=g.extend({},e,n.data(),m&&m.option,typeof l==="object"&&l);if(!m){n.data(h.dataKey,(m=new h(this,o)))}})}function a(l){return g(l).closest("div.sp_container").find("input.sp_input")}function b(){return this.each(function(){var m=a(this),l=m.data(h.dataKey);if(l){l.prop.init_set=true;l.clearAll(l);l.prop.init_set=false}})}function f(){return this.each(function(){var m=a(this),l=m.data(h.dataKey);if(l&&l.elem.hidden.val()){l.setInitRecord(true)}})}function c(l){return this.each(function(){if(l&&g.isArray(l)&&l.length){var n=a(this),m=n.data(h.dataKey);if(m){m.clearAll(m);m.option.data=l}}})}function k(m){var l=false;this.each(function(){var o=a(this),n=o.data(h.dataKey);if(n){if(g.type(m)!=="undefined"){n.disabled(n,m)}else{l=n.disabled(n)}}});return l}function i(){var l="";this.each(function(){var o=a(this),n=o.data(h.dataKey);if(n){if(n.option.multiple){var m=[];n.elem.element_box.find("li.selected_tag").each(function(q,p){m.push(g(p).text())});l+=m.toString()}else{l+=n.elem.combo_input.val()}}});return l}var d=g.fn.selectPage;g.fn.selectPage=j;g.fn.selectPage.Constructor=h;g.fn.selectPageClear=b;g.fn.selectPageRefresh=f;g.fn.selectPageData=c;g.fn.selectPageDisabled=k;g.fn.selectPageText=i;g.fn.selectPage.noConflict=function(){g.fn.selectPage=d;return this}})(window.jQuery); \ No newline at end of file