compass-jquery-plugin 0.3.2.0 → 0.3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -245,6 +245,7 @@ jQuery Plugins included:
245
245
  * Brandon Aaron and Fabrizio Balliano for [jQuery Mousewheel Plugin][21]
246
246
  * Yehuda Katz for [jQuery Offline Plugin][34]
247
247
  * Andreas Eberhard for [jQuery PngFix Plugin][22] (for IE)
248
+ * "Cowboy" Ben Alman for [jQuery replaceText Plugin][36]
248
249
  * Mikael Soederstroem for [jQuery Ribbon Plugin][23]
249
250
  * Gareth Watts from Splunk Inc for [jQuery Sparklines plugin][24]
250
251
  * Denis Howlett for [jQuery Table Drag and Drop Plugin][25]
@@ -313,4 +314,5 @@ Copyright © 2009-2011 Kosmas Schuetz. See LICENSE for details.
313
314
  [33]: http://github.com/rubyredrick/ri_cal/
314
315
  [34]: http://github.com/wycats/jquery-offline
315
316
  [35]: http://github.com/brandonaaron/jquery-mousewheel
317
+ [36]: http://github.com/cowboy/jquery-replacetext
316
318
 
data/VERSION.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  :commit:
3
- :state: 0
3
+ :state: 1
4
4
  :tiny: 2
5
5
  :minor: 3
6
6
  :major: 0
@@ -3660,7 +3660,7 @@ AnyTime.picker = function( id, options )
3660
3660
  //
3661
3661
  // END OF FILE
3662
3662
  //
3663
- if(window.location.hostname.length&&(window.location.hostname!='www.ama3.com')&&(window.location.hostname!='dev2.ama3.com'))alert('REMOVE THE LAST LINE FROM anytime.js!');
3663
+
3664
3664
 
