").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
+
+ /*!
+ * jQuery Cookie Plugin v1.3.1
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2013 Klaus Hartl
+ * Released under the MIT license
+ */
+(function ($, document, undefined) {
+
+ var pluses = /\+/g;
+
+ function raw(s) {
+ return s;
+ }
+
+ function decoded(s) {
+ return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
+ }
+
+ function unRfc2068(value) {
+ if (value.indexOf('"') === 0) {
+ // This is a quoted cookie as according to RFC2068, unescape
+ value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
+ }
+ return value;
+ }
+
+ function fromJSON(value) {
+ return config.json ? JSON.parse(value) : value;
+ }
+
+ var config = $.cookie = function (key, value, options) {
+
+ // write
+ if (value !== undefined) {
+ options = $.extend({}, config.defaults, options);
+
+ if (value === null) {
+ options.expires = -1;
+ }
+
+ if (typeof options.expires === 'number') {
+ var days = options.expires, t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ value = config.json ? JSON.stringify(value) : String(value);
+
+ return (document.cookie = [
+ encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join(''));
+ }
+
+ // read
+ var decode = config.raw ? raw : decoded;
+ var cookies = document.cookie.split('; ');
+ var result = key ? null : {};
+ for (var i = 0, l = cookies.length; i < l; i++) {
+ var parts = cookies[i].split('=');
+ var name = decode(parts.shift());
+ var cookie = decode(parts.join('='));
+
+ if (key && key === name) {
+ result = fromJSON(cookie);
+ break;
+ }
+
+ if (!key) {
+ result[name] = fromJSON(cookie);
+ }
+ }
+
+ return result;
+ };
+
+ config.defaults = {};
+
+ $.removeCookie = function (key, options) {
+ if ($.cookie(key) !== null) {
+ $.cookie(key, null, options);
+ return true;
+ }
+ return false;
+ };
+
+})(jQuery, document);
+
+ /*!
+ * sprintf and vsprintf for jQuery
+ * somewhat based on http://jan.moesen.nu/code/javascript/sprintf-and-printf-in-javascript/
+ * Copyright (c) 2008 Sabin Iacob (m0n5t3r)
+ * @license http://www.gnu.org/licenses/gpl.html
+ * @project jquery.sprintf
+ */
+(function(d){var a={b:function(e){return parseInt(e,10).toString(2)},c:function(e){return String.fromCharCode(parseInt(e,10))},d:function(e){return parseInt(e,10)},u:function(e){return Math.abs(e)},f:function(f,e){e=parseInt(e,10);f=parseFloat(f);if(isNaN(e&&f)){return NaN}return e&&f.toFixed(e)||f},o:function(e){return parseInt(e,10).toString(8)},s:function(e){return e},x:function(e){return(""+parseInt(e,10).toString(16)).toLowerCase()},X:function(e){return(""+parseInt(e,10).toString(16)).toUpperCase()}};var c=/%(?:(\d+)?(?:\.(\d+))?|\(([^)]+)\))([%bcdufosxX])/g;var b=function(f){if(f.length==1&&typeof f[0]=="object"){f=f[0];return function(i,h,k,j,g,m,l){return a[g](f[j])}}else{var e=0;return function(i,h,k,j,g,m,l){if(g=="%"){return"%"}return a[g](f[e++],k)}}};d.extend({sprintf:function(f){var e=Array.apply(null,arguments).slice(1);return f.replace(c,b(e))},vsprintf:function(f,e){return f.replace(c,b(e))}})})(jQuery);
+
+ /*
+ * jQuery Autocomplete plugin 1.2.3
+ *
+ * Copyright (c) 2009 Jörn Zaefferer
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * With small modifications by Alfonso Gómez-Arzola.
+ * See changelog for details.
+ *
+ */
+
+;(function($) {
+
+$.fn.extend({
+ autocomplete: function(urlOrData, options) {
+ var isUrl = typeof urlOrData == "string";
+ options = $.extend({}, $.Autocompleter.defaults, {
+ url: isUrl ? urlOrData : null,
+ data: isUrl ? null : urlOrData,
+ delay: isUrl ? $.Autocompleter.defaults.delay : 10,
+ max: options && !options.scroll ? 10 : 150,
+ noRecord: "No Records."
+ }, options);
+
+ // if highlight is set to false, replace it with a do-nothing function
+ options.highlight = options.highlight || function(value) { return value; };
+
+ // if the formatMatch option is not specified, then use formatItem for backwards compatibility
+ options.formatMatch = options.formatMatch || options.formatItem;
+
+ return this.each(function() {
+ new $.Autocompleter(this, options);
+ });
+ },
+ result: function(handler) {
+ return this.bind("result", handler);
+ },
+ search: function(handler) {
+ return this.trigger("search", [handler]);
+ },
+ flushCache: function() {
+ return this.trigger("flushCache");
+ },
+ setOptions: function(options){
+ return this.trigger("setOptions", [options]);
+ },
+ unautocomplete: function() {
+ return this.trigger("unautocomplete");
+ }
+});
+
+$.Autocompleter = function(input, options) {
+
+ var KEY = {
+ UP: 38,
+ DOWN: 40,
+ DEL: 46,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ COMMA: 188,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ BACKSPACE: 8
+ };
+
+ var globalFailure = null;
+ if(options.failure != null && typeof options.failure == "function") {
+ globalFailure = options.failure;
+ }
+
+ // Create $ object for input element
+ var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
+
+ var timeout;
+ var previousValue = "";
+ var cache = $.Autocompleter.Cache(options);
+ var hasFocus = 0;
+ var lastKeyPressCode;
+ var config = {
+ mouseDownOnSelect: false
+ };
+ var select = $.Autocompleter.Select(options, input, selectCurrent, config);
+
+ var blockSubmit;
+
+ // prevent form submit in opera when selecting with return key
+ navigator.userAgent.indexOf("Opera") != -1 && $(input.form).bind("submit.autocomplete", function() {
+ if (blockSubmit) {
+ blockSubmit = false;
+ return false;
+ }
+ });
+
+ // older versions of opera don't trigger keydown multiple times while pressed, others don't work with keypress at all
+ $input.bind((navigator.userAgent.indexOf("Opera") != -1 && !'KeyboardEvent' in window ? "keypress" : "keydown") + ".autocomplete", function(event) {
+ // a keypress means the input has focus
+ // avoids issue where input had focus before the autocomplete was applied
+ hasFocus = 1;
+ // track last key pressed
+ lastKeyPressCode = event.keyCode;
+ switch(event.keyCode) {
+
+ case KEY.UP:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.prev();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ case KEY.DOWN:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.next();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ case KEY.PAGEUP:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.pageUp();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ case KEY.PAGEDOWN:
+ if ( select.visible() ) {
+ event.preventDefault();
+ select.pageDown();
+ } else {
+ onChange(0, true);
+ }
+ break;
+
+ // matches also semicolon
+ case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
+ case KEY.TAB:
+ case KEY.RETURN:
+ if( selectCurrent() ) {
+ // stop default to prevent a form submit, Opera needs special handling
+ event.preventDefault();
+ blockSubmit = true;
+ return false;
+ }
+ break;
+
+ case KEY.ESC:
+ select.hide();
+ break;
+
+ default:
+ clearTimeout(timeout);
+ timeout = setTimeout(onChange, options.delay);
+ break;
+ }
+ }).focus(function(){
+ // track whether the field has focus, we shouldn't process any
+ // results if the field no longer has focus
+ hasFocus++;
+ }).blur(function() {
+ hasFocus = 0;
+ if (!config.mouseDownOnSelect) {
+ hideResults();
+ }
+ }).click(function() {
+ // show select when clicking in a focused field
+ // but if clickFire is true, don't require field
+ // to be focused to begin with; just show select
+ if( options.clickFire ) {
+ if ( !select.visible() ) {
+ onChange(0, true);
+ }
+ } else {
+ if ( hasFocus++ > 1 && !select.visible() ) {
+ onChange(0, true);
+ }
+ }
+ }).bind("search", function() {
+ // TODO why not just specifying both arguments?
+ var fn = (arguments.length > 1) ? arguments[1] : null;
+ function findValueCallback(q, data) {
+ var result;
+ if( data && data.length ) {
+ for (var i=0; i < data.length; i++) {
+ if( data[i].result.toLowerCase() == q.toLowerCase() ) {
+ result = data[i];
+ break;
+ }
+ }
+ }
+ if( typeof fn == "function" ) fn(result);
+ else $input.trigger("result", result && [result.data, result.value]);
+ }
+ $.each(trimWords($input.val()), function(i, value) {
+ request(value, findValueCallback, findValueCallback);
+ });
+ }).bind("flushCache", function() {
+ cache.flush();
+ }).bind("setOptions", function() {
+ $.extend(true, options, arguments[1]);
+ // if we've updated the data, repopulate
+ if ( "data" in arguments[1] )
+ cache.populate();
+ }).bind("unautocomplete", function() {
+ select.unbind();
+ $input.unbind();
+ $(input.form).unbind(".autocomplete");
+ });
+
+
+ function selectCurrent() {
+ var selected = select.selected();
+ if( !selected )
+ return false;
+
+ var v = selected.result;
+ previousValue = v;
+
+ if ( options.multiple ) {
+ var words = trimWords($input.val());
+ if ( words.length > 1 ) {
+ var seperator = options.multipleSeparator.length;
+ var cursorAt = $(input).selection().start;
+ var wordAt, progress = 0;
+ $.each(words, function(i, word) {
+ progress += word.length;
+ if (cursorAt <= progress) {
+ wordAt = i;
+ return false;
+ }
+ progress += seperator;
+ });
+ words[wordAt] = v;
+ // TODO this should set the cursor to the right position, but it gets overriden somewhere
+ //$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
+ v = words.join( options.multipleSeparator );
+ }
+ v += options.multipleSeparator;
+ }
+
+ $input.val(v);
+ hideResultsNow();
+ $input.trigger("result", [selected.data, selected.value]);
+ return true;
+ }
+
+ function onChange(crap, skipPrevCheck) {
+ if( lastKeyPressCode == KEY.DEL ) {
+ select.hide();
+ return;
+ }
+
+ var currentValue = $input.val();
+
+ if ( !skipPrevCheck && currentValue == previousValue )
+ return;
+
+ previousValue = currentValue;
+
+ currentValue = lastWord(currentValue);
+ if ( currentValue.length >= options.minChars) {
+ $input.addClass(options.loadingClass);
+ if (!options.matchCase)
+ currentValue = currentValue.toLowerCase();
+ request(currentValue, receiveData, hideResultsNow);
+ } else {
+ stopLoading();
+ select.hide();
+ }
+ };
+
+ function trimWords(value) {
+ if (!value)
+ return [""];
+ if (!options.multiple)
+ return [$.trim(value)];
+ return $.map(value.split(options.multipleSeparator), function(word) {
+ return $.trim(value).length ? $.trim(word) : null;
+ });
+ }
+
+ function lastWord(value) {
+ if ( !options.multiple )
+ return value;
+ var words = trimWords(value);
+ if (words.length == 1)
+ return words[0];
+ var cursorAt = $(input).selection().start;
+ if (cursorAt == value.length) {
+ words = trimWords(value)
+ } else {
+ words = trimWords(value.replace(value.substring(cursorAt), ""));
+ }
+ return words[words.length - 1];
+ }
+
+ // fills in the input box w/the first match (assumed to be the best match)
+ // q: the term entered
+ // sValue: the first matching result
+ function autoFill(q, sValue){
+ // autofill in the complete box w/the first match as long as the user hasn't entered in more data
+ // if the last user key pressed was backspace, don't autofill
+ if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
+ // fill in the value (keep the case the user has typed)
+ $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
+ // select the portion of the value not typed by the user (so the next character will erase)
+ $(input).selection(previousValue.length, previousValue.length + sValue.length);
+ }
+ };
+
+ function hideResults() {
+ clearTimeout(timeout);
+ timeout = setTimeout(hideResultsNow, 200);
+ };
+
+ function hideResultsNow() {
+ var wasVisible = select.visible();
+ select.hide();
+ clearTimeout(timeout);
+ stopLoading();
+ if (options.mustMatch) {
+ // call search and run callback
+ $input.search(
+ function (result){
+ // if no value found, clear the input box
+ if( !result ) {
+ if (options.multiple) {
+ var words = trimWords($input.val()).slice(0, -1);
+ $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
+ }
+ else {
+ $input.val( "" );
+ $input.trigger("result", null);
+ }
+ }
+ }
+ );
+ }
+ };
+
+ function receiveData(q, data) {
+ if ( data && data.length && hasFocus ) {
+ stopLoading();
+ select.display(data, q);
+ autoFill(q, data[0].value);
+ select.show();
+ } else {
+ hideResultsNow();
+ }
+ };
+
+ function request(term, success, failure) {
+ if (!options.matchCase)
+ term = term.toLowerCase();
+ var data = cache.load(term);
+ // recieve the cached data
+ if (data) {
+ if(data.length) {
+ success(term, data);
+ }
+ else{
+ var parsed = options.parse && options.parse(options.noRecord) || parse(options.noRecord);
+ success(term,parsed);
+ }
+ // if an AJAX url has been supplied, try loading the data now
+ } else if( (typeof options.url == "string") && (options.url.length > 0) ){
+
+ var extraParams = {
+ timestamp: +new Date()
+ };
+ $.each(options.extraParams, function(key, param) {
+ extraParams[key] = typeof param == "function" ? param() : param;
+ });
+
+ $.ajax({
+ // try to leverage ajaxQueue plugin to abort previous requests
+ mode: "abort",
+ // limit abortion to this input
+ port: "autocomplete" + input.name,
+ dataType: options.dataType,
+ url: options.url,
+ data: $.extend({
+ q: lastWord(term),
+ limit: options.max
+ }, extraParams),
+ success: function(data) {
+ var parsed = options.parse && options.parse(data) || parse(data);
+ cache.add(term, parsed);
+ success(term, parsed);
+ }
+ });
+ } else {
+ // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
+ select.emptyList();
+ if(globalFailure != null) {
+ globalFailure();
+ }
+ else {
+ failure(term);
+ }
+ }
+ };
+
+ function parse(data) {
+ var parsed = [];
+ var rows = data.split("\n");
+ for (var i=0; i < rows.length; i++) {
+ var row = $.trim(rows[i]);
+ if (row) {
+ row = row.split("|");
+ parsed[parsed.length] = {
+ data: row,
+ value: row[0],
+ result: options.formatResult && options.formatResult(row, row[0]) || row[0]
+ };
+ }
+ }
+ return parsed;
+ };
+
+ function stopLoading() {
+ $input.removeClass(options.loadingClass);
+ };
+
+};
+
+$.Autocompleter.defaults = {
+ inputClass: "ac_input",
+ resultsClass: "ac_results",
+ loadingClass: "ac_loading",
+ minChars: 1,
+ delay: 400,
+ matchCase: false,
+ matchSubset: true,
+ matchContains: false,
+ cacheLength: 100,
+ max: 1000,
+ mustMatch: false,
+ extraParams: {},
+ selectFirst: true,
+ formatItem: function(row) { return row[0]; },
+ formatMatch: null,
+ autoFill: false,
+ width: 0,
+ multiple: false,
+ multipleSeparator: " ",
+ inputFocus: true,
+ clickFire: false,
+ highlight: function(value, term) {
+ return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1 ");
+ },
+ scroll: true,
+ scrollHeight: 180,
+ scrollJumpPosition: true
+};
+
+$.Autocompleter.Cache = function(options) {
+
+ var data = {};
+ var length = 0;
+
+ function matchSubset(s, sub) {
+ return (new RegExp(sub.toUpperCase().replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1").replace(/[A-Z0-9]/g, function(m, offset) {
+ return offset === 0 ? '(?:' + m + '|^' + m.toLowerCase() + ')' : '(?:.*' + m + '|' + m.toLowerCase() + ')';
+ }))).test(s); // find by initials
+ };
+
+ function add(q, value) {
+ if (length > options.cacheLength){
+ flush();
+ }
+ if (!data[q]){
+ length++;
+ }
+ data[q] = value;
+ }
+
+ function populate(){
+ if( !options.data ) return false;
+ // track the matches
+ var stMatchSets = {},
+ nullData = 0;
+
+ // no url was specified, we need to adjust the cache length to make sure it fits the local data store
+ if( !options.url ) options.cacheLength = 1;
+
+ // track all options for minChars = 0
+ stMatchSets[""] = [];
+
+ // loop through the array and create a lookup structure
+ for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
+ var rawValue = options.data[i];
+ // if rawValue is a string, make an array otherwise just reference the array
+ rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
+
+ var value = options.formatMatch(rawValue, i+1, options.data.length);
+ if ( typeof(value) === 'undefined' || value === false )
+ continue;
+
+ var firstChar = value.charAt(0).toLowerCase();
+ // if no lookup array for this character exists, look it up now
+ if( !stMatchSets[firstChar] )
+ stMatchSets[firstChar] = [];
+
+ // if the match is a string
+ var row = {
+ value: value,
+ data: rawValue,
+ result: options.formatResult && options.formatResult(rawValue) || value
+ };
+
+ // push the current match into the set list
+ stMatchSets[firstChar].push(row);
+
+ // keep track of minChars zero items
+ if ( nullData++ < options.max ) {
+ stMatchSets[""].push(row);
+ }
+ };
+
+ // add the data items to the cache
+ $.each(stMatchSets, function(i, value) {
+ // increase the cache size
+ options.cacheLength++;
+ // add to the cache
+ add(i, value);
+ });
+ }
+
+ // populate any existing data
+ setTimeout(populate, 25);
+
+ function flush(){
+ data = {};
+ length = 0;
+ }
+
+ return {
+ flush: flush,
+ add: add,
+ populate: populate,
+ load: function(q) {
+ if (!options.cacheLength || !length)
+ return null;
+ /*
+ * if dealing w/local data and matchContains than we must make sure
+ * to loop through all the data collections looking for matches
+ */
+ if( !options.url && options.matchContains ){
+ // track all matches
+ var csub = [];
+ // loop through all the data grids for matches
+ for( var k in data ){
+ // don't search through the stMatchSets[""] (minChars: 0) cache
+ // this prevents duplicates
+ if( k.length > 0 ){
+ var c = data[k];
+ $.each(c, function(i, x) {
+ // if we've got a match, add it to the array
+ if (matchSubset(x.value, q)) {
+ csub.push(x);
+ }
+ });
+ }
+ }
+ return csub;
+ } else
+ // if the exact item exists, use it
+ if (data[q]){
+ return data[q];
+ } else
+ if (options.matchSubset) {
+ for (var i = q.length - 1; i >= options.minChars; i--) {
+ var c = data[q.substr(0, i)];
+ if (c) {
+ var csub = [];
+ $.each(c, function(i, x) {
+ if (matchSubset(x.value, q)) {
+ csub[csub.length] = x;
+ }
+ });
+ return csub;
+ }
+ }
+ }
+ return null;
+ }
+ };
+};
+
+$.Autocompleter.Select = function (options, input, select, config) {
+ var CLASSES = {
+ ACTIVE: "ac_over"
+ };
+
+ var listItems,
+ active = -1,
+ data,
+ term = "",
+ needsInit = true,
+ element,
+ list;
+
+ // Create results
+ function init() {
+ if (!needsInit)
+ return;
+ element = $("
")
+ .hide()
+ .addClass(options.resultsClass)
+ .css("position", "absolute")
+ .appendTo(document.body)
+ .hover(function(event) {
+ // Browsers except FF do not fire mouseup event on scrollbars, resulting in mouseDownOnSelect remaining true, and results list not always hiding.
+ if($(this).is(":visible")) {
+ input.focus();
+ }
+ config.mouseDownOnSelect = false;
+ });
+
+ list = $("").appendTo(element).mouseover( function(event) {
+ if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
+ active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
+ $(target(event)).addClass(CLASSES.ACTIVE);
+ }
+ }).click(function(event) {
+ $(target(event)).addClass(CLASSES.ACTIVE);
+ select();
+ if( options.inputFocus )
+ input.focus();
+ return false;
+ }).mousedown(function() {
+ config.mouseDownOnSelect = true;
+ }).mouseup(function() {
+ config.mouseDownOnSelect = false;
+ });
+
+ if( options.width > 0 )
+ element.css("width", options.width);
+
+ needsInit = false;
+ }
+
+ function target(event) {
+ var element = event.target;
+ while(element && element.tagName != "LI")
+ element = element.parentNode;
+ // more fun with IE, sometimes event.target is empty, just ignore it then
+ if(!element)
+ return [];
+ return element;
+ }
+
+ function moveSelect(step) {
+ listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
+ movePosition(step);
+ var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
+ if(options.scroll) {
+ var offset = 0;
+ listItems.slice(0, active).each(function() {
+ offset += this.offsetHeight;
+ });
+ if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
+ list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
+ } else if(offset < list.scrollTop()) {
+ list.scrollTop(offset);
+ }
+ }
+ };
+
+ function movePosition(step) {
+ if (options.scrollJumpPosition || (!options.scrollJumpPosition && !((step < 0 && active == 0) || (step > 0 && active == listItems.size() - 1)) )) {
+ active += step;
+ if (active < 0) {
+ active = listItems.size() - 1;
+ } else if (active >= listItems.size()) {
+ active = 0;
+ }
+ }
+ }
+
+
+ function limitNumberOfItems(available) {
+ return options.max && options.max < available
+ ? options.max
+ : available;
+ }
+
+ function fillList() {
+ list.empty();
+ var max = limitNumberOfItems(data.length);
+ for (var i=0; i < max; i++) {
+ if (!data[i])
+ continue;
+ var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
+ if ( formatted === false )
+ continue;
+ var li = $(" ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
+ $.data(li, "ac_data", data[i]);
+ }
+ listItems = list.find("li");
+ if ( options.selectFirst ) {
+ listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
+ active = 0;
+ }
+ // apply bgiframe if available
+ if ( $.fn.bgiframe )
+ list.bgiframe();
+ }
+
+ return {
+ display: function(d, q) {
+ init();
+ data = d;
+ term = q;
+ fillList();
+ },
+ next: function() {
+ moveSelect(1);
+ },
+ prev: function() {
+ moveSelect(-1);
+ },
+ pageUp: function() {
+ if (active != 0 && active - 8 < 0) {
+ moveSelect( -active );
+ } else {
+ moveSelect(-8);
+ }
+ },
+ pageDown: function() {
+ if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
+ moveSelect( listItems.size() - 1 - active );
+ } else {
+ moveSelect(8);
+ }
+ },
+ hide: function() {
+ element && element.hide();
+ listItems && listItems.removeClass(CLASSES.ACTIVE);
+ active = -1;
+ },
+ visible : function() {
+ return element && element.is(":visible");
+ },
+ current: function() {
+ return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
+ },
+ show: function() {
+ var offset = $(input).offset();
+ element.css({
+ width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
+ top: offset.top + input.offsetHeight,
+ left: offset.left
+ }).show();
+ if(options.scroll) {
+ list.scrollTop(0);
+ list.css({
+ maxHeight: options.scrollHeight,
+ overflow: 'auto'
+ });
+
+ if(navigator.userAgent.indexOf("MSIE") != -1 && typeof document.body.style.maxHeight === "undefined") {
+ var listHeight = 0;
+ listItems.each(function() {
+ listHeight += this.offsetHeight;
+ });
+ var scrollbarsVisible = listHeight > options.scrollHeight;
+ list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
+ if (!scrollbarsVisible) {
+ // IE doesn't recalculate width when scrollbar disappears
+ listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
+ }
+ }
+
+ }
+ },
+ selected: function() {
+ var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
+ return selected && selected.length && $.data(selected[0], "ac_data");
+ },
+ emptyList: function (){
+ list && list.empty();
+ },
+ unbind: function() {
+ element && element.remove();
+ }
+ };
+};
+
+$.fn.selection = function(start, end) {
+ if (start !== undefined) {
+ return this.each(function() {
+ if( this.createTextRange ){
+ var selRange = this.createTextRange();
+ if (end === undefined || start == end) {
+ selRange.move("character", start);
+ selRange.select();
+ } else {
+ selRange.collapse(true);
+ selRange.moveStart("character", start);
+ selRange.moveEnd("character", end);
+ selRange.select();
+ }
+ } else if( this.setSelectionRange ){
+ this.setSelectionRange(start, end);
+ } else if( this.selectionStart ){
+ this.selectionStart = start;
+ this.selectionEnd = end;
+ }
+ });
+ }
+ var field = this[0];
+ if ( field.createTextRange ) {
+ var range = document.selection.createRange(),
+ orig = field.value,
+ teststring = "<->",
+ textLength = range.text.length;
+ range.text = teststring;
+ var caretAt = field.value.indexOf(teststring);
+ field.value = orig;
+ this.selection(caretAt, caretAt + textLength);
+ return {
+ start: caretAt,
+ end: caretAt + textLength
+ }
+ } else if( field.selectionStart !== undefined ){
+ return {
+ start: field.selectionStart,
+ end: field.selectionEnd
+ }
+ }
+};
+
+})(jQuery);
+
+ /**
+ * jQuery.fn.sortElements
+ * --------------
+ * @author James Padolsey (http://james.padolsey.com)
+ * @version 0.11
+ * @updated 18-MAR-2010
+ * --------------
+ * @param Function comparator:
+ * Exactly the same behaviour as [1,2,3].sort(comparator)
+ *
+ * @param Function getSortable
+ * A function that should return the element that is
+ * to be sorted. The comparator will run on the
+ * current collection, but you may want the actual
+ * resulting sort to occur on a parent or another
+ * associated element.
+ *
+ * E.g. $('td').sortElements(comparator, function(){
+ * return this.parentNode;
+ * })
+ *
+ * The 's parent ( ) will be sorted instead
+ * of the itself.
+ */
+jQuery.fn.sortElements = (function(){
+
+ var sort = [].sort;
+
+ return function(comparator, getSortable) {
+
+ getSortable = getSortable || function(){return this;};
+
+ var placements = this.map(function(){
+
+ var sortElement = getSortable.call(this),
+ parentNode = sortElement.parentNode,
+
+ // Since the element itself will change position, we have
+ // to have some way of storing it's original position in
+ // the DOM. The easiest way is to have a 'flag' node:
+ nextSibling = parentNode.insertBefore(
+ document.createTextNode(''),
+ sortElement.nextSibling
+ );
+
+ return function() {
+
+ if (parentNode === this) {
+ throw new Error(
+ "You can't sort elements if any one is a descendant of another."
+ );
+ }
+
+ // Insert before flag:
+ parentNode.insertBefore(this, nextSibling);
+ // Remove flag:
+ parentNode.removeChild(nextSibling);
+
+ };
+
+ });
+
+ return sort.call(this, comparator).each(function(i){
+ placements[i].call(getSortable.call(this));
+ });
+
+ };
+
+})();
+ $(window).load(function() {
+ var $document = $(document);
+ var $navigation = $('#navigation');
+ var navigationHeight = $navigation.height();
+ var $left = $('#left');
+ var $right = $('#right');
+ var $rightInner = $('#rightInner');
+ var $splitter = $('#splitter');
+ var $groups = $('#groups');
+ var $content = $('#content');
+
+ // Menu
+
+ // Hide deep packages and namespaces
+ $('ul span', $groups).click(function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ $(this)
+ .toggleClass('collapsed')
+ .parent()
+ .next('ul')
+ .toggleClass('collapsed');
+ }).click();
+
+ $active = $('ul li.active', $groups);
+ if ($active.length > 0) {
+ // Open active
+ $('> a > span', $active).click();
+ } else {
+ $main = $('> ul > li.main', $groups);
+ if ($main.length > 0) {
+ // Open first level of the main project
+ $('> a > span', $main).click();
+ } else {
+ // Open first level of all
+ $('> ul > li > a > span', $groups).click();
+ }
+ }
+
+ // Content
+
+ // Search autocompletion
+ var autocompleteFound = false;
+ var autocompleteFiles = {'c': 'class', 'co': 'constant', 'f': 'function', 'm': 'class', 'mm': 'class', 'p': 'class', 'mp': 'class', 'cc': 'class'};
+ var $search = $('#search input[name=q]');
+ $search
+ .autocomplete(ApiGen.elements, {
+ matchContains: true,
+ scrollHeight: 200,
+ max: 20,
+ noRecord: '',
+ highlight: function(value, term) {
+ var term = term.toUpperCase().replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1").replace(/[A-Z0-9]/g, function(m, offset) {
+ return offset === 0 ? '(?:' + m + '|^' + m.toLowerCase() + ')' : '(?:(?:[^<>]|<[^<>]*>)*' + m + '|' + m.toLowerCase() + ')';
+ });
+ return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term + ")(?![^<>]*>)(?![^&;]+;)"), "$1 ");
+ },
+ formatItem: function(data) {
+ return data.length > 1 ? data[1].replace(/^(.+\\)(.+)$/, '$1 $2 ') : data[0];
+ },
+ formatMatch: function(data) {
+ return data[1];
+ },
+ formatResult: function(data) {
+ return data[1];
+ },
+ show: function($list) {
+ var $items = $('li span', $list);
+ var maxWidth = Math.max.apply(null, $items.map(function() {
+ return $(this).width();
+ }));
+ // 10px padding
+ $list.width(Math.max(maxWidth + 10, $search.innerWidth()));
+ }
+ }).result(function(event, data) {
+ autocompleteFound = true;
+ var location = window.location.href.split('/');
+ location.pop();
+ var parts = data[1].split(/::|$/);
+ var file = $.sprintf(ApiGen.config.templates.main[autocompleteFiles[data[0]]].filename, parts[0].replace(/\(\)/, '').replace(/[^\w]/g, '.'));
+ if (parts[1]) {
+ file += '#' + ('mm' === data[0] || 'mp' === data[0] ? 'm' : '') + parts[1].replace(/([\w]+)\(\)/, '_$1');
+ }
+ location.push(file);
+ window.location = location.join('/');
+
+ // Workaround for Opera bug
+ $(this).closest('form').attr('action', location.join('/'));
+ }).closest('form')
+ .submit(function() {
+ var query = $search.val();
+ if ('' === query) {
+ return false;
+ }
+ return !autocompleteFound && '' !== $('#search input[name=cx]').val();
+ });
+
+ // Save natural order
+ $('table.summary tr[data-order]', $content).each(function(index) {
+ do {
+ index = '0' + index;
+ } while (index.length < 3);
+ $(this).attr('data-order-natural', index);
+ });
+
+ // Switch between natural and alphabetical order
+ var $caption = $('table.summary', $content)
+ .filter(':has(tr[data-order])')
+ .prev('h2');
+ $caption
+ .click(function() {
+ var $this = $(this);
+ var order = $this.data('order') || 'natural';
+ order = 'natural' === order ? 'alphabetical' : 'natural';
+ $this.data('order', order);
+ $.cookie('order', order, {expires: 365});
+ var attr = 'alphabetical' === order ? 'data-order' : 'data-order-natural';
+ $this
+ .next('table')
+ .find('tr').sortElements(function(a, b) {
+ return $(a).attr(attr) > $(b).attr(attr) ? 1 : -1;
+ });
+ return false;
+ })
+ .addClass('switchable')
+ .attr('title', 'Switch between natural and alphabetical order');
+ if ((null === $.cookie('order') && 'alphabetical' === ApiGen.config.options.elementsOrder) || 'alphabetical' === $.cookie('order')) {
+ $caption.click();
+ }
+
+ // Open details
+ if (ApiGen.config.options.elementDetailsCollapsed) {
+ $('tr', $content).filter(':has(.detailed)')
+ .click(function() {
+ var $this = $(this);
+ $('.short', $this).hide();
+ $('.detailed', $this).show();
+ });
+ }
+
+ // Splitter
+ var splitterWidth = $splitter.width();
+ var splitterPosition = $.cookie('splitter') ? parseInt($.cookie('splitter')) : null;
+ var splitterPositionBackup = $.cookie('splitterBackup') ? parseInt($.cookie('splitterBackup')) : null;
+ function setSplitterPosition(position)
+ {
+ splitterPosition = position;
+
+ $left.width(position);
+ $right.css('margin-left', position + splitterWidth);
+ $splitter.css('left', position);
+ }
+ function setNavigationPosition()
+ {
+ var height = $(window).height() - navigationHeight;
+ $left.height(height);
+ $splitter.height(height);
+ $right.height(height);
+ }
+ function setContentWidth()
+ {
+ var width = $rightInner.width();
+ $rightInner
+ .toggleClass('medium', width <= 960)
+ .toggleClass('small', width <= 650);
+ }
+ $splitter.mousedown(function() {
+ $splitter.addClass('active');
+
+ $document.mousemove(function(event) {
+ if (event.pageX >= 230 && $document.width() - event.pageX >= 600 + splitterWidth) {
+ setSplitterPosition(event.pageX);
+ setContentWidth();
+ }
+ });
+
+ $()
+ .add($splitter)
+ .add($document)
+ .mouseup(function() {
+ $splitter
+ .removeClass('active')
+ .unbind('mouseup');
+ $document
+ .unbind('mousemove')
+ .unbind('mouseup');
+
+ $.cookie('splitter', splitterPosition, {expires: 365});
+ });
+
+ return false;
+ });
+ $splitter.dblclick(function() {
+ if (splitterPosition) {
+ splitterPositionBackup = $left.width();
+ setSplitterPosition(0);
+ } else {
+ setSplitterPosition(splitterPositionBackup);
+ splitterPositionBackup = null;
+ }
+
+ setContentWidth();
+
+ $.cookie('splitter', splitterPosition, {expires: 365});
+ $.cookie('splitterBackup', splitterPositionBackup, {expires: 365});
+ });
+ if (null !== splitterPosition) {
+ setSplitterPosition(splitterPosition);
+ }
+ setNavigationPosition();
+ setContentWidth();
+ $(window)
+ .resize(setNavigationPosition)
+ .resize(setContentWidth);
+
+ // Select selected lines
+ var matches = window.location.hash.substr(1).match(/^\d+(?:-\d+)?(?:,\d+(?:-\d+)?)*$/);
+ if (null !== matches) {
+ var lists = matches[0].split(',');
+ for (var i = 0; i < lists.length; i++) {
+ var lines = lists[i].split('-');
+ lines[0] = parseInt(lines[0]);
+ lines[1] = parseInt(lines[1] || lines[0]);
+ for (var j = lines[0]; j <= lines[1]; j++) {
+ $('#' + j).addClass('selected');
+ }
+ }
+
+ var $firstLine = $('#' + parseInt(matches[0]));
+ if ($firstLine.length > 0) {
+ $document.scrollTop($firstLine.offset().top);
+ }
+ }
+
+ // Save selected lines
+ var lastLine;
+ $('a.l').click(function(event) {
+ event.preventDefault();
+
+ var $selectedLine = $(this).parent();
+ var selectedLine = parseInt($selectedLine.attr('id'));
+
+ if (event.shiftKey) {
+ if (lastLine) {
+ for (var i = Math.min(selectedLine, lastLine); i <= Math.max(selectedLine, lastLine); i++) {
+ $('#' + i).addClass('selected');
+ }
+ } else {
+ $selectedLine.addClass('selected');
+ }
+ } else if (event.ctrlKey) {
+ $selectedLine.toggleClass('selected');
+ } else {
+ var $selected = $('.l.selected')
+ .not($selectedLine)
+ .removeClass('selected');
+ if ($selected.length > 0) {
+ $selectedLine.addClass('selected');
+ } else {
+ $selectedLine.toggleClass('selected');
+ }
+ }
+
+ lastLine = $selectedLine.hasClass('selected') ? selectedLine : null;
+
+ // Update hash
+ var lines = $('.l.selected')
+ .map(function() {
+ return parseInt($(this).attr('id'));
+ })
+ .get()
+ .sort(function(a, b) {
+ return a - b;
+ });
+
+ var hash = [];
+ var list = [];
+ for (var j = 0; j < lines.length; j++) {
+ if (0 === j && j + 1 === lines.length) {
+ hash.push(lines[j]);
+ } else if (0 === j) {
+ list[0] = lines[j];
+ } else if (lines[j - 1] + 1 !== lines[j] && j + 1 === lines.length) {
+ hash.push(list.join('-'));
+ hash.push(lines[j]);
+ } else if (lines[j - 1] + 1 !== lines[j]) {
+ hash.push(list.join('-'));
+ list = [lines[j]];
+ } else if (j + 1 === lines.length) {
+ list[1] = lines[j];
+ hash.push(list.join('-'));
+ } else {
+ list[1] = lines[j];
+ }
+ }
+
+ hash = hash.join(',');
+ $backup = $('#' + hash).removeAttr('id');
+ window.location.hash = hash;
+ $backup.attr('id', hash);
+ });
+});
+
diff --git a/docs/api/resources/inherit.png b/docs/api/resources/inherit.png
new file mode 100644
index 0000000..957079b
Binary files /dev/null and b/docs/api/resources/inherit.png differ
diff --git a/docs/api/resources/resize.png b/docs/api/resources/resize.png
new file mode 100644
index 0000000..f0bbcdd
Binary files /dev/null and b/docs/api/resources/resize.png differ
diff --git a/docs/api/resources/sort.png b/docs/api/resources/sort.png
new file mode 100644
index 0000000..0d0fea1
Binary files /dev/null and b/docs/api/resources/sort.png differ
diff --git a/docs/api/resources/style.css b/docs/api/resources/style.css
new file mode 100644
index 0000000..d4883ec
--- /dev/null
+++ b/docs/api/resources/style.css
@@ -0,0 +1,508 @@
+body {
+ padding: 40px 0 0 0;
+}
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+h2 {
+ font-size: 1.5em;
+ margin: 0.83em 0;
+}
+
+h3 {
+ font-size: 1.17em;
+ margin: 1em 0 0.2em 0;
+}
+
+h4 {
+ font-size: 100%;
+ margin: 0;
+ padding: 0;
+}
+
+ul, ol {
+ margin-bottom: 0;
+}
+
+a, a:hover {
+ text-decoration: none;
+}
+
+var {
+ font-weight: bold;
+ font-style: normal;
+ color: #c09853;
+}
+
+code {
+ color: #000000;
+ white-space: nowrap;
+ border: none;
+ background: transparent;
+ padding: 0
+}
+
+code:empty {
+ display: none;
+}
+
+code a b {
+ color: #000000;
+}
+
+pre code {
+ white-space: pre;
+}
+
+.deprecated {
+ text-decoration: line-through;
+ opacity: .5;
+}
+
+.invalid {
+ color: #dd1144;
+}
+
+.hidden {
+ display: none;
+}
+
+/* Left side */
+#left {
+ overflow: auto;
+ width: 270px;
+ height: 100%;
+ position: fixed;
+}
+
+/* Menu */
+#menu {
+ padding: 10px;
+}
+
+#menu h3 {
+ border-bottom: 1px solid #cccccc;
+ margin-left: -10px;
+ margin-right: -10px;
+ padding: 0 10px;
+}
+
+#menu ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+#menu ul ul {
+ padding-left: 10px;
+}
+
+#menu li {
+ white-space: nowrap;
+ position: relative;
+}
+
+#menu a {
+ display: block;
+ padding: 3px;
+ border-radius: 3px;
+}
+
+#menu a:hover {
+ background-color: #0088cc;
+ color: #ffffff !important;
+}
+
+#menu .active > a {
+ font-weight: bold;
+ color: #000000;
+}
+
+#menu .active > a.invalid {
+ color: #dd1144;
+}
+
+#menu #groups span {
+ position: absolute;
+ top: 6px;
+ right: 3px;
+ cursor: pointer;
+ display: block;
+ width: 12px;
+ height: 12px;
+ background: url('collapsed.png') transparent 0 0 no-repeat;
+}
+
+#menu #groups span:hover {
+ background-position: -12px 0;
+}
+
+#menu #groups span.collapsed {
+ background-position: 0 -12px;
+}
+
+#menu #groups span.collapsed:hover {
+ background-position: -12px -12px;
+}
+
+#menu #groups ul.collapsed {
+ display: none;
+}
+
+/* Search */
+#menu .form-search {
+ margin-top: 0;
+}
+
+#menu .search-query {
+ height: auto;
+ width: 100%;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+/* Autocomplete */
+.ac_results {
+ border-radius: 4px;
+ margin-top: 2px;
+ background-clip: padding-box;
+ background-color: #ffffff;
+ border-color: rgba(0, 0, 0, 0.2);
+ border-style: solid;
+ border-width: 1px;
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+ overflow: hidden;
+ z-index: 99999;
+}
+
+.ac_results ul {
+ width: 100%;
+ list-style-position: outside;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.ac_results li {
+ margin: 0;
+ padding: 2px 5px;
+ cursor: default;
+ display: block;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.ac_results li strong {
+ color: #000000;
+}
+
+.ac_over {
+ background-color: #0088cc;
+ color: #ffffff;
+}
+
+.ac_results li.ac_over strong {
+ color: #ffffff;
+}
+
+
+/* Right side */
+#right {
+ overflow: auto;
+ margin-left: 275px;
+ height: 100%;
+ position: relative;
+ left: 0;
+ right: 0;
+}
+
+#rightInner {
+ max-width: 1000px;
+ min-width: 350px;
+}
+
+/* Navigation */
+.navbar-fixed-top .container {
+ width: auto;
+ padding: 0 1em;
+}
+
+.navbar .nav > li > span {
+ display: block;
+ color: #999999;
+ line-height: 19px;
+ padding: 10px 10px 11px;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+
+.navbar .nav > li.active > span {
+ background-color: #222222;
+ color: #ffffff;
+}
+
+/* Content */
+#content {
+ clear: both;
+ padding: 5px 15px;
+}
+
+#content > .description {
+ margin: 1.2em 0;
+}
+
+#content .alert-info {
+ margin-top: 18px;
+}
+
+dl.tree {
+ margin: 1.2em 0;
+ padding: 10px;
+}
+
+dl.tree dd {
+ margin: 0;
+ padding: 0;
+ line-height: 18px;
+}
+
+.elementList {
+ line-height: 24px;
+}
+
+h2.switchable {
+ background: transparent url('sort.png') no-repeat center right;
+ cursor: pointer;
+}
+
+.summary td:first-child {
+ text-align: right;
+}
+
+#packages.summary td:first-child, #namespaces.summary td:first-child, .inherited.summary td:first-child, .used.summary td:first-child {
+ text-align: left;
+}
+
+.summary tr:hover td {
+ background: #f6f6f4;
+}
+
+.summary .description p {
+ margin: 0;
+}
+
+.class #methods.summary .description p:first-child, .summary .description.detailed h4:first-child {
+ margin-top: 8px;
+}
+
+.summary .description p + p, .summary .description ul, .summary .description pre, .summary .description.detailed h4 {
+ margin-top: 4px;
+}
+
+.summary dl {
+ margin: 0;
+}
+
+.summary dd {
+ margin: 0 0 0 25px;
+}
+
+.summary dt, dd {
+ line-height: 24px;
+}
+
+.name, .attributes {
+ white-space: nowrap;
+}
+
+.value code {
+ white-space: pre-wrap;
+}
+
+td.attributes {
+ width: 1%;
+}
+
+.class .methods .name, .class .properties .name, .class .constants .name {
+ width: auto;
+ white-space: normal;
+}
+
+.class .methods .name > div > code {
+ white-space: pre-wrap;
+}
+
+.class .methods .name > div > code span, .function .value > code {
+ white-space: nowrap;
+}
+
+.class .methods td.name > div, .class td.value > div {
+ position: relative;
+ padding-right: 1em;
+}
+
+.attributes code, .name code, dd code {
+ color: #468847;
+}
+
+.anchor {
+ position: absolute;
+ top: 0;
+ right: 0;
+ line-height: 1;
+ font-size: 85%;
+ margin: 0;
+ color: #0088cc !important;
+}
+
+.list {
+ margin: 0 0 5px 25px;
+ line-height: 24px;
+}
+
+/* Splitter */
+#splitter {
+ position: fixed;
+ height: 100%;
+ width: 5px;
+ left: 270px;
+ background: #0088cc url('resize.png') left center no-repeat;
+ cursor: e-resize;
+}
+
+#splitter.active {
+ opacity: .5;
+}
+
+/* Footer */
+#footer {
+ border-top: 1px solid #e5e5e5;
+ clear: both;
+ color: #808080;
+ text-align: right;
+ padding: 2em 1em;
+ margin: 3em 0 40px 0;
+}
+
+/* Tree */
+div.tree ul {
+ list-style: none;
+ background: url('tree-vertical.png') left repeat-y;
+ padding: 0;
+ margin-left: 20px;
+}
+
+div.tree li {
+ margin: 0;
+ padding: 0;
+}
+
+div.tree div {
+ padding-left: 30px;
+}
+
+div.tree div.notlast {
+ background: url('tree-hasnext.png') left 10px no-repeat;
+}
+
+div.tree div.last {
+ background: url('tree-last.png') left -240px no-repeat;
+}
+
+div.tree li.last {
+ background: url('tree-cleaner.png') left center repeat-y;
+}
+
+div.tree span.padding {
+ padding-left: 15px;
+}
+
+/* Source code */
+#source {
+ margin: 1em 0 1em 1em;
+ padding: 0;
+}
+
+.php-keyword1 {
+ color: #468847;
+ font-weight: bold;
+}
+
+.php-keyword2 {
+ font-weight: bold;
+}
+
+.php-var {
+ color: #c09853;
+ font-weight: bold;
+}
+
+.php-num {
+ color: #006dcc;
+}
+
+.php-quote {
+ color: #006dcc;
+}
+
+.php-comment {
+ color: #929292;
+}
+
+.xlang {
+ color: #468847;
+ font-weight: bold;
+}
+
+span.l {
+ display: block;
+}
+
+span.l.selected {
+ background: #f9f2d2;
+}
+
+span.l a {
+ color: #333333;
+}
+
+span.l a:hover, span.l a:active, span.l a:focus {
+ background: transparent;
+ color: #333333 !important;
+}
+
+span.l .php-var a {
+ color: #c09853;
+}
+
+span.l .php-var a:hover, span.l .php-var a:active, span.l .php-var a:focus {
+ color: #c09853 !important;
+}
+
+span.l a.l {
+ background: #fbfbfc;
+ margin-right: 8px;
+ padding: 2px 2px 2px 8px;
+ color: #c0c0c0;
+}
+
+span.l a.l:hover, span.l a.l:active, span.l a.l:focus {
+ background: #fbfbfc;
+ color: #c0c0c0 !important;
+}
+
+/* Small screens */
+#rightInner.medium .name, #rightInner.medium .attributes {
+ white-space: normal;
+}
+
+/* global style */
+.left, .summary td.left {
+ text-align: left;
+}
+.right, .summary td.right {
+ text-align: right;
+}
diff --git a/docs/api/resources/tree-cleaner.png b/docs/api/resources/tree-cleaner.png
new file mode 100644
index 0000000..2eb9085
Binary files /dev/null and b/docs/api/resources/tree-cleaner.png differ
diff --git a/docs/api/resources/tree-hasnext.png b/docs/api/resources/tree-hasnext.png
new file mode 100644
index 0000000..91d6b79
Binary files /dev/null and b/docs/api/resources/tree-hasnext.png differ
diff --git a/docs/api/resources/tree-last.png b/docs/api/resources/tree-last.png
new file mode 100644
index 0000000..7f319f8
Binary files /dev/null and b/docs/api/resources/tree-last.png differ
diff --git a/docs/api/resources/tree-vertical.png b/docs/api/resources/tree-vertical.png
new file mode 100644
index 0000000..384908b
Binary files /dev/null and b/docs/api/resources/tree-vertical.png differ
diff --git a/docs/api/source-class-RetailCrm.ApiClient.html b/docs/api/source-class-RetailCrm.ApiClient.html
new file mode 100644
index 0000000..3067ff7
--- /dev/null
+++ b/docs/api/source-class-RetailCrm.ApiClient.html
@@ -0,0 +1,696 @@
+
+
+
+
+
+
+ File RetailCrm/ApiClient.php | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
1 <?php
+ 2
+ 3 namespace RetailCrm;
+ 4
+ 5 use RetailCrm\Http\Client;
+ 6 use RetailCrm\Response\ApiResponse;
+ 7
+ 8 9 10
+ 11 class ApiClient
+ 12 {
+ 13 const VERSION = 'v3' ;
+ 14
+ 15 protected $client ;
+ 16
+ 17 18 19 20 21 22 23
+ 24 public function __construct ($url , $apiKey )
+ 25 {
+ 26 if ('/' != substr ($url , strlen ($url ) - 1 , 1 )) {
+ 27 $url .= '/' ;
+ 28 }
+ 29
+ 30 $url = $url . 'api/' . self::VERSION;
+ 31
+ 32 $this ->client = new Client($url , array ('apiKey' => $apiKey ));
+ 33 }
+ 34
+ 35 36 37 38 39 40
+ 41 public function ordersCreate (array $order )
+ 42 {
+ 43 if (!sizeof ($order )) {
+ 44 throw new \InvalidArgumentException('Parameter `order` must contains a data' );
+ 45 }
+ 46
+ 47 return $this ->client->makeRequest("/orders/create" , Client::METHOD_POST, array (
+ 48 'order' => json_encode ($order )
+ 49 ));
+ 50 }
+ 51
+ 52 53 54 55 56 57
+ 58 public function ordersEdit (array $order , $by = 'externalId' )
+ 59 {
+ 60 if (!sizeof ($order )) {
+ 61 throw new \InvalidArgumentException('Parameter `order` must contains a data' );
+ 62 }
+ 63
+ 64 $this ->checkIdParameter($by );
+ 65
+ 66 if (!isset ($order [$by ])) {
+ 67 throw new \InvalidArgumentException(sprintf ('Order array must contain the "%s" parameter.' , $by ));
+ 68 }
+ 69
+ 70 return $this ->client->makeRequest("/orders/" . $order [$by ] . "/edit" , Client::METHOD_POST, array (
+ 71 'order' => json_encode ($order ),
+ 72 'by' => $by ,
+ 73 ));
+ 74 }
+ 75
+ 76 77 78 79 80 81
+ 82 public function ordersUpload (array $orders )
+ 83 {
+ 84 if (!sizeof ($orders )) {
+ 85 throw new \InvalidArgumentException('Parameter `orders` must contains array of the orders' );
+ 86 }
+ 87
+ 88 return $this ->client->makeRequest("/orders/upload" , Client::METHOD_POST, array (
+ 89 'orders' => json_encode ($orders ),
+ 90 ));
+ 91 }
+ 92
+ 93 94 95 96 97 98 99
+100 public function ordersGet ($id , $by = 'externalId' )
+101 {
+102 $this ->checkIdParameter($by );
+103
+104 return $this ->client->makeRequest("/orders/ $id " , Client::METHOD_GET, array ('by' => $by ));
+105 }
+106
+107 108 109 110 111 112 113 114 115 116
+117 public function ordersHistory (
+118 \DateTime $startDate = null ,
+119 \DateTime $endDate = null ,
+120 $limit = 100 ,
+121 $offset = 0 ,
+122 $skipMyChanges = true
+123 ) {
+124 $parameters = array ();
+125
+126 if ($startDate ) {
+127 $parameters ['startDate' ] = $startDate ->format('Y-m-d H:i:s' );
+128 }
+129 if ($endDate ) {
+130 $parameters ['endDate' ] = $endDate ->format('Y-m-d H:i:s' );
+131 }
+132 if ($limit ) {
+133 $parameters ['limit' ] = (int) $limit ;
+134 }
+135 if ($offset ) {
+136 $parameters ['offset' ] = (int) $offset ;
+137 }
+138 if ($skipMyChanges ) {
+139 $parameters ['skipMyChanges' ] = (bool) $skipMyChanges ;
+140 }
+141
+142 return $this ->client->makeRequest('/orders/history' , Client::METHOD_GET, $parameters );
+143 }
+144
+145 146 147 148 149 150 151 152
+153 public function ordersList (array $filter = array (), $page = null , $limit = null )
+154 {
+155 $parameters = array ();
+156
+157 if (sizeof ($filter )) {
+158 $parameters ['filter' ] = $filter ;
+159 }
+160 if (null !== $page ) {
+161 $parameters ['page' ] = (int) $page ;
+162 }
+163 if (null !== $limit ) {
+164 $parameters ['limit' ] = (int) $limit ;
+165 }
+166
+167 return $this ->client->makeRequest('/orders' , Client::METHOD_GET, $parameters );
+168 }
+169
+170 171 172 173 174 175
+176 public function ordersFixExternalIds (array $ids )
+177 {
+178 if (!sizeof ($ids )) {
+179 throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair' );
+180 }
+181
+182 return $this ->client->makeRequest("/orders/fix-external-ids" , Client::METHOD_POST, array (
+183 'orders' => json_encode ($ids ),
+184 ));
+185 }
+186
+187 188 189 190 191 192
+193 public function customersCreate (array $customer )
+194 {
+195 if (!sizeof ($customer )) {
+196 throw new \InvalidArgumentException('Parameter `customer` must contains a data' );
+197 }
+198
+199 return $this ->client->makeRequest("/customers/create" , Client::METHOD_POST, array (
+200 'customer' => json_encode ($customer )
+201 ));
+202 }
+203
+204 205 206 207 208 209
+210 public function customersEdit (array $customer , $by = 'externalId' )
+211 {
+212 if (!sizeof ($customer )) {
+213 throw new \InvalidArgumentException('Parameter `customer` must contains a data' );
+214 }
+215
+216 $this ->checkIdParameter($by );
+217
+218 if (!isset ($customer [$by ])) {
+219 throw new \InvalidArgumentException(sprintf ('Customer array must contain the "%s" parameter.' , $by ));
+220 }
+221
+222 return $this ->client->makeRequest("/customers/" . $customer [$by ] . "/edit" , Client::METHOD_POST, array (
+223 'customer' => json_encode ($customer ),
+224 'by' => $by ,
+225 ));
+226 }
+227
+228 229 230 231 232 233
+234 public function customersUpload (array $customers )
+235 {
+236 if (!sizeof ($customers )) {
+237 throw new \InvalidArgumentException('Parameter `customers` must contains array of the customers' );
+238 }
+239
+240 return $this ->client->makeRequest("/customers/upload" , Client::METHOD_POST, array (
+241 'customers' => json_encode ($customers ),
+242 ));
+243 }
+244
+245 246 247 248 249 250 251
+252 public function customersGet ($id , $by = 'externalId' )
+253 {
+254 $this ->checkIdParameter($by );
+255
+256 return $this ->client->makeRequest("/customers/ $id " , Client::METHOD_GET, array ('by' => $by ));
+257 }
+258
+259 260 261 262 263 264 265 266
+267 public function customersList (array $filter = array (), $page = null , $limit = null )
+268 {
+269 $parameters = array ();
+270
+271 if (sizeof ($filter )) {
+272 $parameters ['filter' ] = $filter ;
+273 }
+274 if (null !== $page ) {
+275 $parameters ['page' ] = (int) $page ;
+276 }
+277 if (null !== $limit ) {
+278 $parameters ['limit' ] = (int) $limit ;
+279 }
+280
+281 return $this ->client->makeRequest('/customers' , Client::METHOD_GET, $parameters );
+282 }
+283
+284 285 286 287 288 289
+290 public function customersFixExternalIds (array $ids )
+291 {
+292 if (!sizeof ($ids )) {
+293 throw new \InvalidArgumentException('Method parameter must contains at least one IDs pair' );
+294 }
+295
+296 return $this ->client->makeRequest("/customers/fix-external-ids" , Client::METHOD_POST, array (
+297 'customers' => json_encode ($ids ),
+298 ));
+299 }
+300
+301 302 303 304 305
+306 public function deliveryServicesList ()
+307 {
+308 return $this ->client->makeRequest('/reference/delivery-services' , Client::METHOD_GET);
+309 }
+310
+311 312 313 314 315
+316 public function deliveryTypesList ()
+317 {
+318 return $this ->client->makeRequest('/reference/delivery-types' , Client::METHOD_GET);
+319 }
+320
+321 322 323 324 325
+326 public function orderMethodsList ()
+327 {
+328 return $this ->client->makeRequest('/reference/order-methods' , Client::METHOD_GET);
+329 }
+330
+331 332 333 334 335
+336 public function orderTypesList ()
+337 {
+338 return $this ->client->makeRequest('/reference/order-types' , Client::METHOD_GET);
+339 }
+340
+341 342 343 344 345
+346 public function paymentStatusesList ()
+347 {
+348 return $this ->client->makeRequest('/reference/payment-statuses' , Client::METHOD_GET);
+349 }
+350
+351 352 353 354 355
+356 public function paymentTypesList ()
+357 {
+358 return $this ->client->makeRequest('/reference/payment-types' , Client::METHOD_GET);
+359 }
+360
+361 362 363 364 365
+366 public function productStatusesList ()
+367 {
+368 return $this ->client->makeRequest('/reference/product-statuses' , Client::METHOD_GET);
+369 }
+370
+371 372 373 374 375
+376 public function statusGroupsList ()
+377 {
+378 return $this ->client->makeRequest('/reference/status-groups' , Client::METHOD_GET);
+379 }
+380
+381 382 383 384 385
+386 public function statusesList ()
+387 {
+388 return $this ->client->makeRequest('/reference/statuses' , Client::METHOD_GET);
+389 }
+390
+391 392 393 394 395 396
+397 public function deliveryServicesEdit (array $data )
+398 {
+399 if (!isset ($data ['code' ])) {
+400 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+401 }
+402
+403 return $this ->client->makeRequest(
+404 '/reference/delivery-services/' . $data ['code' ] . '/edit' ,
+405 Client::METHOD_POST,
+406 array (
+407 'deliveryService' => json_encode ($data )
+408 )
+409 );
+410 }
+411
+412 413 414 415 416 417
+418 public function deliveryTypesEdit (array $data )
+419 {
+420 if (!isset ($data ['code' ])) {
+421 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+422 }
+423
+424 return $this ->client->makeRequest(
+425 '/reference/delivery-types/' . $data ['code' ] . '/edit' ,
+426 Client::METHOD_POST,
+427 array (
+428 'deliveryType' => json_encode ($data )
+429 )
+430 );
+431 }
+432
+433 434 435 436 437 438
+439 public function orderMethodsEdit (array $data )
+440 {
+441 if (!isset ($data ['code' ])) {
+442 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+443 }
+444
+445 return $this ->client->makeRequest(
+446 '/reference/order-methods/' . $data ['code' ] . '/edit' ,
+447 Client::METHOD_POST,
+448 array (
+449 'orderMethod' => json_encode ($data )
+450 )
+451 );
+452 }
+453
+454 455 456 457 458 459
+460 public function orderTypesEdit (array $data )
+461 {
+462 if (!isset ($data ['code' ])) {
+463 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+464 }
+465
+466 return $this ->client->makeRequest(
+467 '/reference/order-types/' . $data ['code' ] . '/edit' ,
+468 Client::METHOD_POST,
+469 array (
+470 'orderType' => json_encode ($data )
+471 )
+472 );
+473 }
+474
+475 476 477 478 479 480
+481 public function paymentStatusesEdit (array $data )
+482 {
+483 if (!isset ($data ['code' ])) {
+484 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+485 }
+486
+487 return $this ->client->makeRequest(
+488 '/reference/payment-statuses/' . $data ['code' ] . '/edit' ,
+489 Client::METHOD_POST,
+490 array (
+491 'paymentStatus' => json_encode ($data )
+492 )
+493 );
+494 }
+495
+496 497 498 499 500 501
+502 public function paymentTypesEdit (array $data )
+503 {
+504 if (!isset ($data ['code' ])) {
+505 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+506 }
+507
+508 return $this ->client->makeRequest(
+509 '/reference/payment-types/' . $data ['code' ] . '/edit' ,
+510 Client::METHOD_POST,
+511 array (
+512 'paymentType' => json_encode ($data )
+513 )
+514 );
+515 }
+516
+517 518 519 520 521 522
+523 public function productStatusesEdit (array $data )
+524 {
+525 if (!isset ($data ['code' ])) {
+526 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+527 }
+528
+529 return $this ->client->makeRequest(
+530 '/reference/product-statuses/' . $data ['code' ] . '/edit' ,
+531 Client::METHOD_POST,
+532 array (
+533 'productStatus' => json_encode ($data )
+534 )
+535 );
+536 }
+537
+538 539 540 541 542 543
+544 public function statusesEdit (array $data )
+545 {
+546 if (!isset ($data ['code' ])) {
+547 throw new \InvalidArgumentException('Data must contain "code" parameter.' );
+548 }
+549
+550 return $this ->client->makeRequest(
+551 '/reference/statuses/' . $data ['code' ] . '/edit' ,
+552 Client::METHOD_POST,
+553 array (
+554 'status' => json_encode ($data )
+555 )
+556 );
+557 }
+558
+559 560 561 562 563
+564 public function statisticUpdate ()
+565 {
+566 return $this ->client->makeRequest('/statistic/update' , Client::METHOD_GET);
+567 }
+568
+569 570 571 572 573 574
+575 protected function checkIdParameter ($by )
+576 {
+577 $allowedForBy = array ('externalId' , 'id' );
+578 if (!in_array ($by , $allowedForBy )) {
+579 throw new \InvalidArgumentException(sprintf (
+580 'Value "%s" for parameter "by" is not valid. Allowed values are %s.' ,
+581 $by ,
+582 implode (', ' , $allowedForBy )
+583 ));
+584 }
+585
+586 return true ;
+587 }
+588 }
+
+
+
+
+
+
+
+
diff --git a/docs/api/source-class-RetailCrm.Exception.CurlException.html b/docs/api/source-class-RetailCrm.Exception.CurlException.html
new file mode 100644
index 0000000..792e4f7
--- /dev/null
+++ b/docs/api/source-class-RetailCrm.Exception.CurlException.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+ File RetailCrm/Exception/CurlException.php | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
1 <?php
+2
+3 namespace RetailCrm\Exception;
+4
+5 class CurlException extends \RuntimeException
+6 {
+7 }
+
+
+
+
+
+
+
+
diff --git a/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html b/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html
new file mode 100644
index 0000000..3927ab9
--- /dev/null
+++ b/docs/api/source-class-RetailCrm.Exception.InvalidJsonException.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+ File RetailCrm/Exception/InvalidJsonException.php | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/api/source-class-RetailCrm.Http.Client.html b/docs/api/source-class-RetailCrm.Http.Client.html
new file mode 100644
index 0000000..161030e
--- /dev/null
+++ b/docs/api/source-class-RetailCrm.Http.Client.html
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+ File RetailCrm/Http/Client.php | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
1 <?php
+ 2
+ 3 namespace RetailCrm\Http;
+ 4
+ 5 use RetailCrm\Exception\CurlException;
+ 6 use RetailCrm\Response\ApiResponse;
+ 7
+ 8 9 10
+11 class Client
+12 {
+13 const METHOD_GET = 'GET' ;
+14 const METHOD_POST = 'POST' ;
+15
+16 protected $url ;
+17 protected $defaultParameters ;
+18
+19 public function __construct ($url , array $defaultParameters = array ())
+20 {
+21 if (false === stripos ($url , 'https://' )) {
+22 throw new \InvalidArgumentException('API schema requires HTTPS protocol' );
+23 }
+24
+25 $this ->url = $url ;
+26 $this ->defaultParameters = $defaultParameters ;
+27 }
+28
+29 30 31 32 33 34 35 36 37
+38 public function makeRequest ($path , $method , array $parameters = array (), $timeout = 30 )
+39 {
+40 $allowedMethods = array (self::METHOD_GET, self::METHOD_POST);
+41 if (!in_array ($method , $allowedMethods )) {
+42 throw new \InvalidArgumentException(sprintf (
+43 'Method "%s" is not valid. Allowed methods are %s' ,
+44 $method ,
+45 implode (', ' , $allowedMethods )
+46 ));
+47 }
+48
+49 $parameters = array_merge ($this ->defaultParameters, $parameters );
+50
+51 $path = $this ->url . $path ;
+52 if (self::METHOD_GET === $method && sizeof ($parameters )) {
+53 $path .= '?' . http_build_query ($parameters );
+54 }
+55
+56 $ch = curl_init ();
+57 curl_setopt ($ch , CURLOPT_URL, $path );
+58 curl_setopt ($ch , CURLOPT_FAILONERROR, FALSE );
+59 curl_setopt ($ch , CURLOPT_RETURNTRANSFER, 1 );
+60 curl_setopt ($ch , CURLOPT_TIMEOUT, (int) $timeout );
+61
+62
+63
+64 if (self::METHOD_POST === $method ) {
+65 curl_setopt ($ch , CURLOPT_POST, true );
+66 curl_setopt ($ch , CURLOPT_POSTFIELDS, $parameters );
+67 }
+68
+69 $responseBody = curl_exec ($ch );
+70 $statusCode = curl_getinfo ($ch , CURLINFO_HTTP_CODE);
+71
+72 $errno = curl_errno ($ch );
+73 $error = curl_error ($ch );
+74 curl_close ($ch );
+75
+76 if ($errno ) {
+77 throw new CurlException($error , $errno );
+78 }
+79
+80 return new ApiResponse($statusCode , $responseBody );
+81 }
+82 }
+83
+
+
+
+
+
+
+
+
diff --git a/docs/api/source-class-RetailCrm.Response.ApiResponse.html b/docs/api/source-class-RetailCrm.Response.ApiResponse.html
new file mode 100644
index 0000000..1e31d70
--- /dev/null
+++ b/docs/api/source-class-RetailCrm.Response.ApiResponse.html
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+ File RetailCrm/Response/ApiResponse.php | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
1 <?php
+ 2
+ 3 namespace RetailCrm\Response;
+ 4
+ 5 use RetailCrm\Exception\InvalidJsonException;
+ 6
+ 7 8 9
+ 10 class ApiResponse implements \ArrayAccess
+ 11 {
+ 12
+ 13 protected $statusCode ;
+ 14
+ 15
+ 16 protected $response ;
+ 17
+ 18 public function __construct ($statusCode , $responseBody = null )
+ 19 {
+ 20 $this ->statusCode = (int) $statusCode ;
+ 21
+ 22 if (!empty ($responseBody )) {
+ 23 $response = json_decode ($responseBody , true );
+ 24
+ 25 if (!$response && JSON_ERROR_NONE !== ($error = json_last_error ())) {
+ 26 throw new InvalidJsonException(
+ 27 "Invalid JSON in the API response body. Error code # $error " ,
+ 28 $error
+ 29 );
+ 30 }
+ 31
+ 32 $this ->response = $response ;
+ 33 }
+ 34 }
+ 35
+ 36 37 38 39 40
+ 41 public function getStatusCode ()
+ 42 {
+ 43 return $this ->statusCode;
+ 44 }
+ 45
+ 46 47 48 49 50
+ 51 public function isSuccessful ()
+ 52 {
+ 53 return $this ->statusCode < 400 ;
+ 54 }
+ 55
+ 56 57 58 59 60 61
+ 62 public function __call ($name , $arguments )
+ 63 {
+ 64
+ 65 $propertyName = strtolower (substr ($name , 3 , 1 )) . substr ($name , 4 );
+ 66
+ 67 if (!isset ($this ->response[$propertyName ])) {
+ 68 throw new \InvalidArgumentException("Method \" $name \" not found" );
+ 69 }
+ 70
+ 71 return $this ->response[$propertyName ];
+ 72 }
+ 73
+ 74 75 76 77 78 79
+ 80 public function __get ($name )
+ 81 {
+ 82 if (!isset ($this ->response[$name ])) {
+ 83 throw new \InvalidArgumentException("Property \" $name \" not found" );
+ 84 }
+ 85
+ 86 return $this ->response[$name ];
+ 87 }
+ 88
+ 89 90 91 92
+ 93 public function offsetSet ($offset , $value )
+ 94 {
+ 95 throw new \BadMethodCallException('This activity not allowed' );
+ 96 }
+ 97
+ 98 99 100
+101 public function offsetUnset ($offset )
+102 {
+103 throw new \BadMethodCallException('This call not allowed' );
+104 }
+105
+106 107 108 109
+110 public function offsetExists ($offset )
+111 {
+112 return isset ($this ->response[$offset ]);
+113 }
+114
+115 116 117 118
+119 public function offsetGet ($offset )
+120 {
+121 if (!isset ($this ->response[$offset ])) {
+122 throw new \InvalidArgumentException("Property \" $offset \" not found" );
+123 }
+124
+125 return $this ->response[$offset ];
+126 }
+127 }
+
+
+
+
+
+
+
+
diff --git a/docs/api/todo.html b/docs/api/todo.html
new file mode 100644
index 0000000..cf47cf3
--- /dev/null
+++ b/docs/api/todo.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+ Todo | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Todo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/api/tree.html b/docs/api/tree.html
new file mode 100644
index 0000000..c171b2c
--- /dev/null
+++ b/docs/api/tree.html
@@ -0,0 +1,191 @@
+
+
+
+
+
+ Tree | retailCRM PHP API client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Tree
+
+
Classes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Exceptions
+
+
+
+ Exception
+
+
+
+
+
+ LogicException
+
+
+
+
+
+ DomainException
+
+
+
+
+
+ RuntimeException
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/RetailCrm/ApiClient.php b/lib/RetailCrm/ApiClient.php
index 471ef48..67048a8 100644
--- a/lib/RetailCrm/ApiClient.php
+++ b/lib/RetailCrm/ApiClient.php
@@ -19,7 +19,7 @@ class ApiClient
*
* @param string $url
* @param string $apiKey
- * @return void
+ * @return mixed
*/
public function __construct($url, $apiKey)
{
@@ -391,6 +391,7 @@ class ApiClient
/**
* Edit deliveryService
*
+ * @param array $data delivery service data
* @return ApiResponse
*/
public function deliveryServicesEdit(array $data)
@@ -411,6 +412,7 @@ class ApiClient
/**
* Edit deliveryType
*
+ * @param array $data delivery type data
* @return ApiResponse
*/
public function deliveryTypesEdit(array $data)
@@ -431,6 +433,7 @@ class ApiClient
/**
* Edit orderMethod
*
+ * @param array $data order method data
* @return ApiResponse
*/
public function orderMethodsEdit(array $data)
@@ -451,6 +454,7 @@ class ApiClient
/**
* Edit orderType
*
+ * @param array $data order type data
* @return ApiResponse
*/
public function orderTypesEdit(array $data)
@@ -471,6 +475,7 @@ class ApiClient
/**
* Edit paymentStatus
*
+ * @param array $data payment status data
* @return ApiResponse
*/
public function paymentStatusesEdit(array $data)
@@ -491,6 +496,7 @@ class ApiClient
/**
* Edit paymentType
*
+ * @param array $data payment type data
* @return ApiResponse
*/
public function paymentTypesEdit(array $data)
@@ -511,6 +517,7 @@ class ApiClient
/**
* Edit productStatus
*
+ * @param array $data product status data
* @return ApiResponse
*/
public function productStatusesEdit(array $data)
@@ -531,6 +538,7 @@ class ApiClient
/**
* Edit order status
*
+ * @param array $data status data
* @return ApiResponse
*/
public function statusesEdit(array $data)
@@ -577,4 +585,4 @@ class ApiClient
return true;
}
-}
\ No newline at end of file
+}
diff --git a/lib/RetailCrm/Exception/CurlException.php b/lib/RetailCrm/Exception/CurlException.php
index 098fc30..08a0924 100644
--- a/lib/RetailCrm/Exception/CurlException.php
+++ b/lib/RetailCrm/Exception/CurlException.php
@@ -4,4 +4,4 @@ namespace RetailCrm\Exception;
class CurlException extends \RuntimeException
{
-}
\ No newline at end of file
+}
diff --git a/lib/RetailCrm/Exception/InvalidJsonException.php b/lib/RetailCrm/Exception/InvalidJsonException.php
index f7edb1c..979d12e 100644
--- a/lib/RetailCrm/Exception/InvalidJsonException.php
+++ b/lib/RetailCrm/Exception/InvalidJsonException.php
@@ -4,4 +4,4 @@ namespace RetailCrm\Exception;
class InvalidJsonException extends \DomainException
{
-}
\ No newline at end of file
+}
diff --git a/lib/RetailCrm/Http/Client.php b/lib/RetailCrm/Http/Client.php
index d381b06..5dbc826 100644
--- a/lib/RetailCrm/Http/Client.php
+++ b/lib/RetailCrm/Http/Client.php
@@ -29,9 +29,10 @@ class Client
/**
* Make HTTP request
*
- * @param string $path
- * @param string $method (default: 'GET')
- * @param array $parameters (default: array())
+ * @param string $path
+ * @param string $method (default: 'GET')
+ * @param array $parameters (default: array())
+ * @param int $timeout
* @return ApiResponse
*/
public function makeRequest($path, $method, array $parameters = array(), $timeout = 30)
@@ -54,11 +55,11 @@ class Client
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $path);
- curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
- // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
+ curl_setopt($ch, CURLOPT_FAILONERROR, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, (int) $timeout); // times out after 30s
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
if (self::METHOD_POST === $method) {
curl_setopt($ch, CURLOPT_POST, true);
@@ -78,4 +79,4 @@ class Client
return new ApiResponse($statusCode, $responseBody);
}
- }
+}
diff --git a/lib/RetailCrm/Response/ApiResponse.php b/lib/RetailCrm/Response/ApiResponse.php
index c35c6db..3997a72 100644
--- a/lib/RetailCrm/Response/ApiResponse.php
+++ b/lib/RetailCrm/Response/ApiResponse.php
@@ -86,21 +86,36 @@ class ApiResponse implements \ArrayAccess
return $this->response[$name];
}
+ /**
+ * @param mixed $offset
+ * @param mixed $value
+ */
public function offsetSet($offset, $value)
{
throw new \BadMethodCallException('This activity not allowed');
}
+ /**
+ * @param mixed $offset
+ */
public function offsetUnset($offset)
{
throw new \BadMethodCallException('This call not allowed');
}
+ /**
+ * @param mixed $offset
+ * @return bool
+ */
public function offsetExists($offset)
{
return isset($this->response[$offset]);
}
+ /**
+ * @param mixed $offset
+ * @return mixed
+ */
public function offsetGet($offset)
{
if (!isset($this->response[$offset])) {
@@ -109,4 +124,4 @@ class ApiResponse implements \ArrayAccess
return $this->response[$offset];
}
-}
\ No newline at end of file
+}