compass-jquery-plugin 0.3.2.pre.2 → 0.3.2.0

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.
Files changed (83) hide show
  1. data/LICENSE.md +20 -20
  2. data/README.md +7 -2
  3. data/VERSION.yml +2 -2
  4. data/lib/jquery/gridify/grid.rb +1 -1
  5. data/lib/jquery/gridify/grid_column.rb +1 -1
  6. data/lib/jquery/gridify/grid_finder.rb +16 -1
  7. data/lib/jquery/gridify/grid_view.rb +1 -1
  8. data/lib/jquery/jqgrid.rb +4 -4
  9. data/lib/jquery/jqtouch.rb +3 -3
  10. data/lib/jquery/jquery.rb +431 -431
  11. data/lib/jquery/jquery_json_response.rb +28 -0
  12. data/lib/jquery/secret_sauce.rb +8 -8
  13. data/lib/jquery/secret_sauce/controller/ui_dialog_controls.rb +13 -13
  14. data/lib/jquery/secret_sauce/controller/ui_grid_controls.rb +18 -18
  15. data/lib/jquery/secret_sauce/helpers/ui_dialog_helper.rb +5 -5
  16. data/lib/jquery/secret_sauce/model/find_for_grid.rb +41 -41
  17. data/templates/dynatree/jquery.dynatree.js +111 -110
  18. data/templates/dynatree/jquery.dynatree.min.js +75 -77
  19. data/templates/dynatree/jquery/dynatree/aero.scss +1 -3
  20. data/templates/dynatree/jquery/dynatree/aqua.scss +1 -3
  21. data/templates/dynatree/jquery/dynatree/crystal.scss +1 -3
  22. data/templates/dynatree/jquery/dynatree/xp.scss +1 -3
  23. data/templates/emulators/emulators/iphone.landscape.png +0 -0
  24. data/templates/emulators/emulators/iphone.landscape.scss +4 -4
  25. data/templates/emulators/emulators/palm.landscape.scss +6 -6
  26. data/templates/emulators/emulators/palm.pre.landscape.png +0 -0
  27. data/templates/ical/jquery.ical.js +3202 -3197
  28. data/templates/ical/jquery.ical.min.js +185 -184
  29. data/templates/ical/jquery/ical.scss +3 -3
  30. data/templates/jqgrid/i18n/jqgrid/locale-ar.js +126 -0
  31. data/templates/jqgrid/i18n/jqgrid/locale-ar.min.js +6 -0
  32. data/templates/jqgrid/i18n/jqgrid/locale-fi.js +45 -47
  33. data/templates/jqgrid/i18n/jqgrid/locale-fi.min.js +6 -6
  34. data/templates/jqgrid/jquery.jqGrid.js +2047 -2036
  35. data/templates/jqgrid/jquery.jqGrid.min.js +48 -48
  36. data/templates/jqgrid/manifest.rb +2 -0
  37. data/templates/jqtouch/jquery.jqtouch.js +122 -113
  38. data/templates/jqtouch/jquery.jqtouch.min.js +1 -1
  39. data/templates/jquery/config/initializers/jquery.rb +4 -2
  40. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.js +23 -0
  41. data/templates/jquery/i18n/jquery.ui/datepicker-ar-DZ.min.js +2 -0
  42. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.js +23 -0
  43. data/templates/jquery/i18n/jquery.ui/datepicker-en-AU.min.js +2 -0
  44. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.js +23 -0
  45. data/templates/jquery/i18n/jquery.ui/datepicker-en-NZ.min.js +2 -0
  46. data/templates/jquery/i18n/jquery.ui/datepicker-ml.js +23 -0
  47. data/templates/jquery/i18n/jquery.ui/datepicker-ml.min.js +2 -0
  48. data/templates/jquery/jquery-ui.js +354 -316
  49. data/templates/jquery/jquery-ui.min.js +544 -544
  50. data/templates/jquery/jquery.cookie.js +3 -3
  51. data/templates/jquery/jquery.form.js +271 -140
  52. data/templates/jquery/jquery.form.min.js +19 -17
  53. data/templates/jquery/jquery.layout.js +2435 -2437
  54. data/templates/jquery/jquery.layout.min.js +4 -3
  55. data/templates/jquery/jquery.mousewheel.js +78 -0
  56. data/templates/jquery/jquery.mousewheel.min.js +2 -0
  57. data/templates/jquery/jquery.offline.js +212 -0
  58. data/templates/jquery/jquery.offline.min.js +4 -0
  59. data/templates/jquery/jquery.tmpl.js +15 -22
  60. data/templates/jquery/jquery.tmpl.min.js +12 -12
  61. data/templates/jquery/jquery.tmplPlus.js +1 -0
  62. data/templates/jquery/jquery/ui/_theme.scss +27 -27
  63. data/templates/jquery/json.js +7 -0
  64. data/templates/jquery/json.min.js +7 -0
  65. data/templates/jquery/manifest.rb +14 -2
  66. data/templates/mobile/glyphish/{Read me first - license.txt → License.txt} +0 -0
  67. data/templates/mobile/jquery.mobile.js +1583 -1408
  68. data/templates/mobile/jquery.mobile.min.js +5 -5
  69. data/templates/mobile/jquery/mobile/_base.scss +938 -1038
  70. data/templates/mobile/jquery/mobile/default.scss +25 -26
  71. data/templates/mobile/jquery/mobile/valencia.scss +0 -1
  72. data/templates/mobile/manifest.rb +1 -1
  73. data/templates/tools/config/initializers/tools.rb +2 -0
  74. data/templates/tools/flowplayer.js +24 -0
  75. data/templates/tools/flowplayer.min.js +30 -0
  76. data/templates/tools/jquery.tools.js +4 -3
  77. data/templates/tools/jquery.tools.min.js +1 -1
  78. data/templates/tools/manifest.rb +4 -0
  79. data/templates/tools/swfobject.js +777 -0
  80. data/templates/tools/swfobject.min.js +19 -0
  81. metadata +31 -15
  82. data/templates/jquery/jquery.metadata.js +0 -122
  83. data/templates/jquery/jquery.metadata.min.js +0 -2
@@ -1,25 +1,25 @@
1
1
  jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldY:0,build:function(a){this.each(function(){this.tableDnDConfig=jQuery.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,scrollAmount:5,serializeRegexp:/[^\-]*$/,serializeParamName:null,dragHandle:null},a||{});jQuery.tableDnD.makeDraggable(this)});jQuery(document).bind("mousemove",jQuery.tableDnD.mousemove).bind("mouseup",jQuery.tableDnD.mouseup);return this},makeDraggable:function(a){var c=
2
2
  a.tableDnDConfig;a.tableDnDConfig.dragHandle?jQuery("td."+a.tableDnDConfig.dragHandle,a).each(function(){jQuery(this).mousedown(function(e){jQuery.tableDnD.dragObject=this.parentNode;jQuery.tableDnD.currentTable=a;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,e);c.onDragStart&&c.onDragStart(a,this);return false})}):jQuery("tr",a).each(function(){var e=jQuery(this);e.hasClass("nodrag")||e.mousedown(function(b){if(b.target.tagName=="TD"){jQuery.tableDnD.dragObject=this;jQuery.tableDnD.currentTable=
3
3
  a;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,b);c.onDragStart&&c.onDragStart(a,this);return false}}).css("cursor","move")})},updateTables:function(){this.each(function(){this.tableDnDConfig&&jQuery.tableDnD.makeDraggable(this)})},mouseCoords:function(a){if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};return{x:a.clientX+document.body.scrollLeft-document.body.clientLeft,y:a.clientY+document.body.scrollTop-document.body.clientTop}},getMouseOffset:function(a,c){c=c||window.event;
4
- var e=this.getPosition(a),b=this.mouseCoords(c);return{x:b.x-e.x,y:b.y-e.y}},getPosition:function(a){var c=0,e=0;if(a.offsetHeight==0)a=a.firstChild;if(a&&a.offsetParent){for(;a.offsetParent;){c+=a.offsetLeft;e+=a.offsetTop;a=a.offsetParent}c+=a.offsetLeft;e+=a.offsetTop}return{x:c,y:e}},mousemove:function(a){if(jQuery.tableDnD.dragObject!=null){var c=jQuery(jQuery.tableDnD.dragObject),e=jQuery.tableDnD.currentTable.tableDnDConfig,b=jQuery.tableDnD.mouseCoords(a);a=b.y-jQuery.tableDnD.mouseOffset.y;
5
- var f=window.pageYOffset;if(document.all)if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")f=document.documentElement.scrollTop;else if(typeof document.body!="undefined")f=document.body.scrollTop;if(b.y-f<e.scrollAmount)window.scrollBy(0,-e.scrollAmount);else(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-(b.y-f)<e.scrollAmount&&window.scrollBy(0,e.scrollAmount);if(a!=jQuery.tableDnD.oldY){b=
6
- a>jQuery.tableDnD.oldY;jQuery.tableDnD.oldY=a;e.onDragClass?c.addClass(e.onDragClass):c.css(e.onDragStyle);if(c=jQuery.tableDnD.findDropTargetRow(c,a))if(b&&jQuery.tableDnD.dragObject!=c)jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,c.nextSibling);else!b&&jQuery.tableDnD.dragObject!=c&&jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,c)}return false}},findDropTargetRow:function(a,c){for(var e=jQuery.tableDnD.currentTable.rows,b=0;b<e.length;b++){var f=
7
- e[b],g=this.getPosition(f).y,h=parseInt(f.offsetHeight)/2;if(f.offsetHeight==0){g=this.getPosition(f.firstChild).y;h=parseInt(f.firstChild.offsetHeight)/2}if(c>g-h&&c<g+h){if(f==a)break;e=jQuery.tableDnD.currentTable.tableDnDConfig;if(e.onAllowDrop)if(e.onAllowDrop(a,f))return f;else break;else if(jQuery(f).hasClass("nodrop"))break;else return f}}return null},mouseup:function(){if(jQuery.tableDnD.currentTable&&jQuery.tableDnD.dragObject){var a=jQuery.tableDnD.dragObject,c=jQuery.tableDnD.currentTable.tableDnDConfig;
4
+ var e=this.getPosition(a),b=this.mouseCoords(c);return{x:b.x-e.x,y:b.y-e.y}},getPosition:function(a){var c=0,e=0;if(a.offsetHeight==0)a=a.firstChild;for(;a.offsetParent;){c+=a.offsetLeft;e+=a.offsetTop;a=a.offsetParent}c+=a.offsetLeft;e+=a.offsetTop;return{x:c,y:e}},mousemove:function(a){if(jQuery.tableDnD.dragObject!=null){var c=jQuery(jQuery.tableDnD.dragObject),e=jQuery.tableDnD.currentTable.tableDnDConfig,b=jQuery.tableDnD.mouseCoords(a);a=b.y-jQuery.tableDnD.mouseOffset.y;var f=window.pageYOffset;
5
+ if(document.all)if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")f=document.documentElement.scrollTop;else if(typeof document.body!="undefined")f=document.body.scrollTop;if(b.y-f<e.scrollAmount)window.scrollBy(0,-e.scrollAmount);else(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight)-(b.y-f)<e.scrollAmount&&window.scrollBy(0,e.scrollAmount);if(a!=jQuery.tableDnD.oldY){b=a>jQuery.tableDnD.oldY;
6
+ jQuery.tableDnD.oldY=a;e.onDragClass?c.addClass(e.onDragClass):c.css(e.onDragStyle);if(c=jQuery.tableDnD.findDropTargetRow(c,a))if(b&&jQuery.tableDnD.dragObject!=c)jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,c.nextSibling);else!b&&jQuery.tableDnD.dragObject!=c&&jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,c)}return false}},findDropTargetRow:function(a,c){for(var e=jQuery.tableDnD.currentTable.rows,b=0;b<e.length;b++){var f=e[b],g=
7
+ this.getPosition(f).y,h=parseInt(f.offsetHeight)/2;if(f.offsetHeight==0){g=this.getPosition(f.firstChild).y;h=parseInt(f.firstChild.offsetHeight)/2}if(c>g-h&&c<g+h){if(f==a)break;e=jQuery.tableDnD.currentTable.tableDnDConfig;if(e.onAllowDrop)if(e.onAllowDrop(a,f))return f;else break;else if(jQuery(f).hasClass("nodrop"))break;else return f}}return null},mouseup:function(){if(jQuery.tableDnD.currentTable&&jQuery.tableDnD.dragObject){var a=jQuery.tableDnD.dragObject,c=jQuery.tableDnD.currentTable.tableDnDConfig;
8
8
  c.onDragClass?jQuery(a).removeClass(c.onDragClass):jQuery(a).css(c.onDropStyle);jQuery.tableDnD.dragObject=null;c.onDrop&&c.onDrop(jQuery.tableDnD.currentTable,a);jQuery.tableDnD.currentTable=null}},serialize:function(){return jQuery.tableDnD.currentTable?jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable):"Error: No Table id set, you need to set an id on your table and every row"},serializeTable:function(a){for(var c="",e=a.id,b=a.rows,f=0;f<b.length;f++){if(c.length>0)c+="&";var g=b[f].id;
9
9
  if(g&&g&&a.tableDnDConfig&&a.tableDnDConfig.serializeRegexp)g=g.match(a.tableDnDConfig.serializeRegexp)[0];c+=e+"[]="+g}return c},serializeTables:function(){var a="";this.each(function(){a+=jQuery.tableDnD.serializeTable(this)});return a}};jQuery.fn.extend({tableDnD:jQuery.tableDnD.build,tableDnDUpdate:jQuery.tableDnD.updateTables,tableDnDSerialize:jQuery.tableDnD.serializeTables});