3665
3665
  /*****************************************************************************
3666
3666
  * FILE: anytimetz.js - The Any+Time(TM) JavaScript Library
@@ -3910,7 +3910,7 @@ AnyTime.utcLabel[840]=[
3910
3910
  //
3911
3911
  //END OF FILE
3912
3912
  //
3913
- if(window.location.hostname.length&&(window.location.hostname!='www.ama3.com'))alert('REMOVE THE LAST LINE FROM anytimetz.js!');
3913
+
3914
3914
 
3915
3915
  /**
3916
3916
  * @preserve
@@ -113,17 +113,16 @@ if(W>j)j=W}if(this.dM){W=this.dM.outerWidth(true);ga+=W+1;W=this.dM.AnyTime_heig
113
113
  else{d(this).AnyTime_current(false,true);if(c==null)c=d(this)}else d(this).AnyTime_current(false,true)});!b&&c!=null&&c.AnyTime_current(true,true);this.conv.setUtcFormatOffsetAlleged(this.offMin);this.conv.setUtcFormatOffsetSubIndex(this.offSI);this.inp.val(this.conv.format(this.time)).change();this.upd(g)},updYDiv:function(g){var b,c,z=1,Y=this.time.getFullYear();if(Y<0){z=-1;Y=0-Y}Y=AnyTime.pad(Y,4);var ba=H.earliest&&(new Date(H.earliest)).getFullYear(),qa=H.latest&&(new Date(H.latest)).getFullYear();
114
114
  b=0;this.yDiv.find(".AnyTime-mil-btn").each(function(){c=(!H.earliest||z*(b+(z<0?0:999))>=ba)&&(!H.latest||z*(b+(z>0?0:999))<=qa);d(this).AnyTime_current(this.innerHTML==Y.substring(0,1),c);b+=1E3});b=Math.floor(Y/1E3)*1E3;this.yDiv.find(".AnyTime-cent-btn").each(function(){c=(!H.earliest||z*(b+(z<0?0:99))>=ba)&&(!H.latest||z*(b+(z>0?0:99))<=qa);d(this).AnyTime_current(this.innerHTML==Y.substring(1,2),c);b+=100});b=Math.floor(Y/100)*100;this.yDiv.find(".AnyTime-dec-btn").each(function(){c=(!H.earliest||
115
115
  z*(b+(z<0?0:9))>=ba)&&(!H.latest||z*(b+(z>0?0:9))<=qa);d(this).AnyTime_current(this.innerHTML==Y.substring(2,3),c);b+=10});b=Math.floor(Y/10)*10;this.yDiv.find(".AnyTime-yr-btn").each(function(){c=(!H.earliest||z*b>=ba)&&(!H.latest||z*b<=qa);d(this).AnyTime_current(this.innerHTML==Y.substring(3),c);b+=1});this.yDiv.find(".AnyTime-bce-btn").each(function(){d(this).AnyTime_current(z<0,!H.earliest||H.earliest<0)});this.yDiv.find(".AnyTime-ce-btn").each(function(){d(this).AnyTime_current(z>0,!H.latest||
116
- H.latest>0)});this.conv.setUtcFormatOffsetAlleged(this.offMin);this.conv.setUtcFormatOffsetSubIndex(this.offSI);this.inp.val(this.conv.format(this.time)).change();this.upd(g)}};Oa[na].initialize(na)}})(jQuery);window.location.hostname.length&&window.location.hostname!="www.ama3.com"&&window.location.hostname!="dev2.ama3.com"&&alert("REMOVE THE LAST LINE FROM anytime.js!");AnyTime.utcLabel=[];AnyTime.utcLabel[-720]=["BIT--Baker Island Time"];AnyTime.utcLabel[-660]=["SST--Samoa Standard Time"];
117
- AnyTime.utcLabel[-600]=["CKT--Cook Island Time","HAST--Hawaii-Aleutian Standard Time","TAHT--Tahiti Time"];AnyTime.utcLabel[-540]=["AKST--Alaska Standard Time","GIT--Gambier Island Time"];AnyTime.utcLabel[-510]=["MIT--Marquesas Islands Time"];AnyTime.utcLabel[-480]=["CIST--Clipperton Island Standard Time","PST--Pacific Standard Time (North America)"];AnyTime.utcLabel[-420]=["MST--Mountain Standard Time (North America)","PDT--Pacific Daylight Time (North America)"];
118
- AnyTime.utcLabel[-360]=["CST--Central Standard Time (North America)","EAST--Easter Island Standard Time","GALT--Galapagos Time","MDT--Mountain Daylight Time (North America)"];AnyTime.utcLabel[-300]=["CDT--Central Daylight Time (North America)","COT--Colombia Time","ECT--Ecuador Time","EST--Eastern Standard Time (North America)"];
119
- AnyTime.utcLabel[-240]=["AST--Atlantic Standard Time","BOT--Bolivia Time","CLT--Chile Standard Time","COST--Colombia Summer Time","ECT--Eastern Caribbean Time","EDT--Eastern Daylight Time (North America)","FKST--Falkland Islands Standard Time","GYT--Guyana Time"];AnyTime.utcLabel[-210]=["VET--Venezuelan Standard Time"];AnyTime.utcLabel[-180]=["ART--Argentina Time","BRT--Brasilia Time","CLST--Chile Summer Time","GFT--French Guiana Time","UYT--Uruguay Standard Time"];AnyTime.utcLabel[-150]=["NT--Newfoundland Time"];
120
- AnyTime.utcLabel[-120]=["GST--South Georgia and the South Sandwich Islands","UYST--Uruguay Summer Time"];AnyTime.utcLabel[-90]=["NDT--Newfoundland Daylight Time"];AnyTime.utcLabel[-60]=["AZOST--Azores Standard Time","CVT--Cape Verde Time"];AnyTime.utcLabel[0]=["GMT--Greenwich Mean Time","WET--Western European Time"];AnyTime.utcLabel[60]=["BST--British Summer Time","CET--Central European Time"];AnyTime.utcLabel[60]=["WAT--West Africa Time","WEST--Western European Summer Time"];
121
- AnyTime.utcLabel[120]=["CAT--Central Africa Time","CEST--Central European Summer Time","EET--Eastern European Time","IST--Israel Standard Time","SAST--South African Standard Time"];AnyTime.utcLabel[180]=["AST--Arab Standard Time (Kuwait/Riyadh)","AST--Arabic Standard Time (Baghdad)","EAT--East Africa Time","EEST--Eastern European Summer Time","MSK--Moscow Standard Time"];AnyTime.utcLabel[210]=["IRST--Iran Standard Time"];
122
- AnyTime.utcLabel[240]=["AMT--Armenia Time","AST--Arabian Standard Time (Abu Dhabi/Muscat)","AZT--Azerbaijan Time","GET--Georgia Standard Time","MUT--Mauritius Time","RET--Réunion Time","SAMT--Samara Time","SCT--Seychelles Time"];AnyTime.utcLabel[270]=["AFT--Afghanistan Time"];AnyTime.utcLabel[300]=["AMST--Armenia Summer Time","HMT--Heard and McDonald Islands Time","PKT--Pakistan Standard Time","YEKT--Yekaterinburg Time"];AnyTime.utcLabel[330]=["IST--Indian Standard Time","SLT--Sri Lanka Time"];
123
- AnyTime.utcLabel[345]=["NPT--Nepal Time"];AnyTime.utcLabel[360]=["BIOT--British Indian Ocean Time","BST--Bangladesh Standard Time","BTT--Bhutan Time","OMST--Omsk Time"];AnyTime.utcLabel[390]=["CCT--Cocos Islands Time","MST--Myanmar Standard Time"];AnyTime.utcLabel[420]=["CXT--Christmas Island Time","KRAT--Krasnoyarsk Time","THA--Thailand Standard Time"];
124
- AnyTime.utcLabel[480]=["ACT--ASEAN Common Time","AWST--Australian Western Standard Time","BDT--Brunei Time","CST--China Standard Time","HKT--Hong Kong Time","IRKT--Irkutsk Time","MST--Malaysian Standard Time","PST--Philippine Standard Time","SST--Singapore Standard Time"];AnyTime.utcLabel[540]=["JST--Japan Standard Time","KST--Korea Standard Time","YAKT--Yakutsk Time"];AnyTime.utcLabel[570]=["ACST--Australian Central Standard Time"];
125
- AnyTime.utcLabel[600]=["AEST--Australian Eastern Standard Time","ChST--Chamorro Standard Time","VLAT--Vladivostok Time"];AnyTime.utcLabel[630]=["LHST--Lord Howe Standard Time"];AnyTime.utcLabel[660]=["MAGT--Magadan Time","SBT--Solomon Islands Time"];AnyTime.utcLabel[690]=["NFT--Norfolk Time"];AnyTime.utcLabel[720]=["FJT--Fiji Time","GILT--Gilbert Island Time","PETT--Kamchatka Time"];AnyTime.utcLabel[765]=["CHAST--Chatham Standard Time"];AnyTime.utcLabel[780]=["PHOT--Phoenix Island Time"];
126
- AnyTime.utcLabel[840]=["LINT--Line Islands Time"];window.location.hostname.length&&window.location.hostname!="www.ama3.com"&&alert("REMOVE THE LAST LINE FROM anytimetz.js!");
116
+ H.latest>0)});this.conv.setUtcFormatOffsetAlleged(this.offMin);this.conv.setUtcFormatOffsetSubIndex(this.offSI);this.inp.val(this.conv.format(this.time)).change();this.upd(g)}};Oa[na].initialize(na)}})(jQuery);AnyTime.utcLabel=[];AnyTime.utcLabel[-720]=["BIT--Baker Island Time"];AnyTime.utcLabel[-660]=["SST--Samoa Standard Time"];AnyTime.utcLabel[-600]=["CKT--Cook Island Time","HAST--Hawaii-Aleutian Standard Time","TAHT--Tahiti Time"];AnyTime.utcLabel[-540]=["AKST--Alaska Standard Time","GIT--Gambier Island Time"];
117
+ AnyTime.utcLabel[-510]=["MIT--Marquesas Islands Time"];AnyTime.utcLabel[-480]=["CIST--Clipperton Island Standard Time","PST--Pacific Standard Time (North America)"];AnyTime.utcLabel[-420]=["MST--Mountain Standard Time (North America)","PDT--Pacific Daylight Time (North America)"];AnyTime.utcLabel[-360]=["CST--Central Standard Time (North America)","EAST--Easter Island Standard Time","GALT--Galapagos Time","MDT--Mountain Daylight Time (North America)"];
118
+ AnyTime.utcLabel[-300]=["CDT--Central Daylight Time (North America)","COT--Colombia Time","ECT--Ecuador Time","EST--Eastern Standard Time (North America)"];AnyTime.utcLabel[-240]=["AST--Atlantic Standard Time","BOT--Bolivia Time","CLT--Chile Standard Time","COST--Colombia Summer Time","ECT--Eastern Caribbean Time","EDT--Eastern Daylight Time (North America)","FKST--Falkland Islands Standard Time","GYT--Guyana Time"];AnyTime.utcLabel[-210]=["VET--Venezuelan Standard Time"];
119
+ AnyTime.utcLabel[-180]=["ART--Argentina Time","BRT--Brasilia Time","CLST--Chile Summer Time","GFT--French Guiana Time","UYT--Uruguay Standard Time"];AnyTime.utcLabel[-150]=["NT--Newfoundland Time"];AnyTime.utcLabel[-120]=["GST--South Georgia and the South Sandwich Islands","UYST--Uruguay Summer Time"];AnyTime.utcLabel[-90]=["NDT--Newfoundland Daylight Time"];AnyTime.utcLabel[-60]=["AZOST--Azores Standard Time","CVT--Cape Verde Time"];AnyTime.utcLabel[0]=["GMT--Greenwich Mean Time","WET--Western European Time"];
120
+ AnyTime.utcLabel[60]=["BST--British Summer Time","CET--Central European Time"];AnyTime.utcLabel[60]=["WAT--West Africa Time","WEST--Western European Summer Time"];AnyTime.utcLabel[120]=["CAT--Central Africa Time","CEST--Central European Summer Time","EET--Eastern European Time","IST--Israel Standard Time","SAST--South African Standard Time"];
121
+ AnyTime.utcLabel[180]=["AST--Arab Standard Time (Kuwait/Riyadh)","AST--Arabic Standard Time (Baghdad)","EAT--East Africa Time","EEST--Eastern European Summer Time","MSK--Moscow Standard Time"];AnyTime.utcLabel[210]=["IRST--Iran Standard Time"];AnyTime.utcLabel[240]=["AMT--Armenia Time","AST--Arabian Standard Time (Abu Dhabi/Muscat)","AZT--Azerbaijan Time","GET--Georgia Standard Time","MUT--Mauritius Time","RET--Réunion Time","SAMT--Samara Time","SCT--Seychelles Time"];AnyTime.utcLabel[270]=["AFT--Afghanistan Time"];
122
+ AnyTime.utcLabel[300]=["AMST--Armenia Summer Time","HMT--Heard and McDonald Islands Time","PKT--Pakistan Standard Time","YEKT--Yekaterinburg Time"];AnyTime.utcLabel[330]=["IST--Indian Standard Time","SLT--Sri Lanka Time"];AnyTime.utcLabel[345]=["NPT--Nepal Time"];AnyTime.utcLabel[360]=["BIOT--British Indian Ocean Time","BST--Bangladesh Standard Time","BTT--Bhutan Time","OMST--Omsk Time"];AnyTime.utcLabel[390]=["CCT--Cocos Islands Time","MST--Myanmar Standard Time"];
123
+ AnyTime.utcLabel[420]=["CXT--Christmas Island Time","KRAT--Krasnoyarsk Time","THA--Thailand Standard Time"];AnyTime.utcLabel[480]=["ACT--ASEAN Common Time","AWST--Australian Western Standard Time","BDT--Brunei Time","CST--China Standard Time","HKT--Hong Kong Time","IRKT--Irkutsk Time","MST--Malaysian Standard Time","PST--Philippine Standard Time","SST--Singapore Standard Time"];AnyTime.utcLabel[540]=["JST--Japan Standard Time","KST--Korea Standard Time","YAKT--Yakutsk Time"];
124
+ AnyTime.utcLabel[570]=["ACST--Australian Central Standard Time"];AnyTime.utcLabel[600]=["AEST--Australian Eastern Standard Time","ChST--Chamorro Standard Time","VLAT--Vladivostok Time"];AnyTime.utcLabel[630]=["LHST--Lord Howe Standard Time"];AnyTime.utcLabel[660]=["MAGT--Magadan Time","SBT--Solomon Islands Time"];AnyTime.utcLabel[690]=["NFT--Norfolk Time"];AnyTime.utcLabel[720]=["FJT--Fiji Time","GILT--Gilbert Island Time","PETT--Kamchatka Time"];AnyTime.utcLabel[765]=["CHAST--Chatham Standard Time"];
125
+ AnyTime.utcLabel[780]=["PHOT--Phoenix Island Time"];AnyTime.utcLabel[840]=["LINT--Line Islands Time"];
127
126
  (function(d,ma){function Ja(a){d.extend(true,ab,a)}function $a(a,e,f){function r(){setTimeout(function(){!N.start&&d("body")[0].offsetWidth!==0&&y()},0)}function p(h){if(!N||h!=N.name){ua++;ra();var x=N,v;if(x){(x.beforeHide||mb)();db($,$.height());x.element.hide()}else db($,1);$.css("overflow","hidden");if(N=Aa[h])N.element.show();else N=Aa[h]=new Ua[h](v=Da=d("<div class='fc-view fc-view-"+h+"' style='position:absolute'/>").appendTo($),P);x&&C.deactivateButton(x.name);C.activateButton(h);y();$.css("overflow",
128
127
  "");x&&db($,1);v||(N.afterShow||mb)();ua--}}function y(h){if(D.offsetWidth!==0){ua++;ra();Ka===ma&&l();var x=false;if(!N.start||h||va<N.start||va>=N.end){N.render(va,h||0);m(true);x=true}else if(N.sizeDirty){N.clearEvents();m();x=true}else if(N.eventsDirty){N.clearEvents();x=true}N.sizeDirty=false;N.eventsDirty=false;h=x;if(!e.lazyFetching||n(N.visStart,N.visEnd))S();else h&&U();Ga=a.outerWidth();C.updateTitle(N.title);h=new Date;h>=N.start&&h<N.end?C.disableButton("today"):C.enableButton("today");
129
128
  ua--;N.trigger("viewDisplay",D)}}function A(){w();if(D.offsetWidth!==0){l();m();ra();N.clearEvents();N.renderEvents(Q);N.sizeDirty=false}}function w(){d.each(Aa,function(h,x){x.sizeDirty=true})}function l(){Ka=e.contentHeight?e.contentHeight:e.height?e.height-(X?X.height():0)-eb($[0]):Math.round($.width()/Math.max(e.aspectRatio,0.5))}function m(h){ua++;N.setHeight(Ka,h);if(Da){Da.css("position","relative");Da=null}N.setWidth($.width(),h);ua--}function M(){if(!ua)if(N.start){var h=++ja;setTimeout(function(){if(h==
@@ -827,7 +827,7 @@ $.extend($.jgrid,{
827
827
  if ( typeof expr === 'string' ) {
828
828
  prm = expr.split('.');
829
829
  }
830
- i = prm.length;
830
+ i = prm.length;
831
831
  if( i ) {
832
832
  ret = obj;
833
833
  while (ret && i--) {
@@ -904,7 +904,7 @@ $.extend($.jgrid,{
904
904
  if(!_usecase){
905
905
  phrase=phrase.toLowerCase();
906
906
  }
907
- phrase=phrase.toString().replace(new RegExp('\\"',"g"),'\\"');
907
+ phrase=phrase.toString().replace(/\\/g,'\\\\').replace(/\"/g,'\\"')
908
908
  return phrase;
909
909
  };
910
910
  this._funcLoop=function(func){
@@ -1475,7 +1475,7 @@ $.fn.jqGrid = function( pin ) {
1475
1475
  var tbot = ttop + table.height();
1476
1476
  var div = rh * rn;
1477
1477
  var page, npage, empty;
1478
- if ( tbot < dh && ttop <= 0 &&
1478
+ if ( tbot < dh && ttop <= 0 &&
1479
1479
  (p.lastpage===undefined||parseInt((tbot + scrollTop + div - 1) / div,10) <= p.lastpage))
1480
1480
  {
1481
1481
  npage = parseInt((dh - tbot + div - 1) / div,10);
@@ -1697,7 +1697,7 @@ $.fn.jqGrid = function( pin ) {
1697
1697
  ts.p.data = [];
1698
1698
  ts.p._index = {};
1699
1699
  ts.p.localReader.id = xmlid = "_id_";
1700
- }
1700
+ }
1701
1701
  ts.p.reccount = 0;
1702
1702
  if($.isXMLDoc(xml)) {
1703
1703
  if(ts.p.treeANode===-1 && !ts.p.scroll) {
@@ -1816,7 +1816,7 @@ $.fn.jqGrid = function( pin ) {
1816
1816
  if(ts.p.grouping) {
1817
1817
  $(ts).jqGrid('groupingRender',grpdata,ts.p.colModel.length);
1818
1818
  grpdata = null;
1819
- } else {
1819
+ } else {
1820
1820
  $("tbody:first",t).append(rowData.join(''));
1821
1821
  }
1822
1822
  }
@@ -1867,7 +1867,7 @@ $.fn.jqGrid = function( pin ) {
1867
1867
  rcnt=1;
1868
1868
  } else { rcnt = rcnt > 1 ? rcnt :1; }
1869
1869
  } else { return; }
1870
-
1870
+
1871
1871
  var dReader, locid, frd,
1872
1872
  locdata = (ts.p.datatype != "local" && ts.p.loadonce) || ts.p.datatype == "jsonstring";
1873
1873
  if(locdata) { ts.p.data = []; ts.p._index = {}; locid = ts.p.localReader.id = "_id_";}
@@ -1933,7 +1933,7 @@ $.fn.jqGrid = function( pin ) {
1933
1933
  gi = 1;
1934
1934
  }
1935
1935
  if (ts.p.subGrid) {
1936
- rowData.push( $(ts).jqGrid("addSubGridCell",gi+ni,i+rcnt) );
1936
+ rowData.push( $(ts).jqGrid("addSubGridCell",gi+ni,i+rcnt) );
1937
1937
  si= 1;
1938
1938
  }
1939
1939
  if (dReader.repeatitems) {
@@ -2010,7 +2010,7 @@ $.fn.jqGrid = function( pin ) {
2010
2010
  ccur2=null;
2011
2011
  }
2012
2012
  }
2013
- }
2013
+ }
2014
2014
  if(cur) {
2015
2015
  if (dReader.repeatitems) {
2016
2016
  if(dReader.cell) {cur = $.jgrid.getAccessor(cur,dReader.cell);}
@@ -2089,7 +2089,7 @@ $.fn.jqGrid = function( pin ) {
2089
2089
  'ew':function(queryObj) {return queryObj.endsWith;},
2090
2090
  'ni':function(queryObj) {return queryObj.not().equals;},
2091
2091
  'in':function(queryObj) {return queryObj.equals;}
2092
-
2092
+
2093
2093
  },
2094
2094
  query = $.jgrid.from(ts.p.data);
2095
2095
  if (ts.p.ignoreCase) { query = query.ignoreCase(); }
@@ -2157,7 +2157,7 @@ $.fn.jqGrid = function( pin ) {
2157
2157
  var height = parseInt(ts.p.records,10) * rh;
2158
2158
  $(">div:first",ts.grid.bDiv).css({height : height}).children("div:first").css({height:top,display:top?"":"none"});
2159
2159
  }
2160
- ts.grid.bDiv.scrollLeft = ts.grid.hDiv.scrollLeft;
2160
+ ts.grid.bDiv.scrollLeft = ts.grid.hDiv.scrollLeft;
2161
2161
  }
2162
2162
  pgboxes = ts.p.pager ? ts.p.pager : "";
2163
2163
  pgboxes += ts.p.toppager ? (pgboxes ? "," + ts.p.toppager : ts.p.toppager) : "";
@@ -2169,7 +2169,7 @@ $.fn.jqGrid = function( pin ) {
2169
2169
  if(ts.p.pginput===true) {
2170
2170
  $('.ui-pg-input',pgboxes).val(ts.p.page);
2171
2171
  $('#sp_1',pgboxes).html($.fmatter ? $.fmatter.util.NumberFormat(ts.p.lastpage,fmt):ts.p.lastpage);
2172
-
2172
+
2173
2173
  }
2174
2174
  if (ts.p.viewrecords){
2175
2175
  if(ts.p.reccount === 0) {
@@ -2279,7 +2279,7 @@ $.fn.jqGrid = function( pin ) {
2279
2279
  }
2280
2280
  }
2281
2281
  $.extend(ts.p.postData,prm);
2282
- var rcnt = !ts.p.scroll ? 1 : ts.rows.length-1;
2282
+ var rcnt = !ts.p.scroll ? 1 : ts.rows.length-1;
2283
2283
  if ($.isFunction(ts.p.datatype)) { ts.p.datatype.call(ts,ts.p.postData,"load_"+ts.p.id); return;}
2284
2284
  else if($.isFunction(ts.p.beforeRequest)) {ts.p.beforeRequest.call(ts);}
2285
2285
  dt = ts.p.datatype.toLowerCase();
@@ -2364,7 +2364,7 @@ $.fn.jqGrid = function( pin ) {
2364
2364
  pgid = pgid.substr(1);
2365
2365
  pgcnt = "pg_"+pgid;
2366
2366
  lft = pgid+"_left"; cent = pgid+"_center"; rgt = pgid+"_right";
2367
- $("#"+pgid)
2367
+ $("#"+$.jgrid.jqID(pgid) )
2368
2368
  .append("<div id='"+pgcnt+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+lft+"' align='left'></td><td id='"+cent+"' align='center' style='white-space:pre;'></td><td id='"+rgt+"' align='right'></td></tr></tbody></table></div>")
2369
2369
  .attr("dir","ltr"); //explicit setting
2370
2370
  if(ts.p.rowList.length >0){
@@ -2401,7 +2401,7 @@ $.fn.jqGrid = function( pin ) {
2401
2401
  ts.p._nvtd[0] = twd ? Math.floor((ts.p.width - twd)/2) : Math.floor(ts.p.width/3);
2402
2402
  ts.p._nvtd[1] = 0;
2403
2403
  pgl=null;
2404
- $('.ui-pg-selbox',"#"+pgcnt).bind('change',function() {
2404
+ $('.ui-pg-selbox',"#"+pgcnt).bind('change',function() {
2405
2405
  ts.p.page = Math.round(ts.p.rowNum*(ts.p.page-1)/this.value-0.5)+1;
2406
2406
  ts.p.rowNum = this.value;
2407
2407
  if(tp) { $('.ui-pg-selbox',ts.p.pager).val(this.value); }
@@ -2431,13 +2431,13 @@ $.fn.jqGrid = function( pin ) {
2431
2431
  fp=true, pp=true, np=true,lp=true;
2432
2432
  if(last ===0 || last===1) {fp=false;pp=false;np=false;lp=false; }
2433
2433
  else if( last>1 && cp >=1) {
2434
- if( cp === 1) { fp=false; pp=false; }
2434
+ if( cp === 1) { fp=false; pp=false; }
2435
2435
  else if( cp>1 && cp <last){ }
2436
2436
  else if( cp===last){ np=false;lp=false; }
2437
2437
  } else if( last>1 && cp===0 ) { np=false;lp=false; cp=last-1;}
2438
- if( this.id === 'first'+tp && fp ) { ts.p.page=1; selclick=true;}
2439
- if( this.id === 'prev'+tp && pp) { ts.p.page=(cp-1); selclick=true;}
2440
- if( this.id === 'next'+tp && np) { ts.p.page=(cp+1); selclick=true;}
2438
+ if( this.id === 'first'+tp && fp ) { ts.p.page=1; selclick=true;}
2439
+ if( this.id === 'prev'+tp && pp) { ts.p.page=(cp-1); selclick=true;}
2440
+ if( this.id === 'next'+tp && np) { ts.p.page=(cp+1); selclick=true;}
2441
2441
  if( this.id === 'last'+tp && lp) { ts.p.page=last; selclick=true;}
2442
2442
  if(selclick) {
2443
2443
  if(!clearVals(this.id)) { return false; }
@@ -2657,7 +2657,7 @@ $.fn.jqGrid = function( pin ) {
2657
2657
  id: "id",
2658
2658
  userdata: "userdata",
2659
2659
  subgrid: {root:"rows", repeatitems: true, cell:"cell"}
2660
- },ts.p.localReader);
2660
+ },ts.p.localReader);
2661
2661
  if(ts.p.scroll){
2662
2662
  ts.p.pgbuttons = false; ts.p.pginput=false; ts.p.rowList=[];
2663
2663
  }
@@ -2687,7 +2687,7 @@ $.fn.jqGrid = function( pin ) {
2687
2687
  if(typeof(ts.p.colModel[i].title) !== "boolean") { ts.p.colModel[i].title = true; }
2688
2688
  if (idn == ts.p.sortname) {
2689
2689
  ts.p.lastsort = i;
2690
- }
2690
+ }
2691
2691
  thead += imgs+"</div></th>";
2692
2692
  }
2693
2693
  thead += "</tr></thead>";
@@ -2728,7 +2728,7 @@ $.fn.jqGrid = function( pin ) {
2728
2728
  if($.isFunction(ts.p.onSelectAll)) {ts.p.onSelectAll.call(ts, chk ? ts.p.selarrrow : emp,chk);}
2729
2729
  });
2730
2730
  }
2731
-
2731
+
2732
2732
  if(ts.p.autowidth===true) {
2733
2733
  var pw = $(eg).innerWidth();
2734
2734
  ts.p.width = pw > 0? pw: 'nw';
@@ -2791,7 +2791,7 @@ $.fn.jqGrid = function( pin ) {
2791
2791
  if (t.length != 1) { return; }
2792
2792
  var ci = $.jgrid.getCellIndex(this);
2793
2793
  if (!ts.p.viewsortcols[2]) { r=true;d=t.attr("sort"); }
2794
- sortData($('div',this)[0].id,ci,r,d);
2794
+ sortData( $('div',this)[0].id, ci, r, d);
2795
2795
  return false;
2796
2796
  });
2797
2797
  if (ts.p.sortable && $.fn.sortable) {
@@ -3191,7 +3191,7 @@ $.jgrid.extend({
3191
3191
  if(getall) { ind = $t.rows[j]; }
3192
3192
  if( $(ind).hasClass('jqgrow') ) {
3193
3193
  $('td',ind).each( function(i) {
3194
- nm = $t.p.colModel[i].name;
3194
+ nm = $t.p.colModel[i].name;
3195
3195
  if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
3196
3196
  if($t.p.treeGrid===true && nm == $t.p.ExpandColumn) {
3197
3197
  res[nm] = $.jgrid.htmlDecode($("span:first",this).html());
@@ -3227,7 +3227,7 @@ $.jgrid.extend({
3227
3227
  if($t.p.multiselect) {
3228
3228
  ia = $.inArray(rowid,$t.p.selarrrow);
3229
3229
  if(ia != -1) { $t.p.selarrrow.splice(ia,1);}
3230
- }
3230
+ }
3231
3231
  if(rowid == $t.p.selrow) {$t.p.selrow=null;}
3232
3232
  }
3233
3233
  if($t.p.datatype == 'local') {
@@ -3265,7 +3265,7 @@ $.jgrid.extend({
3265
3265
  if(t.p.treeGrid===true && nm == t.p.ExpandColumn) {
3266
3266
  $("td:eq("+i+") > span:first",ind).html(vl).attr(title);
3267
3267
  } else {
3268
- $("td:eq("+i+")",ind).html(vl).attr(title);
3268
+ $("td:eq("+i+")",ind).html(vl).attr(title);
3269
3269
  }
3270
3270
  }
3271
3271
  });
@@ -3346,7 +3346,7 @@ $.jgrid.extend({
3346
3346
  }
3347
3347
  row = "<tr id=\""+rowid+"\" role=\"row\" class=\"ui-widget-content jqgrow ui-row-"+t.p.direction+" "+cna+"\">" + row+"</tr>";
3348
3348
  if(t.p.subGrid===true) {
3349
- row = $(row)[0];
3349
+ row = $(row)[0];
3350
3350
  $(t).jqGrid("addSubGrid",row,gi+ni);
3351
3351
  }
3352
3352
  if(t.rows.length === 0){
@@ -3420,7 +3420,7 @@ $.jgrid.extend({
3420
3420
  if( data[nm] !== undefined) {
3421
3421
  vl = format ? t.formatter( "", data[nm], i, data, 'edit') : data[nm];
3422
3422
  title = this.title ? {"title":$.jgrid.stripHtml(vl)} : {};
3423
- $("tr.footrow td:eq("+i+")",t.grid.sDiv).html(vl).attr(title);
3423
+ $("tr.footrow td:eq("+i+")",t.grid.sDiv).html(vl).attr(title);
3424
3424
  success = true;
3425
3425
  }
3426
3426
  } else if(action == "get") {
@@ -3539,7 +3539,7 @@ $.jgrid.extend({
3539
3539
  if($t.p.toolbar[1]=="both") {$($t.grid.ubDiv).css("width",nwidth+"px");}
3540
3540
  }
3541
3541
  if($t.p.footerrow) { $($t.grid.sDiv).css("width",nwidth+"px"); }
3542
- if(shrink ===false && $t.p.forceFit === true) {$t.p.forceFit=false;}
3542
+ if(shrink ===false && $t.p.forceFit === true) {$t.p.forceFit=false;}
3543
3543
  if(shrink===true) {
3544
3544
  if ($.browser.safari) { brd=0;}
3545
3545
  $.each($t.p.colModel, function(i) {
@@ -26,10 +26,10 @@ e.async=false;e.loadXML(c)}return e&&e.documentElement&&e.documentElement.tagNam
26
26
  var j=a.jgrid.formatter.date.monthNames,d=a.jgrid.formatter.date.AmPm,l=function(k,m){if(k===0){if(m==12)m=0}else if(m!=12)m+=12;return m};f=0;for(g=c.length;f<g;f++){if(c[f]=="M"){h=a.inArray(e[f],j);if(h!==-1&&h<12)e[f]=h+1}if(c[f]=="F"){h=a.inArray(e[f],j);if(h!==-1&&h>11)e[f]=h+1-12}if(c[f]=="a"){h=a.inArray(e[f],d);if(h!==-1&&h<2&&e[f]==d[h]){e[f]=h;b.h=l(e[f],b.h)}}if(c[f]=="A"){h=a.inArray(e[f],d);if(h!==-1&&h>1&&e[f]==d[h]){e[f]=h-2;b.h=l(e[f],b.h)}}if(e[f]!==undefined)b[c[f].toLowerCase()]=
27
27
  parseInt(e[f],10)}b.m=parseInt(b.m,10)-1;f=b.y;if(f>=70&&f<=99)b.y=1900+b.y;else if(f>=0&&f<=69)b.y=2E3+b.y}return new Date(b.y,b.m,b.d,b.h,b.i,b.s,0)},jqID:function(c){c+="";return c.replace(/([\.\:\[\]])/g,"\\$1")},getAccessor:function(c,e){var b,f,g=[],h;if(typeof e==="function")return e(c);b=c[e];if(b===undefined)try{if(typeof e==="string")g=e.split(".");if(h=g.length)for(b=c;b&&h--;){f=g.shift();b=b[f]}}catch(j){}return b},ajaxOptions:{},from:function(c){return new function(e,b){if(typeof e==
28
28
  "string")e=a.data(e);var f=this,g=e,h=true,j=false,d=b,l=/[\$,%]/g,k=null,m=null,p=false,q="",v=[],r=true;if(typeof e=="object"&&e.push){if(e.length>0)r=typeof e[0]!="object"?false:true}else throw"data provides is not an array";this._hasData=function(){return g===null?false:g.length===0?false:true};this._getStr=function(n){var o=[];j&&o.push("jQuery.trim(");o.push("String("+n+")");j&&o.push(")");h||o.push(".toLowerCase()");return o.join("")};this._strComp=function(n){return typeof n=="string"?".toString()":
29
- ""};this._group=function(n,o){return{field:n.toString(),unique:o,items:[]}};this._toStr=function(n){if(j)n=a.trim(n);h||(n=n.toLowerCase());return n=n.toString().replace(RegExp('\\"',"g"),'\\"')};this._funcLoop=function(n){var o=[];a.each(g,function(s,A){o.push(n(A))});return o};this._append=function(n){if(d===null)d="";else d+=q===""?" && ":q;if(p)d+="!";d+="("+n+")";p=false;q=""};this._setCommand=function(n,o){k=n;m=o};this._resetNegate=function(){p=false};this._repeatCommand=function(n,o){if(k===
30
- null)return f;if(n!=null&&o!=null)return k(n,o);if(m===null)return k(n);if(!r)return k(n);return k(m,n)};this._equals=function(n,o){return f._compare(n,o,1)===0};this._compare=function(n,o,s){if(s===undefined)s=1;if(n===undefined)n=null;if(o===undefined)o=null;if(n===null&&o===null)return 0;if(n===null&&o!==null)return 1;if(n!==null&&o===null)return-1;if(!h&&typeof n!=="number"&&typeof o!=="number"){n=String(n).toLowerCase();o=String(o).toLowerCase()}if(n<o)return-s;if(n>o)return s;return 0};this._performSort=
31
- function(){if(v.length!==0)g=f._doSort(g,0)};this._doSort=function(n,o){var s=v[o].by,A=v[o].dir,C=v[o].type,D=v[o].datefmt;if(o==v.length-1)return f._getOrder(n,s,A,C,D);o++;s=f._getGroup(n,s,A,C,D);A=[];for(C=0;C<s.length;C++){D=f._doSort(s[C].items,o);for(var x=0;x<D.length;x++)A.push(D[x])}return A};this._getOrder=function(n,o,s,A,C){var D=[],x=[],B=s=="a"?1:-1,y,z;if(A===undefined)A="text";z=A=="float"||A=="number"||A=="currency"||A=="numeric"?function(L){L=parseFloat(String(L).replace(l,""));
32
- return isNaN(L)?0:L}:A=="int"||A=="integer"?function(L){return L?parseFloat(String(L).replace(l,"")):0}:A=="date"||A=="datetime"?function(L){return a.jgrid.parseDate(C,L).getTime()}:a.isFunction(A)?A:function(L){L||(L="");return a.trim(String(L).toUpperCase())};a.each(n,function(L,U){y=o!==""?a.jgrid.getAccessor(U,o):U;if(y===undefined)y="";y=z(y,U);x.push({vSort:y,index:L})});x.sort(function(L,U){L=L.vSort;U=U.vSort;return f._compare(L,U,B)});A=0;for(var I=n.length;A<I;){s=x[A].index;D.push(n[s]);
29
+ ""};this._group=function(n,o){return{field:n.toString(),unique:o,items:[]}};this._toStr=function(n){if(j)n=a.trim(n);h||(n=n.toLowerCase());return n=n.toString().replace(/\\/g,"\\\\").replace(/\"/g,'\\"')};this._funcLoop=function(n){var o=[];a.each(g,function(s,A){o.push(n(A))});return o};this._append=function(n){if(d===null)d="";else d+=q===""?" && ":q;if(p)d+="!";d+="("+n+")";p=false;q=""};this._setCommand=function(n,o){k=n;m=o};this._resetNegate=function(){p=false};this._repeatCommand=function(n,
30
+ o){if(k===null)return f;if(n!=null&&o!=null)return k(n,o);if(m===null)return k(n);if(!r)return k(n);return k(m,n)};this._equals=function(n,o){return f._compare(n,o,1)===0};this._compare=function(n,o,s){if(s===undefined)s=1;if(n===undefined)n=null;if(o===undefined)o=null;if(n===null&&o===null)return 0;if(n===null&&o!==null)return 1;if(n!==null&&o===null)return-1;if(!h&&typeof n!=="number"&&typeof o!=="number"){n=String(n).toLowerCase();o=String(o).toLowerCase()}if(n<o)return-s;if(n>o)return s;return 0};
31
+ this._performSort=function(){if(v.length!==0)g=f._doSort(g,0)};this._doSort=function(n,o){var s=v[o].by,A=v[o].dir,C=v[o].type,D=v[o].datefmt;if(o==v.length-1)return f._getOrder(n,s,A,C,D);o++;s=f._getGroup(n,s,A,C,D);A=[];for(C=0;C<s.length;C++){D=f._doSort(s[C].items,o);for(var x=0;x<D.length;x++)A.push(D[x])}return A};this._getOrder=function(n,o,s,A,C){var D=[],x=[],B=s=="a"?1:-1,y,z;if(A===undefined)A="text";z=A=="float"||A=="number"||A=="currency"||A=="numeric"?function(L){L=parseFloat(String(L).replace(l,
32
+ ""));return isNaN(L)?0:L}:A=="int"||A=="integer"?function(L){return L?parseFloat(String(L).replace(l,"")):0}:A=="date"||A=="datetime"?function(L){return a.jgrid.parseDate(C,L).getTime()}:a.isFunction(A)?A:function(L){L||(L="");return a.trim(String(L).toUpperCase())};a.each(n,function(L,U){y=o!==""?a.jgrid.getAccessor(U,o):U;if(y===undefined)y="";y=z(y,U);x.push({vSort:y,index:L})});x.sort(function(L,U){L=L.vSort;U=U.vSort;return f._compare(L,U,B)});A=0;for(var I=n.length;A<I;){s=x[A].index;D.push(n[s]);
33
33
  A++}return D};this._getGroup=function(n,o,s,A,C){var D=[],x=null,B=null,y;a.each(f._getOrder(n,o,s,A,C),function(z,I){y=a.jgrid.getAccessor(I,o);if(y===undefined)y="";if(!f._equals(B,y)){B=y;x!=null&&D.push(x);x=f._group(o,y)}x.items.push(I)});x!=null&&D.push(x);return D};this.ignoreCase=function(){h=false;return f};this.useCase=function(){h=true;return f};this.trim=function(){j=true;return f};this.noTrim=function(){j=false;return f};this.combine=function(n){var o=a.from(g);h||o.ignoreCase();j&&o.trim();
34
34
  n=n(o).showQuery();f._append(n);return f};this.execute=function(){var n=d,o=[];if(n===null)return f;a.each(g,function(){eval(n)&&o.push(this)});g=o;return f};this.data=function(){return g};this.select=function(n){f._performSort();if(!f._hasData())return[];f.execute();if(a.isFunction(n)){var o=[];a.each(g,function(s,A){o.push(n(A))});return o}return g};this.hasMatch=function(){if(!f._hasData())return false;f.execute();return g.length>0};this.showQuery=function(n){var o=d;if(o===null)o="no query found";
35
35
  if(a.isFunction(n)){n(o);return f}return o};this.andNot=function(n,o,s){p=!p;return f.and(n,o,s)};this.orNot=function(n,o,s){p=!p;return f.or(n,o,s)};this.not=function(n,o,s){return f.andNot(n,o,s)};this.and=function(n,o,s){q=" && ";if(n===undefined)return f;return f._repeatCommand(n,o,s)};this.or=function(n,o,s){q=" || ";if(n===undefined)return f;return f._repeatCommand(n,o,s)};this.isNot=function(n){p=!p;return f.is(n)};this.is=function(n){f._append("this."+n);f._resetNegate();return f};this._compareValues=
@@ -80,7 +80,7 @@ null&&F.totalrows!==null)w[F.totalrows]=d.p.rowTotal;var N=d.p.loadComplete,M=a.
80
80
  w);var aa=!d.p.scroll?1:d.rows.length-1;if(a.isFunction(d.p.datatype))d.p.datatype.call(d,d.p.postData,"load_"+d.p.id);else{a.isFunction(d.p.beforeRequest)&&d.p.beforeRequest.call(d);E=d.p.datatype.toLowerCase();switch(E){case "json":case "jsonp":case "xml":case "script":a.ajax(a.extend({url:d.p.url,type:d.p.mtype,dataType:E,data:a.isFunction(d.p.serializeGridData)?d.p.serializeGridData.call(d,d.p.postData):d.p.postData,success:function(H){E==="xml"?I(H,d.grid.bDiv,aa,t>1,S):L(H,d.grid.bDiv,aa,t>
81
81
  1,S);N&&N.call(d,H);u&&d.grid.populateVisible();if(d.p.loadonce||d.p.treeGrid)d.p.datatype="local";ca()},error:function(H,K,O){a.isFunction(d.p.loadError)&&d.p.loadError.call(d,H,K,O);ca()},beforeSend:function(H){ha();a.isFunction(d.p.loadBeforeSend)&&d.p.loadBeforeSend.call(d,H)}},a.jgrid.ajaxOptions,d.p.ajaxGridOptions));break;case "xmlstring":ha();w=a.jgrid.stringToDoc(d.p.datastr);I(w,d.grid.bDiv);M&&d.p.loadComplete.call(d,w);d.p.datatype="local";d.p.datastr=null;ca();break;case "jsonstring":ha();
82
82
  w=typeof d.p.datastr=="string"?a.jgrid.parse(d.p.datastr):d.p.datastr;L(w,d.grid.bDiv);M&&d.p.loadComplete.call(d,w);d.p.datatype="local";d.p.datastr=null;ca();break;case "local":case "clientside":ha();d.p.datatype="local";w=U();L(w,d.grid.bDiv,aa,t>1,S);N&&N.call(d,w);u&&d.grid.populateVisible();ca()}}}};m=function(t,u){var w="",E="<table cellspacing='0' cellpadding='0' border='0' style='table-layout:auto;' class='ui-pg-table'><tbody><tr>",F="",N,M,S,aa,H=function(K){var O;if(a.isFunction(d.p.onPaging))O=
83
- d.p.onPaging.call(d,K);d.p.selrow=null;if(d.p.multiselect){d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}d.p.savedRow=[];if(O=="stop")return false;return true};t=t.substr(1);N="pg_"+t;M=t+"_left";S=t+"_center";aa=t+"_right";a("#"+t).append("<div id='"+N+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+M+"' align='left'></td><td id='"+
83
+ d.p.onPaging.call(d,K);d.p.selrow=null;if(d.p.multiselect){d.p.selarrrow=[];a("#cb_"+a.jgrid.jqID(d.p.id),d.grid.hDiv).attr("checked",false)}d.p.savedRow=[];if(O=="stop")return false;return true};t=t.substr(1);N="pg_"+t;M=t+"_left";S=t+"_center";aa=t+"_right";a("#"+a.jgrid.jqID(t)).append("<div id='"+N+"' class='ui-pager-control' role='group'><table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table' style='width:100%;table-layout:fixed;height:100%;' role='row'><tbody><tr><td id='"+M+"' align='left'></td><td id='"+
84
84
  S+"' align='center' style='white-space:pre;'></td><td id='"+aa+"' align='right'></td></tr></tbody></table></div>").attr("dir","ltr");if(d.p.rowList.length>0){F="<td dir='"+j+"'>";F+="<select class='ui-pg-selbox' role='listbox'>";for(M=0;M<d.p.rowList.length;M++)F+='<option role="option" value="'+d.p.rowList[M]+'"'+(d.p.rowNum==d.p.rowList[M]?' selected="selected"':"")+">"+d.p.rowList[M]+"</option>";F+="</select></td>"}if(j=="rtl")E+=F;if(d.p.pginput===true)w="<td dir='"+j+"'>"+a.jgrid.format(d.p.pgtext||
85
85
  "","<input class='ui-pg-input' type='text' size='2' maxlength='7' value='0' role='textbox'/>","<span id='sp_1'></span>")+"</td>";if(d.p.pgbuttons===true){M=["first"+u,"prev"+u,"next"+u,"last"+u];j=="rtl"&&M.reverse();E+="<td id='"+M[0]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-first'></span></td>";E+="<td id='"+M[1]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-prev'></span></td>";E+=w!==""?"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>"+
86
86
  w+"<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>":"";E+="<td id='"+M[2]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-next'></span></td>";E+="<td id='"+M[3]+"' class='ui-pg-button ui-corner-all'><span class='ui-icon ui-icon-seek-end'></span></td>"}else if(w!=="")E+=w;if(j=="ltr")E+=F;E+="</tr></tbody></table>";d.p.viewrecords===true&&a("td#"+t+"_"+d.p.recordpos,"#"+N).append("<div dir='"+j+"' style='text-align:"+d.p.recordpos+
@@ -174,11 +174,9 @@ body {
174
174
 
175
175
  @-webkit-keyframes slideLeftOut {
176
176
  0% {
177
- -webkit-transform: translateX(0px);
178
- opacity: 1; }
177
+ -webkit-transform: translateX(0px); }
179
178
  100% {
180
- -webkit-transform: translateX(-100%);
181
- opacity: 0; } }
179
+ -webkit-transform: translateX(-100%); } }
182
180
 
183
181
 
184
182
  /* Slide Right */
