aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2010-10-16 17:23:40 +0200
committerJochen Topf <jochen@topf.org>2010-10-16 17:23:40 +0200
commitcbfa79d7d13cc4f7c79eb01c449bed275251e017 (patch)
tree2bebf3b7ed8224323d5025f73f6411729332a86c /web
parent4f7ef2c538da67f612fac579382764e081063774 (diff)
downloadtaginfo-cbfa79d7d13cc4f7c79eb01c449bed275251e017.tar
taginfo-cbfa79d7d13cc4f7c79eb01c449bed275251e017.tar.gz
Improved and minified version of flexigrid.js
Diffstat (limited to 'web')
-rw-r--r--web/public/js/flexigrid-minified.js1
-rw-r--r--web/public/js/flexigrid.js190
-rw-r--r--web/public/js/flexigrid.pack.js10
-rw-r--r--web/public/robots.txt1
-rw-r--r--web/views/layout.erb3
5 files changed, 100 insertions, 105 deletions
diff --git a/web/public/js/flexigrid-minified.js b/web/public/js/flexigrid-minified.js
new file mode 100644
index 0000000..241de13
--- /dev/null
+++ b/web/public/js/flexigrid-minified.js
@@ -0,0 +1 @@
+(function(a){a.addFlex=function(r,v){if(r.grid){return false}v=a.extend({height:200,width:"auto",striped:true,novstripe:false,minwidth:30,minheight:80,resizable:true,url:false,method:"POST",dataType:"xml",errormsg:"Connection Error",usepager:false,nowrap:true,page:1,total:1,useRp:true,rp:15,rpOptions:[10,15,20,25,40],title:false,pagestat:"Displaying {from} to {to} of {total} items",pagetext:"Page",outof:"of",findtext:"Find",procmsg:"Processing, please wait ...",query:"",qtype:"",nomsg:"No items",minColToggle:1,showToggleBtn:true,hideOnSubmit:true,autoload:true,blockOpacity:0.5,onDragCol:false,onToggleCol:false,onChangeSort:false,onSuccess:false,onError:false,onSubmit:false},v);a(r).show().attr({cellPadding:0,cellSpacing:0,border:0}).removeAttr("width");var z={hset:{},rePosDrag:function(){var i=0-this.hDiv.scrollLeft;if(this.hDiv.scrollLeft>0){i-=Math.floor(v.cgwidth/2)}a(z.cDrag).css({top:z.hDiv.offsetTop+1});var g=this.cdpad;a("div",z.cDrag).hide();a("thead tr:first th:visible",this.hDiv).each(function(){var s=a("thead tr:first th:visible",z.hDiv).index(this),p=parseInt(a("div",this).width());if(i==0){i-=Math.floor(v.cgwidth/2)}p=p+i+g;a("div:eq("+s+")",z.cDrag).css({left:p+"px"}).show();i=p})},fixHeight:function(i){i=false;if(!i){i=a(z.bDiv).height()}var s=a(this.hDiv).height();a("div",this.cDrag).each(function(){a(this).height(i+s)});var p=parseInt(a(z.nDiv).height());if(p>i){a(z.nDiv).height(i).width(200)}else{a(z.nDiv).height("auto").width("auto")}a(z.block).css({height:i,marginBottom:(i*-1)});var g=z.bDiv.offsetTop+i;if(v.height!="auto"&&v.resizable){g=z.vDiv.offsetTop}a(z.rDiv).css({height:g})},dragStart:function(t,s,p){if(t=="colresize"){a(z.nDiv).hide();a(z.nBtn).hide();var F=a("div",this.cDrag).index(p),g=a("th:visible div:eq("+F+")",this.hDiv).width();a(p).addClass("dragging").siblings().hide();a(p).prev().addClass("dragging").show();this.colresize={startX:s.pageX,ol:parseInt(p.style.left),ow:g,n:F};a("body").css("cursor","col-resize")}else{if(t=="vresize"){var i=false;a("body").css("cursor","row-resize");if(p){i=true;a("body").css("cursor","col-resize")}this.vresize={h:v.height,sy:s.pageY,w:v.width,sx:s.pageX,hgo:i}}else{if(t=="colMove"){a(z.nDiv).hide();a(z.nBtn).hide();this.hset=a(this.hDiv).offset();this.hset.right=this.hset.left+a("table",this.hDiv).width();this.hset.bottom=this.hset.top+a("table",this.hDiv).height();this.dcol=p;this.dcoln=a("th",this.hDiv).index(p);this.colCopy=document.createElement("div");this.colCopy.className="colCopy";this.colCopy.innerHTML=p.innerHTML;if(a.browser.msie){this.colCopy.className="colCopy ie"}a(this.colCopy).css({position:"absolute","float":"left",display:"none",textAlign:p.align});a("body").append(this.colCopy);a(this.cDrag).hide()}}}a("body").noSelect()},dragMove:function(t){if(this.colresize){var i=this.colresize.n,J=t.pageX-this.colresize.startX,F=this.colresize.ol+J,s=this.colresize.ow+J;if(s>v.minwidth){a("div:eq("+i+")",this.cDrag).css("left",F);this.colresize.nw=s}}else{if(this.vresize){var K=this.vresize,H=t.pageY,J=H-K.sy;if(!v.defwidth){v.defwidth=v.width}if(v.width!="auto"&&!v.nohresize&&K.hgo){var I=t.pageX,p=I-K.sx,g=K.w+p;if(g>v.defwidth){this.gDiv.style.width=g+"px";v.width=g}}var G=K.h+J;if((G>v.minheight||v.height<v.minheight)&&!K.hgo){this.bDiv.style.height=G+"px";v.height=G;this.fixHeight(G)}K=null}else{if(this.colCopy){a(this.dcol).addClass("thMove").removeClass("thOver");if(t.pageX>this.hset.right||t.pageX<this.hset.left||t.pageY>this.hset.bottom||t.pageY<this.hset.top){a("body").css("cursor","move")}else{a("body").css("cursor","pointer")}a(this.colCopy).css({top:t.pageY+10,left:t.pageX+20,display:"block"})}}}},dragEnd:function(){if(this.colresize){var i=this.colresize.n,g=this.colresize.nw;a("th:visible div:eq("+i+")",this.hDiv).css("width",g);a("tr",this.bDiv).each(function(){a("td:visible div:eq("+i+")",this).css("width",g)});this.hDiv.scrollLeft=this.bDiv.scrollLeft;a("div:eq("+i+")",this.cDrag).siblings().show();a(".dragging",this.cDrag).removeClass("dragging");this.rePosDrag();this.fixHeight();this.colresize=false}else{if(this.vresize){this.vresize=false}else{if(this.colCopy){a(this.colCopy).remove();if(this.dcolt!=null){if(this.dcoln>this.dcolt){a("th:eq("+this.dcolt+")",this.hDiv).before(this.dcol)}else{a("th:eq("+this.dcolt+")",this.hDiv).after(this.dcol)}this.switchCol(this.dcoln,this.dcolt);a(this.cdropleft).remove();a(this.cdropright).remove();this.rePosDrag();if(v.onDragCol){v.onDragCol(this.dcoln,this.dcolt)}}this.dcol=null;this.hset=null;this.dcoln=null;this.dcolt=null;this.colCopy=null;a(".thMove",this.hDiv).removeClass("thMove");a(this.cDrag).show()}}}a("body").css("cursor","default");a("body").noSelect(false)},toggleCol:function(t,p){var i=a("th[axis='col"+t+"']",this.hDiv)[0],s=a("thead th",z.hDiv).index(i),g=a("input[value="+t+"]",z.nDiv)[0];if(p==null){p=i.hide}if(a("input:checked",z.nDiv).length<v.minColToggle&&!p){return false}if(p){i.hide=false;a(i).show();g.checked=true}else{i.hide=true;a(i).hide();g.checked=false}a("tbody tr",r).each(function(){if(p){a("td:eq("+s+")",this).show()}else{a("td:eq("+s+")",this).hide()}});this.rePosDrag();if(v.onToggleCol){v.onToggleCol(t,p)}return p},switchCol:function(i,g){a("tbody tr",r).each(function(){if(i>g){a("td:eq("+g+")",this).before(a("td:eq("+i+")",this))}else{a("td:eq("+g+")",this).after(a("td:eq("+i+")",this))}});if(i>g){a("tr:eq("+g+")",this.nDiv).before(a("tr:eq("+i+")",this.nDiv))}else{a("tr:eq("+g+")",this.nDiv).after(a("tr:eq("+i+")",this.nDiv))}if(a.browser.msie&&a.browser.version<7){a("tr:eq("+g+") input",this.nDiv)[0].checked=true}this.hDiv.scrollLeft=this.bDiv.scrollLeft},scroll:function(){this.hDiv.scrollLeft=this.bDiv.scrollLeft;this.rePosDrag()},addData:function(s){if(v.preProcess){s=v.preProcess(s)}if(this.pDiv){this.domElements.pReload.removeClass("loading")}this.loading=false;if(!s){if(this.pDiv){this.domElements.pPageStat.html(v.errormsg)}return false}if(v.dataType=="xml"){v.total=+a("rows total",s).text()}else{v.total=s.total}if(v.total==0){a("tr, a, td, div",r).unbind();a(r).empty();v.pages=1;v.page=1;this.buildpager();if(this.pDiv){this.domElements.pPageStat.html(v.nomsg)}return false}v.pages=Math.ceil(v.total/v.rp);if(v.dataType=="xml"){v.page=+a("rows page",s).text()}else{v.page=s.page}this.buildpager();var g=document.createElement("tbody");if(v.dataType=="json"){a.each(s.rows,function(F,H){var G=document.createElement("tr");if(F%2&&v.striped){G.className="erow"}if(H.id){G.id="row"+H.id}a("thead tr:first th",z.hDiv).each(function(){var J=document.createElement("td"),i=a(this).attr("axis").substr(3);J.align=this.align;J.innerHTML=H.cell[i];a(G).append(J);J=null});if(a("thead",this.gDiv).length<1){for(var t=0;t<cell.length;t++){var I=document.createElement("td");I.innerHTML=H.cell[t];a(G).append(I);I=null}}a(g).append(G);G=null})}else{if(v.dataType=="xml"){var p=1;a("rows row",s).each(function(){p++;var t=document.createElement("tr");if(p%2&&v.striped){t.className="erow"}var F=a(this).attr("id");if(F){t.id="row"+F}F=null;var i=this;a("thead tr:first th",z.hDiv).each(function(){var H=document.createElement("td"),G=a(this).attr("axis").substr(3);H.align=this.align;H.innerHTML=a("cell:eq("+G+")",i).text();a(t).append(H);H=null});if(a("thead",this.gDiv).length<1){a("cell",this).each(function(){var G=document.createElement("td");G.innerHTML=a(this).text();a(t).append(G);G=null})}a(g).append(t);t=null;i=null})}}a("tr",r).unbind();a(r).empty();a(r).append(g);this.addCellProp();this.addRowProp();this.rePosDrag();g=null;s=null;p=null;if(v.onSuccess){v.onSuccess()}if(v.hideOnSubmit){a(z.block).remove()}this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(a.browser.opera){a(r).css("visibility","visible")}},changeSort:function(g){if(this.loading){return true}a(z.nDiv).hide();a(z.nBtn).hide();if(v.sortname==a(g).attr("abbr")){if(v.sortorder=="asc"){v.sortorder="desc"}else{v.sortorder="asc"}}a(g).addClass("sorted").siblings().removeClass("sorted");a(".sdesc",this.hDiv).removeClass("sdesc");a(".sasc",this.hDiv).removeClass("sasc");a("div",g).addClass("s"+v.sortorder);v.sortname=a(g).attr("abbr");if(v.onChangeSort){v.onChangeSort(v.sortname,v.sortorder)}else{this.populate()}},buildpager:function(){if(this.pDiv){this.domElements.pcontrol_input.val(v.page);this.domElements.pcontrol_span.html(v.pages)}var i=(v.page-1)*v.rp+1,g=i+v.rp-1;if(v.total<g){g=v.total}var p=v.pagestat;p=p.replace(/{from}/,i);p=p.replace(/{to}/,g);p=p.replace(/{total}/,v.total);if(this.pDiv){this.domElements.pPageStat.html(p)}},populate:function(){if(this.loading){return true}if(v.onSubmit){var g=v.onSubmit();if(!g){return false}}this.loading=true;if(!v.url){return false}if(this.pDiv){this.domElements.pPageStat.html(v.procmsg);this.domElements.pReload.addClass("loading")}a(z.block).css({top:z.bDiv.offsetTop});if(v.hideOnSubmit){a(this.gDiv).prepend(z.block)}if(a.browser.opera){a(r).css("visibility","hidden")}if(!v.newp){v.newp=1}if(v.page>v.pages){v.page=v.pages}var p=[{name:"page",value:v.newp},{name:"rp",value:v.rp},{name:"sortname",value:v.sortname},{name:"sortorder",value:v.sortorder},{name:"query",value:v.query},{name:"qtype",value:v.qtype}];if(v.params){for(var i=0;i<v.params.length;i++){p[p.length]=v.params[i]}}a.ajax({type:v.method,url:v.url,data:p,dataType:v.dataType,success:function(s){z.addData(s)},error:function(s,G,F){try{if(v.onError){v.onError(s,G,F)}}catch(t){}}})},doSearch:function(){v.query=a("input[name=q]",z.sDiv).val();v.qtype=a("select[name=qtype]",z.sDiv).val();v.newp=1;this.populate()},changePage:function(i){if(this.loading){return true}switch(i){case"first":v.newp=1;break;case"prev":if(v.page>1){v.newp=parseInt(v.page)-1}break;case"next":if(v.page<v.pages){v.newp=parseInt(v.page)+1}break;case"last":v.newp=v.pages;break;case"input":if(this.pDiv){var g=parseInt(this.domElements.pcontrol_input.val());if(isNaN(g)){g=1}if(g<1){g=1}else{if(g>v.pages){g=v.pages}}this.domElements.pcontrol_input.val(g);v.newp=g;break}}if(v.newp==v.page){return false}if(v.onChangePage){v.onChangePage(v.newp)}else{this.populate()}},addCellProp:function(){a("tbody tr td",z.bDiv).each(function(){var p=document.createElement("div"),t=a("td",a(this).parent()).index(this),s=a("th:eq("+t+")",z.hDiv).get(0);if(s!=null){if(v.sortname==a(s).attr("abbr")&&v.sortname){this.className="sorted"}a(p).css({textAlign:s.align,width:a("div:first",s)[0].style.width});if(s.hide){a(this).css("display","none")}}if(v.nowrap==false){a(p).css("white-space","normal")}if(this.innerHTML==""){this.innerHTML="&nbsp;"}p.innerHTML=this.innerHTML;var i=a(this).parent()[0],g=false;if(i.id){g=i.id.substr(3)}if(s!=null){if(s.process){s.process(p,g)}}a(this).empty().append(p).removeAttr("width")})},getCellDim:function(p){var G=parseInt(a(p).height()),g=parseInt(a(p).parent().height()),t=parseInt(p.style.width),I=parseInt(a(p).parent().width()),F=p.offsetParent.offsetTop,i=p.offsetParent.offsetLeft,H=parseInt(a(p).css("paddingLeft")),s=parseInt(a(p).css("paddingTop"));return{ht:G,wt:t,top:F,left:i,pdl:H,pdt:s,pht:g,pwt:I}},addRowProp:function(){a("tbody tr",z.bDiv).each(function(){a(this).click(function(i){var g=(i.target||i.srcElement);if(g.href||g.type){return true}a(this).toggleClass("trSelected");if(v.singleSelect){a(this).siblings().removeClass("trSelected")}}).mousedown(function(g){if(g.shiftKey){a(this).toggleClass("trSelected");z.multisel=true;this.focus();a(z.gDiv).noSelect()}}).mouseup(function(){if(z.multisel){z.multisel=false;a(z.gDiv).noSelect(false)}}).hover(function(g){if(z.multisel){a(this).toggleClass("trSelected")}},function(){});if(a.browser.msie&&a.browser.version<7){a(this).hover(function(){a(this).addClass("trOver")},function(){a(this).removeClass("trOver")})}})},pager:0};if(v.colModel){var A=document.createElement("thead");var c=document.createElement("tr");for(var x=0;x<v.colModel.length;x++){var n=v.colModel[x],k=document.createElement("th");k.innerHTML=n.display;if(n.name&&n.sortable){a(k).attr("abbr",n.name)}a(k).attr("axis","col"+x);if(n.align){k.align=n.align}if(n.width){a(k).attr("width",n.width)}if(n.hide){k.hide=true}if(n.process){k.process=n.process}a(c).append(k)}a(A).append(c);a(r).prepend(A)}z.gDiv=document.createElement("div");z.mDiv=document.createElement("div");z.hDiv=document.createElement("div");z.bDiv=document.createElement("div");z.vDiv=document.createElement("div");z.rDiv=document.createElement("div");z.cDrag=document.createElement("div");z.block=document.createElement("div");z.nDiv=document.createElement("div");z.nBtn=document.createElement("div");z.iDiv=document.createElement("div");z.tDiv=document.createElement("div");z.sDiv=document.createElement("div");if(v.usepager){z.pDiv=document.createElement("div")}z.hTable=document.createElement("table");z.gDiv.className="flexigrid";if(v.width!="auto"){z.gDiv.style.width=v.width+"px"}if(a.browser.msie){a(z.gDiv).addClass("ie")}if(v.novstripe){a(z.gDiv).addClass("novstripe")}a(r).before(z.gDiv);a(z.gDiv).append(r);if(v.buttons){z.tDiv.className="tDiv";var D=document.createElement("div");D.className="tDiv2";for(x=0;x<v.buttons.length;x++){var m=v.buttons[x];if(!m.separator){var y=document.createElement("div");y.className="fbutton";y.innerHTML="<div><span>"+m.name+"</span></div>";if(m.bclass){a("span",y).addClass(m.bclass).css({paddingLeft:20})}y.onpress=m.onpress;y.name=m.name;if(m.onpress){a(y).click(function(){this.onpress(this.name,z.gDiv)})}a(D).append(y);if(a.browser.msie&&a.browser.version<7){a(y).hover(function(){a(this).addClass("fbOver")},function(){a(this).removeClass("fbOver")})}}else{a(D).append("<div class='btnseparator'></div>")}}a(z.tDiv).append(D);a(z.tDiv).append("<div style='clear:both'></div>");a(z.gDiv).prepend(z.tDiv)}z.hDiv.className="hDiv";a(r).before(z.hDiv);z.hTable.cellPadding=0;z.hTable.cellSpacing=0;a(z.hDiv).append('<div class="hDivBox"></div>');a("div",z.hDiv).append(z.hTable);var A=a("thead:first",r).get(0);if(A){a(z.hTable).append(A)}A=null;if(!v.colmodel){var o=0}a("thead tr:first th",z.hDiv).each(function(){var g=document.createElement("div");if(a(this).attr("abbr")){a(this).click(function(p){if(!a(this).hasClass("thOver")){return false}var i=(p.target||p.srcElement);if(i.href||i.type){return true}z.changeSort(this)});if(a(this).attr("abbr")==v.sortname){this.className="sorted";g.className="s"+v.sortorder}}if(this.hide){a(this).hide()}if(!v.colmodel){a(this).attr("axis","col"+o++)}a(g).css({textAlign:this.align,width:this.width+"px"});g.innerHTML=this.innerHTML;a(this).empty().append(g).removeAttr("width").mousedown(function(i){z.dragStart("colMove",i,this)}).hover(function(){if(!z.colresize&&!a(this).hasClass("thMove")&&!z.colCopy){a(this).addClass("thOver")}if(a(this).attr("abbr")!=v.sortname&&!z.colCopy&&!z.colresize&&a(this).attr("abbr")){a("div",this).addClass("s"+v.sortorder)}else{if(a(this).attr("abbr")==v.sortname&&!z.colCopy&&!z.colresize&&a(this).attr("abbr")){var G="";if(v.sortorder=="asc"){G="desc"}else{G="asc"}a("div",this).removeClass("s"+v.sortorder).addClass("s"+G)}}if(z.colCopy){var H=a("th",z.hDiv).index(this);if(H==z.dcoln){return false}if(H<z.dcoln){a(this).append(z.cdropleft)}else{a(this).append(z.cdropright)}z.dcolt=H}else{if(!z.colresize){var s=a("th:visible",z.hDiv).index(this),F=parseInt(a("div:eq("+s+")",z.cDrag).css("left")),p=jQuery(z.nBtn).outerWidth(),i=F-p+Math.floor(v.cgwidth/2);a(z.nDiv).hide();a(z.nBtn).hide();a(z.nBtn).css({left:i,top:z.hDiv.offsetTop}).show();var t=parseInt(a(z.nDiv).width());a(z.nDiv).css({top:z.bDiv.offsetTop});if((i+t)>a(z.gDiv).width()){a(z.nDiv).css("left",F-t+1)}else{a(z.nDiv).css("left",i)}if(a(this).hasClass("sorted")){a(z.nBtn).addClass("srtd")}else{a(z.nBtn).removeClass("srtd")}}}},function(){a(this).removeClass("thOver");if(a(this).attr("abbr")!=v.sortname){a("div",this).removeClass("s"+v.sortorder)}else{if(a(this).attr("abbr")==v.sortname){var i="";if(v.sortorder=="asc"){i="desc"}else{i="asc"}a("div",this).addClass("s"+v.sortorder).removeClass("s"+i)}}if(z.colCopy){a(z.cdropleft).remove();a(z.cdropright).remove();z.dcolt=null}})});z.bDiv.className="bDiv";a(r).before(z.bDiv);a(z.bDiv).css({height:(v.height=="auto")?"auto":v.height+"px"}).scroll(function(g){z.scroll()}).append(r);if(v.height=="auto"){a("table",z.bDiv).addClass("autoht")}z.addCellProp();z.addRowProp();var j=a("thead tr:first th:first",z.hDiv).get(0);if(j!=null){z.cDrag.className="cDrag";z.cdpad=0;z.cdpad+=(isNaN(parseInt(a("div",j).css("borderLeftWidth")))?0:parseInt(a("div",j).css("borderLeftWidth")));z.cdpad+=(isNaN(parseInt(a("div",j).css("borderRightWidth")))?0:parseInt(a("div",j).css("borderRightWidth")));z.cdpad+=(isNaN(parseInt(a("div",j).css("paddingLeft")))?0:parseInt(a("div",j).css("paddingLeft")));z.cdpad+=(isNaN(parseInt(a("div",j).css("paddingRight")))?0:parseInt(a("div",j).css("paddingRight")));z.cdpad+=(isNaN(parseInt(a(j).css("borderLeftWidth")))?0:parseInt(a(j).css("borderLeftWidth")));z.cdpad+=(isNaN(parseInt(a(j).css("borderRightWidth")))?0:parseInt(a(j).css("borderRightWidth")));z.cdpad+=(isNaN(parseInt(a(j).css("paddingLeft")))?0:parseInt(a(j).css("paddingLeft")));z.cdpad+=(isNaN(parseInt(a(j).css("paddingRight")))?0:parseInt(a(j).css("paddingRight")));a(z.bDiv).before(z.cDrag);var e=a(z.bDiv).height(),d=a(z.hDiv).height();a(z.cDrag).css({top:-d+"px"});a("thead tr:first th",z.hDiv).each(function(){var g=document.createElement("div");a(z.cDrag).append(g);if(!v.cgwidth){v.cgwidth=a(g).width()}a(g).css({height:e+d}).mousedown(function(i){z.dragStart("colresize",i,this)});if(a.browser.msie&&a.browser.version<7){z.fixHeight(a(z.gDiv).height());a(g).hover(function(){z.fixHeight();a(this).addClass("dragging")},function(){if(!z.colresize){a(this).removeClass("dragging")}})}})}if(v.striped){a("tbody tr:odd",z.bDiv).addClass("erow")}if(v.resizable&&v.height!="auto"){z.vDiv.className="vGrip";a(z.vDiv).mousedown(function(g){z.dragStart("vresize",g)}).html("<span></span>");a(z.bDiv).after(z.vDiv)}if(v.resizable&&v.width!="auto"&&!v.nohresize){z.rDiv.className="hGrip";a(z.rDiv).mousedown(function(g){z.dragStart("vresize",g,true)}).html("<span></span>").css("height",a(z.gDiv).height());if(a.browser.msie&&a.browser.version<7){a(z.rDiv).hover(function(){a(this).addClass("hgOver")},function(){a(this).removeClass("hgOver")})}a(z.gDiv).append(z.rDiv)}if(v.usepager){z.pDiv.className="pDiv";z.pDiv.innerHTML='<div class="pDiv2"></div>';a(z.bDiv).after(z.pDiv);var q=' <div class="pGroup"> <div class="pFirst pButton"><span></span></div><div class="pPrev pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pcontrol">'+v.pagetext+' <input type="text" size="4" value="1" /> '+v.outof+' <span> 1 </span></span></div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pNext pButton"><span></span></div><div class="pLast pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pReload pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pPageStat"></span></div>';a("div",z.pDiv).html(q);z.domElements={pReload:a(".pReload",z.pDiv),pPageStat:a(".pPageStat",z.pDiv),pcontrol_input:a(".pcontrol input",z.pDiv),pcontrol_span:a(".pcontrol span",z.pDiv)};z.domElements.pReload.click(function(){z.populate()});a(".pFirst",z.pDiv).click(function(){z.changePage("first")});a(".pPrev",z.pDiv).click(function(){z.changePage("prev")});a(".pNext",z.pDiv).click(function(){z.changePage("next")});a(".pLast",z.pDiv).click(function(){z.changePage("last")});z.domElements.pcontrol_input.keydown(function(g){if(g.keyCode==13){z.changePage("input")}});if(a.browser.msie&&a.browser.version<7){a(".pButton",z.pDiv).hover(function(){a(this).addClass("pBtnOver")},function(){a(this).removeClass("pBtnOver")})}if(v.useRp){var f="";for(var C=0;C<v.rpOptions.length;C++){var w="";if(v.rp==v.rpOptions[C]){w='selected="selected"'}f+="<option value='"+v.rpOptions[C]+"' "+w+" >"+v.rpOptions[C]+"&nbsp;&nbsp;</option>"}a(".pDiv2",z.pDiv).prepend("<div class='pGroup'><select name='rp'>"+f+"</select></div> <div class='btnseparator'></div>");a("select",z.pDiv).change(function(){if(v.onRpChange){v.onRpChange(+this.value)}else{v.newp=1;v.rp=+this.value;z.populate()}})}if(v.searchitems){a(".pDiv2",z.pDiv).prepend("<div class='pGroup'> <div class='pSearch pButton'><span></span></div> </div> <div class='btnseparator'></div>");a(".pSearch",z.pDiv).click(function(){a(z.sDiv).slideToggle("fast",function(){a(".sDiv:visible input:first",z.gDiv).trigger("focus")})});z.sDiv.className="sDiv";sitems=v.searchitems;var h="";for(var u=0;u<sitems.length;u++){if(v.qtype==""&&sitems[u].isdefault==true){v.qtype=sitems[u].name;w='selected="selected"'}else{w=""}h+="<option value='"+sitems[u].name+"' "+w+" >"+sitems[u].display+"&nbsp;&nbsp;</option>"}if(v.qtype==""){v.qtype=sitems[0].name}a(z.sDiv).append("<div class='sDiv2'>"+v.findtext+" <input type='text' size='30' name='q' class='qsbox' /> <select name='qtype'>"+h+"</select> <!--input type='button' value='Clear' /--></div>");a("input[name=q],select[name=qtype]",z.sDiv).keydown(function(g){if(g.keyCode==13){z.doSearch()}});a("input[value=Clear]",z.sDiv).click(function(){a("input[name=q]",z.sDiv).val("");v.query="";z.doSearch()});a(z.bDiv).after(z.sDiv)}}a(z.pDiv,z.sDiv).append("<div style='clear:both'></div>");if(v.title){z.mDiv.className="mDiv";z.mDiv.innerHTML='<div class="ftitle">'+v.title+"</div>";a(z.gDiv).prepend(z.mDiv);if(v.showTableToggleBtn){a(z.mDiv).append('<div class="ptogtitle" title="Minimize/Maximize Table"><span></span></div>');a("div.ptogtitle",z.mDiv).click(function(){a(z.gDiv).toggleClass("hideBody");a(this).toggleClass("vsble")})}}z.cdropleft=document.createElement("span");z.cdropleft.className="cdropleft";z.cdropright=document.createElement("span");z.cdropright.className="cdropright";z.block.className="gBlock";var B=a(z.bDiv).height(),E=z.bDiv.offsetTop;a(z.block).css({width:z.bDiv.style.width,height:B,background:"white",position:"relative",marginBottom:(B*-1),zIndex:1,top:E,left:"0px"});a(z.block).fadeTo(0,v.blockOpacity);if(a("th",z.hDiv).length){z.nDiv.className="nDiv";z.nDiv.innerHTML="<table cellpadding='0' cellspacing='0'><tbody></tbody></table>";a(z.nDiv).css({marginBottom:(B*-1),display:"none",top:E}).noSelect();var l=0;a("th div",z.hDiv).each(function(){var i=a("th[axis='col"+l+"']",z.hDiv)[0],g='checked="checked"';if(i.style.display=="none"){g=""}a("tbody",z.nDiv).append('<tr><td class="ndcol1"><input type="checkbox" '+g+' class="togCol" value="'+l+'" /></td><td class="ndcol2">'+this.innerHTML+"</td></tr>");l++});if(a.browser.msie&&a.browser.version<7){a("tr",z.nDiv).hover(function(){a(this).addClass("ndcolover")},function(){a(this).removeClass("ndcolover")})}a("td.ndcol2",z.nDiv).click(function(){if(a("input:checked",z.nDiv).length<=v.minColToggle&&a(this).prev().find("input")[0].checked){return false}return z.toggleCol(a(this).prev().find("input").val())});a("input.togCol",z.nDiv).click(function(){if(a("input:checked",z.nDiv).length<v.minColToggle&&this.checked==false){return false}a(this).parent().next().trigger("click")});a(z.gDiv).prepend(z.nDiv);a(z.nBtn).addClass("nBtn").html("<div></div>").attr("title","Hide/Show Columns").click(function(){a(z.nDiv).toggle();return true});if(v.showToggleBtn){a(z.gDiv).prepend(z.nBtn)}}a(z.iDiv).addClass("iDiv").css({display:"none"});a(z.bDiv).append(z.iDiv);a(z.bDiv).hover(function(){a(z.nDiv).hide();a(z.nBtn).hide()},function(){if(z.multisel){z.multisel=false}});a(z.gDiv).hover(function(){},function(){a(z.nDiv).hide();a(z.nBtn).hide()});a(document).mousemove(function(g){z.dragMove(g)}).mouseup(function(g){z.dragEnd()}).hover(function(){},function(){z.dragEnd()});if(a.browser.msie&&a.browser.version<7){a(".hDiv,.bDiv,.mDiv,.pDiv,.vGrip,.tDiv, .sDiv",z.gDiv).css({width:"100%"});a(z.gDiv).addClass("ie6");if(v.width!="auto"){a(z.gDiv).addClass("ie6fullwidthbug")}}z.rePosDrag();z.fixHeight();r.p=v;r.grid=z;if(v.url&&v.autoload){z.populate()}return r};var b=false;a(document).ready(function(){b=true});a.fn.flexigrid=function(c){return this.each(function(){if(!b){a(this).hide();var d=this;a(document).ready(function(){a.addFlex(d,c)})}else{a.addFlex(this,c)}})};a.fn.flexReload=function(c){return this.each(function(){if(this.grid&&this.p.url){this.grid.populate()}})};a.fn.flexOptions=function(c){return this.each(function(){if(this.grid){a.extend(this.p,c)}})};a.fn.flexToggleCol=function(d,c){return this.each(function(){if(this.grid){this.grid.toggleCol(d,c)}})};a.fn.flexAddData=function(c){return this.each(function(){if(this.grid){this.grid.addData(c)}})};a.fn.noSelect=function(c){if(c==null){prevent=true}else{prevent=c}if(prevent){return this.each(function(){if(a.browser.msie||a.browser.safari){a(this).bind("selectstart",function(){return false})}else{if(a.browser.mozilla){a(this).css("MozUserSelect","none");a("body").trigger("focus")}else{if(a.browser.opera){a(this).bind("mousedown",function(){return false})}else{a(this).attr("unselectable","on")}}}})}else{return this.each(function(){if(a.browser.msie||a.browser.safari){a(this).unbind("selectstart")}else{if(a.browser.mozilla){a(this).css("MozUserSelect","inherit")}else{if(a.browser.opera){a(this).unbind("mousedown")}else{a(this).removeAttr("unselectable","on")}}}})}}})(jQuery); \ No newline at end of file
diff --git a/web/public/js/flexigrid.js b/web/public/js/flexigrid.js
index 0027405..0591369 100644
--- a/web/public/js/flexigrid.js
+++ b/web/public/js/flexigrid.js
@@ -80,10 +80,8 @@
(
function ()
{
- var n = $('thead tr:first th:visible',g.hDiv).index(this);
-
- var cdpos = parseInt($('div',this).width());
- var ppos = cdpos;
+ var n = $('thead tr:first th:visible',g.hDiv).index(this),
+ cdpos = parseInt($('div',this).width());
if (cdleft==0)
cdleft -= Math.floor(p.cgwidth/2);
@@ -126,8 +124,8 @@
if (dragtype=='colresize') //column resize
{
$(g.nDiv).hide();$(g.nBtn).hide();
- var n = $('div',this.cDrag).index(obj);
- var ow = $('th:visible div:eq('+n+')',this.hDiv).width();
+ var n = $('div',this.cDrag).index(obj),
+ ow = $('th:visible div:eq('+n+')',this.hDiv).width();
$(obj).addClass('dragging').siblings().hide();
$(obj).prev().addClass('dragging').show();
@@ -165,7 +163,7 @@
}
- $(this.colCopy).css({position:'absolute',float:'left',display:'none', textAlign: obj.align});
+ $(this.colCopy).css({position:'absolute','float':'left',display:'none', textAlign: obj.align});
$('body').append(this.colCopy);
$(this.cDrag).hide();
@@ -178,10 +176,10 @@
if (this.colresize) //column resize
{
- var n = this.colresize.n;
- var diff = e.pageX-this.colresize.startX;
- var nleft = this.colresize.ol + diff;
- var nw = this.colresize.ow + diff;
+ var n = this.colresize.n,
+ diff = e.pageX-this.colresize.startX,
+ nleft = this.colresize.ol + diff,
+ nw = this.colresize.ow + diff;
if (nw > p.minwidth)
{
$('div:eq('+n+')',this.cDrag).css('left',nleft);
@@ -190,17 +188,17 @@
}
else if (this.vresize) //table resize
{
- var v = this.vresize;
- var y = e.pageY;
- var diff = y-v.sy;
+ var v = this.vresize,
+ y = e.pageY,
+ diff = y-v.sy;
if (!p.defwidth) p.defwidth = p.width;
if (p.width != 'auto' && !p.nohresize && v.hgo)
{
- var x = e.pageX;
- var xdiff = x - v.sx;
- var newW = v.w + xdiff;
+ var x = e.pageX,
+ xdiff = x - v.sx,
+ newW = v.w + xdiff;
if (newW > p.defwidth)
{
this.gDiv.style.width = newW + 'px';
@@ -234,8 +232,8 @@
if (this.colresize)
{
- var n = this.colresize.n;
- var nw = this.colresize.nw;
+ var n = this.colresize.n,
+ nw = this.colresize.nw;
$('th:visible div:eq('+n+')',this.hDiv).css('width',nw);
$('tr',this.bDiv).each (
@@ -294,18 +292,15 @@
},
toggleCol: function(cid,visible) {
- var ncol = $("th[axis='col"+cid+"']",this.hDiv)[0];
- var n = $('thead th',g.hDiv).index(ncol);
- var cb = $('input[value='+cid+']',g.nDiv)[0];
-
+ var ncol = $("th[axis='col"+cid+"']",this.hDiv)[0],
+ n = $('thead th',g.hDiv).index(ncol),
+ cb = $('input[value='+cid+']',g.nDiv)[0];
if (visible==null)
{
visible = ncol.hide;
}
-
-
if ($('input:checked',g.nDiv).length<p.minColToggle&&!visible) return false;
if (visible)
@@ -371,15 +366,15 @@
data = p.preProcess(data);
if (this.pDiv) {
- $('.pReload',this.pDiv).removeClass('loading');
- }
+ this.domElements.pReload.removeClass('loading');
+ }
this.loading = false;
if (!data)
{
- if (this.pDiv) {
- $('.pPageStat',this.pDiv).html(p.errormsg);
- }
+ if (this.pDiv) {
+ this.domElements.pPageStat.html(p.errormsg);
+ }
return false;
}
@@ -395,9 +390,9 @@
p.pages = 1;
p.page = 1;
this.buildpager();
- if (this.pDiv) {
- $('.pPageStat',this.pDiv).html(p.nomsg);
- }
+ if (this.pDiv) {
+ this.domElements.pPageStat.html(p.nomsg);
+ }
return false;
}
@@ -431,8 +426,8 @@
function ()
{
- var td = document.createElement('td');
- var idx = $(this).attr('axis').substr(3);
+ var td = document.createElement('td'),
+ idx = $(this).attr('axis').substr(3);
td.align = this.align;
td.innerHTML = row.cell[idx];
$(tr).append(td);
@@ -444,7 +439,7 @@
if ($('thead',this.gDiv).length<1) //handle if grid has no headers
{
- for (idx=0;idx<cell.length;idx++)
+ for (var idx=0;idx<cell.length;idx++)
{
var td = document.createElement('td');
td.innerHTML = row.cell[idx];
@@ -460,7 +455,7 @@
} else if (p.dataType=='xml') {
- i = 1;
+ var i = 1;
$("rows row",data).each
(
@@ -487,8 +482,8 @@
function ()
{
- var td = document.createElement('td');
- var idx = $(this).attr('axis').substr(3);
+ var td = document.createElement('td'),
+ idx = $(this).attr('axis').substr(3);
td.align = this.align;
td.innerHTML = $("cell:eq("+ idx +")",robj).text();
$(tr).append(td);
@@ -565,13 +560,13 @@
},
buildpager: function(){ //rebuild pager based on new properties
- if (this.pDiv) {
- $('.pcontrol input',this.pDiv).val(p.page);
- $('.pcontrol span',this.pDiv).html(p.pages);
- }
+ if (this.pDiv) {
+ this.domElements.pcontrol_input.val(p.page);
+ this.domElements.pcontrol_span.html(p.pages);
+ }
- var r1 = (p.page-1) * p.rp + 1;
- var r2 = r1 + p.rp - 1;
+ var r1 = (p.page-1) * p.rp + 1,
+ r2 = r1 + p.rp - 1;
if (p.total<r2) r2 = p.total;
@@ -581,9 +576,9 @@
stat = stat.replace(/{to}/,r2);
stat = stat.replace(/{total}/,p.total);
- if (this.pDiv) {
- $('.pPageStat',this.pDiv).html(stat);
- }
+ if (this.pDiv) {
+ this.domElements.pPageStat.html(stat);
+ }
},
populate: function () { //get latest data
@@ -599,10 +594,10 @@
this.loading = true;
if (!p.url) return false;
- if (this.pDiv) {
- $('.pPageStat',this.pDiv).html(p.procmsg);
- $('.pReload',this.pDiv).addClass('loading');
- }
+ if (this.pDiv) {
+ this.domElements.pPageStat.html(p.procmsg);
+ this.domElements.pReload.addClass('loading');
+ }
$(g.block).css({top:g.bDiv.offsetTop});
@@ -655,13 +650,15 @@
case 'next': if (p.page<p.pages) p.newp = parseInt(p.page) + 1; break;
case 'last': p.newp = p.pages; break;
case 'input':
- var nv = parseInt($('.pcontrol input',this.pDiv).val());
- if (isNaN(nv)) nv = 1;
- if (nv<1) nv = 1;
- else if (nv > p.pages) nv = p.pages;
- $('.pcontrol input',this.pDiv).val(nv);
- p.newp =nv;
- break;
+ if (this.pDiv) {
+ var nv = parseInt(this.domElements.pcontrol_input.val());
+ if (isNaN(nv)) nv = 1;
+ if (nv<1) nv = 1;
+ else if (nv > p.pages) nv = p.pages;
+ this.domElements.pcontrol_input.val(nv);
+ p.newp =nv;
+ break;
+ }
}
if (p.newp==p.page) return false;
@@ -679,9 +676,9 @@
(
function ()
{
- var tdDiv = document.createElement('div');
- var n = $('td',$(this).parent()).index(this);
- var pth = $('th:eq('+n+')',g.hDiv).get(0);
+ var tdDiv = document.createElement('div'),
+ n = $('td',$(this).parent()).index(this),
+ pth = $('th:eq('+n+')',g.hDiv).get(0);
if (pth!=null)
{
@@ -702,8 +699,8 @@
//tdDiv.value = this.innerHTML; //store preprocess value
tdDiv.innerHTML = this.innerHTML;
- var prnt = $(this).parent()[0];
- var pid = false;
+ var prnt = $(this).parent()[0],
+ pid = false;
if (prnt.id) pid = prnt.id.substr(3);
if (pth!=null)
@@ -721,14 +718,14 @@
},
getCellDim: function (obj) // get cell prop for editable event
{
- var ht = parseInt($(obj).height());
- var pht = parseInt($(obj).parent().height());
- var wt = parseInt(obj.style.width);
- var pwt = parseInt($(obj).parent().width());
- var top = obj.offsetParent.offsetTop;
- var left = obj.offsetParent.offsetLeft;
- var pdl = parseInt($(obj).css('paddingLeft'));
- var pdt = parseInt($(obj).css('paddingTop'));
+ var ht = parseInt($(obj).height()),
+ pht = parseInt($(obj).parent().height()),
+ wt = parseInt(obj.style.width),
+ pwt = parseInt($(obj).parent().width()),
+ top = obj.offsetParent.offsetTop,
+ left = obj.offsetParent.offsetLeft,
+ pdl = parseInt($(obj).css('paddingLeft')),
+ pdt = parseInt($(obj).css('paddingTop'));
return {ht:ht,wt:wt,top:top,left:left,pdl:pdl, pdt:pdt, pht:pht, pwt: pwt};
},
addRowProp: function()
@@ -800,13 +797,13 @@
//create model if any
if (p.colModel)
{
- thead = document.createElement('thead');
- tr = document.createElement('tr');
+ var thead = document.createElement('thead');
+ var tr = document.createElement('tr');
- for (i=0;i<p.colModel.length;i++)
+ for (var i=0;i<p.colModel.length;i++)
{
- var cm = p.colModel[i];
- var th = document.createElement('th');
+ var cm = p.colModel[i],
+ th = document.createElement('th');
th.innerHTML = cm.display;
@@ -1009,10 +1006,10 @@
} else if (!g.colresize) {
- var nv = $('th:visible',g.hDiv).index(this);
- var onl = parseInt($('div:eq('+nv+')',g.cDrag).css('left'));
- var nw = jQuery(g.nBtn).outerWidth();
- nl = onl - nw + Math.floor(p.cgwidth/2);
+ var nv = $('th:visible',g.hDiv).index(this),
+ onl = parseInt($('div:eq('+nv+')',g.cDrag).css('left')),
+ nw = jQuery(g.nBtn).outerWidth(),
+ nl = onl - nw + Math.floor(p.cgwidth/2);
$(g.nDiv).hide();$(g.nBtn).hide();
@@ -1083,7 +1080,7 @@
var cdcol = $('thead tr:first th:first',g.hDiv).get(0);
if (cdcol != null)
- {
+ {
g.cDrag.className = 'cDrag';
g.cdpad = 0;
@@ -1098,8 +1095,8 @@
$(g.bDiv).before(g.cDrag);
- var cdheight = $(g.bDiv).height();
- var hdheight = $(g.hDiv).height();
+ var cdheight = $(g.bDiv).height(),
+ hdheight = $(g.hDiv).height();
$(g.cDrag).css({top: -hdheight + 'px'});
@@ -1170,13 +1167,20 @@
$(g.bDiv).after(g.pDiv);
var html = ' <div class="pGroup"> <div class="pFirst pButton"><span></span></div><div class="pPrev pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pcontrol">'+p.pagetext+' <input type="text" size="4" value="1" /> '+p.outof+' <span> 1 </span></span></div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pNext pButton"><span></span></div><div class="pLast pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pReload pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pPageStat"></span></div>';
$('div',g.pDiv).html(html);
+
+ g.domElements = {
+ pReload: $('.pReload', g.pDiv),
+ pPageStat: $('.pPageStat', g.pDiv),
+ pcontrol_input: $('.pcontrol input', g.pDiv),
+ pcontrol_span: $('.pcontrol span', g.pDiv)
+ };
- $('.pReload',g.pDiv).click(function(){g.populate()});
+ g.domElements.pReload.click(function(){g.populate()});
$('.pFirst',g.pDiv).click(function(){g.changePage('first')});
$('.pPrev',g.pDiv).click(function(){g.changePage('prev')});
$('.pNext',g.pDiv).click(function(){g.changePage('next')});
$('.pLast',g.pDiv).click(function(){g.changePage('last')});
- $('.pcontrol input',g.pDiv).keydown(function(e){if(e.keyCode==13) g.changePage('input')});
+ g.domElements.pcontrol_input.keydown(function(e){if(e.keyCode==13) g.changePage('input')});
if ($.browser.msie&&$.browser.version<7) $('.pButton',g.pDiv).hover(function(){$(this).addClass('pBtnOver');},function(){$(this).removeClass('pBtnOver');});
if (p.useRp)
@@ -1184,8 +1188,9 @@
var opt = "";
for (var nx=0;nx<p.rpOptions.length;nx++)
{
- if (p.rp == p.rpOptions[nx]) sel = 'selected="selected"'; else sel = '';
- opt += "<option value='" + p.rpOptions[nx] + "' " + sel + " >" + p.rpOptions[nx] + "&nbsp;&nbsp;</option>";
+ var sel = '';
+ if (p.rp == p.rpOptions[nx]) sel = 'selected="selected"';
+ opt += "<option value='" + p.rpOptions[nx] + "' " + sel + " >" + p.rpOptions[nx] + "&nbsp;&nbsp;</option>";
};
$('.pDiv2',g.pDiv).prepend("<div class='pGroup'><select name='rp'>"+opt+"</select></div> <div class='btnseparator'></div>");
$('select',g.pDiv).change(
@@ -1266,8 +1271,8 @@
//add block
g.block.className = 'gBlock';
- var gh = $(g.bDiv).height();
- var gtop = g.bDiv.offsetTop;
+ var gh = $(g.bDiv).height(),
+ gtop = g.bDiv.offsetTop;
$(g.block).css(
{
width: g.bDiv.style.width,
@@ -1299,13 +1304,12 @@
var cn = 0;
-
$('th div',g.hDiv).each
(
function ()
{
- var kcol = $("th[axis='col" + cn + "']",g.hDiv)[0];
- var chk = 'checked="checked"';
+ var kcol = $("th[axis='col" + cn + "']",g.hDiv)[0],
+ chk = 'checked="checked"';
if (kcol.style.display=='none') chk = '';
$('tbody',g.nDiv).append('<tr><td class="ndcol1"><input type="checkbox" '+ chk +' class="togCol" value="'+ cn +'" /></td><td class="ndcol2">'+this.innerHTML+'</td></tr>');
diff --git a/web/public/js/flexigrid.pack.js b/web/public/js/flexigrid.pack.js
deleted file mode 100644
index 8fd54f1..0000000
--- a/web/public/js/flexigrid.pack.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Flexigrid for jQuery - New Wave Grid
- *
- * Copyright (c) 2008 Paulo P. Marinas (webplicity.net/flexigrid)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- * $Date: 2008-04-01 00:09:43 +0800 (Tue, 01 Apr 2008) $
- */
-(function(a){a.addFlex=function(n,r){if(n.grid){return false}var x,A,C,k,w,q,y,b,c,h,m,j,l,f,d,B,e,o,z,u,v;r=a.extend({height:200,width:"auto",striped:true,novstripe:false,minwidth:30,minheight:80,resizable:true,url:false,method:"POST",dataType:"xml",errormsg:"Connection Error",usepager:false,nowrap:true,page:1,total:1,useRp:true,rp:15,rpOptions:[10,15,20,25,40],title:false,pagestat:"Displaying {from} to {to} of {total} items",procmsg:"Processing, please wait ...",query:"",qtype:"",nomsg:"No items",minColToggle:1,showToggleBtn:true,hideOnSubmit:true,autoload:true,blockOpacity:0.5,onToggleCol:false,onChangeSort:false,onSuccess:false,onSubmit:false},r);a(n).show().attr({cellPadding:0,cellSpacing:0,border:0}).removeAttr("width");x={hset:{},rePosDrag:function(){var i,g;i=0-this.hDiv.scrollLeft;if(this.hDiv.scrollLeft>0){i-=Math.floor(r.cgwidth/2)}a(x.cDrag).css({top:x.hDiv.offsetTop+1});g=this.cdpad;a("div",x.cDrag).hide();a("thead tr:first th:visible",this.hDiv).each(function(){var s,p;s=a("thead tr:first th:visible",x.hDiv).index(this);if(i==0){i-=Math.floor(r.cgwidth/2)}p=parseInt(a("div",this).width())+i+g;a("div:eq("+s+")",x.cDrag).css({left:p+"px"}).show();i=p})},fixHeight:function(i){var s,p,g;if(!i){i=a(x.bDiv).height()}s=a(this.hDiv).height();a("div",this.cDrag).each(function(){a(this).height(i+s)});p=parseInt(a(x.nDiv).height());if(p>i){a(x.nDiv).height(i).width(200)}else{a(x.nDiv).height("auto").width("auto")}a(x.block).css({height:i,marginBottom:(i*-1)});g=x.bDiv.offsetTop+i;if(r.height!="auto"&&r.resizable){g=x.vDiv.offsetTop}a(x.rDiv).css({height:g})},dragStart:function(t,s,p){var D,g,i;if(t=="colresize"){a(x.nDiv).hide();a(x.nBtn).hide();D=a("div",this.cDrag).index(p);g=a("th:visible div:eq("+D+")",this.hDiv).width();a(p).addClass("dragging").siblings().hide();a(p).prev().addClass("dragging").show();this.colresize={startX:s.pageX,ol:parseInt(p.style.left),ow:g,n:D};a("body").css("cursor","col-resize")}else{if(t=="vresize"){i=false;a("body").css("cursor","row-resize");if(p){i=true;a("body").css("cursor","col-resize")}this.vresize={h:r.height,sy:s.pageY,w:r.width,sx:s.pageX,hgo:i}}else{if(t=="colMove"){a(x.nDiv).hide();a(x.nBtn).hide();this.hset=a(this.hDiv).offset();this.hset.right=this.hset.left+a("table",this.hDiv).width();this.hset.bottom=this.hset.top+a("table",this.hDiv).height();this.dcol=p;this.dcoln=a("th",this.hDiv).index(p);this.colCopy=document.createElement("div");this.colCopy.className="colCopy";this.colCopy.innerHTML=p.innerHTML;if(a.browser.msie){this.colCopy.className="colCopy ie"}a(this.colCopy).css({position:"absolute","float":"left",display:"none",textAlign:p.align});a("body").append(this.colCopy);a(this.cDrag).hide()}}}a("body").noSelect()},dragMove:function(t){var i,I,G,F,p,H,D,s,g,E;if(this.colresize){i=this.colresize.n;H=t.pageX-this.colresize.startX;D=this.colresize.ol+H;s=this.colresize.ow+H;if(s>r.minwidth){a("div:eq("+i+")",this.cDrag).css("left",D);this.colresize.nw=s}}else{if(this.vresize){I=this.vresize;F=t.pageY;H=F-I.sy;if(!r.defwidth){r.defwidth=r.width}if(r.width!="auto"&&!r.nohresize&&I.hgo){G=t.pageX;p=G-I.sx;g=I.w+p;if(g>r.defwidth){this.gDiv.style.width=g+"px";r.width=g}}E=I.h+H;if((E>r.minheight||r.height<r.minheight)&&!I.hgo){this.bDiv.style.height=E+"px";r.height=E;this.fixHeight(E)}I=null}else{if(this.colCopy){a(this.dcol).addClass("thMove").removeClass("thOver");if(t.pageX>this.hset.right||t.pageX<this.hset.left||t.pageY>this.hset.bottom||t.pageY<this.hset.top){a("body").css("cursor","move")}else{a("body").css("cursor","pointer")}a(this.colCopy).css({top:t.pageY+10,left:t.pageX+20,display:"block"})}}}},dragEnd:function(){var i,g;if(this.colresize){i=this.colresize.n;g=this.colresize.nw;a("th:visible div:eq("+i+")",this.hDiv).css("width",g);a("tr",this.bDiv).each(function(){a("td:visible div:eq("+i+")",this).css("width",g)});this.hDiv.scrollLeft=this.bDiv.scrollLeft;a("div:eq("+i+")",this.cDrag).siblings().show();a(".dragging",this.cDrag).removeClass("dragging");this.rePosDrag();this.fixHeight();this.colresize=false}else{if(this.vresize){this.vresize=false}else{if(this.colCopy){a(this.colCopy).remove();if(this.dcolt!=null){if(this.dcoln>this.dcolt){a("th:eq("+this.dcolt+")",this.hDiv).before(this.dcol)}else{a("th:eq("+this.dcolt+")",this.hDiv).after(this.dcol)}this.switchCol(this.dcoln,this.dcolt);a(this.cdropleft).remove();a(this.cdropright).remove();this.rePosDrag()}this.dcol=null;this.hset=null;this.dcoln=null;this.dcolt=null;this.colCopy=null;a(".thMove",this.hDiv).removeClass("thMove");a(this.cDrag).show()}}}a("body").css("cursor","default");a("body").noSelect(false)},toggleCol:function(t,p){var i,s,g;i=a("th[axis='col"+t+"']",this.hDiv)[0];s=a("thead th",x.hDiv).index(i);g=a("input[value="+t+"]",x.nDiv)[0];if(p==null){p=i.hide}if(a("input:checked",x.nDiv).length<r.minColToggle&&!p){return false}if(p){i.hide=false;a(i).show();g.checked=true}else{i.hide=true;a(i).hide();g.checked=false}a("tbody tr",n).each(function(){if(p){a("td:eq("+s+")",this).show()}else{a("td:eq("+s+")",this).hide()}});this.rePosDrag();if(r.onToggleCol){r.onToggleCol(t,p)}return p},switchCol:function(i,g){a("tbody tr",n).each(function(){if(i>g){a("td:eq("+g+")",this).before(a("td:eq("+i+")",this))}else{a("td:eq("+g+")",this).after(a("td:eq("+i+")",this))}});if(i>g){a("tr:eq("+g+")",this.nDiv).before(a("tr:eq("+i+")",this.nDiv))}else{a("tr:eq("+g+")",this.nDiv).after(a("tr:eq("+i+")",this.nDiv))}if(a.browser.msie&&a.browser.version<7){a("tr:eq("+g+") input",this.nDiv)[0].checked=true}this.hDiv.scrollLeft=this.bDiv.scrollLeft},scroll:function(){this.hDiv.scrollLeft=this.bDiv.scrollLeft;this.rePosDrag()},addData:function(t){var s,E,g,D,p;if(r.preProcess){t=r.preProcess(t)}a(".pReload",this.pDiv).removeClass("loading");this.loading=false;if(!t){a(".pPageStat",this.pDiv).html(r.errormsg);return false}if(r.dataType=="xml"){r.total=+a("rows total",t).text()}else{r.total=t.total}if(r.total==0){a("tr, a, td, div",n).unbind();a(n).empty();r.pages=1;r.page=1;this.buildpager();a(".pPageStat",this.pDiv).html(r.nomsg);return false}r.pages=Math.ceil(r.total/r.rp);if(r.dataType=="xml"){r.page=+a("rows page",t).text()}else{r.page=t.page}this.buildpager();b=document.createElement("tbody");if(r.dataType=="json"){a.each(t.rows,function(F,G){s=document.createElement("tr");if(F%2&&r.striped){s.className="erow"}if(G.id){s.id="row"+G.id}a("thead tr:first th",x.hDiv).each(function(){E=document.createElement("td");g=a(this).attr("axis").substr(3);E.align=this.align;E.innerHTML=G.cell[g];a(s).append(E);E=null});if(a("thead",this.gDiv).length<1){for(g=0;g<cell.length;g++){E=document.createElement("td");E.innerHTML=G.cell[g];a(s).append(E);E=null}}a(b).append(s);s=null})}else{if(r.dataType=="xml"){p=1;a("rows row",t).each(function(){p++;s=document.createElement("tr");if(p%2&&r.striped){s.className="erow"}D=a(this).attr("id");if(D){s.id="row"+D}D=null;var i=this;a("thead tr:first th",x.hDiv).each(function(){E=document.createElement("td");g=a(this).attr("axis").substr(3);E.align=this.align;E.innerHTML=a("cell:eq("+g+")",i).text();a(s).append(E);E=null});if(a("thead",this.gDiv).length<1){a("cell",this).each(function(){E=document.createElement("td");E.innerHTML=a(this).text();a(s).append(E);E=null})}a(b).append(s);s=null;i=null})}}a("tr",n).unbind();a(n).empty();a(n).append(b);this.addCellProp();this.addRowProp();this.rePosDrag();b=null;t=null;p=null;if(r.onSuccess){r.onSuccess()}if(r.hideOnSubmit){a(x.block).remove()}this.hDiv.scrollLeft=this.bDiv.scrollLeft;if(a.browser.opera){a(n).css("visibility","visible")}if(typeof sweetTitles!="undefined"){sweetTitles.init()}},changeSort:function(g){if(this.loading){return true}a(x.nDiv).hide();a(x.nBtn).hide();if(r.sortname==a(g).attr("abbr")){if(r.sortorder=="asc"){r.sortorder="desc"}else{r.sortorder="asc"}}a(g).addClass("sorted").siblings().removeClass("sorted");a(".sdesc",this.hDiv).removeClass("sdesc");a(".sasc",this.hDiv).removeClass("sasc");a("div",g).addClass("s"+r.sortorder);r.sortname=a(g).attr("abbr");if(r.onChangeSort){r.onChangeSort(r.sortname,r.sortorder)}else{this.populate()}},buildpager:function(){var i,g,p;a(".pcontrol input",this.pDiv).val(r.page);a(".pcontrol span",this.pDiv).html(r.pages);i=(r.page-1)*r.rp+1;g=i+r.rp-1;if(r.total<g){g=r.total}p=r.pagestat;p=p.replace(/{from}/,i);p=p.replace(/{to}/,g);p=p.replace(/{total}/,r.total);a(".pPageStat",this.pDiv).html(p)},populate:function(){var i,g,p;if(this.loading){return true}if(r.onSubmit){g=r.onSubmit();if(!g){return false}}this.loading=true;if(!r.url){return false}a(".pPageStat",this.pDiv).html(r.procmsg);a(".pReload",this.pDiv).addClass("loading");a(x.block).css({top:x.bDiv.offsetTop});if(r.hideOnSubmit){a(this.gDiv).prepend(x.block)}if(a.browser.opera){a(n).css("visibility","hidden")}if(!r.newp){r.newp=1}if(r.page>r.pages){r.page=r.pages}p=[{name:"page",value:r.newp},{name:"rp",value:r.rp},{name:"sortname",value:r.sortname},{name:"sortorder",value:r.sortorder},{name:"query",value:r.query},{name:"qtype",value:r.qtype}];if(r.params){for(i=0;i<r.params.length;i++){p[p.length]=r.params[i]}}a.ajax({type:r.method,url:r.url,data:p,dataType:r.dataType,success:function(s){x.addData(s)},error:function(s){try{if(r.onError){r.onError(s)}}catch(t){}}})},doSearch:function(){r.query=a("input[name=q]",x.sDiv).val();r.qtype=a("select[name=qtype]",x.sDiv).val();r.newp=1;this.populate()},changePage:function(i){var g;if(this.loading){return true}switch(i){case"first":r.newp=1;break;case"prev":if(r.page>1){r.newp=parseInt(r.page)-1}break;case"next":if(r.page<r.pages){r.newp=parseInt(r.page)+1}break;case"last":r.newp=r.pages;break;case"input":g=parseInt(a(".pcontrol input",this.pDiv).val());if(isNaN(g)){g=1}if(g<1){g=1}else{if(g>r.pages){g=r.pages}}a(".pcontrol input",this.pDiv).val(g);r.newp=g;break}if(r.newp==r.page){return false}if(r.onChangePage){r.onChangePage(r.newp)}else{this.populate()}},addCellProp:function(){var p,t,s,i,g;a("tbody tr td",x.bDiv).each(function(){p=document.createElement("div");t=a("td",a(this).parent()).index(this);s=a("th:eq("+t+")",x.hDiv).get(0);if(s!=null){if(r.sortname==a(s).attr("abbr")&&r.sortname){this.className="sorted"}a(p).css({textAlign:s.align,width:a("div:first",s)[0].style.width});if(s.hide){a(this).css("display","none")}}if(r.nowrap==false){a(p).css("white-space","normal")}if(this.innerHTML==""){this.innerHTML="&nbsp;"}p.innerHTML=this.innerHTML;i=a(this).parent()[0];g=false;if(i.id){g=i.id.substr(3)}if(s!=null){if(s.process){s.process(p,g)}}a(this).empty().append(p).removeAttr("width")})},getCellDim:function(p){var E,g,t,G,D,i,F,s;E=parseInt(a(p).height());g=parseInt(a(p).parent().height());t=parseInt(p.style.width);G=parseInt(a(p).parent().width());D=p.offsetParent.offsetTop;i=p.offsetParent.offsetLeft;F=parseInt(a(p).css("paddingLeft"));s=parseInt(a(p).css("paddingTop"));return{ht:E,wt:t,top:D,left:i,pdl:F,pdt:s,pht:g,pwt:G}},addRowProp:function(){var g;a("tbody tr",x.bDiv).each(function(){a(this).click(function(i){g=(i.target||i.srcElement);if(g.href||g.type){return true}a(this).toggleClass("trSelected");if(r.singleSelect){a(this).siblings().removeClass("trSelected")}}).mousedown(function(i){if(i.shiftKey){a(this).toggleClass("trSelected");x.multisel=true;this.focus();a(x.gDiv).noSelect()}}).mouseup(function(){if(x.multisel){x.multisel=false;a(x.gDiv).noSelect(false)}}).hover(function(i){if(x.multisel){a(this).toggleClass("trSelected")}},function(){});if(a.browser.msie&&a.browser.version<7){a(this).hover(function(){a(this).addClass("trOver")},function(){a(this).removeClass("trOver")})}})},pager:0};if(r.colModel){y=document.createElement("thead");c=document.createElement("tr");for(v=0;v<r.colModel.length;v++){l=r.colModel[v];h=document.createElement("th");h.innerHTML=l.display;if(l.name&&l.sortable){a(h).attr("abbr",l.name)}a(h).attr("axis","col"+v);if(l.align){h.align=l.align}if(l.width){a(h).attr("width",l.width)}if(l.hide){h.hide=true}if(l.process){h.process=l.process}a(c).append(h)}a(y).append(c);a(n).prepend(y)}x.gDiv=document.createElement("div");x.mDiv=document.createElement("div");x.hDiv=document.createElement("div");x.bDiv=document.createElement("div");x.vDiv=document.createElement("div");x.rDiv=document.createElement("div");x.cDrag=document.createElement("div");x.block=document.createElement("div");x.nDiv=document.createElement("div");x.nBtn=document.createElement("div");x.iDiv=document.createElement("div");x.tDiv=document.createElement("div");x.sDiv=document.createElement("div");if(r.usepager){x.pDiv=document.createElement("div")}x.hTable=document.createElement("table");x.gDiv.className="flexigrid";if(r.width!="auto"){x.gDiv.style.width=r.width+"px"}if(a.browser.msie){a(x.gDiv).addClass("ie")}if(r.novstripe){a(x.gDiv).addClass("novstripe")}a(n).before(x.gDiv);a(x.gDiv).append(n);if(r.buttons){x.tDiv.className="tDiv";C=document.createElement("div");C.className="tDiv2";for(v=0;v<r.buttons.length;v++){k=r.buttons[v];if(!k.separator){w=document.createElement("div");w.className="fbutton";w.innerHTML="<div><span>"+k.name+"</span></div>";if(k.bclass){a("span",w).addClass(k.bclass).css({paddingLeft:20})}w.onpress=k.onpress;w.name=k.name;if(k.onpress){a(w).click(function(){this.onpress(this.name,x.gDiv)})}a(C).append(w);if(a.browser.msie&&a.browser.version<7){a(w).hover(function(){a(this).addClass("fbOver")},function(){a(this).removeClass("fbOver")})}}else{a(C).append("<div class='btnseparator'></div>")}}a(x.tDiv).append(C);a(x.tDiv).append("<div style='clear:both'></div>");a(x.gDiv).prepend(x.tDiv)}x.hDiv.className="hDiv";a(n).before(x.hDiv);x.hTable.cellPadding=0;x.hTable.cellSpacing=0;a(x.hDiv).append('<div class="hDivBox"></div>');a("div",x.hDiv).append(x.hTable);y=a("thead:first",n).get(0);if(y){a(x.hTable).append(y)}y=null;if(!r.colmodel){m=0}a("thead tr:first th",x.hDiv).each(function(){q=document.createElement("div");if(a(this).attr("abbr")){a(this).click(function(i){if(!a(this).hasClass("thOver")){return false}var g=(i.target||i.srcElement);if(g.href||g.type){return true}x.changeSort(this)});if(a(this).attr("abbr")==r.sortname){this.className="sorted";q.className="s"+r.sortorder}}if(this.hide){a(this).hide()}if(!r.colmodel){a(this).attr("axis","col"+m++)}a(q).css({textAlign:this.align,width:this.width+"px"});q.innerHTML=this.innerHTML;a(this).empty().append(q).removeAttr("width").mousedown(function(g){x.dragStart("colMove",g,this)}).hover(function(){var i,D,E,p,t,g,s;if(!x.colresize&&!a(this).hasClass("thMove")&&!x.colCopy){a(this).addClass("thOver")}if(a(this).attr("abbr")!=r.sortname&&!x.colCopy&&!x.colresize&&a(this).attr("abbr")){a("div",this).addClass("s"+r.sortorder)}else{if(a(this).attr("abbr")==r.sortname&&!x.colCopy&&!x.colresize&&a(this).attr("abbr")){D="";if(r.sortorder=="asc"){D="desc"}else{D="asc"}a("div",this).removeClass("s"+r.sortorder).addClass("s"+D)}}if(x.colCopy){E=a("th",x.hDiv).index(this);if(E==x.dcoln){return false}if(E<x.dcoln){a(this).append(x.cdropleft)}else{a(this).append(x.cdropright)}x.dcolt=E}else{if(!x.colresize){p=a("th:visible",x.hDiv).index(this);t=parseInt(a("div:eq("+p+")",x.cDrag).css("left"));g=a(x.nBtn).outerWidth();i=t-g+Math.floor(r.cgwidth/2);a(x.nDiv).hide();a(x.nBtn).hide();a(x.nBtn).css({left:i,top:a(x.hDiv).offset().top}).show();s=parseInt(a(x.nDiv).width());a(x.nDiv).css({top:a(x.bDiv).offset().top});if((i+s)>a(x.gDiv).width()){a(x.nDiv).css("left",t-s+1)}else{a(x.nDiv).css("left",i)}if(a(this).hasClass("sorted")){a(x.nBtn).addClass("srtd")}else{a(x.nBtn).removeClass("srtd")}}}},function(){var g;a(this).removeClass("thOver");if(a(this).attr("abbr")!=r.sortname){a("div",this).removeClass("s"+r.sortorder)}else{if(a(this).attr("abbr")==r.sortname){g="";if(r.sortorder=="asc"){g="desc"}else{g="asc"}a("div",this).addClass("s"+r.sortorder).removeClass("s"+g)}}if(x.colCopy){a(x.cdropleft).remove();a(x.cdropright).remove();x.dcolt=null}})});x.bDiv.className="bDiv";a(n).before(x.bDiv);a(x.bDiv).css({height:(r.height=="auto")?"auto":r.height+"px"}).scroll(function(g){x.scroll()}).append(n);if(r.height=="auto"){a("table",x.bDiv).addClass("autoht")}x.addCellProp();x.addRowProp();f=a("thead tr:first th:first",x.hDiv).get(0);if(f!=null){x.cDrag.className="cDrag";x.cdpad=0;x.cdpad+=(isNaN(parseInt(a("div",f).css("borderLeftWidth")))?0:parseInt(a("div",f).css("borderLeftWidth")));x.cdpad+=(isNaN(parseInt(a("div",f).css("borderRightWidth")))?0:parseInt(a("div",f).css("borderRightWidth")));x.cdpad+=(isNaN(parseInt(a("div",f).css("paddingLeft")))?0:parseInt(a("div",f).css("paddingLeft")));x.cdpad+=(isNaN(parseInt(a("div",f).css("paddingRight")))?0:parseInt(a("div",f).css("paddingRight")));x.cdpad+=(isNaN(parseInt(a(f).css("borderLeftWidth")))?0:parseInt(a(f).css("borderLeftWidth")));x.cdpad+=(isNaN(parseInt(a(f).css("borderRightWidth")))?0:parseInt(a(f).css("borderRightWidth")));x.cdpad+=(isNaN(parseInt(a(f).css("paddingLeft")))?0:parseInt(a(f).css("paddingLeft")));x.cdpad+=(isNaN(parseInt(a(f).css("paddingRight")))?0:parseInt(a(f).css("paddingRight")));a(x.bDiv).before(x.cDrag);a(x.cDrag).css({top:-a(x.hDiv).height()+"px"});a("thead tr:first th",x.hDiv).each(function(){var g=document.createElement("div");a(x.cDrag).append(g);if(!r.cgwidth){r.cgwidth=a(g).width()}a(g).css({height:a(x.bDiv).height()+a(x.hDiv).height()}).mousedown(function(i){x.dragStart("colresize",i,this)});if(a.browser.msie&&a.browser.version<7){x.fixHeight(a(x.gDiv).height());a(g).hover(function(){x.fixHeight();a(this).addClass("dragging")},function(){if(!x.colresize){a(this).removeClass("dragging")}})}})}if(r.striped){a("tbody tr:odd",x.bDiv).addClass("erow")}if(r.resizable&&r.height!="auto"){x.vDiv.className="vGrip";a(x.vDiv).mousedown(function(g){x.dragStart("vresize",g)}).html("<span></span>");a(x.bDiv).after(x.vDiv)}if(r.resizable&&r.width!="auto"&&!r.nohresize){x.rDiv.className="hGrip";a(x.rDiv).mousedown(function(g){x.dragStart("vresize",g,true)}).html("<span></span>").css("height",a(x.gDiv).height());if(a.browser.msie&&a.browser.version<7){a(x.rDiv).hover(function(){a(this).addClass("hgOver")},function(){a(this).removeClass("hgOver")})}a(x.gDiv).append(x.rDiv)}if(r.usepager){x.pDiv.className="pDiv";x.pDiv.innerHTML='<div class="pDiv2"></div>';a(x.bDiv).after(x.pDiv);a("div",x.pDiv).html(' <div class="pGroup"> <div class="pFirst pButton"><span></span></div><div class="pPrev pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pcontrol">Page <input type="text" size="4" value="1" /> of <span> 1 </span></span></div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pNext pButton"><span></span></div><div class="pLast pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"> <div class="pReload pButton"><span></span></div> </div> <div class="btnseparator"></div> <div class="pGroup"><span class="pPageStat"></span></div>');a(".pReload",x.pDiv).click(function(){x.populate()});a(".pFirst",x.pDiv).click(function(){x.changePage("first")});a(".pPrev",x.pDiv).click(function(){x.changePage("prev")});a(".pNext",x.pDiv).click(function(){x.changePage("next")});a(".pLast",x.pDiv).click(function(){x.changePage("last")});a(".pcontrol input",x.pDiv).keydown(function(g){if(g.keyCode==13){x.changePage("input")}});if(a.browser.msie&&a.browser.version<7){a(".pButton",x.pDiv).hover(function(){a(this).addClass("pBtnOver")},function(){a(this).removeClass("pBtnOver")})}if(r.useRp){d="";for(B=0;B<r.rpOptions.length;B++){if(r.rp==r.rpOptions[B]){u='selected="selected"'}else{u=""}d+="<option value='"+r.rpOptions[B]+"' "+u+" >"+r.rpOptions[B]+"&nbsp;&nbsp;</option>"}a(".pDiv2",x.pDiv).prepend("<div class='pGroup'><select name='rp'>"+d+"</select></div> <div class='btnseparator'></div>");a("select",x.pDiv).change(function(){if(r.onRpChange){r.onRpChange(+this.value)}else{r.newp=1;r.rp=+this.value;x.populate()}})}if(r.searchitems){a(".pDiv2",x.pDiv).prepend("<div class='pGroup'> <div class='pSearch pButton'><span></span></div> </div> <div class='btnseparator'></div>");a(".pSearch",x.pDiv).click(function(){a(x.sDiv).slideToggle("fast",function(){a(".sDiv:visible input:first",x.gDiv).trigger("focus")})});x.sDiv.className="sDiv";sitems=r.searchitems;e="";for(o=0;o<sitems.length;o++){if(r.qtype==""&&sitems[o].isdefault==true){r.qtype=sitems[o].name;u='selected="selected"'}else{u=""}e+="<option value='"+sitems[o].name+"' "+u+" >"+sitems[o].display+"&nbsp;&nbsp;</option>"}if(r.qtype==""){r.qtype=sitems[0].name}a(x.sDiv).append("<div class='sDiv2'>Quick Search <input type='text' size='30' name='q' class='qsbox' /> <select name='qtype'>"+e+"</select> <input type='button' value='Clear' /></div>");a("input[name=q],select[name=qtype]",x.sDiv).keydown(function(g){if(g.keyCode==13){x.doSearch()}});a("input[value=Clear]",x.sDiv).click(function(){a("input[name=q]",x.sDiv).val("");r.query="";x.doSearch()});a(x.bDiv).after(x.sDiv)}}a(x.pDiv,x.sDiv).append("<div style='clear:both'></div>");if(r.title){x.mDiv.className="mDiv";x.mDiv.innerHTML='<div class="ftitle">'+r.title+"</div>";a(x.gDiv).prepend(x.mDiv);if(r.showTableToggleBtn){a(x.mDiv).append('<div class="ptogtitle" title="Minimize/Maximize Table"><span></span></div>');a("div.ptogtitle",x.mDiv).click(function(){a(x.gDiv).toggleClass("hideBody");a(this).toggleClass("vsble")})}}x.cdropleft=document.createElement("span");x.cdropleft.className="cdropleft";x.cdropright=document.createElement("span");x.cdropright.className="cdropright";x.block.className="gBlock";z=a(x.bDiv).height();a(x.block).css({width:x.bDiv.style.width,height:z,background:"white",position:"relative",marginBottom:(z*-1),zIndex:1,top:x.bDiv.offsetTop,left:"0px"});a(x.block).fadeTo(0,r.blockOpacity);if(a("th",x.hDiv).length){x.nDiv.className="nDiv";x.nDiv.innerHTML="<table cellpadding='0' cellspacing='0'><tbody></tbody></table>";a(x.nDiv).css({marginBottom:(z*-1),display:"none",top:x.bDiv.offsetTop}).noSelect();j=0;a("th div",x.hDiv).each(function(){var i,g;i=a("th[axis='col"+j+"']",x.hDiv)[0];g='checked="checked"';if(i.style.display=="none"){g=""}a("tbody",x.nDiv).append('<tr><td class="ndcol1"><input type="checkbox" '+g+' class="togCol" value="'+j+'" /></td><td class="ndcol2">'+this.innerHTML+"</td></tr>");j++});if(a.browser.msie&&a.browser.version<7){a("tr",x.nDiv).hover(function(){a(this).addClass("ndcolover")},function(){a(this).removeClass("ndcolover")})}a("td.ndcol2",x.nDiv).click(function(){if(a("input:checked",x.nDiv).length<=r.minColToggle&&a(this).prev().find("input")[0].checked){return false}return x.toggleCol(a(this).prev().find("input").val())});a("input.togCol",x.nDiv).click(function(){if(a("input:checked",x.nDiv).length<r.minColToggle&&this.checked==false){return false}a(this).parent().next().trigger("click")});a(x.gDiv).prepend(x.nDiv);a(x.nBtn).addClass("nBtn").html("<div></div>").attr("title","Hide/Show Columns").click(function(){a(x.nDiv).toggle();return true});if(r.showToggleBtn){a(x.gDiv).prepend(x.nBtn)}}a(x.iDiv).addClass("iDiv").css({display:"none"});a(x.bDiv).append(x.iDiv);a(x.bDiv).hover(function(){a(x.nDiv).hide();a(x.nBtn).hide()},function(){if(x.multisel){x.multisel=false}});a(x.gDiv).hover(function(){},function(){a(x.nDiv).hide();a(x.nBtn).hide()});a(document).mousemove(function(g){x.dragMove(g)}).mouseup(function(g){x.dragEnd()}).hover(function(){},function(){x.dragEnd()});if(a.browser.msie&&a.browser.version<7){a(".hDiv,.bDiv,.mDiv,.pDiv,.vGrip,.tDiv, .sDiv",x.gDiv).css({width:"100%"});a(x.gDiv).addClass("ie6");if(r.width!="auto"){a(x.gDiv).addClass("ie6fullwidthbug")}}x.rePosDrag();x.fixHeight();n.p=r;n.grid=x;if(r.url&&r.autoload){x.populate()}return n};docloaded=false;a(document).ready(function(){docloaded=true});a.fn.flexigrid=function(b){return this.each(function(){if(docloaded===false){a(this).hide();var c=this;a(document).ready(function(){a.addFlex(c,b)})}else{a.addFlex(this,b)}})};a.fn.flexReload=function(b){return this.each(function(){if(this.grid&&this.p.url){this.grid.populate()}})};a.fn.flexOptions=function(b){return this.each(function(){if(this.grid){a.extend(this.p,b)}})};a.fn.flexToggleCol=function(c,b){return this.each(function(){if(this.grid){this.grid.toggleCol(c,b)}})};a.fn.flexAddData=function(b){return this.each(function(){if(this.grid){this.grid.addData(b)}})};a.fn.noSelect=function(b){if(b==null){prevent=true}else{prevent=b}if(prevent){return this.each(function(){if(a.browser.msie||a.browser.safari){a(this).bind("selectstart",function(){return false})}else{if(a.browser.mozilla){a(this).css("MozUserSelect","none");a("body").trigger("focus")}else{if(a.browser.opera){a(this).bind("mousedown",function(){return false})}else{a(this).attr("unselectable","on")}}}})}else{return this.each(function(){if(a.browser.msie||a.browser.safari){a(this).unbind("selectstart")}else{if(a.browser.mozilla){a(this).css("MozUserSelect","inherit")}else{if(a.browser.opera){a(this).unbind("mousedown")}else{a(this).removeAttr("unselectable","on")}}}})}}})(jQuery);
diff --git a/web/public/robots.txt b/web/public/robots.txt
index 1f53798..2d178f8 100644
--- a/web/public/robots.txt
+++ b/web/public/robots.txt
@@ -1,2 +1,3 @@
User-agent: *
Disallow: /
+Disallow: /download
diff --git a/web/views/layout.erb b/web/views/layout.erb
index 0545b9d..a0e9d28 100644
--- a/web/views/layout.erb
+++ b/web/views/layout.erb
@@ -8,8 +8,7 @@
<link rel="stylesheet" type="text/css" href="/css/flexigrid/flexigrid.css" />
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.7.2.all.min.js"></script>
-<!-- <script type="text/javascript" src="/js/flexigrid.pack.js"></script>-->
- <script type="text/javascript" src="/js/flexigrid.js"></script>
+ <script type="text/javascript" src="/js/flexigrid-minified.js"></script>
<script type="text/javascript" src="/js/taginfo.js"></script>
<script type="text/javascript" src="/js/protovis-r3.2.js"></script>
</head>