10
- (function(a){a.widget("ui.multiselect",{_init:function(){this.element.hide();this.id=this.element.attr("id");this.container=a('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);this.count=0;this.selectedContainer=a('<div class="selected"></div>').appendTo(this.container);this.availableContainer=a('<div class="available"></div>').appendTo(this.container);this.selectedActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+
11
- a.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+a.ui.multiselect.locale.removeAll+"</a></div>").appendTo(this.selectedContainer);this.availableActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+a.ui.multiselect.locale.addAll+"</a></div>").appendTo(this.availableContainer);this.selectedList=a('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",
12
- function(){return false}).appendTo(this.selectedContainer);this.availableList=a('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",function(){return false}).appendTo(this.availableContainer);var c=this;this.container.width(this.element.width()+1);this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-
13
- this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));if(!this.options.animated){this.options.show="show";this.options.hide="hide"}this._populateLists(this.element.find("option"));this.options.sortable&&a("ul.selected").sortable({placeholder:"ui-state-highlight",axis:"y",update:function(){c.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(c.element)})},receive:function(e,
14
- b){b.item.data("optionLink").attr("selected",true);c.count+=1;c._updateCount();c.selectedList.children(".ui-draggable").each(function(){a(this).removeClass("ui-draggable");a(this).data("optionLink",b.item.data("optionLink"));a(this).data("idx",b.item.data("idx"));c._applyItemState(a(this),true)});setTimeout(function(){b.item.remove()},1)}});this.options.searchable?this._registerSearchEvents(this.availableContainer.find("input.search")):a(".search").hide();a(".remove-all").click(function(){c._populateLists(c.element.find("option").removeAttr("selected"));
15
- return false});a(".add-all").click(function(){c._populateLists(c.element.find("option").attr("selected","selected"));return false})},destroy:function(){this.element.show();this.container.remove();a.widget.prototype.destroy.apply(this,arguments)},_populateLists:function(c){this.selectedList.children(".ui-element").remove();this.availableList.children(".ui-element").remove();this.count=0;var e=this;a(c.map(function(b){var f=e._getOptionNode(this).appendTo(this.selected?e.selectedList:e.availableList).show();
16
- if(this.selected)e.count+=1;e._applyItemState(f,this.selected);f.data("idx",b);return f[0]}));this._updateCount()},_updateCount:function(){this.selectedContainer.find("span.count").text(this.count+" "+a.ui.multiselect.locale.itemsCount)},_getOptionNode:function(c){c=a(c);var e=a('<li class="ui-state-default ui-element" title="'+c.text()+'"><span class="ui-icon"/>'+c.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();e.data("optionLink",c);return e},_cloneWithData:function(c){var e=
17
- c.clone();e.data("optionLink",c.data("optionLink"));e.data("idx",c.data("idx"));return e},_setSelected:function(c,e){c.data("optionLink").attr("selected",e);if(e){var b=this._cloneWithData(c);c[this.options.hide](this.options.animated,function(){a(this).remove()});b.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(b,true);return b}else{var f=this.availableList.find("li"),g=this.options.nodeComparator;b=null;var h=c.data("idx"),j=g(c,a(f[h]));if(j)for(;h>=
18
- 0&&h<f.length;){j>0?h++:h--;if(j!=g(c,a(f[h]))){b=f[j>0?h:h+1];break}}else b=f[h];f=this._cloneWithData(c);b?f.insertBefore(a(b)):f.appendTo(this.availableList);c[this.options.hide](this.options.animated,function(){a(this).remove()});f.hide()[this.options.show](this.options.animated);this._applyItemState(f,false);return f}},_applyItemState:function(c,e){if(e){this.options.sortable?c.children("span").addClass("ui-icon-arrowthick-2-n-s").removeClass("ui-helper-hidden").addClass("ui-icon"):c.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");
19
- c.find("a.action span").addClass("ui-icon-minus").removeClass("ui-icon-plus");this._registerRemoveEvents(c.find("a.action"))}else{c.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");c.find("a.action span").addClass("ui-icon-plus").removeClass("ui-icon-minus");this._registerAddEvents(c.find("a.action"))}this._registerHoverEvents(c)},_filter:function(c){var e=a(this),b=c.children("li");c=b.map(function(){return a(this).text().toLowerCase()});
20
- var f=a.trim(e.val().toLowerCase()),g=[];if(f){b.hide();c.each(function(h){this.indexOf(f)>-1&&g.push(h)});a.each(g,function(){a(b[this]).show()})}else b.show()},_registerHoverEvents:function(c){c.removeClass("ui-state-hover");c.mouseover(function(){a(this).addClass("ui-state-hover")});c.mouseout(function(){a(this).removeClass("ui-state-hover")})},_registerAddEvents:function(c){var e=this;c.click(function(){e._setSelected(a(this).parent(),true);e.count+=1;e._updateCount();return false}).each(function(){a(this).parent().draggable({connectToSortable:"ul.selected",
21
- helper:function(){var b=e._cloneWithData(a(this)).width(a(this).width()-50);b.width(a(this).width());return b},appendTo:".ui-multiselect",containment:".ui-multiselect",revert:"invalid"})})},_registerRemoveEvents:function(c){var e=this;c.click(function(){e._setSelected(a(this).parent(),false);e.count-=1;e._updateCount();return false})},_registerSearchEvents:function(c){var e=this;c.focus(function(){a(this).addClass("ui-state-active")}).blur(function(){a(this).removeClass("ui-state-active")}).keypress(function(b){if(b.keyCode==
22
- 13)return false}).keyup(function(){e._filter.apply(this,[e.availableList])})}});a.extend(a.ui.multiselect,{defaults:{sortable:true,searchable:true,animated:"fast",show:"slideDown",hide:"slideUp",dividerLocation:0.6,nodeComparator:function(c,e){var b=c.text(),f=e.text();return b==f?0:b<f?-1:1}},locale:{addAll:"Add all",removeAll:"Remove all",itemsCount:"items selected"}})})(jQuery);
10
+ (function(a){a.widget("ui.multiselect",{options:{sortable:true,searchable:true,animated:"fast",show:"slideDown",hide:"slideUp",dividerLocation:0.6,nodeComparator:function(c,e){var b=c.text(),f=e.text();return b==f?0:b<f?-1:1}},_create:function(){this.element.hide();this.id=this.element.attr("id");this.container=a('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);this.count=0;this.selectedContainer=a('<div class="selected"></div>').appendTo(this.container);
11
+ this.availableContainer=a('<div class="available"></div>').appendTo(this.container);this.selectedActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+a.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+a.ui.multiselect.locale.removeAll+"</a></div>").appendTo(this.selectedContainer);this.availableActions=a('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+
12
+ a.ui.multiselect.locale.addAll+"</a></div>").appendTo(this.availableContainer);this.selectedList=a('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",function(){return false}).appendTo(this.selectedContainer);this.availableList=a('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind("selectstart",function(){return false}).appendTo(this.availableContainer);var c=this;this.container.width(this.element.width()+
13
+ 1);this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));if(!this.options.animated){this.options.show="show";this.options.hide="hide"}this._populateLists(this.element.find("option"));this.options.sortable&&
14
+ this.selectedList.sortable({placeholder:"ui-state-highlight",axis:"y",update:function(){c.selectedList.find("li").each(function(){a(this).data("optionLink")&&a(this).data("optionLink").remove().appendTo(c.element)})},receive:function(e,b){b.item.data("optionLink").attr("selected",true);c.count+=1;c._updateCount();c.selectedList.children(".ui-draggable").each(function(){a(this).removeClass("ui-draggable");a(this).data("optionLink",b.item.data("optionLink"));a(this).data("idx",b.item.data("idx"));c._applyItemState(a(this),
15
+ true)});setTimeout(function(){b.item.remove()},1)}});this.options.searchable?this._registerSearchEvents(this.availableContainer.find("input.search")):a(".search").hide();this.container.find(".remove-all").click(function(){c._populateLists(c.element.find("option").removeAttr("selected"));return false});this.container.find(".add-all").click(function(){c._populateLists(c.element.find("option").attr("selected","selected"));return false})},destroy:function(){this.element.show();this.container.remove();
16
+ a.Widget.prototype.destroy.apply(this,arguments)},_populateLists:function(c){this.selectedList.children(".ui-element").remove();this.availableList.children(".ui-element").remove();this.count=0;var e=this;a(c.map(function(b){var f=e._getOptionNode(this).appendTo(this.selected?e.selectedList:e.availableList).show();if(this.selected)e.count+=1;e._applyItemState(f,this.selected);f.data("idx",b);return f[0]}));this._updateCount()},_updateCount:function(){this.selectedContainer.find("span.count").text(this.count+
17
+ " "+a.ui.multiselect.locale.itemsCount)},_getOptionNode:function(c){c=a(c);var e=a('<li class="ui-state-default ui-element" title="'+c.text()+'"><span class="ui-icon"/>'+c.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();e.data("optionLink",c);return e},_cloneWithData:function(c){var e=c.clone();e.data("optionLink",c.data("optionLink"));e.data("idx",c.data("idx"));return e},_setSelected:function(c,e){c.data("optionLink").attr("selected",e);if(e){var b=this._cloneWithData(c);
18
+ c[this.options.hide](this.options.animated,function(){a(this).remove()});b.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);this._applyItemState(b,true);return b}else{var f=this.availableList.find("li"),g=this.options.nodeComparator;b=null;var h=c.data("idx"),j=g(c,a(f[h]));if(j)for(;h>=0&&h<f.length;){j>0?h++:h--;if(j!=g(c,a(f[h]))){b=f[j>0?h:h+1];break}}else b=f[h];f=this._cloneWithData(c);b?f.insertBefore(a(b)):f.appendTo(this.availableList);c[this.options.hide](this.options.animated,
19
+ function(){a(this).remove()});f.hide()[this.options.show](this.options.animated);this._applyItemState(f,false);return f}},_applyItemState:function(c,e){if(e){this.options.sortable?c.children("span").addClass("ui-icon-arrowthick-2-n-s").removeClass("ui-helper-hidden").addClass("ui-icon"):c.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");c.find("a.action span").addClass("ui-icon-minus").removeClass("ui-icon-plus");this._registerRemoveEvents(c.find("a.action"))}else{c.children("span").removeClass("ui-icon-arrowthick-2-n-s").addClass("ui-helper-hidden").removeClass("ui-icon");
20
+ c.find("a.action span").addClass("ui-icon-plus").removeClass("ui-icon-minus");this._registerAddEvents(c.find("a.action"))}this._registerHoverEvents(c)},_filter:function(c){var e=a(this),b=c.children("li");c=b.map(function(){return a(this).text().toLowerCase()});var f=a.trim(e.val().toLowerCase()),g=[];if(f){b.hide();c.each(function(h){this.indexOf(f)>-1&&g.push(h)});a.each(g,function(){a(b[this]).show()})}else b.show()},_registerHoverEvents:function(c){c.removeClass("ui-state-hover");c.mouseover(function(){a(this).addClass("ui-state-hover")});
21
+ c.mouseout(function(){a(this).removeClass("ui-state-hover")})},_registerAddEvents:function(c){var e=this;c.click(function(){e._setSelected(a(this).parent(),true);e.count+=1;e._updateCount();return false});this.options.sortable&&c.each(function(){a(this).parent().draggable({connectToSortable:e.selectedList,helper:function(){var b=e._cloneWithData(a(this)).width(a(this).width()-50);b.width(a(this).width());return b},appendTo:e.container,containment:e.container,revert:"invalid"})})},_registerRemoveEvents:function(c){var e=
22
+ this;c.click(function(){e._setSelected(a(this).parent(),false);e.count-=1;e._updateCount();return false})},_registerSearchEvents:function(c){var e=this;c.focus(function(){a(this).addClass("ui-state-active")}).blur(function(){a(this).removeClass("ui-state-active")}).keypress(function(b){if(b.keyCode==13)return false}).keyup(function(){e._filter.apply(this,[e.availableList])})}});a.extend(a.ui.multiselect,{locale:{addAll:"Add all",removeAll:"Remove all",itemsCount:"items selected"}})})(jQuery);
23
23
  (function(a){a.jgrid=a.jgrid||{};a.extend(a.jgrid,{htmlDecode:function(c){if(c=="&nbsp;"||c=="&#160;"||c.length==1&&c.charCodeAt(0)==160)return"";return!c?c:String(c).replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"')},htmlEncode:function(c){return!c?c:String(c).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\"/g,"&quot;")},format:function(c){var e=a.makeArray(arguments).slice(1);if(c===undefined)c="";return c.replace(/\{(\d+)\}/g,function(b,
24
24
  f){return e[f]})},getCellIndex:function(c){c=a(c);if(c.is("tr"))return-1;c=(!c.is("td")&&!c.is("th")?c.closest("td,th"):c)[0];if(a.browser.msie)return a.inArray(c,c.parentNode.cells);return c.cellIndex},stripHtml:function(c){c+="";var e=/<("[^"]*"|'[^']*'|[^'">])*>/gi;if(c)return(c=c.replace(e,""))&&c!=="&nbsp;"&&c!=="&#160;"?c.replace(/\"/g,"'"):"";else return c},stringToDoc:function(c){var e;if(typeof c!=="string")return c;try{e=(new DOMParser).parseFromString(c,"text/xml")}catch(b){e=new ActiveXObject("Microsoft.XMLDOM");
25
25
  e.async=false;e.loadXML(c)}return e&&e.documentElement&&e.documentElement.tagName!="parsererror"?e:null},parse:function(c){c=c;if(c.substr(0,9)=="while(1);")c=c.substr(9);if(c.substr(0,2)=="/*")c=c.substr(2,c.length-4);c||(c="{}");return a.jgrid.useJSON===true&&typeof JSON==="object"&&typeof JSON.parse==="function"?JSON.parse(c):eval("("+c+")")},parseDate:function(c,e){var b={m:1,d:1,y:1970,h:0,i:0,s:0},f,g,h;if(e&&e!==null&&e!==undefined){e=a.trim(e);e=e.split(/[\\\/:_;.,\t\T\s-]/);c=c.split(/[\\\/:_;.,\t\T\s-]/);
@@ -99,9 +99,9 @@ subgrid:{root:"rows",repeatitems:true,cell:"cell"}},d.p.localReader);if(d.p.scro
99
99
  W+" ui-state-disabled ui-icon ui-icon-triangle-1-n ui-sort-"+j+"'></span>";W+="<span sort='desc' class='ui-grid-ico-sort ui-icon-desc"+G+" ui-state-disabled ui-icon ui-icon-triangle-1-s ui-sort-"+j+"'></span></span>";for(h=0;h<this.p.colNames.length;h++){G=d.p.headertitles?' title="'+a.jgrid.stripHtml(d.p.colNames[h])+'"':"";l+="<th id='"+d.p.id+"_"+d.p.colModel[h].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+j+"'"+G+">";G=d.p.colModel[h].index||d.p.colModel[h].name;l+=
100
100
  "<div id='jqgh_"+d.p.colModel[h].name+"' "+Da+">"+d.p.colNames[h];d.p.colModel[h].width=d.p.colModel[h].width?parseInt(d.p.colModel[h].width,10):150;if(typeof d.p.colModel[h].title!=="boolean")d.p.colModel[h].title=true;if(G==d.p.sortname)d.p.lastsort=h;l+=W+"</div></th>"}l+="</tr></thead>";W=null;a(this).append(l);a("thead tr:first th",this).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});if(this.p.multiselect){var ka=[],Z;a("#cb_"+a.jgrid.jqID(d.p.id),
101
101
  this).bind("click",function(){d.p.selarrrow=[];if(this.checked){a("[id^=jqg_"+d.p.id+"_]").attr("checked","checked");a(d.rows).each(function(t){if(t>0)if(!a(this).hasClass("subgrid")&&!a(this).hasClass("jqgroup")){a(this).addClass("ui-state-highlight").attr("aria-selected","true");d.p.selarrrow.push(this.id);d.p.selrow=this.id}});Z=true;ka=[]}else{a("[id^=jqg_"+d.p.id+"_]").removeAttr("checked");a(d.rows).each(function(t){if(t>0)if(!a(this).hasClass("subgrid")){a(this).removeClass("ui-state-highlight").attr("aria-selected",
102
- "false");ka.push(this.id)}});d.p.selrow=null;Z=false}if(a.isFunction(d.p.onSelectAll))d.p.onSelectAll.call(d,Z?d.p.selarrrow:ka,Z)})}if(d.p.autowidth===true){l=a(v).innerWidth();d.p.width=l>0?l:"nw"}(function(){var t=0,u=d.p.cellLayout,w=0,E,F=d.p.scrollOffset,N,M=false,S,aa=0,H=0,K=0,O;if(q)u=0;a.each(d.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){t+=r(this.width,0);if(this.fixed){aa+=this.width;H+=this.width+u}else w++;K++}});if(isNaN(d.p.width))d.p.width=
103
- g.width=t;else g.width=d.p.width;d.p.tblwidth=t;if(d.p.shrinkToFit===false&&d.p.forceFit===true)d.p.forceFit=false;if(d.p.shrinkToFit===true&&w>0){S=g.width-u*w-H;if(!isNaN(d.p.height)){S-=F;M=true}t=0;a.each(d.p.colModel,function(X){if(this.hidden===false&&!this.fixed){this.width=N=Math.round(S*this.width/(d.p.tblwidth-aa));t+=N;E=X}});O=0;if(M){if(g.width-H-(t+u*w)!==F)O=g.width-H-(t+u*w)-F}else if(!M&&Math.abs(g.width-H-(t+u*w))!==1)O=g.width-H-(t+u*w);d.p.colModel[E].width+=O;d.p.tblwidth=t+O+
104
- aa+K*u;if(d.p.tblwidth>d.p.width){d.p.colModel[E].width-=d.p.tblwidth-parseInt(d.p.width,10);d.p.tblwidth=d.p.width}}})();a(v).css("width",g.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+d.p.id+"'>&#160;</div>");a(k).css("width",g.width+"px");l=a("thead:first",d).get(0);var la="";if(d.p.footerrow)la+="<table role='grid' style='width:"+d.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+
102
+ "false");ka.push(this.id)}});d.p.selrow=null;Z=false}if(a.isFunction(d.p.onSelectAll))d.p.onSelectAll.call(d,Z?d.p.selarrrow:ka,Z)})}if(d.p.autowidth===true){l=a(v).innerWidth();d.p.width=l>0?l:"nw"}(function(){var t=0,u=d.p.cellLayout,w=0,E,F=d.p.scrollOffset,N,M=false,S,aa=0,H=0,K=0,O;if(q)u=0;a.each(d.p.colModel,function(){if(typeof this.hidden==="undefined")this.hidden=false;if(this.hidden===false){t+=r(this.width,0);if(this.fixed){aa+=this.width;H+=this.width+u}else w++;K++}});if(d.p.shrinkToFit===
103
+ false)t+=u*K;if(isNaN(d.p.width))d.p.width=g.width=t;else g.width=d.p.width;d.p.tblwidth=t;if(d.p.shrinkToFit===false&&d.p.forceFit===true)d.p.forceFit=false;if(d.p.shrinkToFit===true&&w>0){S=g.width-u*w-H;if(!isNaN(d.p.height)){S-=F;M=true}t=0;a.each(d.p.colModel,function(X){if(this.hidden===false&&!this.fixed){this.width=N=Math.round(S*this.width/(d.p.tblwidth-aa));t+=N;E=X}});O=0;if(M){if(g.width-H-(t+u*w)!==F)O=g.width-H-(t+u*w)-F}else if(!M&&Math.abs(g.width-H-(t+u*w))!==1)O=g.width-H-(t+u*w);
104
+ d.p.colModel[E].width+=O;d.p.tblwidth=t+O+aa+K*u;if(d.p.tblwidth>d.p.width){d.p.colModel[E].width-=d.p.tblwidth-parseInt(d.p.width,10);d.p.tblwidth=d.p.width}}})();a(v).css("width",g.width+"px").append("<div class='ui-jqgrid-resize-mark' id='rs_m"+d.p.id+"'>&#160;</div>");a(k).css("width",g.width+"px");l=a("thead:first",d).get(0);var la="";if(d.p.footerrow)la+="<table role='grid' style='width:"+d.p.tblwidth+"px' class='ui-jqgrid-ftable' cellspacing='0' cellpadding='0' border='0'><tbody><tr role='row' class='ui-widget-content footrow footrow-"+
105
105
  j+"'>";k=a("tr:first",l);var ba="<tr class='jqgfirstrow' role='row' style='height:auto'>";d.p.disableClick=false;a("th",k).each(function(t){J=d.p.colModel[t].width;if(typeof d.p.colModel[t].resizable==="undefined")d.p.colModel[t].resizable=true;if(d.p.colModel[t].resizable){T=document.createElement("span");a(T).html("&#160;").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+j);a.browser.opera||a(T).css("cursor","col-resize");a(this).addClass(d.p.resizeclass)}else T="";a(this).css("width",J+"px").prepend(T);
106
106
  var u="";if(d.p.colModel[t].hidden){a(this).css("display","none");u="display:none;"}ba+="<td role='gridcell' style='height:0px;width:"+J+"px;"+u+"'></td>";g.headers[t]={width:J,el:this};P=d.p.colModel[t].sortable;if(typeof P!=="boolean")P=d.p.colModel[t].sortable=true;u=d.p.colModel[t].name;u=="cb"||u=="subgrid"||u=="rn"||d.p.viewsortcols[2]&&a("div",this).addClass("ui-jqgrid-sortable");if(P)if(d.p.viewsortcols[0]){a("div span.s-ico",this).show();t==d.p.lastsort&&a("div span.ui-icon-"+d.p.sortorder,
107
107
  this).removeClass("ui-state-disabled")}else if(t==d.p.lastsort){a("div span.s-ico",this).show();a("div span.ui-icon-"+d.p.sortorder,this).removeClass("ui-state-disabled")}if(d.p.footerrow)la+="<td role='gridcell' "+n(t,0,"")+">&#160;</td>"}).mousedown(function(t){if(a(t.target).closest("th>span.ui-jqgrid-resize").length==1){var u=a.jgrid.getCellIndex(this);if(d.p.forceFit===true){var w=d.p,E=u,F;for(F=u+1;F<d.p.colModel.length;F++)if(d.p.colModel[F].hidden!==true){E=F;break}w.nv=E-u}g.dragStart(u,
@@ -151,7 +151,7 @@ parseInt(c,10);b.p.tblwidth=c;f=b.p.colModel[j].width-=l}else f=b.p.colModel[j].
151
151
  h);a("[id^=jqgh_]",h).empty().html(e).append(j);this.p.colNames[g]=e}if(b)typeof b==="string"?a(h).addClass(b):a(h).css(b);typeof f==="object"&&a(h).attr(f)}}})},setCell:function(c,e,b,f,g,h){return this.each(function(){var j=-1,d,l;if(this.grid){if(isNaN(e))a(this.p.colModel).each(function(m){if(this.name==e){j=m;return false}});else j=parseInt(e,10);if(j>=0)if(d=this.rows.namedItem(c)){var k=a("td:eq("+j+")",d);if(b!==""||h===true){d=this.formatter(c,b,j,d,"edit");l=this.p.colModel[j].title?{title:a.jgrid.stripHtml(d)}:
152
152
  {};this.p.treeGrid&&a(".tree-wrap",a(k)).length>0?a("span",a(k)).html(d).attr(l):a(k).html(d).attr(l);if(this.p.datatype=="local"){d=this.p.colModel[j];b=d.formatter&&typeof d.formatter==="string"&&d.formatter=="date"?a.unformat.date(b,d):b;l=this.p._index[c];if(typeof l!="undefined")this.p.data[l][d.name]=b}}if(typeof f==="string")a(k).addClass(f);else f&&a(k).css(f);typeof g==="object"&&a(k).attr(g)}}})},getCell:function(c,e){var b=false;this.each(function(){var f=-1;if(this.grid){if(isNaN(e))a(this.p.colModel).each(function(j){if(this.name===
153
153
  e){f=j;return false}});else f=parseInt(e,10);if(f>=0){var g=this.rows.namedItem(c);if(g)try{b=a.unformat(a("td:eq("+f+")",g),{rowId:g.id,colModel:this.p.colModel[f]},f)}catch(h){b=a.jgrid.htmlDecode(a("td:eq("+f+")",g).html())}}}});return b},getCol:function(c,e,b){var f=[],g,h=0;e=typeof e!="boolean"?false:e;if(typeof b=="undefined")b=false;this.each(function(){var j=-1;if(this.grid){if(isNaN(c))a(this.p.colModel).each(function(m){if(this.name===c){j=m;return false}});else j=parseInt(c,10);if(j>=
154
- 0){var d=this.rows.length,l=0;if(d&&d>0){for(;l<d;){if(a(this.rows[l]).hasClass("jqgrow")){try{g=a.unformat(a(this.rows[l].cells[j]),{rowId:this.rows[l].id,colModel:this.p.colModel[j]},j)}catch(k){g=a.jgrid.htmlDecode(this.rows[l].cells[j].innerHTML)}if(b)h+=parseFloat(g);else if(e)f.push({id:this.rows[l].id,value:g});else f[l]=g}l++}if(b)switch(b.toLowerCase()){case "sum":f=h;break;case "avg":f=h/d;break;case "count":f=d}}}}});return f},clearGridData:function(c){return this.each(function(){if(this.grid){if(typeof c!=
154
+ 0){var d=this.rows.length,l=0;if(d&&d>0){for(;l<d;){if(a(this.rows[l]).hasClass("jqgrow")){try{g=a.unformat(a(this.rows[l].cells[j]),{rowId:this.rows[l].id,colModel:this.p.colModel[j]},j)}catch(k){g=a.jgrid.htmlDecode(this.rows[l].cells[j].innerHTML)}if(b)h+=parseFloat(g);else e?f.push({id:this.rows[l].id,value:g}):f.push(g)}l++}if(b)switch(b.toLowerCase()){case "sum":f=h;break;case "avg":f=h/d;break;case "count":f=d}}}}});return f},clearGridData:function(c){return this.each(function(){if(this.grid){if(typeof c!=
155
155
  "boolean")c=false;if(this.p.deepempty)a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:gt(0)").remove();else{var e=a("#"+a.jgrid.jqID(this.p.id)+" tbody:first tr:first")[0];a("#"+a.jgrid.jqID(this.p.id)+" tbody:first").empty().append(e)}this.p.footerrow&&c&&a(".ui-jqgrid-ftable td",this.grid.sDiv).html("&#160;");this.p.selrow=null;this.p.selarrrow=[];this.p.savedRow=[];this.p.records=0;this.p.page=1;this.p.lastpage=0;this.p.reccount=0;this.p.data=[];this.p_index={};this.updatepager(true,false)}})},
156
156
  getInd:function(c,e){var b=false,f;this.each(function(){if(f=this.rows.namedItem(c))b=e===true?f:f.rowIndex});return b}})})(jQuery);