@@ -192,11 +190,9 @@ body {
192
190
 
193
191
  @-webkit-keyframes slideRightOut {
194
192
  0% {
195
- -webkit-transform: translateX(0);
196
- opacity: 1; }
193
+ -webkit-transform: translateX(0); }
197
194
  100% {
198
- -webkit-transform: translateX(100%);
199
- opacity: 0; } }
195
+ -webkit-transform: translateX(100%); } }
200
196
 
201
197
 
202
198
  /* Slide Up */
@@ -34,6 +34,7 @@ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :layout => ['j
34
34
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :mousewheel => ['jquery.mousewheel.min']
35
35
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :offline => ['json.min', 'jquery.offline.min']
36
36
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :pngFix => ['jquery.pngFix.min']
37
+ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :replaceText => ['jquery.replaceText.min']
37
38
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :sparklines => ['jquery.sparkline.min']
38
39
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :themeSwitcher => ['jquery.themeswitchertool.min']
39
40
  ActionView::Helpers::AssetTagHelper.register_javascript_expansion :tmpl => ['jquery.tmpl.min', 'jquery.tmplPlus.min']
@@ -20759,6 +20759,7 @@ $.extend($.ui.selectable, {
20759
20759
  * and GPL (GPL-LICENSE.txt) licenses.
20760
20760
  *
20761
20761
  * http://docs.jquery.com/UI
20762
+ * https://github.com/fnagel/jquery-ui/wiki/Selectmenu
20762
20763
  */
20763
20764
 
20764
20765
  (function($) {
@@ -20783,83 +20784,95 @@ $.widget("ui.selectmenu", {
20783
20784
  format: null,
20784
20785
  bgImage: function() {},
20785
20786
  wrapperElement: ""
20786
- },
20787
-
20787
+ },
20788
+
20788
20789
  _create: function() {
20789
20790
  var self = this, o = this.options;
20790
-
20791
- // set a default id value
20792
- var selectmenuId = this.element.attr('id') || 'ui-selectmenu-' + Math.random().toString(16).slice(2, 10);
20793
-
20794
- //quick array of button and menu id's
20795
- this.ids = [selectmenuId + '-' + 'button', selectmenuId + '-' + 'menu'];
20796
-
20797
- //define safe mouseup for future toggling
20791
+
20792
+ // set a default id value, generate a new random one if not set by developer
20793
+ var selectmenuId = this.element.attr('id') || 'ui-selectmenu-' + Math.random().toString(16).slice(2, 10);
20794
+
20795
+ // quick array of button and menu id's
20796
+ this.ids = [ selectmenuId + '-button', selectmenuId + '-menu' ];
20797
+
20798
+ // define safe mouseup for future toggling
20798
20799
  this._safemouseup = true;
20799
-
20800
- //create menu button wrapper
20801
- this.newelement = $('<a class="'+ this.widgetBaseClass +' ui-widget ui-state-default ui-corner-all" id="'+this.ids[0]+'" role="button" href="#" tabindex="0" aria-haspopup="true" aria-owns="'+this.ids[1]+'"></a>')
20800
+
20801
+ // create menu button wrapper
20802
+ this.newelement = $('<a class="' + this.widgetBaseClass + ' ui-widget ui-state-default ui-corner-all" id="' + this.ids[0] + '" role="button" href="#" tabindex="0" aria-haspopup="true" aria-owns="' + this.ids[1] + '"></a>')
20802
20803
  .insertAfter(this.element);
20803
- //
20804
20804
  this.newelement.wrap(o.wrapperElement);
20805
- //transfer tabindex
20805
+
20806
+ // transfer tabindex
20806
20807
  var tabindex = this.element.attr('tabindex');
20807
- if(tabindex){ this.newelement.attr('tabindex', tabindex); }
20808
-
20809
- //save reference to select in data for ease in calling methods
20808
+ if (tabindex) {
20809
+ this.newelement.attr('tabindex', tabindex);
20810
+ }
20811
+
20812
+ // save reference to select in data for ease in calling methods
20810
20813
  this.newelement.data('selectelement', this.element);
20811
20814
 
20812
- //menu icon
20813
- this.selectmenuIcon = $('<span class="'+ this.widgetBaseClass +'-icon ui-icon"></span>')
20814
- .prependTo(this.newelement)
20815
- .addClass( (o.style == "popup")? 'ui-icon-triangle-2-n-s' : 'ui-icon-triangle-1-s' );
20816
-
20815
+ // menu icon
20816
+ this.selectmenuIcon = $('<span class="' + this.widgetBaseClass + '-icon ui-icon"></span>')
20817
+ .prependTo(this.newelement);
20818
+
20819
+ // append status span to button
20820
+ this.newelement.prepend('<span class="' + self.widgetBaseClass + '-status" />');
20817
20821
 
20818
- //make associated form label trigger focus
20819
- $('label[for='+this.element.attr('id')+']')
20822
+ // make associated form label trigger focus
20823
+ $('label[for="' + this.element.attr('id') + '"]')
20820
20824
  .attr('for', this.ids[0])
20821
- .bind('click', function(){
20825
+ .bind('click.selectmenu', function() {
20822
20826
  self.newelement[0].focus();
20823
20827
  return false;
20824
20828
  });
20825
-
20826
- //click toggle for menu visibility
20829
+
20830
+ // click toggle for menu visibility
20827
20831
  this.newelement
20828
- .bind('mousedown', function(event){
20832
+ .bind('mousedown.selectmenu', function(event) {
20829
20833
  self._toggle(event, true);
20830
- //make sure a click won't open/close instantly
20831
- if(o.style == "popup"){
20834
+ // make sure a click won't open/close instantly
20835
+ if (o.style == "popup") {
20832
20836
  self._safemouseup = false;
20833
- setTimeout(function(){self._safemouseup = true;}, 300);
20834
- }
20837
+ setTimeout(function() { self._safemouseup = true; }, 300);
20838
+ }
20835
20839
  return false;
20836
20840
  })
20837
- .bind('click',function(){
20841
+ .bind('click.selectmenu', function() {
20838
20842
  return false;
20839
20843
  })
20840
- .keydown(function(event){
20841
- var ret = true;
20844
+ .bind("keydown.selectmenu", function(event) {
20845
+ var ret = false;
20842
20846
  switch (event.keyCode) {
20843
20847
  case $.ui.keyCode.ENTER:
20844
20848
  ret = true;
20845
20849
  break;
20846
20850
  case $.ui.keyCode.SPACE:
20847
- ret = false;
20848
20851
  self._toggle(event);
20849
20852
  break;
20850
20853
  case $.ui.keyCode.UP:
20854
+ if (event.altKey) {
20855
+ self.open(event);
20856
+ } else {
20857
+ self._moveSelection(-1);
20858
+ }
20859
+ break;
20860
+ case $.ui.keyCode.DOWN:
20861
+ if (event.altKey) {
20862
+ self.open(event);
20863
+ } else {
20864
+ self._moveSelection(1);
20865
+ }
20866
+ break;
20851
20867
  case $.ui.keyCode.LEFT:
20852
- ret = false;
20853
20868
  self._moveSelection(-1);
20854
20869
  break;
20855
- case $.ui.keyCode.DOWN:
20856
20870
  case $.ui.keyCode.RIGHT:
20857
- ret = false;
20858
20871
  self._moveSelection(1);
20859
- break;
20872
+ break;
20860
20873
  case $.ui.keyCode.TAB:
20861
20874
  ret = true;
20862
- break;
20875
+ break;
20863
20876
  default:
20864
20877
  ret = true;
20865
20878
  self._typeAhead(event.keyCode, 'mouseup');
@@ -20867,37 +20880,120 @@ $.widget("ui.selectmenu", {
20867
20880
  }
20868
20881
  return ret;
20869
20882
  })
20870
- .bind('mouseover focus', function(){
20871
- if (!o.disabled) $(this).addClass(self.widgetBaseClass+'-focus ui-state-hover');
20883
+ .bind('mouseover.selectmenu focus.selectmenu', function() {
20884
+ if (!o.disabled) {
20885
+ $(this).addClass(self.widgetBaseClass + '-focus ui-state-hover');
20886
+ }
20872
20887
  })
20873
- .bind('mouseout blur', function(){
20874
- if (!o.disabled) $(this).removeClass(self.widgetBaseClass+'-focus ui-state-hover');
20888
+ .bind('mouseout.selectmenu blur.selectmenu', function() {
20889
+ if (!o.disabled) {
20890
+ $(this).removeClass(self.widgetBaseClass + '-focus ui-state-hover');
20891
+ }
20875
20892
  });
20876
-
20877
- //document click closes menu
20878
- $(document).mousedown(function(event){
20893
+
20894
+ // document click closes menu
20895
+ $(document).bind("mousedown.selectmenu", function(event) {
20879
20896
  self.close(event);
20880
20897
  });
20881
20898
 
20882
- //change event on original selectmenu
20899
+ // change event on original selectmenu
20883
20900
  this.element
20884
- .click(function(){ this._refreshValue(); })
20885
- // newelement can be null under unclear circumstances in IE8
20886
- .focus(function () { if (this.newelement) { this.newelement[0].focus(); } });
20901
+ .bind("click.selectmenu", function() {
20902
+ self._refreshValue();
20903
+ })
20904
+ // newelement can be null under unclear circumstances in IE8
20905
+ .bind("focus.selectmenu", function() {
20906
+ if (this.newelement) {
20907
+ this.newelement[0].focus();
20908
+ }
20909
+ });
20910
+
20911
+ // original selectmenu width
20912
+ var selectWidth = this.element.width();
20913
+
20914
+ // set menu button width
20915
+ this.newelement.width(o.width ? o.width : selectWidth);
20916
+
20917
+ // hide original selectmenu element
20918
+ this.element.hide();
20919
+
20920
+ // create menu portion, append to body
20921
+ this.list = $('<ul class="' + self.widgetBaseClass + '-menu ui-widget ui-widget-content" aria-hidden="true" role="listbox" aria-labelledby="' + this.ids[0] + '" id="' + this.ids[1] + '"></ul>').appendTo('body');
20922
+ this.list.wrap(o.wrapperElement);
20923
+
20924
+ // transfer menu click to menu button
20925
+ this.list
20926
+ .bind("keydown.selectmenu", function(event) {
20927
+ var ret = false;
20928
+ switch (event.keyCode) {
20929
+ case $.ui.keyCode.UP:
20930
+ if (event.altKey) {
20931
+ self.close(event, true);
20932
+ } else {
20933
+ self._moveFocus(-1);
20934
+ }
20935
+ break;
20936
+ case $.ui.keyCode.DOWN:
20937
+ if (event.altKey) {
20938
+ self.close(event, true);
20939
+ } else {
20940
+ self._moveFocus(1);
20941
+ }
20942
+ break;
20943
+ case $.ui.keyCode.LEFT:
20944
+ self._moveFocus(-1);
20945
+ break;
20946
+ case $.ui.keyCode.RIGHT:
20947
+ self._moveFocus(1);
20948
+ break;
20949
+ case $.ui.keyCode.HOME:
20950
+ self._moveFocus(':first');
20951
+ break;
20952
+ case $.ui.keyCode.PAGE_UP:
20953
+ self._scrollPage('up');
20954
+ break;
20955
+ case $.ui.keyCode.PAGE_DOWN:
20956
+ self._scrollPage('down');
20957
+ break;
20958
+ case $.ui.keyCode.END:
20959
+ self._moveFocus(':last');
20960
+ break;
20961
+ case $.ui.keyCode.ENTER:
20962
+ case $.ui.keyCode.SPACE:
20963
+ self.close(event, true);
20964
+ $(event.target).parents('li:eq(0)').trigger('mouseup');
20965
+ break;
20966
+ case $.ui.keyCode.TAB:
20967
+ ret = true;
20968
+ self.close(event, true);
20969
+ break;
20970
+ case $.ui.keyCode.ESCAPE:
20971
+ self.close(event, true);
20972
+ break;
20973
+ default:
20974
+ ret = true;
20975
+ break;
20976
+ }
20977
+ return ret;
20978
+ });
20887
20979
 
20888
- //create menu portion, append to body
20889
- var cornerClass = (o.style == "dropdown")? " ui-corner-bottom" : " ui-corner-all";
20890
- this.list = $('<ul class="' + self.widgetBaseClass + '-menu ui-widget ui-widget-content'+cornerClass+'" aria-hidden="true" role="listbox" aria-labelledby="'+this.ids[0]+'" id="'+this.ids[1]+'"></ul>').appendTo('body');
20891
- this.list.wrap(o.wrapperElement);
20980
+ // needed when window is resized
20981
+ $(window).bind("resize.selectmenu", function() {
20982
+ $.proxy(self._refreshPosition, this);
20983
+ });
20984
+ },
20985
+
20986
+ _init: function() {
20987
+ var self = this, o = this.options;
20892
20988
 
20893
- //serialize selectmenu element options
20989
+ // serialize selectmenu element options
20894
20990
  var selectOptionData = [];
20895
20991
  this.element
20896
20992
  .find('option')
20897
- .each(function(){
20993
+ .each(function() {
20898
20994
  selectOptionData.push({
20899
20995
  value: $(this).attr('value'),
20900
- text: self._formatText(jQuery(this).text()),
20996
+ text: self._formatText($(this).text()),
20901
20997
  selected: $(this).attr('selected'),
20902
20998
  classes: $(this).attr('class'),
20903
20999
  parentOptGroup: $(this).parent('optgroup').attr('label'),
@@ -20905,70 +21001,75 @@ $.widget("ui.selectmenu", {
20905
21001
  });
20906
21002
  });
20907
21003
 
20908
- //active state class is only used in popup style
21004
+ // active state class is only used in popup style
20909
21005
  var activeClass = (self.options.style == "popup") ? " ui-state-active" : "";
20910
-
20911
- //write li's
21006
+
21007
+ // empty list so we can refresh the selectmenu via selectmenu()
21008
+ this.list.html("");
21009
+
21010
+ // write li's
20912
21011
  for (var i = 0; i < selectOptionData.length; i++) {
20913
- var thisLi = $('<li role="presentation"><a href="#" tabindex="-1" role="option" aria-selected="false">'+ selectOptionData[i].text +'</a></li>')
20914
- .data('index',i)
21012
+ var thisLi = $('<li role="presentation"><a href="#" tabindex="-1" role="option" aria-selected="false">' + selectOptionData[i].text + '</a></li>')
21013
+ .data('index', i)
20915
21014
  .addClass(selectOptionData[i].classes)
20916
- .data('optionClasses', selectOptionData[i].classes|| '')
20917
- .mouseup(function(event){
20918
- if(self._safemouseup){
21015
+ .data('optionClasses', selectOptionData[i].classes || '')
21016
+ .bind("mouseup.selectmenu", function(event) {
21017
+ if (self._safemouseup) {
20919
21018
  var changed = $(this).data('index') != self._selectedIndex();
20920
21019
  self.index($(this).data('index'));
20921
21020
  self.select(event);
20922
- if(changed){ self.change(event); }
20923
- self.close(event,true);
21021
+ if (changed) {
21022
+ self.change(event);
21023
+ }
21024
+ self.close(event, true);
20924
21025
  }
20925
21026
  return false;
20926
21027
  })
20927
- .click(function(){
21028
+ .bind("click.selectmenu", function() {
20928
21029
  return false;
20929
21030
  })
20930
- .bind('mouseover focus', function(){
21031
+ .bind('mouseover.selectmenu focus.selectmenu', function() {
20931
21032
  self._selectedOptionLi().addClass(activeClass);
20932
- self._focusedOptionLi().removeClass(self.widgetBaseClass+'-item-focus ui-state-hover');
21033
+ self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
20933
21034
  $(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover');
20934
21035
  })
20935
- .bind('mouseout blur', function(){
20936
- if ($(this).is( self._selectedOptionLi().selector )){ $(this).addClass(activeClass); }
20937
- $(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
21036
+ .bind('mouseout.selectmenu blur.selectmenu', function() {
21037
+ if ($(this).is(self._selectedOptionLi().selector)) {
21038
+ $(this).addClass(activeClass);
21039
+ }
21040
+ $(this).removeClass(self.widgetBaseClass + '-item-focus ui-state-hover');
20938
21041
  });
20939
-
20940
- //optgroup or not...
20941
- if(selectOptionData[i].parentOptGroup){
21042
+
21043
+ // optgroup or not...
21044
+ if (selectOptionData[i].parentOptGroup) {
20942
21045
  // whitespace in the optgroupname must be replaced, otherwise the li of existing optgroups are never found
20943
21046
  var optGroupName = self.widgetBaseClass + '-group-' + selectOptionData[i].parentOptGroup.replace(/[^a-zA-Z0-9]/g, "");
20944
- if(this.list.find('li.' + optGroupName).size()){
21047
+ if (this.list.find('li.' + optGroupName).size()) {
20945
21048
  this.list.find('li.' + optGroupName + ':last ul').append(thisLi);
20946
- }
20947
- else{
20948
- $('<li role="presentation" class="'+self.widgetBaseClass+'-group '+optGroupName+'"><span class="'+self.widgetBaseClass+'-group-label">'+selectOptionData[i].parentOptGroup+'</span><ul></ul></li>')
21049
+ } else {
21050
+ $('<li role="presentation" class="' + self.widgetBaseClass + '-group ' + optGroupName + '"><span class="' + self.widgetBaseClass + '-group-label">' + selectOptionData[i].parentOptGroup + '</span><ul></ul></li>')
20949
21051
  .appendTo(this.list)
20950
21052
  .find('ul')
20951
21053
  .append(thisLi);
20952
21054
  }
20953
- }
20954
- else{
21055
+ } else {
20955
21056
  thisLi.appendTo(this.list);
20956
21057
  }
20957
21058
 
20958
- //this allows for using the scrollbar in an overflowed list
20959
- this.list.bind('mousedown mouseup', function(){return false;});
21059
+ // this allows for using the scrollbar in an overflowed list
21060
+ this.list.bind('mousedown.selectmenu mouseup.selectmenu', function() { return false; });
20960
21061
 
20961
- //append icon if option is specified
20962
- if(o.icons){
20963
- for(var j in o.icons){
20964
- if(thisLi.is(o.icons[j].find)){
21062
+ // append icon if option is specified
21063
+ if (o.icons) {
21064
+ for (var j in o.icons) {
21065
+ if (thisLi.is(o.icons[j].find)) {
20965
21066
  thisLi
20966
21067
  .data('optionClasses', selectOptionData[i].classes + ' ' + self.widgetBaseClass + '-hasIcon')
20967
21068
  .addClass(self.widgetBaseClass + '-hasIcon');
20968
21069
  var iconClass = o.icons[j].icon || "";
20969
21070
  thisLi
20970
21071
  .find('a:eq(0)')
20971
- .prepend('<span class="'+self.widgetBaseClass+'-item-icon ui-icon ' +iconClass + '"></span>');
21072
+ .prepend('<span class="' + self.widgetBaseClass + '-item-icon ui-icon ' + iconClass + '"></span>');
20972
21073
  if (selectOptionData[i].bgImage) {
20973
21074
  thisLi.find('span').css('background-image', selectOptionData[i].bgImage);
20974
21075
  }
@@ -20976,169 +21077,130 @@ $.widget("ui.selectmenu", {
20976
21077
  }
20977
21078
  }
20978
21079
  }
20979
-
20980
- //add corners to top and bottom menu items
20981
- this.list.find('li:last').addClass("ui-corner-bottom");
20982
- if(o.style == 'popup'){ this.list.find('li:first').addClass("ui-corner-top"); }
20983
-
20984
- //transfer classes to selectmenu and list
20985
- if(o.transferClasses){
20986
- var transferClasses = this.element.attr('class') || '';
21080
+
21081
+ // we need to set and unset the CSS classes for dropdown and popup style
21082
+ var isDropDown = (o.style == 'dropdown');
21083
+ this.newelement
21084
+ .toggleClass(self.widgetBaseClass + "-dropdown", isDropDown)
21085
+ .toggleClass(self.widgetBaseClass + "-popup", !isDropDown);
21086
+ this.list
21087
+ .toggleClass(self.widgetBaseClass + "-menu-dropdown ui-corner-bottom", isDropDown)
21088
+ .toggleClass(self.widgetBaseClass + "-menu-popup ui-corner-all", !isDropDown)
21089
+ // add corners to top and bottom menu items
21090
+ .find('li:first')
21091
+ .toggleClass("ui-corner-top", !isDropDown)
21092
+ .end().find('li:last')
21093
+ .addClass("ui-corner-bottom");
21094
+ this.selectmenuIcon
21095
+ .toggleClass('ui-icon-triangle-1-s', isDropDown)
21096
+ .toggleClass('ui-icon-triangle-2-n-s', !isDropDown);
21097
+
21098
+ // transfer classes to selectmenu and list
21099
+ if (o.transferClasses) {
21100
+ var transferClasses = this.element.attr('class') || '';
20987
21101
  this.newelement.add(this.list).addClass(transferClasses);
20988
21102
  }
20989
-
20990
- //original selectmenu width
21103
+
21104
+ // original selectmenu width
20991
21105
  var selectWidth = this.element.width();
20992
-
20993
- //set menu button width
20994
- this.newelement.width( (o.width) ? o.width : selectWidth);
20995
-
20996
- //set menu width to either menuWidth option value, width option value, or select width
20997
- if(o.style == 'dropdown'){ this.list.width( (o.menuWidth) ? o.menuWidth : ((o.width) ? o.width : selectWidth)); }
20998
- else { this.list.width( (o.menuWidth) ? o.menuWidth : ((o.width) ? o.width - o.handleWidth : selectWidth - o.handleWidth)); }
20999
-
21106
+
21107
+ // set menu width to either menuWidth option value, width option value, or select width
21108
+ if (o.style == 'dropdown') {
21109
+ this.list.width(o.menuWidth ? o.menuWidth : (o.width ? o.width : selectWidth));
21110
+ } else {
21111
+ this.list.width(o.menuWidth ? o.menuWidth : (o.width ? o.width - o.handleWidth : selectWidth - o.handleWidth));
21112
+ }
21113
+
21000
21114
  // calculate default max height
21001
- if(o.maxHeight) {
21002
- //set max height from option
21003
- if (o.maxHeight < this.list.height()){ this.list.height(o.maxHeight); }
21115
+ if (o.maxHeight) {
21116
+ // set max height from option
21117
+ if (o.maxHeight < this.list.height()) {
21118
+ this.list.height(o.maxHeight);
21119
+ }
21004
21120
  } else {
21005
21121
  if (!o.format && ($(window).height() / 3) < this.list.height()) {
21006
21122
  o.maxHeight = $(window).height() / 3;
21007
21123
  this.list.height(o.maxHeight);
21008
21124
  }
21009
21125
  }
21010
- //save reference to actionable li's (not group label li's)
21011
- this._optionLis = this.list.find('li:not(.'+ self.widgetBaseClass +'-group)');
21012
-
21013
- //transfer menu click to menu button
21014
- this.list
21015
- .keydown(function(event){
21016
- var ret = true;
21017
- switch (event.keyCode) {
21018
- case $.ui.keyCode.UP:
21019
- case $.ui.keyCode.LEFT:
21020
- ret = false;
21021
- self._moveFocus(-1);
21022
- break;
21023
- case $.ui.keyCode.DOWN:
21024
- case $.ui.keyCode.RIGHT:
21025
- ret = false;
21026
- self._moveFocus(1);
21027
- break;
21028
- case $.ui.keyCode.HOME:
21029
- ret = false;
21030
- self._moveFocus(':first');
21031
- break;
21032
- case $.ui.keyCode.PAGE_UP:
21033
- ret = false;
21034
- self._scrollPage('up');
21035
- break;
21036
- case $.ui.keyCode.PAGE_DOWN:
21037
- ret = false;
21038
- self._scrollPage('down');
21039
- break;
21040
- case $.ui.keyCode.END:
21041
- ret = false;
21042
- self._moveFocus(':last');
21043
- break;
21044
- case $.ui.keyCode.ENTER:
21045
- case $.ui.keyCode.SPACE:
21046
- ret = false;
21047
- self.close(event,true);
21048
- $(event.target).parents('li:eq(0)').trigger('mouseup');
21049
- break;
21050
- case $.ui.keyCode.TAB:
21051
- ret = true;
21052
- self.close(event,true);
21053
- break;
21054
- case $.ui.keyCode.ESCAPE:
21055
- ret = false;
21056
- self.close(event,true);
21057
- break;
21058
- }
21059
- return ret;
21060
- });
21061
-
21062
- //selectmenu style
21063
- if(o.style == 'dropdown'){
21064
- this.newelement
21065
- .addClass(self.widgetBaseClass+"-dropdown");
21066
- this.list
21067
- .addClass(self.widgetBaseClass+"-menu-dropdown");
21068
- }
21069
- else {
21070
- this.newelement
21071
- .addClass(self.widgetBaseClass+"-popup");
21072
- this.list
21073
- .addClass(self.widgetBaseClass+"-menu-popup");
21126
+
21127
+ // save reference to actionable li's (not group label li's)
21128
+ this._optionLis = this.list.find('li:not(.' + self.widgetBaseClass + '-group)');
21129
+
21130
+ // transfer disabled state
21131
+ if (this.element.attr('disabled') === true) {
21132
+ this.disable();
21074
21133
  }
21075
-
21076
- //append status span to button
21077
- this.newelement.prepend('<span class="'+self.widgetBaseClass+'-status">'+ selectOptionData[this._selectedIndex()].text +'</span>');
21078
-
21079
- //hide original selectmenu element
21080
- this.element.hide();
21081
-
21082
- //transfer disabled state
21083
- if(this.element.attr('disabled') == true){ this.disable(); }
21084
-
21085
- //update value
21086
- this.index(this._selectedIndex());
21087
-
21134
+
21135
+ // update value
21136
+ this.index(this._selectedIndex());
21137
+
21088
21138
  // needed when selectmenu is placed at the very bottom / top of the page
21089
- window.setTimeout(function() {
21090
- self._refreshPosition();
21091
- }, 200);
21092
-
21093
- // needed when window is resized
21094
- $(window).resize(function(){
21139
+ window.setTimeout(function() {
21095
21140
  self._refreshPosition();
21096
- });
21141
+ }, 200);
21097
21142
  },
21143
+
21098
21144
  destroy: function() {
21099
- this.element.removeData(this.widgetName)
21100
- .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
21101
- .removeAttr('aria-disabled')
21102
- .unbind("click");
21145
+ this.element.removeData( this.widgetName )
21146
+ .removeClass( this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled' )
21147
+ .removeAttr( 'aria-disabled' )
21148
+ .unbind( ".selectmenu" );
21149
+
21150
+ $( window ).unbind( ".selectmenu" );
21151
+ $( document ).unbind( ".selectmenu" );
21103
21152
 
21104
- //unbind click on label, reset its for attr
21105
- $('label[for='+this.newelement.attr('id')+']')
21106
- .attr('for',this.element.attr('id'))
21107
- .unbind('click');
21108
- this.newelement.remove();
21109
- // FIXME option.wrapper needs
21110
- this.list.remove();
21111
- this.element.show();
21153
+ // unbind click on label, reset its for attr
21154
+ $( 'label[for=' + this.newelement.attr('id') + ']' )
21155
+ .attr( 'for', this.element.attr( 'id' ) )
21156
+ .unbind( '.selectmenu' );
21112
21157
 
21158
+ if ( this.options.wrapperElement ) {
21159
+ this.newelement.find( this.options.wrapperElement ).remove();
21160
+ this.list.find( this.options.wrapperElement ).remove();
21161
+ } else {
21162
+ this.newelement.remove();
21163
+ this.list.remove();
21164
+ }
21165
+ this.element.show();
21166
+
21113
21167
  // call widget destroy function
21114
21168
  $.Widget.prototype.destroy.apply(this, arguments);
21115
21169
  },
21116
- _typeAhead: function(code, eventType){
21170
+
21171
+ _typeAhead: function(code, eventType) {
21117
21172
  var self = this;
21118
21173
  //define self._prevChar if needed
21119
- if(!self._prevChar){ self._prevChar = ['',0]; }
21174
+ if (!self._prevChar) {
21175
+ self._prevChar = [ '', 0 ];
21176
+ }
21120
21177
  var C = String.fromCharCode(code);
21121
21178
  c = C.toLowerCase();
21122
21179
  var focusFound = false;
21123
- function focusOpt(elem, ind){
21180
+ function focusOpt(elem, ind) {
21124
21181
  focusFound = true;
21125
21182
  $(elem).trigger(eventType);
21126
21183
  self._prevChar[1] = ind;
21127
21184
  }
21128
- this.list.find('li a').each(function(i){
21129
- if(!focusFound){
21185
+ this.list.find('li a').each(function(i) {
21186
+ if (!focusFound) {
21130
21187
  var thisText = $(this).text();
21131
- if( thisText.indexOf(C) == 0 || thisText.indexOf(c) == 0){
21132
- if(self._prevChar[0] == C){
21133
- if(self._prevChar[1] < i){ focusOpt(this,i); }
21188
+ if ( thisText.indexOf(C) === 0 || thisText.indexOf(c) === 0 ) {
21189
+ if (self._prevChar[0] == C) {
21190
+ if (self._prevChar[1] < i) {
21191
+ focusOpt(this, i);
21134
21192
  }
21135
- else{ focusOpt(this,i); }
21193
+ } else {
21194
+ focusOpt(this, i);
21195
+ }
21136
21196
  }
21137
21197
  }
21138
21198
  });
21139
21199
  this._prevChar[0] = C;
21140
21200
  },
21141
- _uiHash: function(){
21201
+
21202
+ // returns some usefull information, called by callbacks only
21203
+ _uiHash: function() {
21142
21204
  var index = this.index();
21143
21205
  return {
21144
21206
  index: index,
@@ -21146,10 +21208,11 @@ $.widget("ui.selectmenu", {
21146
21208
  value: this.element[0].value
21147
21209
  };
21148
21210
  },
21149
- open: function(event){
21211
+
21212
+ open: function(event) {
21150
21213
  var self = this;
21151
21214
  var disabledStatus = this.newelement.attr("aria-disabled");
21152
- if(disabledStatus != 'true'){
21215
+ if ( disabledStatus != 'true' ) {
21153
21216
  this._refreshPosition();
21154
21217
  this._closeOthers(event);
21155
21218
  this.newelement
@@ -21161,93 +21224,119 @@ $.widget("ui.selectmenu", {
21161
21224
  }
21162
21225
  this.list.addClass(self.widgetBaseClass + '-open')
21163
21226
  .attr('aria-hidden', false)
21164
- .find('li:not(.'+ self.widgetBaseClass +'-group):eq('+ this._selectedIndex() +') a')[0].focus();
21165
- if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top'); }
21227
+ .find('li:not(.' + self.widgetBaseClass + '-group):eq(' + this._selectedIndex() + ') a')[0].focus();
21228
+ if ( this.options.style == "dropdown" ) {
21229
+ this.newelement.removeClass('ui-corner-all').addClass('ui-corner-top');
21230
+ }
21166
21231
  this._refreshPosition();
21167
21232
  this._trigger("open", event, this._uiHash());
21168
21233
  }
21169
21234
  },
21170
- close: function(event, retainFocus){
21171
- if(this.newelement.is('.ui-state-active')){
21235
+
21236
+ close: function(event, retainFocus) {
21237
+ if ( this.newelement.is('.ui-state-active') ) {
21172
21238
  this.newelement
21173
21239
  .removeClass('ui-state-active');
21174
21240
  this.list
21175
21241
  .attr('aria-hidden', true)
21176
- .removeClass(this.widgetBaseClass+'-open');
21177
- if(this.options.style == "dropdown"){ this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all'); }
21178
- if(retainFocus){this.newelement.focus();}
21242
+ .removeClass(this.widgetBaseClass + '-open');
21243
+ if ( this.options.style == "dropdown" ) {
21244
+ this.newelement.removeClass('ui-corner-top').addClass('ui-corner-all');
21245
+ }
21246
+ if ( retainFocus ) {
21247
+ this.newelement.focus();
21248
+ }
21179
21249
  this._trigger("close", event, this._uiHash());
21180
21250
  }
21181
21251
  },
21252
+
21182
21253
  change: function(event) {
21183
- this.element.trigger('change');
21254
+ this.element.trigger("change");
21184
21255
  this._trigger("change", event, this._uiHash());
21185
21256
  },
21257
+
21186
21258
  select: function(event) {
21187
21259
  this._trigger("select", event, this._uiHash());
21188
21260
  },
21189
- _closeOthers: function(event){
21190
- $('.'+ this.widgetBaseClass +'.ui-state-active').not(this.newelement).each(function(){
21191
- $(this).data('selectelement').selectmenu('close',event);
21261
+
21262
+ _closeOthers: function(event) {
21263
+ $('.' + this.widgetBaseClass + '.ui-state-active').not(this.newelement).each(function() {
21264
+ $(this).data('selectelement').selectmenu('close', event);
21192
21265
  });
21193
- $('.'+ this.widgetBaseClass +'.ui-state-hover').trigger('mouseout');
21266
+ $('.' + this.widgetBaseClass + '.ui-state-hover').trigger('mouseout');
21194
21267
  },
21195
- _toggle: function(event,retainFocus){
21196
- if(this.list.is('.'+ this.widgetBaseClass +'-open')){ this.close(event,retainFocus); }
21197
- else { this.open(event); }
21268
+
21269
+ _toggle: function(event, retainFocus) {
21270
+ if ( this.list.is('.' + this.widgetBaseClass + '-open') ) {
21271
+ this.close(event, retainFocus);
21272
+ } else {
21273
+ this.open(event);
21274
+ }
21198
21275
  },
21199
- _formatText: function(text){
21200
- return this.options.format ? this.options.format(text) : text;
21276
+
21277
+ _formatText: function(text) {
21278
+ return (this.options.format ? this.options.format(text) : text);
21201
21279
  },
21202
- _selectedIndex: function(){
21280
+
21281
+ _selectedIndex: function() {
21203
21282
  return this.element[0].selectedIndex;
21204
21283
  },
21205
- _selectedOptionLi: function(){
21284
+
21285
+ _selectedOptionLi: function() {
21206
21286
  return this._optionLis.eq(this._selectedIndex());
21207
21287
  },
21208
- _focusedOptionLi: function(){
21209
- return this.list.find('.'+ this.widgetBaseClass +'-item-focus');
21288
+
21289
+ _focusedOptionLi: function() {
21290
+ return this.list.find('.' + this.widgetBaseClass + '-item-focus');
21210
21291
  },
21211
- _moveSelection: function(amt){
21292
+
21293
+ _moveSelection: function(amt) {
21212
21294
  var currIndex = parseInt(this._selectedOptionLi().data('index'), 10);
21213
21295
  var newIndex = currIndex + amt;
21214
21296
  return this._optionLis.eq(newIndex).trigger('mouseup');
21215
21297
  },
21216
- _moveFocus: function(amt){
21217
- if(!isNaN(amt)){
21298
+
21299
+ _moveFocus: function(amt) {
21300
+ if (!isNaN(amt)) {
21218
21301
  var currIndex = parseInt(this._focusedOptionLi().data('index') || 0, 10);
21219
21302
  var newIndex = currIndex + amt;
21220
21303
  }
21221
- else { var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10); }
21222
-
21223
- if(newIndex < 0){ newIndex = 0; }
21224
- if(newIndex > this._optionLis.size()-1){
21225
- newIndex = this._optionLis.size()-1;
21304
+ else {
21305
+ var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10);
21306
+ }
21307
+
21308
+ if (newIndex < 0) {
21309
+ newIndex = 0;
21310
+ }
21311
+ if (newIndex > this._optionLis.size() - 1) {
21312
+ newIndex = this._optionLis.size() - 1;
21226
21313
  }
21227
21314
  var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
21228
-
21229
- this._focusedOptionLi().find('a:eq(0)').attr('id','');
21230
- this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID).focus();
21315
+
21316
+ this._focusedOptionLi().find('a:eq(0)').attr('id', '');
21317
+ this._optionLis.eq(newIndex).find('a:eq(0)').attr('id', activeID).focus();
21231
21318
  this.list.attr('aria-activedescendant', activeID);
21232
21319
  },
21233
- _scrollPage: function(direction){
21320
+
21321
+ _scrollPage: function(direction) {
21234
21322
  var numPerPage = Math.floor(this.list.outerHeight() / this.list.find('li:first').outerHeight());
21235
- numPerPage = (direction == 'up') ? -numPerPage : numPerPage;
21323
+ numPerPage = (direction == 'up' ? -numPerPage : numPerPage);
21236
21324
  this._moveFocus(numPerPage);
21237
21325
  },
21326
+
21238
21327
  _setOption: function(key, value) {
21239
21328
  this.options[key] = value;
21240
21329
  if (key == 'disabled') {
21241
21330
  this.close();
21242
21331
  this.element
21243
21332
  .add(this.newelement)
21244
- .add(this.list)
21245
- [value ? 'addClass' : 'removeClass'](
21246
- this.widgetBaseClass + '-disabled' + ' ' +
21247
- this.namespace + '-state-disabled')
21248
- .attr("aria-disabled", value);
21333
+ .add(this.list)[value ? 'addClass' : 'removeClass'](
21334
+ this.widgetBaseClass + '-disabled' + ' ' +
21335
+ this.namespace + '-state-disabled')
21336
+ .attr("aria-disabled", value);
21249
21337
  }
21250
21338
  },
21339
+
21251
21340
  index: function(newValue) {
21252
21341
  if (arguments.length) {
21253
21342
  this.element[0].selectedIndex = newValue;
@@ -21256,9 +21345,11 @@ $.widget("ui.selectmenu", {
21256
21345
  return this._selectedIndex();
21257
21346
  }
21258
21347
  },
21348
+
21259
21349
  value: function(newValue) {
21260
21350
  if (arguments.length) {
21261
21351
  // FIXME test for number is a kind of legacy support, could be removed at any time (Dez. 2010)
21352
+ // see this post for more info: https://github.com/fnagel/jquery-ui/issues#issue/33
21262
21353
  if (typeof newValue == "number") {
21263
21354
  this.index(newValue);
21264
21355
  } else if (typeof newValue == "string") {
@@ -21269,45 +21360,46 @@ $.widget("ui.selectmenu", {
21269
21360
  return this.element[0].value;
21270
21361
  }
21271
21362
  },
21363
+
21272
21364
  _refreshValue: function() {
21273
21365
  var activeClass = (this.options.style == "popup") ? " ui-state-active" : "";
21274
21366
  var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000);
21275
- //deselect previous
21367
+ // deselect previous
21276
21368
  this.list
21277
- .find('.'+ this.widgetBaseClass +'-item-selected')
21369
+ .find('.' + this.widgetBaseClass + '-item-selected')
21278
21370
  .removeClass(this.widgetBaseClass + "-item-selected" + activeClass)
21279
21371
  .find('a')
21280
21372
  .attr('aria-selected', 'false')
21281
21373
  .attr('id', '');
21282
- //select new
21374
+ // select new
21283
21375
  this._selectedOptionLi()
21284
- .addClass(this.widgetBaseClass + "-item-selected"+activeClass)
21376
+ .addClass(this.widgetBaseClass + "-item-selected" + activeClass)
21285
21377
  .find('a')
21286
21378
  .attr('aria-selected', 'true')
21287
21379
  .attr('id', activeID);
21288
21380
 
21289
- //toggle any class brought in from option
21290
- var currentOptionClasses = this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : "";
21291
- var newOptionClasses = this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : "";
21381
+ // toggle any class brought in from option
21382
+ var currentOptionClasses = (this.newelement.data('optionClasses') ? this.newelement.data('optionClasses') : "");
21383
+ var newOptionClasses = (this._selectedOptionLi().data('optionClasses') ? this._selectedOptionLi().data('optionClasses') : "");
21292
21384
  this.newelement
21293
21385
  .removeClass(currentOptionClasses)
21294
21386
  .data('optionClasses', newOptionClasses)
21295
21387
  .addClass( newOptionClasses )
21296
- .find('.'+this.widgetBaseClass+'-status')
21388
+ .find('.' + this.widgetBaseClass + '-status')
21297
21389
  .html(
21298
21390
  this._selectedOptionLi()
21299
21391
  .find('a:eq(0)')
21300
- .html()
21392
+ .html()
21301
21393
  );
21302
-
21394
+
21303
21395
  this.list.attr('aria-activedescendant', activeID);
21304
21396
  },
21305
- _refreshPosition: function(){
21306
- var o = this.options;
21397
+
21398
+ _refreshPosition: function() {
21399
+ var o = this.options;
21307
21400
  // if its a native pop-up we need to calculate the position of the selected li
21308
21401
  if (o.style == "popup" && !o.positionOptions.offset) {
21309
- var selected = this.list.find('li:not(.ui-selectmenu-group):eq('+this._selectedIndex()+')');
21310
- // var _offset = "0 -" + (selected.outerHeight() + selected.offset().top - this.list.offset().top);
21402
+ var selected = this._selectedOptionLi();
21311
21403
  var _offset = "0 -" + (selected.outerHeight() + selected.offset().top - this.list.offset().top);
21312
21404
  }
21313
21405
  this.list
@@ -21323,8 +21415,10 @@ $.widget("ui.selectmenu", {
21323
21415
  });
21324
21416
  }
21325
21417
  });
21418
+
21326
21419
  })(jQuery);
21327
21420
 
21421
+
21328
21422
  /*
21329
21423
  * jQuery UI Slider 1.8.9
21330
21424
  *