157
157
  (function(a){a.extend(a.jgrid,{showModal:function(c){c.w.show()},closeModal:function(c){c.w.hide().attr("aria-hidden","true");c.o&&c.o.remove()},hideModal:function(c,e){e=a.extend({jqm:true,gb:""},e||{});if(e.onClose){var b=e.onClose(c);if(typeof b=="boolean"&&!b)return}if(a.fn.jqm&&e.jqm===true)a(c).attr("aria-hidden","true").jqmHide();else{if(e.gb!=="")try{a(".jqgrid-overlay:first",e.gb).hide()}catch(f){}a(c).hide().attr("aria-hidden","true")}},findPos:function(c){var e=0,b=0;if(c.offsetParent){do{e+=
@@ -255,7 +255,7 @@ p,complete:function(D,x){if(x!="success"){s[0]=false;s[1]=a.isFunction(c.errorTe
255
255
  B.length;z++)a(f).jqGrid("delRowData",B[z]);f.p.selrow=null;f.p.selarrrow=[]}a.isFunction(c.afterComplete)&&setTimeout(function(){c.afterComplete(D,A)},500)}c.processing=false;a("#dData","#"+m+"_2").removeClass("ui-state-active");s[0]&&a.jgrid.hideModal("#"+n.themodal,{gb:"#gbox_"+d,jqm:b.jqModal,onClose:c.onClose})},error:function(D,x,B){a("#DelError>td","#"+m).html(x+" : "+B);a("#DelError","#"+m).show();c.processing=false;a("#dData","#"+m+"_2").removeClass("ui-state-active")}},a.jgrid.ajaxOptions,
256
256
  b.ajaxDelOptions);if(!C.url&&!c.useDataProxy)if(a.isFunction(f.p.dataProxy))c.useDataProxy=true;else{s[0]=false;s[1]+=" "+a.jgrid.errors.nourl}if(s[0])c.useDataProxy?f.p.dataProxy.call(f,C,"del_"+f.p.id):a.ajax(C)}if(s[0]===false){a("#DelError>td","#"+m).html(s[1]);a("#DelError","#"+m).show()}return false});a("#eData","#"+m+"_2").click(function(){a.jgrid.hideModal("#"+n.themodal,{gb:"#gbox_"+d,jqm:b.jqModal,onClose:c.onClose});return false});g&&b.beforeShowForm(a("#"+m));a.jgrid.viewModal("#"+n.themodal,
257
257
  {gbox:"#gbox_"+d,jqm:b.jqModal,overlay:b.overlay,modal:b.modal})}h&&b.afterShowForm(a("#"+m));b.closeOnEscape===true&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+n.modalhead).focus()},0)}})},navGrid:function(e,b,f,g,h,j,d){b=a.extend({edit:true,editicon:"ui-icon-pencil",add:true,addicon:"ui-icon-plus",del:true,delicon:"ui-icon-trash",search:true,searchicon:"ui-icon-search",refresh:true,refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:false,viewicon:"ui-icon-document",position:"left",
258
- closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,b||{});return this.each(function(){var l={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},k=this,m,p,q;if(!(!k.grid||typeof e!="string")){if(a("#"+l.themodal).html()===null){if(typeof window.innerWidth!="undefined"){m=window.innerWidth;p=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==
258
+ closeOnEscape:true,beforeRefresh:null,afterRefresh:null,cloneToTop:false},a.jgrid.nav,b||{});return this.each(function(){if(!this.nav){var l={themodal:"alertmod",modalhead:"alerthd",modalcontent:"alertcnt"},k=this,m,p,q;if(!(!k.grid||typeof e!="string")){if(a("#"+l.themodal).html()===null){if(typeof window.innerWidth!="undefined"){m=window.innerWidth;p=window.innerHeight}else if(typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==
259
259
  0){m=document.documentElement.clientWidth;p=document.documentElement.clientHeight}else{m=1024;p=768}a.jgrid.createModal(l,"<div>"+b.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+k.p.id,jqModal:true,drag:true,resize:true,caption:b.alertcap,top:p/2-25,left:m/2-100,width:200,height:"auto",closeOnEscape:b.closeOnEscape},"","",true)}m=1;if(b.cloneToTop&&k.p.toppager)m=2;for(p=0;p<m;p++){var v=a("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
260
260
  r,n;if(p===0){r=e;n=k.p.id;if(r==k.p.toppager){n+="_top";m=1}}else{r=k.p.toppager;n=k.p.id+"_top"}k.p.direction=="rtl"&&a(v).attr("dir","rtl").css("float","right");if(b.add){g=g||{};q=a("<td class='ui-pg-button ui-corner-all'></td>");a(q).append("<div class='ui-pg-div'><span class='ui-icon "+b.addicon+"'></span>"+b.addtext+"</div>");a("tr",v).append(q);a(q,v).attr({title:b.addtitle||"",id:g.id||"add_"+n}).click(function(){a(this).hasClass("ui-state-disabled")||(typeof b.addfunc=="function"?b.addfunc():
261
261
  a(k).jqGrid("editGridRow","new",g));return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});q=null}if(b.edit){q=a("<td class='ui-pg-button ui-corner-all'></td>");f=f||{};a(q).append("<div class='ui-pg-div'><span class='ui-icon "+b.editicon+"'></span>"+b.edittext+"</div>");a("tr",v).append(q);a(q,v).attr({title:b.edittitle||"",id:f.id||"edit_"+n}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var o=
@@ -265,11 +265,11 @@ h=h||{};a(q).append("<div class='ui-pg-div'><span class='ui-icon "+b.delicon+"'>
265
265
  a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});q=null}if(b.add||b.edit||b.del||b.view)a("tr",v).append("<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>");if(b.search){q=a("<td class='ui-pg-button ui-corner-all'></td>");j=j||{};a(q).append("<div class='ui-pg-div'><span class='ui-icon "+b.searchicon+"'></span>"+b.searchtext+"</div>");a("tr",v).append(q);a(q,v).attr({title:b.searchtitle||"",id:j.id||"search_"+
266
266
  n}).click(function(){a(this).hasClass("ui-state-disabled")||a(k).jqGrid("searchGrid",j);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});q=null}if(b.refresh){q=a("<td class='ui-pg-button ui-corner-all'></td>");a(q).append("<div class='ui-pg-div'><span class='ui-icon "+b.refreshicon+"'></span>"+b.refreshtext+"</div>");a("tr",v).append(q);a(q,v).attr({title:b.refreshtitle||"",id:"refresh_"+n}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(b.beforeRefresh)&&
267
267
  b.beforeRefresh();k.p.search=false;try{a("#fbox_"+k.p.id).searchFilter().reset({reload:false});a.isFunction(k.clearToolbar)&&k.clearToolbar(false)}catch(o){}switch(b.refreshstate){case "firstpage":a(k).trigger("reloadGrid",[{page:1}]);break;case "current":a(k).trigger("reloadGrid",[{current:true}])}a.isFunction(b.afterRefresh)&&b.afterRefresh()}return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});
268
- q=null}q=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+q+";visibility:hidden;' ></div>");q=a(v).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(r+"_"+b.position,r).append(v);if(k.p._nvtd){if(q>k.p._nvtd[0]){a(r+"_"+b.position,r).width(q);k.p._nvtd[0]=q}k.p._nvtd[1]=q}v=q=q=null}}})},navButtonAdd:function(e,b){b=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,
269
- position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0],g=this;if(f){var h=a("<td></td>");b.buttonicon.toString().toUpperCase()=="NONE"?a(h).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+b.caption+"</div>"):a(h).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+"</div>");b.id&&a(h).attr("id",b.id);if(b.position==
270
- "first")f.rows[0].cells.length===0?a("tr",f).append(h):a("tr td:eq(0)",f).before(h);else a("tr",f).append(h);a(h,f).attr("title",b.title||"").click(function(j){a(this).hasClass("ui-state-disabled")||a.isFunction(b.onClickButton)&&b.onClickButton.call(g,j);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},navSeparatorAdd:function(e,b){b=a.extend({sepclass:"ui-separator",sepcontent:""},b||
271
- {});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0];if(f){var g="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+b.sepclass+"'></span>"+b.sepcontent+"</td>";a("tr",f).append(g)}}})},GridToForm:function(e,b){return this.each(function(){if(this.grid){var f=a(this).jqGrid("getRowData",e);if(f)for(var g in f)a("[name="+g+"]",b).is("input:radio")||a("[name="+g+"]",b).is("input:checkbox")?a("[name="+g+"]",b).each(function(){a(this).val()==
272
- f[g]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+g+"]",b).val(f[g])}})},FormToGrid:function(e,b,f,g){return this.each(function(){if(this.grid){f||(f="set");g||(g="first");var h=a(b).serializeArray(),j={};a.each(h,function(d,l){j[l.name]=l.value});if(f=="add")a(this).jqGrid("addRowData",e,j,g);else f=="set"&&a(this).jqGrid("setRowData",e,j)}})}})})(jQuery);
268
+ q=null}q=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+q+";visibility:hidden;' ></div>");q=a(v).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(r+"_"+b.position,r).append(v);if(k.p._nvtd){if(q>k.p._nvtd[0]){a(r+"_"+b.position,r).width(q);k.p._nvtd[0]=q}k.p._nvtd[1]=q}v=q=q=null;this.nav=true}}}})},navButtonAdd:function(e,b){b=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",
269
+ onClickButton:null,position:"last",cursor:"pointer"},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0],g=this;if(f)if(!(b.id&&a("#"+b.id,f).html()!=null)){var h=a("<td></td>");b.buttonicon.toString().toUpperCase()=="NONE"?a(h).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'>"+b.caption+"</div>"):a(h).addClass("ui-pg-button ui-corner-all").append("<div class='ui-pg-div'><span class='ui-icon "+b.buttonicon+"'></span>"+b.caption+
270
+ "</div>");b.id&&a(h).attr("id",b.id);if(b.position=="first")f.rows[0].cells.length===0?a("tr",f).append(h):a("tr td:eq(0)",f).before(h);else a("tr",f).append(h);a(h,f).attr("title",b.title||"").click(function(j){a(this).hasClass("ui-state-disabled")||a.isFunction(b.onClickButton)&&b.onClickButton.call(g,j);return false}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},navSeparatorAdd:function(e,b){b=
271
+ a.extend({sepclass:"ui-separator",sepcontent:""},b||{});return this.each(function(){if(this.grid){if(e.indexOf("#")!==0)e="#"+e;var f=a(".navtable",e)[0];if(f){var g="<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+b.sepclass+"'></span>"+b.sepcontent+"</td>";a("tr",f).append(g)}}})},GridToForm:function(e,b){return this.each(function(){if(this.grid){var f=a(this).jqGrid("getRowData",e);if(f)for(var g in f)a("[name="+g+"]",b).is("input:radio")||a("[name="+g+"]",b).is("input:checkbox")?
272
+ a("[name="+g+"]",b).each(function(){a(this).val()==f[g]?a(this).attr("checked","checked"):a(this).attr("checked","")}):a("[name="+g+"]",b).val(f[g])}})},FormToGrid:function(e,b,f,g){return this.each(function(){if(this.grid){f||(f="set");g||(g="first");var h=a(b).serializeArray(),j={};a.each(h,function(d,l){j[l.name]=l.value});if(f=="add")a(this).jqGrid("addRowData",e,j,g);else f=="set"&&a(this).jqGrid("setRowData",e,j)}})}})})(jQuery);
273
273
  (function(a){a.jgrid.extend({editRow:function(c,e,b,f,g,h,j,d,l){return this.each(function(){var k=this,m,p,q=0,v=null,r={},n,o;if(k.grid){n=a(k).jqGrid("getInd",c,true);if(n!==false)if((a(n).attr("editable")||"0")=="0"&&!a(n).hasClass("not-editable-row")){o=k.p.colModel;a("td",n).each(function(s){m=o[s].name;var A=k.p.treeGrid===true&&m==k.p.ExpandColumn;if(A)p=a("span:first",this).html();else try{p=a.unformat(this,{rowId:c,colModel:o[s]},s)}catch(C){p=a(this).html()}if(m!="cb"&&m!="subgrid"&&m!=
274
274
  "rn"){if(k.p.autoencode)p=a.jgrid.htmlDecode(p);r[m]=p;if(o[s].editable===true){if(v===null)v=s;A?a("span:first",this).html(""):a(this).html("");var D=a.extend({},o[s].editoptions||{},{id:c+"_"+m,name:m});if(!o[s].edittype)o[s].edittype="text";D=a.jgrid.createEl(o[s].edittype,D,p,true,a.extend({},a.jgrid.ajaxOptions,k.p.ajaxSelectOptions||{}));a(D).addClass("editable");A?a("span:first",this).append(D):a(this).append(D);o[s].edittype=="select"&&o[s].editoptions.multiple===true&&a.browser.msie&&a(D).width(a(D).width());
275
275
  q++}}});if(q>0){r.id=c;k.p.savedRow.push(r);a(n).attr("editable","1");a("td:eq("+v+") input",n).focus();e===true&&a(n).bind("keydown",function(s){s.keyCode===27&&a(k).jqGrid("restoreRow",c,l);if(s.keyCode===13){if(s.target.tagName=="TEXTAREA")return true;a(k).jqGrid("saveRow",c,f,g,h,j,d,l);return false}s.stopPropagation()});a.isFunction(b)&&b.call(k,c)}}}})},saveRow:function(c,e,b,f,g,h,j){return this.each(function(){var d=this,l,k={},m={},p,q,v,r;if(d.grid){r=a(d).jqGrid("getInd",c,true);if(r!==
@@ -362,17 +362,17 @@ A.appendChild(C)}}else if(typeof s==="object")for(D in s)if(s.hasOwnProperty(D))
362
362
  r).attr(o.sopt);if(b.p.gridToolbar===true&&o.width)a.browser.msie?a("input",r).width(o.width-4):a("input",r).width(o.width-2);b.p.autosearch===true&&a("input",r).keypress(function(x){if((x.charCode?x.charCode:x.keyCode?x.keyCode:0)==13){j();return false}return this})}if(b.p.formtype=="horizontal"){b.p.gridToolbar===true&&b.p.gridNames===false?a(m).append(r):a(m).append(v).append(r);a(m).append(r)}else{p=document.createElement("tr");a(p).append(v).append(r);a(l).append(p)}});r=document.createElement("td");
363
363
  if(b.p.enableSearch===true){q="<input type='button' id='sButton' class='"+b.p.buttonclass+"' value='"+b.p.searchButton+"'/>";a(r).append(q);a("input#sButton",r).click(function(){j();return false})}if(b.p.enableClear===true){q="<input type='button' id='cButton' class='"+b.p.buttonclass+"' value='"+b.p.clearButton+"'/>";a(r).append(q);a("input#cButton",r).click(function(){d();return false})}if(b.p.enableClear===true||b.p.enableSearch===true)if(b.p.formtype=="horizontal")a(m).append(r);else{p=document.createElement("tr");
364
364
  a(p).append("<td>&#160;</td>").append(r);a(l).append(p)}})();a(this).append(k);this.triggerSearch=j;this.clearSearch=d}else alert("Could not get grid colModel")}else alert("No target grid is set!")})},filterToolbar:function(c){c=a.extend({autosearch:true,searchOnEnter:true,beforeSearch:null,afterSearch:null,beforeClear:null,afterClear:null,searchurl:"",stringResult:false,groupOp:"AND",defaultSearch:"bw"},c||{});return this.each(function(){function e(j,d){var l=a(j);l[0]&&jQuery.each(d,function(){this.data!==
365
- undefined?l.bind(this.type,this.data,this.fn):l.bind(this.type,this.fn)})}var b=this,f=function(){var j={},d=0,l,k,m={},p;a.each(b.p.colModel,function(){k=this.index||this.name;switch(this.stype){case "select":p=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"eq";if(l=a("select[name="+k+"]",b.grid.hDiv).val()){j[k]=l;m[k]=p;d++}else try{delete b.p.postData[k]}catch(s){}break;case "text":p=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:c.defaultSearch;
366
- if(l=a("input[name="+k+"]",b.grid.hDiv).val()){j[k]=l;m[k]=p;d++}else try{delete b.p.postData[k]}catch(A){}}});var q=d>0?true:false;if(c.stringResult===true||b.p.datatype=="local"){var v='{"groupOp":"'+c.groupOp+'","rules":[',r=0;a.each(j,function(s,A){if(r>0)v+=",";v+='{"field":"'+s+'",';v+='"op":"'+m[s]+'",';v+='"data":"'+A+'"}';r++});v+="]}";a.extend(b.p.postData,{filters:v})}else a.extend(b.p.postData,j);var n;if(b.p.searchurl){n=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var o=false;
367
- if(a.isFunction(c.beforeSearch))o=c.beforeSearch.call(b);o||a(b).jqGrid("setGridParam",{search:q}).trigger("reloadGrid",[{page:1}]);n&&a(b).jqGrid("setGridParam",{url:n});a.isFunction(c.afterSearch)&&c.afterSearch()},g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),h;a.each(b.p.colModel,function(){var j=this,d,l,k,m;l=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");d=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");
365
+ undefined?l.bind(this.type,this.data,this.fn):l.bind(this.type,this.fn)})}var b=this;if(!this.ftoolbar){var f=function(){var j={},d=0,l,k,m={},p;a.each(b.p.colModel,function(){k=this.index||this.name;switch(this.stype){case "select":p=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"eq";if(l=a("select[name="+k+"]",b.grid.hDiv).val()){j[k]=l;m[k]=p;d++}else try{delete b.p.postData[k]}catch(s){}break;case "text":p=this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:
366
+ c.defaultSearch;if(l=a("input[name="+k+"]",b.grid.hDiv).val()){j[k]=l;m[k]=p;d++}else try{delete b.p.postData[k]}catch(A){}}});var q=d>0?true:false;if(c.stringResult===true||b.p.datatype=="local"){var v='{"groupOp":"'+c.groupOp+'","rules":[',r=0;a.each(j,function(s,A){if(r>0)v+=",";v+='{"field":"'+s+'",';v+='"op":"'+m[s]+'",';A+="";v+='"data":"'+A.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';r++});v+="]}";a.extend(b.p.postData,{filters:v})}else a.extend(b.p.postData,j);var n;if(b.p.searchurl){n=
367
+ b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var o=false;if(a.isFunction(c.beforeSearch))o=c.beforeSearch.call(b);o||a(b).jqGrid("setGridParam",{search:q}).trigger("reloadGrid",[{page:1}]);n&&a(b).jqGrid("setGridParam",{url:n});a.isFunction(c.afterSearch)&&c.afterSearch()},g=a("<tr class='ui-search-toolbar' role='rowheader'></tr>"),h;a.each(b.p.colModel,function(){var j=this,d,l,k,m;l=a("<th role='columnheader' class='ui-state-default ui-th-column ui-th-"+b.p.direction+"'></th>");d=a("<div style='width:100%;position:relative;height:100%;padding-right:0.3em;'></div>");
368
368
  this.hidden===true&&a(l).css("display","none");this.search=this.search===false?false:true;if(typeof this.stype=="undefined")this.stype="text";k=a.extend({},this.searchoptions||{});if(this.search)switch(this.stype){case "select":if(m=this.surl||k.dataUrl)a.ajax(a.extend({url:m,dataType:"html",complete:function(n){if(k.buildSelect!==undefined)(n=k.buildSelect(n))&&a(d).append(n);else a(d).append(n.responseText);k.defaultValue&&a("select",d).val(k.defaultValue);a("select",d).attr({name:j.index||j.name,
369
369
  id:"gs_"+j.name});k.attr&&a("select",d).attr(k.attr);a("select",d).css({width:"100%"});k.dataInit!==undefined&&k.dataInit(a("select",d)[0]);k.dataEvents!==undefined&&e(a("select",d)[0],k.dataEvents);c.autosearch===true&&a("select",d).change(function(){f();return false});n=null}},a.jgrid.ajaxOptions,b.p.ajaxSelectOptions||{}));else{var p;if(j.searchoptions&&j.searchoptions.value)p=j.searchoptions.value;else if(j.editoptions&&j.editoptions.value)p=j.editoptions.value;if(p){m=document.createElement("select");
370
370
  m.style.width="100%";a(m).attr({name:j.index||j.name,id:"gs_"+j.name});var q,v;if(typeof p==="string"){p=p.split(";");for(var r=0;r<p.length;r++){q=p[r].split(":");v=document.createElement("option");v.value=q[0];v.innerHTML=q[1];m.appendChild(v)}}else if(typeof p==="object")for(q in p)if(p.hasOwnProperty(q)){v=document.createElement("option");v.value=q;v.innerHTML=p[q];m.appendChild(v)}k.defaultValue&&a(m).val(k.defaultValue);k.attr&&a(m).attr(k.attr);k.dataInit!==undefined&&k.dataInit(m);k.dataEvents!==
371
371
  undefined&&e(m,k.dataEvents);a(d).append(m);c.autosearch===true&&a(m).change(function(){f();return false})}}break;case "text":m=k.defaultValue?k.defaultValue:"";a(d).append("<input type='text' style='width:95%;padding:0px;' name='"+(j.index||j.name)+"' id='gs_"+j.name+"' value='"+m+"'/>");k.attr&&a("input",d).attr(k.attr);k.dataInit!==undefined&&k.dataInit(a("input",d)[0]);k.dataEvents!==undefined&&e(a("input",d)[0],k.dataEvents);if(c.autosearch===true)c.searchOnEnter?a("input",d).keypress(function(n){if((n.charCode?
372
- n.charCode:n.keyCode?n.keyCode:0)==13){f();return false}return this}):a("input",d).keydown(function(n){switch(n.which){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:h&&clearTimeout(h);h=setTimeout(function(){f()},500)}})}a(l).append(d);a(g).append(l)});a("table thead",b.grid.hDiv).append(g);this.triggerToolbar=f;this.clearToolbar=function(j){var d={},l,k=0,m;j=typeof j!="boolean"?true:j;a.each(b.p.colModel,function(){l=this.searchoptions&&this.searchoptions.defaultValue?
373
- this.searchoptions.defaultValue:"";m=this.index||this.name;switch(this.stype){case "select":var o;a("select[name="+m+"] option",b.grid.hDiv).each(function(C){if(C===0)this.selected=true;if(a(this).text()==l){this.selected=true;o=a(this).val();return false}});if(o){d[m]=o;k++}else try{delete b.p.postData[m]}catch(s){}break;case "text":a("input[name="+m+"]",b.grid.hDiv).val(l);if(l){d[m]=l;k++}else try{delete b.p.postData[m]}catch(A){}}});var p=k>0?true:false;if(c.stringResult===true||b.p.datatype==
374
- "local"){var q='{"groupOp":"'+c.groupOp+'","rules":[',v=0;a.each(d,function(o,s){if(v>0)q+=",";q+='{"field":"'+o+'",';q+='"op":"eq",';q+='"data":"'+s+'"}';v++});q+="]}";a.extend(b.p.postData,{filters:q})}else a.extend(b.p.postData,d);var r;if(b.p.searchurl){r=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var n=false;if(a.isFunction(c.beforeClear))n=c.beforeClear.call(b);n||j&&a(b).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",[{page:1}]);r&&a(b).jqGrid("setGridParam",{url:r});a.isFunction(c.afterClear)&&
375
- c.afterClear()};this.toggleToolbar=function(){var j=a("tr.ui-search-toolbar",b.grid.hDiv);j.css("display")=="none"?j.show():j.hide()}})}})})(jQuery);
372
+ n.charCode:n.keyCode?n.keyCode:0)==13){f();return false}return this}):a("input",d).keydown(function(n){switch(n.which){case 13:return false;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:h&&clearTimeout(h);h=setTimeout(function(){f()},500)}})}a(l).append(d);a(g).append(l)});a("table thead",b.grid.hDiv).append(g);this.ftoolbar=true;this.triggerToolbar=f;this.clearToolbar=function(j){var d={},l,k=0,m;j=typeof j!="boolean"?true:j;a.each(b.p.colModel,function(){l=this.searchoptions&&
373
+ this.searchoptions.defaultValue?this.searchoptions.defaultValue:"";m=this.index||this.name;switch(this.stype){case "select":var o;a("select[name="+m+"] option",b.grid.hDiv).each(function(C){if(C===0)this.selected=true;if(a(this).text()==l){this.selected=true;o=a(this).val();return false}});if(o){d[m]=o;k++}else try{delete b.p.postData[m]}catch(s){}break;case "text":a("input[name="+m+"]",b.grid.hDiv).val(l);if(l){d[m]=l;k++}else try{delete b.p.postData[m]}catch(A){}}});var p=k>0?true:false;if(c.stringResult===
374
+ true||b.p.datatype=="local"){var q='{"groupOp":"'+c.groupOp+'","rules":[',v=0;a.each(d,function(o,s){if(v>0)q+=",";q+='{"field":"'+o+'",';q+='"op":"eq",';s+="";q+='"data":"'+s.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"}';v++});q+="]}";a.extend(b.p.postData,{filters:q})}else a.extend(b.p.postData,d);var r;if(b.p.searchurl){r=b.p.url;a(b).jqGrid("setGridParam",{url:b.p.searchurl})}var n=false;if(a.isFunction(c.beforeClear))n=c.beforeClear.call(b);n||j&&a(b).jqGrid("setGridParam",{search:p}).trigger("reloadGrid",
375
+ [{page:1}]);r&&a(b).jqGrid("setGridParam",{url:r});a.isFunction(c.afterClear)&&c.afterClear()};this.toggleToolbar=function(){var j=a("tr.ui-search-toolbar",b.grid.hDiv);j.css("display")=="none"?j.show():j.hide()}}})}})})(jQuery);
376
376
  (function(a){a.jgrid.extend({getPostData:function(){var c=this[0];if(c.grid)return c.p.postData},setPostData:function(c){var e=this[0];if(e.grid)if(typeof c==="object")e.p.postData=c;else alert("Error: cannot add a non-object postData value. postData unchanged.")},appendPostData:function(c){var e=this[0];if(e.grid)typeof c==="object"?a.extend(e.p.postData,c):alert("Error: cannot append a non-object postData value. postData unchanged.")},setPostDataItem:function(c,e){var b=this[0];if(b.grid)b.p.postData[c]=
377
377
  e},getPostDataItem:function(c){var e=this[0];if(e.grid)return e.p.postData[c]},removePostDataItem:function(c){var e=this[0];e.grid&&delete e.p.postData[c]},getUserData:function(){var c=this[0];if(c.grid)return c.p.userData},getUserDataItem:function(c){var e=this[0];if(e.grid)return e.p.userData[c]}})})(jQuery);
378
378
  function tableToGrid(a,c){jQuery(a).each(function(){if(!this.grid){jQuery(this).width("99%");var e=jQuery(this).width(),b=jQuery("input[type=checkbox]:first",jQuery(this)),f=jQuery("input[type=radio]:first",jQuery(this));b=b.length>0;f=!b&&f.length>0;var g=b||f,h=[],j=[];jQuery("th",jQuery(this)).each(function(){if(h.length===0&&g){h.push({name:"__selection__",index:"__selection__",width:0,hidden:true});j.push("__selection__")}else{h.push({name:jQuery(this).attr("id")||jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"),
@@ -394,7 +394,7 @@ c.importComplete(h)}}},c.ajaxOptions));break;case "jsonstring":if(c.impstring&&t
394
394
  return e},excelExport:function(c){c=a.extend({exptype:"remote",url:null,oper:"oper",tag:"excel",exportOptions:{}},c||{});return this.each(function(){if(this.grid){var e;if(c.exptype=="remote"){e=a.extend({},this.p.postData);e[c.oper]=c.tag;e=jQuery.param(e);e=c.url.indexOf("?")!=-1?c.url+"&"+e:c.url+"?"+e;window.location=e}}})}})})(jQuery);
395
395
  (function(a){a.fmatter={};a.extend(a.fmatter,{isBoolean:function(c){return typeof c==="boolean"},isObject:function(c){return c&&(typeof c==="object"||a.isFunction(c))||false},isString:function(c){return typeof c==="string"},isNumber:function(c){return typeof c==="number"&&isFinite(c)},isNull:function(c){return c===null},isUndefined:function(c){return typeof c==="undefined"},isValue:function(c){return this.isObject(c)||this.isString(c)||this.isNumber(c)||this.isBoolean(c)},isEmpty:function(c){if(!this.isString(c)&&
396
396
  this.isValue(c))return false;else if(!this.isValue(c))return true;c=a.trim(c).replace(/\&nbsp\;/ig,"").replace(/\&#160\;/ig,"");return c===""}});a.fn.fmatter=function(c,e,b,f,g){var h=e;b=a.extend({},a.jgrid.formatter,b);if(a.fn.fmatter[c])h=a.fn.fmatter[c](e,b,f,g);return h};a.fmatter.util={NumberFormat:function(c,e){a.fmatter.isNumber(c)||(c*=1);if(a.fmatter.isNumber(c)){var b=c<0,f=c+"",g=e.decimalSeparator?e.decimalSeparator:".",h;if(a.fmatter.isNumber(e.decimalPlaces)){var j=e.decimalPlaces;
397
- f=Math.pow(10,j);f=Math.round(c*f)/f+"";h=f.lastIndexOf(".");if(j>0){if(h<0){f+=g;h=f.length-1}else if(g!==".")f=f.replace(".",g);for(;f.length-1-h<j;)f+="0"}}if(e.thousandsSeparator){j=e.thousandsSeparator;h=f.lastIndexOf(g);h=h>-1?h:f.length;g=f.substring(h);for(var d=-1,l=h;l>0;l--){d++;if(d%3===0&&l!==h&&(!b||l>1))g=j+g;g=f.charAt(l-1)+g}f=g}f=e.prefix?e.prefix+f:f;return f=e.suffix?f+e.suffix:f}else return c},DateFormat:function(c,e,b,f){var g=/^\/Date((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?)\/$/,
397
+ f=Math.pow(10,j);f=Math.round(c*f)/f+"";h=f.lastIndexOf(".");if(j>0){if(h<0){f+=g;h=f.length-1}else if(g!==".")f=f.replace(".",g);for(;f.length-1-h<j;)f+="0"}}if(e.thousandsSeparator){j=e.thousandsSeparator;h=f.lastIndexOf(g);h=h>-1?h:f.length;g=f.substring(h);for(var d=-1,l=h;l>0;l--){d++;if(d%3===0&&l!==h&&(!b||l>1))g=j+g;g=f.charAt(l-1)+g}f=g}f=e.prefix?e.prefix+f:f;return f=e.suffix?f+e.suffix:f}else return c},DateFormat:function(c,e,b,f){var g=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,
398
398
  h=typeof e==="string"?e.match(g):null;g=function(s,A){s=String(s);for(A=parseInt(A,10)||2;s.length<A;)s="0"+s;return s};var j={m:1,d:1,y:1970,h:0,i:0,s:0,u:0},d=0,l,k=["i18n"];k.i18n={dayNames:f.dayNames,monthNames:f.monthNames};if(c in f.masks)c=f.masks[c];if(e.constructor===Number){if(String(c).toLowerCase()=="u")e*=1E3;d=new Date(e)}else if(e.constructor===Date)d=e;else if(h!==null){d=new Date(parseInt(h[1],10));if(h[3]){c=Number(h[5])*60+Number(h[6]);c*=h[4]=="-"?1:-1;c-=d.getTimezoneOffset();
399
399
  d.setTime(Number(Number(d)+c*60*1E3))}}else{e=String(e).split(/[\\\/:_;.,\t\T\s-]/);c=c.split(/[\\\/:_;.,\t\T\s-]/);h=0;for(l=c.length;h<l;h++){if(c[h]=="M"){d=a.inArray(e[h],k.i18n.monthNames);if(d!==-1&&d<12)e[h]=d+1}if(c[h]=="F"){d=a.inArray(e[h],k.i18n.monthNames);if(d!==-1&&d>11)e[h]=d+1-12}if(e[h])j[c[h].toLowerCase()]=parseInt(e[h],10)}if(j.f)j.m=j.f;if(j.m===0&&j.y===0&&j.d===0)return"&#160;";j.m=parseInt(j.m,10)-1;d=j.y;if(d>=70&&d<=99)j.y=1900+j.y;else if(d>=0&&d<=69)j.y=2E3+j.y;d=new Date(j.y,
400
400
  j.m,j.d,j.h,j.i,j.s,j.u)}if(b in f.masks)b=f.masks[b];else b||(b="Y-m-d");c=d.getHours();e=d.getMinutes();j=d.getDate();h=d.getMonth()+1;l=d.getTimezoneOffset();var m=d.getSeconds(),p=d.getMilliseconds(),q=d.getDay(),v=d.getFullYear(),r=(q+6)%7+1,n=(new Date(v,h-1,j)-new Date(v,0,1))/864E5,o={d:g(j),D:k.i18n.dayNames[q],j:j,l:k.i18n.dayNames[q+7],N:r,S:f.S(j),w:q,z:n,W:r<5?Math.floor((n+r-1)/7)+1:Math.floor((n+r-1)/7)||(((new Date(v-1,0,1)).getDay()+6)%7<4?53:52),F:k.i18n.monthNames[h-1+12],m:g(h),
@@ -439,19 +439,19 @@ function(){this.element.show();this.container.remove();a.Widget===undefined?a.wi
439
439
  " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]},update:function(j,d){d.height(j.currentItem.innerHeight()-parseInt(j.currentItem.css("paddingTop")||0,10)-parseInt(j.currentItem.css("paddingBottom")||0,10));d.width(j.currentItem.innerWidth()-parseInt(j.currentItem.css("paddingLeft")||0,10)-parseInt(j.currentItem.css("paddingRight")||0,10))}},update:function(j,d){var l=a(d.item).parent();l=a(">th",l);var k={};a.each(f.p.colModel,function(p){k[this.name]=p});var m=
440
440
  [];l.each(function(){var p=a(">div",this).get(0).id.replace(/^jqgh_/,"");p in k&&m.push(k[p])});a(f).jqGrid("remapColumns",m,true,true);a.isFunction(f.p.sortable.update)&&f.p.sortable.update(m);setTimeout(function(){f.p.disableClick=false},50)}};if(f.p.sortable.options)a.extend(g,f.p.sortable.options);else if(a.isFunction(f.p.sortable))f.p.sortable={update:f.p.sortable};if(g.start){var h=g.start;g.start=function(j,d){b();h.call(this,j,d)}}else g.start=b;if(f.p.sortable.exclude)g.items+=":not("+f.p.sortable.exclude+
441
441
  ")";e.sortable(g).data("sortable").floating=true})},columnChooser:function(e){function b(p,q){if(p)if(typeof p=="string")a.fn[p]&&a.fn[p].apply(q,a.makeArray(arguments).slice(2));else a.isFunction(p)&&p.apply(q,a.makeArray(arguments).slice(2))}var f=this;if(!a("#colchooser_"+f[0].p.id).length){var g=a('<div id="colchooser_'+f[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>'),h=a("select",g);e=a.extend({width:420,height:240,classname:null,
442
- done:function(p){p&&f.jqGrid("remapColumns",p,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(p){var q={};q[p.bSubmit]=function(){p.apply_perm();p.cleanup(false)};q[p.bCancel]=function(){p.cleanup(true)};return{buttons:q,close:function(){p.cleanup(true)},modal:false,resizable:false,width:p.width+20}},apply_perm:function(){a("option",h).each(function(){this.selected?f.jqGrid("showCol",j[this.value].name):f.jqGrid("hideCol",j[this.value].name)});var p=[];a("option[selected]",h).each(function(){p.push(parseInt(this.value,
443
- 10))});a.each(p,function(){delete l[j[parseInt(this,10)].name]});a.each(l,function(){var q=parseInt(this,10);var v=p,r=q;if(r>=0){var n=v.slice(),o=n.splice(r,Math.max(v.length-r,r));if(r>v.length)r=v.length;n[r]=q;p=n.concat(o)}else p=void 0});e.done&&e.done.call(f,p)},cleanup:function(p){b(e.dlog,g,"destroy");b(e.msel,h,"destroy");g.remove();p&&e.done&&e.done.call(f)},msel_opts:{}},a.jgrid.col,e||{});if(a.ui)if(a.ui.multiselect)if(e.msel=="multiselect"){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
444
- return}e.msel_opts=a.extend(a.ui.multiselect.defaults,e.msel_opts)}e.caption&&g.attr("title",e.caption);if(e.classname){g.addClass(e.classname);h.addClass(e.classname)}if(e.width){a(">div",g).css({width:e.width,margin:"0 auto"});h.css("width",e.width)}if(e.height){a(">div",g).css("height",e.height);h.css("height",e.height-10)}var j=f.jqGrid("getGridParam","colModel"),d=f.jqGrid("getGridParam","colNames"),l={},k=[];h.empty();a.each(j,function(p){l[this.name]=p;if(this.hidedlg)this.hidden||k.push(p);
445
- else h.append("<option value='"+p+"' "+(this.hidden?"":"selected='selected'")+">"+d[p]+"</option>")});var m=a.isFunction(e.dlog_opts)?e.dlog_opts.call(f,e):e.dlog_opts;b(e.dlog,g,m);m=a.isFunction(e.msel_opts)?e.msel_opts.call(f,e):e.msel_opts;b(e.msel,h,m)}},sortableRows:function(e){return this.each(function(){var b=this;if(b.grid)if(!b.p.treeGrid)if(a.fn.sortable){e=a.extend({cursor:"move",axis:"y",items:".jqgrow"},e||{});if(e.start&&a.isFunction(e.start)){e._start_=e.start;delete e.start}else e._start_=
446
- false;if(e.update&&a.isFunction(e.update)){e._update_=e.update;delete e.update}else e._update_=false;e.start=function(f,g){a(g.item).css("border-width","0px");a("td",g.item).each(function(d){this.style.width=b.grid.cols[d].style.width});if(b.p.subGrid){var h=a(g.item).attr("id");try{a(b).jqGrid("collapseSubGridRow",h)}catch(j){}}e._start_&&e._start_.apply(this,[f,g])};e.update=function(f,g){a(g.item).css("border-width","");b.p.rownumbers===true&&a("td.jqgrid-rownum",b.rows).each(function(h){a(this).html(h+
447
- 1)});e._update_&&e._update_.apply(this,[f,g])};a("tbody:first",b).sortable(e);a("tbody:first",b).disableSelection()}})},gridDnD:function(e){return this.each(function(){function b(){var h=a.data(f,"dnd");a("tr.jqgrow:not(.ui-draggable)",f).draggable(a.isFunction(h.drag)?h.drag.call(a(f),h):h.drag)}var f=this;if(f.grid)if(!f.p.treeGrid)if(a.fn.draggable&&a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof e=="string"&&e==
448
- "updateDnD"&&f.p.jqgdnd===true)b();else{e=a.extend({drag:function(h){return a.extend({start:function(j,d){if(f.p.subGrid){var l=a(d.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",l)}catch(k){}}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(f,"dnd").connectWith[l]).jqGrid("addRowData","jqg_empty_row",{});d.helper.addClass("ui-state-highlight");a("td",d.helper).each(function(m){this.style.width=f.grid.headers[m].width+
449
- "px"});h.onstart&&a.isFunction(h.onstart)&&h.onstart.call(a(f),j,d)},stop:function(j,d){if(d.helper.dropped){var l=a(d.helper).attr("id");a(f).jqGrid("delRowData",l)}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("delRowData","jqg_empty_row");h.onstop&&a.isFunction(h.onstop)&&h.onstop.call(a(f),j,d)}},h.drag_opts||{})},drop:function(h){return a.extend({accept:function(j){if(!a(j).hasClass("jqgrow"))return j;var d=a(j).closest("table.ui-jqgrid-btable");if(d.length>
450
- 0&&a.data(d[0],"dnd")!==undefined){j=a.data(d[0],"dnd").connectWith;return a.inArray("#"+this.id,j)!=-1?true:false}return j},drop:function(j,d){if(a(d.draggable).hasClass("jqgrow")){var l=a(d.draggable).attr("id");l=d.draggable.parent().parent().jqGrid("getRowData",l);if(!h.dropbyname){var k=0,m={},p,q=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var v in l){if(l.hasOwnProperty(v)&&q[k]){p=q[k].name;m[p]=l[v]}k++}l=m}catch(r){}}d.helper.dropped=true;if(h.beforedrop&&a.isFunction(h.beforedrop)){p=
451
- h.beforedrop.call(this,j,d,l,a("#"+f.id),a(this));if(typeof p!="undefined"&&p!==null&&typeof p=="object")l=p}if(d.helper.dropped){var n;if(h.autoid)if(a.isFunction(h.autoid))n=h.autoid.call(this,l);else{n=Math.ceil(Math.random()*1E3);n=h.autoidprefix+n}a("#"+this.id).jqGrid("addRowData",n,l,h.droppos)}h.ondrop&&a.isFunction(h.ondrop)&&h.ondrop.call(this,j,d,l)}}},h.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",hoverClass:"ui-state-hover"},
452
- drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},e||{});if(e.connectWith){e.connectWith=e.connectWith.split(",");e.connectWith=a.map(e.connectWith,function(h){return a.trim(h)});a.data(f,"dnd",e);f.p.reccount!="0"&&!f.p.jqgdnd&&b();f.p.jqgdnd=true;for(var g=0;g<e.connectWith.length;g++)a(e.connectWith[g]).droppable(a.isFunction(e.drop)?e.drop.call(a(f),e):e.drop)}}}})},gridResize:function(e){return this.each(function(){var b=
453
- this;if(b.grid&&a.fn.resizable){e=a.extend({},e||{});if(e.alsoResize){e._alsoResize_=e.alsoResize;delete e.alsoResize}else e._alsoResize_=false;if(e.stop&&a.isFunction(e.stop)){e._stop_=e.stop;delete e.stop}else e._stop_=false;e.stop=function(f,g){a(b).jqGrid("setGridParam",{height:a("#gview_"+b.p.id+" .ui-jqgrid-bdiv").height()});a(b).jqGrid("setGridWidth",g.size.width,e.shrinkToFit);e._stop_&&e._stop_.call(b,f,g)};e.alsoResize=e._alsoResize_?eval("("+("{'#gview_"+b.p.id+" .ui-jqgrid-bdiv':true,'"+
454
- e._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+b.p.id);delete e._alsoResize_;a("#gbox_"+b.p.id).resizable(e)}})}})})(jQuery);(function(a){a.jgrid.extend({contextMenu:function(){alert("ContextMenu extension");return false}})})(jQuery);
442
+ done:function(p){p&&f.jqGrid("remapColumns",p,true)},msel:"multiselect",dlog:"dialog",dlog_opts:function(p){var q={};q[p.bSubmit]=function(){p.apply_perm();p.cleanup(false)};q[p.bCancel]=function(){p.cleanup(true)};return{buttons:q,close:function(){p.cleanup(true)},modal:p.modal?p.modal:false,resizable:p.resizable?p.resizable:true,width:p.width+20}},apply_perm:function(){a("option",h).each(function(){this.selected?f.jqGrid("showCol",j[this.value].name):f.jqGrid("hideCol",j[this.value].name)});var p=
443
+ [];a("option[selected]",h).each(function(){p.push(parseInt(this.value,10))});a.each(p,function(){delete l[j[parseInt(this,10)].name]});a.each(l,function(){var q=parseInt(this,10);var v=p,r=q;if(r>=0){var n=v.slice(),o=n.splice(r,Math.max(v.length-r,r));if(r>v.length)r=v.length;n[r]=q;p=n.concat(o)}else p=void 0});e.done&&e.done.call(f,p)},cleanup:function(p){b(e.dlog,g,"destroy");b(e.msel,h,"destroy");g.remove();p&&e.done&&e.done.call(f)},msel_opts:{}},a.jgrid.col,e||{});if(a.ui)if(a.ui.multiselect)if(e.msel==
444
+ "multiselect"){if(!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");return}e.msel_opts=a.extend(a.ui.multiselect.defaults,e.msel_opts)}e.caption&&g.attr("title",e.caption);if(e.classname){g.addClass(e.classname);h.addClass(e.classname)}if(e.width){a(">div",g).css({width:e.width,margin:"0 auto"});h.css("width",e.width)}if(e.height){a(">div",g).css("height",e.height);h.css("height",e.height-10)}var j=f.jqGrid("getGridParam","colModel"),
445
+ d=f.jqGrid("getGridParam","colNames"),l={},k=[];h.empty();a.each(j,function(p){l[this.name]=p;if(this.hidedlg)this.hidden||k.push(p);else h.append("<option value='"+p+"' "+(this.hidden?"":"selected='selected'")+">"+d[p]+"</option>")});var m=a.isFunction(e.dlog_opts)?e.dlog_opts.call(f,e):e.dlog_opts;b(e.dlog,g,m);m=a.isFunction(e.msel_opts)?e.msel_opts.call(f,e):e.msel_opts;b(e.msel,h,m)}},sortableRows:function(e){return this.each(function(){var b=this;if(b.grid)if(!b.p.treeGrid)if(a.fn.sortable){e=
446
+ a.extend({cursor:"move",axis:"y",items:".jqgrow"},e||{});if(e.start&&a.isFunction(e.start)){e._start_=e.start;delete e.start}else e._start_=false;if(e.update&&a.isFunction(e.update)){e._update_=e.update;delete e.update}else e._update_=false;e.start=function(f,g){a(g.item).css("border-width","0px");a("td",g.item).each(function(d){this.style.width=b.grid.cols[d].style.width});if(b.p.subGrid){var h=a(g.item).attr("id");try{a(b).jqGrid("collapseSubGridRow",h)}catch(j){}}e._start_&&e._start_.apply(this,
447
+ [f,g])};e.update=function(f,g){a(g.item).css("border-width","");b.p.rownumbers===true&&a("td.jqgrid-rownum",b.rows).each(function(h){a(this).html(h+1)});e._update_&&e._update_.apply(this,[f,g])};a("tbody:first",b).sortable(e);a("tbody:first",b).disableSelection()}})},gridDnD:function(e){return this.each(function(){function b(){var h=a.data(f,"dnd");a("tr.jqgrow:not(.ui-draggable)",f).draggable(a.isFunction(h.drag)?h.drag.call(a(f),h):h.drag)}var f=this;if(f.grid)if(!f.p.treeGrid)if(a.fn.draggable&&
448
+ a.fn.droppable){a("#jqgrid_dnd").html()===null&&a("body").append("<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>");if(typeof e=="string"&&e=="updateDnD"&&f.p.jqgdnd===true)b();else{e=a.extend({drag:function(h){return a.extend({start:function(j,d){if(f.p.subGrid){var l=a(d.helper).attr("id");try{a(f).jqGrid("collapseSubGridRow",l)}catch(k){}}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("getGridParam","reccount")=="0"&&a(a.data(f,"dnd").connectWith[l]).jqGrid("addRowData",
449
+ "jqg_empty_row",{});d.helper.addClass("ui-state-highlight");a("td",d.helper).each(function(m){this.style.width=f.grid.headers[m].width+"px"});h.onstart&&a.isFunction(h.onstart)&&h.onstart.call(a(f),j,d)},stop:function(j,d){if(d.helper.dropped){var l=a(d.helper).attr("id");a(f).jqGrid("delRowData",l)}for(l=0;l<a.data(f,"dnd").connectWith.length;l++)a(a.data(f,"dnd").connectWith[l]).jqGrid("delRowData","jqg_empty_row");h.onstop&&a.isFunction(h.onstop)&&h.onstop.call(a(f),j,d)}},h.drag_opts||{})},drop:function(h){return a.extend({accept:function(j){if(!a(j).hasClass("jqgrow"))return j;
450
+ var d=a(j).closest("table.ui-jqgrid-btable");if(d.length>0&&a.data(d[0],"dnd")!==undefined){j=a.data(d[0],"dnd").connectWith;return a.inArray("#"+this.id,j)!=-1?true:false}return j},drop:function(j,d){if(a(d.draggable).hasClass("jqgrow")){var l=a(d.draggable).attr("id");l=d.draggable.parent().parent().jqGrid("getRowData",l);if(!h.dropbyname){var k=0,m={},p,q=a("#"+this.id).jqGrid("getGridParam","colModel");try{for(var v in l){if(l.hasOwnProperty(v)&&q[k]){p=q[k].name;m[p]=l[v]}k++}l=m}catch(r){}}d.helper.dropped=
451
+ true;if(h.beforedrop&&a.isFunction(h.beforedrop)){p=h.beforedrop.call(this,j,d,l,a("#"+f.id),a(this));if(typeof p!="undefined"&&p!==null&&typeof p=="object")l=p}if(d.helper.dropped){var n;if(h.autoid)if(a.isFunction(h.autoid))n=h.autoid.call(this,l);else{n=Math.ceil(Math.random()*1E3);n=h.autoidprefix+n}a("#"+this.id).jqGrid("addRowData",n,l,h.droppos)}h.ondrop&&a.isFunction(h.ondrop)&&h.ondrop.call(this,j,d,l)}}},h.drop_opts||{})},onstart:null,onstop:null,beforedrop:null,ondrop:null,drop_opts:{activeClass:"ui-state-active",
452
+ hoverClass:"ui-state-hover"},drag_opts:{revert:"invalid",helper:"clone",cursor:"move",appendTo:"#jqgrid_dnd",zIndex:5E3},dropbyname:false,droppos:"first",autoid:true,autoidprefix:"dnd_"},e||{});if(e.connectWith){e.connectWith=e.connectWith.split(",");e.connectWith=a.map(e.connectWith,function(h){return a.trim(h)});a.data(f,"dnd",e);f.p.reccount!="0"&&!f.p.jqgdnd&&b();f.p.jqgdnd=true;for(var g=0;g<e.connectWith.length;g++)a(e.connectWith[g]).droppable(a.isFunction(e.drop)?e.drop.call(a(f),e):e.drop)}}}})},
453
+ gridResize:function(e){return this.each(function(){var b=this;if(b.grid&&a.fn.resizable){e=a.extend({},e||{});if(e.alsoResize){e._alsoResize_=e.alsoResize;delete e.alsoResize}else e._alsoResize_=false;if(e.stop&&a.isFunction(e.stop)){e._stop_=e.stop;delete e.stop}else e._stop_=false;e.stop=function(f,g){a(b).jqGrid("setGridParam",{height:a("#gview_"+b.p.id+" .ui-jqgrid-bdiv").height()});a(b).jqGrid("setGridWidth",g.size.width,e.shrinkToFit);e._stop_&&e._stop_.call(b,f,g)};e.alsoResize=e._alsoResize_?
454
+ eval("("+("{'#gview_"+b.p.id+" .ui-jqgrid-bdiv':true,'"+e._alsoResize_+"':true}")+")"):a(".ui-jqgrid-bdiv","#gview_"+b.p.id);delete e._alsoResize_;a("#gbox_"+b.p.id).resizable(e)}})}})})(jQuery);(function(a){a.jgrid.extend({contextMenu:function(){alert("ContextMenu extension");return false}})})(jQuery);
455
455
  jQuery.fn.searchFilter=function(a,c){return new function(e,b,f){this.$=e;this.add=function(x){x==null?e.find(".ui-add-last").click():e.find(".sf:eq("+x+") .ui-add").click();return this};this.del=function(x){x==null?e.find(".sf:last .ui-del").click():e.find(".sf:eq("+x+") .ui-del").click();return this};this.search=function(){e.find(".ui-search").click();return this};this.reset=function(x){if(x===undefined)x=false;e.find(".ui-reset").trigger("click",[x]);return this};this.close=function(){e.find(".ui-closer").click();
456
456
  return this};if(b!=null){var g=function(){jQuery(this).toggleClass("ui-state-hover");return false},h=function(x){jQuery(this).toggleClass("ui-state-active",x.type=="mousedown");return false},j=function(x,B){return"<option value='"+x+"'>"+B+"</option>"},d=function(x,B,y){return"<select class='"+x+"'"+(y?" style='display:none;'":"")+">"+B+"</select>"},l=function(x,B){var y=e.find("tr.sf td.data "+x);y[0]!=null&&B(y)},k=function(x,B){var y=e.find("tr.sf td.data "+x);y[0]!=null&&jQuery.each(B,function(){this.data!=
457
457
  null?y.bind(this.type,this.data,this.fn):y.bind(this.type,this.fn)})},m=jQuery.extend({},jQuery.fn.searchFilter.defaults,f),p=-1,q="";jQuery.each(m.groupOps,function(){q+=j(this.op,this.text)});q="<select name='groupOp'>"+q+"</select>";e.html("").addClass("ui-searchFilter").append("<div class='ui-widget-overlay' style='z-index: -1'>&#160;</div><table class='ui-widget-content ui-corner-all'><thead><tr><td colspan='5' class='ui-widget-header ui-corner-all' style='line-height: 18px;'><div class='ui-closer ui-state-default ui-corner-all ui-helper-clearfix' style='float: right;'><span class='ui-icon ui-icon-close'></span></div>"+
@@ -6,6 +6,8 @@ file 'config/locales/jquery/jqgrid/de.yml'
6
6
  file 'config/locales/jquery/jqgrid/en.yml'
7
7
  javascript 'jquery.jqGrid.js'
8
8
  javascript 'jquery.jqGrid.min.js'
9
+ javascript 'i18n/jqgrid/locale-ar.js'
10
+ javascript 'i18n/jqgrid/locale-ar.min.js'
9
11
  javascript 'i18n/jqgrid/locale-bg.js'
10
12
  javascript 'i18n/jqgrid/locale-bg.min.js'
11
13
  javascript 'i18n/jqgrid/locale-bg1251.js'
@@ -17,8 +17,8 @@
17
17
  (c) 2010 by jQTouch project members.
18
18
  See LICENSE.txt for license.
19
19
 
20
- $Revision: 159 $
21
- $Date: Tue Dec 28 22:40:38 EST 2010 $
20
+ $Revision: 161 $
21
+ $Date: Wed Jan 19 23:43:35 EST 2011 $
22
22
  $LastChangedBy: jonathanstark $
23
23
 
24
24
 
@@ -50,13 +50,13 @@
50
50
  addGlossToIcon: true,
51
51
  backSelector: '.back, .cancel, .goback',
52
52
  cacheGetRequests: true,
53
- debug: true,
53
+ debug: false,
54
54
  fallback2dAnimation: 'fade',
55
55
  fixedViewport: true,
56
56
  formSelector: 'form',
57
57
  fullScreen: true,
58
58
  fullScreenClass: 'fullscreen',
59
- hoverDelay: 150,
59
+ hoverDelay: 50,
60
60
  icon: null,
61
61
  icon4: null, // experimental
62
62
  moveThreshold: 10,
@@ -66,7 +66,6 @@
66
66
  statusBar: 'default', // other options: black-translucent, black
67
67
  submitSelector: '.submit',
68
68
  touchSelector: 'a, .touch',
69
- unloadMessage: 'Are you sure you want to leave this page? Doing so will log you out of the app.',
70
69
  useAnimations: true,
71
70
  useFastTouch: true, // experimental
72
71
  animations: [ // highest to lowest priority
@@ -112,34 +111,46 @@
112
111
  hist.unshift({
113
112
  page: page,
114
113
  animation: animation,
114
+ hash: '#' + page.attr('id'),
115
115
  id: page.attr('id')
116
116
  });
117
117
  }
118
118
  function clickHandler(e) {
119
119
  _debug();
120
120
 
121
+ if (!tapReady) {
122
+ _debug('ClickHandler handler aborted because tap is not ready');
123
+ e.preventDefault();
124
+ return false;
125
+ }
126
+
127
+ // Figure out whether to prevent default
121
128
  var $el = $(e.target);
122
129
 
123
- if ($el.attr('href')) {
124
- if (!$el.isExternalLink()) { // Checks for mailto, maps, tel, checkboxes, etc...
125
- e.preventDefault();
126
- _debug('Preventing default click behavior');
127
- }
128
- };
130
+ // Find the nearest tappable ancestor
131
+ if (!$el.is(touchSelectors.join(', '))) {
132
+ var $el = $(e.target).closest(touchSelectors.join(', '));
133
+ }
129
134
 
135
+ // Prevent default if we found an internal link (relative or absolute)
136
+ if ($el && $el.attr('href') && !$el.isExternalLink()) {
137
+ _debug('Need to prevent default click behavior');
138
+ e.preventDefault();
139
+ } else {
140
+ _debug('No need to prevent default click behavior');
141
+ }
142
+
143
+ // Trigger a tap event if touchstart is not on the job
130
144
  if ($.support.touch) {
131
- // The touchstart handler will trigger tap handler
132
- _debug('Ignoring click handler because touch support is true');
145
+ _debug('Not converting click to a tap event because touch handler is on the job');
133
146
  } else {
134
- // Convert the click to a tap
135
- _debug('Converting click to a tap event');
136
- $el.makeActive();
137
- $el.trigger('tap', e);
147
+ _debug('Converting click event to a tap event');
148
+ $(e.target).trigger('tap', e);
138
149
  }
150
+
139
151
  }
140
152
  function doNavigation(fromPage, toPage, animation, backwards) {
141
153
  _debug();
142
- // _debug('animation.name: ' + animation.name + '; backwards: ' + backwards);
143
154
 
144
155
  // Error check for target page
145
156
  if (toPage.length === 0) {
@@ -191,7 +202,7 @@
191
202
  finalAnimationName = animation.name;
192
203
  }
193
204
 
194
- _debug('finalAnimationName is ' + finalAnimationName);
205
+ // _debug('finalAnimationName is ' + finalAnimationName);
195
206
 
196
207
  // Bind internal "cleanup" callback
197
208
  fromPage.bind('webkitAnimationEnd', navigationEndHandler);
@@ -208,14 +219,14 @@
208
219
  // Define private navigationEnd callback
209
220
  function navigationEndHandler(event) {
210
221
  _debug();
211
-
222
+
212
223
  if ($.support.animationEvents && animation && jQTSettings.useAnimations) {
213
224
  fromPage.unbind('webkitAnimationEnd', navigationEndHandler);
214
- fromPage.attr('class', '');
215
- toPage.attr('class', 'current');
225
+ fromPage.removeClass(finalAnimationName + ' out current');
226
+ toPage.removeClass(finalAnimationName + ' in');
216
227
  // toPage.css('top', 0);
217
228
  } else {
218
- fromPage.attr('class', '');
229
+ fromPage.removeClass(finalAnimationName + ' out current');
219
230
  }
220
231
 
221
232
  // Housekeeping
@@ -231,7 +242,7 @@
231
242
  setHash(currentPage.attr('id'));
232
243
  tapReady = true;
233
244
 
234
- // Finally, trigger custom events
245
+ // Trigger custom events
235
246
  toPage.trigger('pageAnimationEnd', {direction:'in', animation:animation});
236
247
  fromPage.trigger('pageAnimationEnd', {direction:'out', animation:animation});
237
248
 
@@ -256,8 +267,7 @@
256
267
  _debug('You are on the first panel.');
257
268
  }
258
269
 
259
- var from = hist[0],
260
- to = hist[1];
270
+ var from = hist[0], to = hist[1];
261
271
 
262
272
  if (doNavigation(from.page, to.page, from.animation, true)) {
263
273
  return publicObj;
@@ -266,8 +276,6 @@
266
276
  return false;
267
277
  }
268
278
 
269
- // Prevent default behavior
270
- return false;
271
279
  }
272
280
  function goTo(toPage, animation, reverse) {
273
281
  _debug();
@@ -306,13 +314,17 @@
306
314
  return false;
307
315
  }
308
316
  }
309
- function hashChange(e) {
317
+ function hashChangeHandler(e) {
310
318
  _debug();
311
- if (location.href == hist[1].href) {
312
- goBack();
319
+ if (hist[1] === undefined) {
320
+ _debug('There is no previous page in history');
313
321
  } else {
314
- _debug(location.href+' == '+hist[1].href);
315
- }
322
+ if(location.hash === hist[1].hash) {
323
+ goBack();
324
+ } else {
325
+ _debug(location.hash + ' !== ' + hist[1].hash);
326
+ }
327
+ }
316
328
  }
317
329
  function init(options) {
318
330
  _debug();
@@ -375,7 +387,7 @@
375
387
  $node.attr('id', 'page-' + (++newPageCount));
376
388
  }
377
389
 
378
- // remove any existing instance
390
+ // Remove any existing instance
379
391
  $('#' + $node.attr('id')).remove();
380
392
 
381
393
  $body.trigger('pageInserted', {page: $node.appendTo($body)});
@@ -404,27 +416,19 @@
404
416
  $body.removeClass('portrait landscape').addClass(orientation).trigger('turn', {orientation: orientation});
405
417
  }
406
418
  function setHash(hash) {
407
- return; // Deactivated at the moment
408
-
409
419
  _debug();
410
420
 
411
- // trim leading # if need be
421
+ // Trim leading # if need be
412
422
  hash = hash.replace(/^#/, ''),
413
423
 
414
- // remove listener
415
- // window.removeEventListener('hashchange', hashChange, false);
424
+ // Remove listener
416
425
  window.onhashchange = null;
417
426
 
418
- // change hash
419
- if (hash === initialPageId) {
420
- location.href = location.href.split('#')[0];
421
- } else {
422
- location.hash = '#' + hash;
423
- }
424
-
425
- // add listener
426
- // window.addEventListener('hashchange', hashChange, false);
427
- window.onhashchange = hashChange;
427
+ // Change hash
428
+ location.hash = '#' + hash;
429
+
430
+ // Add listener
431
+ window.onhashchange = hashChangeHandler;
428
432
 
429
433
  }
430
434
  function showPageByHref(href, options) {
@@ -567,34 +571,35 @@
567
571
  function tapHandler(e){
568
572
  _debug();
569
573
 
574
+ if (!tapReady) {
575
+ _debug('Tap is not ready');
576
+ return false;
577
+ }
578
+
570
579
  // Grab the target element
571
580
  var $el = $(e.target);
572
581
 
573
- // Find the nearest interactive ancestor
574
- if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA') {
575
- $el = $el.closest('a, area');
582
+ // Find the nearest tappable ancestor
583
+ if (!$el.is(touchSelectors.join(', '))) {
584
+ var $el = $(e.target).closest(touchSelectors.join(', '));
585
+ }
586
+
587
+ // Make sure we have a tappable element
588
+ if (!$el.length || !$el.attr('href')) {
589
+ _debug('Could not find a link related to tapped element');
590
+ return false;
576
591
  }
577
592
 
593
+ // Init some vars
578
594
  var target = $el.attr('target'),
579
595
  hash = $el.attr('hash'),
580
596
  animation = null;
581
597
 
582
- if (tapReady == false) {
583
- _debug('Tap is not ready');
584
- return false;
585
- }
586
-
587
- if (!$el.length) {
588
- _debug('Nothing tappable here');
589
- return false;
590
- }
591
-
592
598
  if ($el.isExternalLink()) {
593
- $el.removeClass('active');
599
+ $el.unselect();
594
600
  return true;
595
- }
596
601
 
597
- if ($el.is(jQTSettings.backSelector)) {
602
+ } else if ($el.is(jQTSettings.backSelector)) {
598
603
  // User clicked or tapped a back button
599
604
  goBack(hash);
600
605
 
@@ -602,12 +607,12 @@
602
607
  // User clicked or tapped a submit element
603
608
  submitParentForm($el);
604
609
 
605
- } else if (target == '_webapp') {
610
+ } else if (target === '_webapp') {
606
611
  // User clicked or tapped an internal link, fullscreen mode
607
612
  window.location = $el.attr('href');
608
613
  return false;
609
614
 
610
- } else if ($el.attr('href') == '#') {
615
+ } else if ($el.attr('href') === '#') {
611
616
  // Allow tap on item with no href
612
617
  $el.unselect();
613
618
  return true;
@@ -627,7 +632,7 @@
627
632
  animation = 'slideleft';
628
633
  }
629
634
 
630
- if (hash && hash!='#') {
635
+ if (hash && hash !== '#') {
631
636
  // Internal href
632
637
  $el.addClass('active');
633
638
  goTo($(hash).data('referrer', $el), animation, $(this).hasClass('reverse'));
@@ -635,7 +640,6 @@
635
640
 
636
641
  } else {
637
642
  // External href
638
- // alert('mkay');
639
643
  $el.addClass('loading active');
640
644
  showPageByHref($el.attr('href'), {
641
645
  animation: animation,
@@ -651,16 +655,18 @@
651
655
  }
652
656
  function touchStartHandler(e) {
653
657
  _debug();
658
+
659
+ if (!tapReady) {
660
+ _debug('TouchStart handler aborted because tap is not ready');
661
+ e.preventDefault();
662
+ return false;
663
+ }
654
664
 
655
665
  var $el = $(e.target);
656
666
 
657
- if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA') {
658
- $el = $el.closest('a, area');
659
- }
660
-
661
667
  // Error check
662
668
  if (!$el.length) {
663
- _debug('Could not find a link element.');
669
+ _debug('Could not find target of touchstart event.');
664
670
  return;
665
671
  }
666
672
 
@@ -680,7 +686,7 @@
680
686
  startY = touch.pageY;
681
687
  }
682
688
 
683
- // Prep the link
689
+ // Prep the element
684
690
  $el.bind('touchmove',touchmove).bind('touchend',touchend).bind('touchcancel',touchcancel);
685
691
 
686
692
  hoverTimeout = setTimeout(function() {
@@ -688,9 +694,8 @@
688
694
  }, jQTSettings.hoverDelay);
689
695
 
690
696
  pressTimeout = setTimeout(function() {
691
- _debug('press');
692
697
  $el.unbind('touchmove',touchmove).unbind('touchend',touchend).unbind('touchcancel',touchcancel);
693
- $el.removeClass('active');
698
+ $el.unselect();
694
699
  clearTimeout(hoverTimeout);
695
700
  $el.trigger('press');
696
701
  }, jQTSettings.pressDelay);
@@ -699,12 +704,27 @@
699
704
  function touchcancel(e) {
700
705
  _debug();
701
706
  clearTimeout(hoverTimeout);
702
- $el.removeClass('active');
707
+ $el.unselect();
703
708
  $el.unbind('touchmove',touchmove).unbind('touchend',touchend).unbind('touchcancel',touchcancel);
704
709
  }
705
710
 
706
- function touchmove(e) {
711
+ function touchend(e) {
707
712
  _debug();
713
+ // updateChanges();
714
+ $el.unbind('touchend',touchend).unbind('touchcancel',touchcancel);
715
+ clearTimeout(hoverTimeout);
716
+ clearTimeout(pressTimeout);
717
+ if (Math.abs(deltaX) < jQTSettings.moveThreshold && Math.abs(deltaY) < jQTSettings.moveThreshold && deltaT < jQTSettings.pressDelay) {
718
+ // e.preventDefault();
719
+ // e.stopImmediatePropagation();
720
+ $el.trigger('tap', e);
721
+ } else {
722
+ $el.unselect();
723
+ }
724
+ }
725
+
726
+ function touchmove(e) {
727
+ // _debug();
708
728
  updateChanges();
709
729
  var absX = Math.abs(deltaX);
710
730
  var absY = Math.abs(deltaY);
@@ -718,28 +738,15 @@
718
738
  $el.unbind('touchmove',touchmove).unbind('touchend',touchend).unbind('touchcancel',touchcancel);
719
739
  $el.trigger('swipe', {direction:direction, deltaX:deltaX, deltaY: deltaY});
720
740
  }
721
- $el.removeClass('active');
741
+ $el.unselect();
722
742
  clearTimeout(hoverTimeout);
723
743
  if (absX > jQTSettings.moveThreshold || absY > jQTSettings.moveThreshold) {
724
744
  clearTimeout(pressTimeout);
725
745
  }
726
746
  }
727
747
 
728
- function touchend() {
729
- _debug();
730
- // updateChanges();
731
- $el.unbind('touchend',touchend).unbind('touchcancel',touchcancel);
732
- clearTimeout(hoverTimeout);
733
- clearTimeout(pressTimeout);
734
- if (Math.abs(deltaX) < jQTSettings.moveThreshold && Math.abs(deltaY) < jQTSettings.moveThreshold && deltaT < jQTSettings.pressDelay) {
735
- $el.trigger('tap', e);
736
- } else {
737
- $el.removeClass('active');
738
- }
739
- }
740
-
741
748
  function updateChanges() {
742
- _debug();
749
+ // _debug();
743
750
  var firstFinger = event.changedTouches[0] || null;
744
751
  deltaX = firstFinger.pageX - startX;
745
752
  deltaY = firstFinger.pageY - startY;
@@ -771,7 +778,7 @@
771
778
  // Define public jQuery functions
772
779
  $.fn.isExternalLink = function() {
773
780
  var $el = $(this);
774
- return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('input[type="checkbox"], input[type="radio"], a[href^="http://maps.google.com"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));
781
+ return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('a[href^="http://maps.google.com"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));
775
782
  }
776
783
  $.fn.makeActive = function() {
777
784
  return $(this).addClass('active');
@@ -834,8 +841,8 @@
834
841
  addAnimation(animation);
835
842
  }
836
843
 
837
- // I'm not so sure about this stuff...
838
- touchSelectors.push('input');
844
+ // Create an array of stuff that needs touch event handling
845
+ touchSelectors.push('input'); // TODO: Ask DK why inputs are considered touch selectors
839
846
  touchSelectors.push(jQTSettings.touchSelector);
840
847
  touchSelectors.push(jQTSettings.backSelector);
841
848
  touchSelectors.push(jQTSettings.submitSelector);
@@ -844,7 +851,7 @@
844
851
  // Make sure we have a jqt element
845
852
  $body = $('#jqt');
846
853
  if ($body.length === 0) {
847
- console.warn('Could not find an element with the id "jqt", so the body id has been set to "jqt". This might cause problems, so you should prolly wrap your panels in a div with the id "jqt".');
854
+ console.warn('Could not find an element with the id "jqt", so the body id has been set to "jqt". If you are having any problems, wrapping your panels in a div with the id "jqt" might help.');
848
855
  $body = $('body').attr('id', 'jqt');
849
856
  }
850
857
 
@@ -858,21 +865,19 @@
858
865
  }
859
866
 
860
867
  // Bind events
861
- if ($.support.touch) {
862
- $body.bind('touchstart', touchStartHandler);
863
- }
864
- $body.bind('click', clickHandler);
865
- $body.bind('mousedown', mousedownHandler);
866
- $body.bind('orientationchange', orientationChangeHandler);
867
- $body.bind('submit', submitHandler);
868
- $body.bind('tap', tapHandler);
869
- $body.trigger('orientationchange');
868
+ $body.bind('touchstart', touchStartHandler)
869
+ .bind('click', clickHandler)
870
+ .bind('mousedown', mousedownHandler)
871
+ .bind('orientationchange', orientationChangeHandler)
872
+ .bind('submit', submitHandler)
873
+ .bind('tap', tapHandler)
874
+ .trigger('orientationchange');
870
875
 
871
876
  // Normalize href
872
877
  if (location.hash.length) {
873
878
  location.replace(location.href.split('#')[0]);
874
879
  }
875
-
880
+
876
881
  // Make sure exactly one child of body has "current" class
877
882
  if ($('#jqt > .current').length == 0) {
878
883
  currentPage = $('#jqt > *:first');
@@ -883,10 +888,15 @@
883
888
 
884
889
  // Go to the top of the "current" page
885
890
  $(currentPage).addClass('current');
886
- setHash($(currentPage).attr('id'));
887
891
  initialPageId = $(currentPage).attr('id');
892
+ if(history.replaceState !== undefined) {
893
+ history.replaceState(null, null, '#' + initialPageId);
894
+ } else {
895
+ setHash(initialPageId);
896
+ }
888
897
  addPageToHistory(currentPage);
889
898
  scrollTo(0, 0);
899
+
890
900
  });
891
901
 
892
902
  // Expose public methods and properties
@@ -5060,7 +5070,7 @@ $.Chain.extend('items', {
5060
5070
  if (data.direction === 'in'){
5061
5071
  var $title = $(titleSelector, $(e.target));
5062
5072
  var $ref = $(e.target).data('referrer');
5063
- if ($title.length && $ref){
5073
+ if ($title.length && $ref && $title.html() === ''){
5064
5074
  $title.html($ref.text());
5065
5075
  }
5066
5076
  }
@@ -6110,7 +6120,7 @@ $(function(){
6110
6120
  //cache.addEventListener('obsolete', logEvent, false);
6111
6121
  //cache.addEventListener('progress', logEvent, false);
6112
6122
  //cache.addEventListener('updateready', logEvent, false);
6113
- window.addEventListener('cached', logEvent, false);
6123
+ window.addEventListener('cached', logEvent, false);
6114
6124
  window.addEventListener('checking', logEvent, false);
6115
6125
  window.addEventListener('downloading', logEvent, false);
6116
6126
  window.addEventListener('error', logEvent, false);
@@ -6143,8 +6153,7 @@ $(function(){
6143
6153
  }
6144
6154
 
6145
6155
  // Swap in newly download files when update is ready
6146
- //cache.addEventListener('updateready', function(e){
6147
- window.addEventListener('updateready', function(e){
6156
+ cache.addEventListener('updateready', function(e){
6148
6157
  // Don't perform "swap" if this is the first cache
6149
6158
  if (cacheStatusValues[cache.status] != 'idle') {
6150
6159
  cache.swapCache();