From 0ded44245ee9dd86f39ad8b42dddc9be69baf537 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Wed, 10 Dec 2014 08:35:31 -0500 Subject: [PATCH 01/19] NIFI-27: - Latest version of qtip2. --- .../webapp/WEB-INF/pages/bulletin-board.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/canvas.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/cluster.jsp | 2 +- .../main/webapp/WEB-INF/pages/counters.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/history.jsp | 2 +- .../main/webapp/WEB-INF/pages/provenance.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/summary.jsp | 2 +- .../main/webapp/WEB-INF/pages/templates.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/users.jsp | 2 +- .../webapp/js/jquery/qtip2/jquery.qtip.css | 557 -------------- .../js/jquery/qtip2/jquery.qtip.min.css | 3 + .../webapp/js/jquery/qtip2/jquery.qtip.min.js | 711 +----------------- 12 files changed, 17 insertions(+), 1272 deletions(-) delete mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.css create mode 100644 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.css diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp index 8669f6c057..083862d22d 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/bulletin-board.jsp @@ -24,7 +24,7 @@ ${nf.bulletin.board.style.tags} - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp index acdd1478a2..c8f2ff735d 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp @@ -28,7 +28,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp index 33fdbb0183..e3e7b86bbe 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp @@ -24,7 +24,7 @@ ${nf.cluster.style.tags} - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp index 5b901136fd..21ee50862c 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp @@ -24,7 +24,7 @@ ${nf.counters.style.tags} - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp index 47eb9ec74a..61be72761f 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp @@ -24,7 +24,7 @@ ${nf.history.style.tags} - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp index 742dd3213b..2f5191886e 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp @@ -25,7 +25,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp index 983fac9f1e..b34f0e6db5 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp @@ -25,7 +25,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp index d4c41ab537..c7c0293d63 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp @@ -24,7 +24,7 @@ ${nf.templates.style.tags} - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp index a1b511f9bf..770dad577b 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp @@ -25,7 +25,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.css b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.css deleted file mode 100755 index 4655d9c111..0000000000 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.css +++ /dev/null @@ -1,557 +0,0 @@ -/* -* qTip2 - Pretty powerful tooltips -* http://craigsworks.com/projects/qtip2/ -* -* Version: 2.0.0pre -* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com -* -* Dual licensed under MIT or GPLv2 licenses -* http://en.wikipedia.org/wiki/MIT_License -* http://en.wikipedia.org/wiki/GNU_General_Public_License -* -* Date: Thu Apr 26 20:40:09 2012 +0100 -*/ - -/* Core qTip styles */ -.ui-tooltip, .qtip{ - position: absolute; - left: -28000px; - top: -28000px; - display: none; - - max-width: 600px; - min-width: 50px; - - font-size: 10.5px; - line-height: 12px; -} - -/* Fluid class for determining actual width in IE */ -.ui-tooltip-fluid{ - display: block; - visibility: hidden; - position: static !important; - float: left !important; -} - -.ui-tooltip-content{ - position: relative; - padding: 5px 9px; - overflow: hidden; - - border: 1px solid #000001; - - text-align: left; - word-wrap: break-word; - overflow: hidden; -} - -.ui-tooltip-titlebar{ - position: relative; - min-height: 14px; - padding: 5px 35px 5px 10px; - overflow: hidden; - - border: 1px solid #000001; - border-width: 1px 1px 0; - - font-weight: bold; -} - -.ui-tooltip-titlebar + .ui-tooltip-content{ border-top-width: 0px !important; } - -/*! Default close button class */ -.ui-tooltip-titlebar .ui-state-default{ - position: absolute; - right: 4px; - top: 50%; - margin-top: -9px; - - cursor: pointer; - outline: medium none; - - border-width: 1px; - border-style: solid; -} - -* html .ui-tooltip-titlebar .ui-state-default{ top: 16px; } /* IE fix */ - -.ui-tooltip-titlebar .ui-icon, -.ui-tooltip-icon .ui-icon{ - display: block; - text-indent: -1000em; -} - -.ui-tooltip-icon, .ui-tooltip-icon .ui-icon{ - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.ui-tooltip-icon .ui-icon{ - width: 18px; - height: 14px; - - text-align: center; - text-indent: 0; - font: normal bold 10px/13px Tahoma,sans-serif; - - color: inherit; - background: transparent none no-repeat -100em -100em; -} - - -/* Applied to 'focused' tooltips e.g. most recently displayed/interacted with */ -.ui-tooltip-focus{ - -} - -/* Applied on hover of tooltips i.e. added/removed on mouseenter/mouseleave respectively */ -.ui-tooltip-hover{ - -} - - -/*! Default tooltip style */ -.ui-tooltip-default .ui-tooltip-titlebar, -.ui-tooltip-default .ui-tooltip-content{ - border-color: #F1D031; - background-color: #FFFFA3; - color: #555; -} - -.ui-tooltip-default .ui-tooltip-titlebar{ - background-color: #FFEF93; -} - -.ui-tooltip-default .ui-tooltip-icon{ - border-color: #CCC; - background: #F1F1F1; - color: #777; -} - -.ui-tooltip-default .ui-tooltip-titlebar .ui-state-hover{ - border-color: #AAA; - color: #111; -} - -/* Modal plugin */ -#qtip-overlay{ - position: fixed; - left: -10000em; - top: -10000em; -} - -/* Applied to modals with show.modal.blur set to true */ -#qtip-overlay.blurs{ cursor: pointer; } - -/* Change opacity of overlay here */ -#qtip-overlay div{ - position: absolute; - left: 0; top: 0; - width: 100%; height: 100%; - - background-color: black; - - opacity: 0.7; - filter:alpha(opacity=70); - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; -} - -/* Tips plugin */ -.ui-tooltip .ui-tooltip-tip{ - margin: 0 auto; - overflow: hidden; - z-index: 10; -} - -.ui-tooltip .ui-tooltip-tip, -.ui-tooltip .ui-tooltip-tip *{ - position: absolute; - - line-height: 0.1px !important; - font-size: 0.1px !important; - color: #123456; - - background: transparent; - border: 0px dashed transparent; -} - -.ui-tooltip .ui-tooltip-tip canvas{ top: 0; left: 0; } - - -/*! Light tooltip style */ -.ui-tooltip-light .ui-tooltip-titlebar, -.ui-tooltip-light .ui-tooltip-content{ - border-color: #E2E2E2; - color: #454545; -} - -.ui-tooltip-light .ui-tooltip-content{ - background-color: white; -} - -.ui-tooltip-light .ui-tooltip-titlebar{ - background-color: #f1f1f1; -} - - -/*! Dark tooltip style */ -.ui-tooltip-dark .ui-tooltip-titlebar, -.ui-tooltip-dark .ui-tooltip-content{ - border-color: #303030; - color: #f3f3f3; -} - -.ui-tooltip-dark .ui-tooltip-content{ - background-color: #505050; -} - -.ui-tooltip-dark .ui-tooltip-titlebar{ - background-color: #404040; -} - -.ui-tooltip-dark .ui-tooltip-icon{ - border-color: #444; -} - -.ui-tooltip-dark .ui-tooltip-titlebar .ui-state-hover{ - border-color: #303030; -} - - -/*! Cream tooltip style */ -.ui-tooltip-cream .ui-tooltip-titlebar, -.ui-tooltip-cream .ui-tooltip-content{ - border-color: #F9E98E; - color: #A27D35; -} - -.ui-tooltip-cream .ui-tooltip-content{ - background-color: #FBF7AA; -} - -.ui-tooltip-cream .ui-tooltip-titlebar{ - background-color: #F0DE7D; -} - -.ui-tooltip-cream .ui-state-default .ui-tooltip-icon{ - background-position: -82px 0; -} - - -/*! Red tooltip style */ -.ui-tooltip-red .ui-tooltip-titlebar, -.ui-tooltip-red .ui-tooltip-content{ - border-color: #D95252; - color: #912323; -} - -.ui-tooltip-red .ui-tooltip-content{ - background-color: #F78B83; -} - -.ui-tooltip-red .ui-tooltip-titlebar{ - background-color: #F06D65; -} - -.ui-tooltip-red .ui-state-default .ui-tooltip-icon{ - background-position: -102px 0; -} - -.ui-tooltip-red .ui-tooltip-icon{ - border-color: #D95252; -} - -.ui-tooltip-red .ui-tooltip-titlebar .ui-state-hover{ - border-color: #D95252; -} - - -/*! Green tooltip style */ -.ui-tooltip-green .ui-tooltip-titlebar, -.ui-tooltip-green .ui-tooltip-content{ - border-color: #90D93F; - color: #3F6219; -} - -.ui-tooltip-green .ui-tooltip-content{ - background-color: #CAED9E; -} - -.ui-tooltip-green .ui-tooltip-titlebar{ - background-color: #B0DE78; -} - -.ui-tooltip-green .ui-state-default .ui-tooltip-icon{ - background-position: -42px 0; -} - - -/*! Blue tooltip style */ -.ui-tooltip-blue .ui-tooltip-titlebar, -.ui-tooltip-blue .ui-tooltip-content{ - border-color: #ADD9ED; - color: #5E99BD; -} - -.ui-tooltip-blue .ui-tooltip-content{ - background-color: #E5F6FE; -} - -.ui-tooltip-blue .ui-tooltip-titlebar{ - background-color: #D0E9F5; -} - -.ui-tooltip-blue .ui-state-default .ui-tooltip-icon{ - background-position: -2px 0; -} - -/*! Add shadows to your tooltips in: FF3+, Chrome 2+, Opera 10.6+, IE6+, Safari 2+ */ -.ui-tooltip-shadow{ - -webkit-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15); - -moz-box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15); - box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.15); -} - -.ui-tooltip-shadow .ui-tooltip-titlebar, -.ui-tooltip-shadow .ui-tooltip-content{ - filter: progid:DXImageTransform.Microsoft.Shadow(Color='gray', Direction=135, Strength=3); - -ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Color='gray', Direction=135, Strength=3)"; - - _margin-bottom: -3px; /* IE6 */ - .margin-bottom: -3px; /* IE7 */ -} - - -/*! Add rounded corners to your tooltips in: FF3+, Chrome 2+, Opera 10.6+, IE9+, Safari 2+ */ -.ui-tooltip-rounded, -.ui-tooltip-rounded .ui-tooltip-content, -.ui-tooltip-tipsy, -.ui-tooltip-tipsy .ui-tooltip-content, -.ui-tooltip-youtube, -.ui-tooltip-youtube .ui-tooltip-content{ - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; -} - -.ui-tooltip-rounded .ui-tooltip-titlebar, -.ui-tooltip-tipsy .ui-tooltip-titlebar, -.ui-tooltip-youtube .ui-tooltip-titlebar{ - -moz-border-radius: 5px 5px 0 0; - -webkit-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; -} - -.ui-tooltip-rounded .ui-tooltip-titlebar + .ui-tooltip-content, -.ui-tooltip-tipsy .ui-tooltip-titlebar + .ui-tooltip-content, -.ui-tooltip-youtube .ui-tooltip-titlebar + .ui-tooltip-content{ - -moz-border-radius: 0 0 5px 5px; - -webkit-border-radius: 0 0 5px 5px; - border-radius: 0 0 5px 5px; -} - - -/*! Youtube tooltip style */ -.ui-tooltip-youtube{ - -webkit-box-shadow: 0 0 3px #333; - -moz-box-shadow: 0 0 3px #333; - box-shadow: 0 0 3px #333; -} - -.ui-tooltip-youtube .ui-tooltip-titlebar, -.ui-tooltip-youtube .ui-tooltip-content{ - _margin-bottom: 0; /* IE6 */ - .margin-bottom: 0; /* IE7 */ - - background: transparent; - background: rgba(0, 0, 0, 0.85); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)"; - - color: white; - border-color: #CCCCCC; -} - -.ui-tooltip-youtube .ui-tooltip-icon{ - border-color: #222; -} - -.ui-tooltip-youtube .ui-tooltip-titlebar .ui-state-hover{ - border-color: #303030; -} - - -/* jQuery TOOLS Tooltip style */ -.ui-tooltip-jtools{ - background: #232323; - background: rgba(0, 0, 0, 0.7); - background-image: -moz-linear-gradient(top, #717171, #232323); - background-image: -webkit-gradient(linear, left top, left bottom, from(#717171), to(#232323)); - - border: 2px solid #ddd; - border: 2px solid rgba(241,241,241,1); - - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - - -webkit-box-shadow: 0 0 12px #333; - -moz-box-shadow: 0 0 12px #333; - box-shadow: 0 0 12px #333; -} - -/* IE Specific */ -.ui-tooltip-jtools .ui-tooltip-titlebar{ - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)"; -} -.ui-tooltip-jtools .ui-tooltip-content{ - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)"; -} - -.ui-tooltip-jtools .ui-tooltip-titlebar, -.ui-tooltip-jtools .ui-tooltip-content{ - background: transparent; - color: white; - border: 0 dashed transparent; -} - -.ui-tooltip-jtools .ui-tooltip-icon{ - border-color: #555; -} - -.ui-tooltip-jtools .ui-tooltip-titlebar .ui-state-hover{ - border-color: #333; -} - - -/* Cluetip style */ -.ui-tooltip-cluetip{ - -webkit-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - -moz-box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); - box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.4); -} - -.ui-tooltip-cluetip .ui-tooltip-titlebar{ - background-color: #87876A; - color: white; - border: 0 dashed transparent; -} - -.ui-tooltip-cluetip .ui-tooltip-content{ - background-color: #D9D9C2; - color: #111; - border: 0 dashed transparent; -} - -.ui-tooltip-cluetip .ui-tooltip-icon{ - border-color: #808064; -} - -.ui-tooltip-cluetip .ui-tooltip-titlebar .ui-state-hover{ - border-color: #696952; - color: #696952; -} - - -/* Tipsy style */ -.ui-tooltip-tipsy{ - border: 0; -} - -.ui-tooltip-tipsy .ui-tooltip-titlebar, -.ui-tooltip-tipsy .ui-tooltip-content{ - _margin-bottom: 0; /* IE6 */ - .margin-bottom: 0; /* IE7 */ - - background: transparent; - background: rgba(0, 0, 0, .87); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)"; - - color: white; - border: 0px transparent; - - font-size: 11px; - font-family: 'Lucida Grande', sans-serif; - font-weight: bold; - line-height: 16px; - text-shadow: 0 1px black; -} - -.ui-tooltip-tipsy .ui-tooltip-titlebar{ - padding: 6px 35px 0 10; -} - -.ui-tooltip-tipsy .ui-tooltip-content{ - padding: 6px 10; -} - -.ui-tooltip-tipsy .ui-tooltip-icon{ - border-color: #222; - text-shadow: none; -} - -.ui-tooltip-tipsy .ui-tooltip-titlebar .ui-state-hover{ - border-color: #303030; -} - - -/* Tipped style */ -.ui-tooltip-tipped{ - -} - -.ui-tooltip-tipped .ui-tooltip-titlebar, -.ui-tooltip-tipped .ui-tooltip-content{ - border: 3px solid #959FA9; - - filter: none; -ms-filter: none; -} - -.ui-tooltip-tipped .ui-tooltip-titlebar{ - background: #3A79B8; - background-image: -moz-linear-gradient(top, #3A79B8, #2E629D); - background-image: -webkit-gradient(linear, left top, left bottom, from(#3A79B8), to(#2E629D)); - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D); - -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)"; - - color: white; - font-weight: normal; - font-family: serif; - - border-bottom-width: 0; - -moz-border-radius: 3px 3px 0 0; - -webkit-border-radius: 3px 3px 0 0; - border-radius: 3px 3px 0 0; -} - -.ui-tooltip-tipped .ui-tooltip-content{ - background-color: #F9F9F9; - color: #454545; - - -moz-border-radius: 0 0 3px 3px; - -webkit-border-radius: 0 0 3px 3px; - border-radius: 0 0 3px 3px; -} - -.ui-tooltip-tipped .ui-tooltip-icon{ - border: 2px solid #285589; - background: #285589; -} - -.ui-tooltip-tipped .ui-tooltip-icon .ui-icon{ - background-color: #FBFBFB; - color: #555; -} - -/* IE9 fix - removes all filters */ -.ui-tooltip:not(.ie9haxors) div.ui-tooltip-content, -.ui-tooltip:not(.ie9haxors) div.ui-tooltip-titlebar{ - filter: none; - -ms-filter: none; -} - diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.css b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.css new file mode 100644 index 0000000000..27b9729645 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.css @@ -0,0 +1,3 @@ +/* qTip2 v2.2.1 | Plugins: tips modal viewport svg imagemap ie6 | Styles: core basic css3 | qtip2.com | Licensed MIT | Sat Sep 06 2014 23:12:07 */ + +.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;z-index:11;cursor:pointer;outline:0;border:1px solid transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-icon .ui-icon,.qtip-titlebar .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:-100em -100em no-repeat}.qtip-default{border:1px solid #F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}.qtip-light{background-color:#fff;border-color:#E2E2E2;color:#454545}.qtip-light .qtip-titlebar{background-color:#f1f1f1}.qtip-dark{background-color:#505050;border-color:#303030;color:#f3f3f3}.qtip-dark .qtip-titlebar{background-color:#404040}.qtip-dark .qtip-icon{border-color:#444}.qtip-dark .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-cream{background-color:#FBF7AA;border-color:#F9E98E;color:#A27D35}.qtip-cream .qtip-titlebar{background-color:#F0DE7D}.qtip-cream .qtip-close .qtip-icon{background-position:-82px 0}.qtip-red{background-color:#F78B83;border-color:#D95252;color:#912323}.qtip-red .qtip-titlebar{background-color:#F06D65}.qtip-red .qtip-close .qtip-icon{background-position:-102px 0}.qtip-red .qtip-icon,.qtip-red .qtip-titlebar .ui-state-hover{border-color:#D95252}.qtip-green{background-color:#CAED9E;border-color:#90D93F;color:#3F6219}.qtip-green .qtip-titlebar{background-color:#B0DE78}.qtip-green .qtip-close .qtip-icon{background-position:-42px 0}.qtip-blue{background-color:#E5F6FE;border-color:#ADD9ED;color:#5E99BD}.qtip-blue .qtip-titlebar{background-color:#D0E9F5}.qtip-blue .qtip-close .qtip-icon{background-position:-2px 0}.qtip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,.15)}.qtip-bootstrap,.qtip-rounded,.qtip-tipsy{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.qtip-rounded .qtip-titlebar{-moz-border-radius:4px 4px 0 0;-webkit-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.qtip-youtube{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;color:#fff;border:0 solid transparent;background:#4A4A4A;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#4A4A4A),color-stop(100%,#000));background-image:-webkit-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-moz-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-ms-linear-gradient(top,#4A4A4A 0,#000 100%);background-image:-o-linear-gradient(top,#4A4A4A 0,#000 100%)}.qtip-youtube .qtip-titlebar{background-color:transparent}.qtip-youtube .qtip-content{padding:.75em;font:12px arial,sans-serif;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#4a4a4a, EndColorStr=#000000);-ms-filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#4a4a4a,EndColorStr=#000000);"}.qtip-youtube .qtip-icon{border-color:#222}.qtip-youtube .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-jtools{background:#232323;background:rgba(0,0,0,.7);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-linear-gradient(top,#717171,#232323);background-image:-ms-linear-gradient(top,#717171,#232323);background-image:-o-linear-gradient(top,#717171,#232323);border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333}.qtip-jtools .qtip-titlebar{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171, endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)"}.qtip-jtools .qtip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A, endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)"}.qtip-jtools .qtip-content,.qtip-jtools .qtip-titlebar{background:0 0;color:#fff;border:0 dashed transparent}.qtip-jtools .qtip-icon{border-color:#555}.qtip-jtools .qtip-titlebar .ui-state-hover{border-color:#333}.qtip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,.4);box-shadow:4px 4px 5px rgba(0,0,0,.4);background-color:#D9D9C2;color:#111;border:0 dashed transparent}.qtip-cluetip .qtip-titlebar{background-color:#87876A;color:#fff;border:0 dashed transparent}.qtip-cluetip .qtip-icon{border-color:#808064}.qtip-cluetip .qtip-titlebar .ui-state-hover{border-color:#696952;color:#696952}.qtip-tipsy{background:#000;background:rgba(0,0,0,.87);color:#fff;border:0 solid transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:700;line-height:16px;text-shadow:0 1px #000}.qtip-tipsy .qtip-titlebar{padding:6px 35px 0 10px;background-color:transparent}.qtip-tipsy .qtip-content{padding:6px 10px}.qtip-tipsy .qtip-icon{border-color:#222;text-shadow:none}.qtip-tipsy .qtip-titlebar .ui-state-hover{border-color:#303030}.qtip-tipped{border:3px solid #959FA9;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#F9F9F9;color:#454545;font-weight:400;font-family:serif}.qtip-tipped .qtip-titlebar{border-bottom-width:0;color:#fff;background:#3A79B8;background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));background-image:-webkit-linear-gradient(top,#3A79B8,#2E629D);background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-ms-linear-gradient(top,#3A79B8,#2E629D);background-image:-o-linear-gradient(top,#3A79B8,#2E629D);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8, endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)"}.qtip-tipped .qtip-icon{border:2px solid #285589;background:#285589}.qtip-tipped .qtip-icon .ui-icon{background-color:#FBFBFB;color:#555}.qtip-bootstrap{font-size:14px;line-height:20px;color:#333;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.qtip-bootstrap .qtip-titlebar{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.qtip-bootstrap .qtip-titlebar .qtip-close{right:11px;top:45%;border-style:none}.qtip-bootstrap .qtip-content{padding:9px 14px}.qtip-bootstrap .qtip-icon{background:0 0}.qtip-bootstrap .qtip-icon .ui-icon{width:auto;height:auto;float:right;font-size:20px;font-weight:700;line-height:18px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.qtip-bootstrap .qtip-icon .ui-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}.qtip:not(.ie9haxors) div.qtip-content,.qtip:not(.ie9haxors) div.qtip-titlebar{filter:none;-ms-filter:none}.qtip .qtip-tip{margin:0 auto;overflow:hidden;z-index:10}.qtip .qtip-tip,x:-o-prefocus{visibility:hidden}.qtip .qtip-tip,.qtip .qtip-tip .qtip-vml,.qtip .qtip-tip canvas{position:absolute;color:#123456;background:0 0;border:0 dashed transparent}.qtip .qtip-tip canvas{top:0;left:0}.qtip .qtip-tip .qtip-vml{behavior:url(#default#VML);display:inline-block;visibility:visible}#qtip-overlay{position:fixed;left:0;top:0;width:100%;height:100%}#qtip-overlay.blurs{cursor:pointer}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;opacity:.7;filter:alpha(opacity=70);-ms-filter:"alpha(Opacity=70)"}.qtipmodal-ie6fix{position:absolute!important} \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.js index de35e9a7e3..411a0f8f98 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/qtip2/jquery.qtip.min.js @@ -1,706 +1,5 @@ -/* - * qTip2 - Pretty powerful tooltips - * http://craigsworks.com/projects/qtip2/ - * - * Version: 2.0.0pre - * Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com - * - * Dual licensed under MIT or GPLv2 licenses - * http://en.wikipedia.org/wiki/MIT_License - * http://en.wikipedia.org/wiki/GNU_General_Public_License - * - * Date: Thu Apr 26 20:40:09 2012 +0100 - *//*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true *//*global window: false, jQuery: false, console: false, define: false */// Uses AMD or browser globals to create a jQuery plugin. -(function (a) { - typeof define == "function" && define.amd ? define(["jquery"], a) : a(jQuery) -})(function (a) { - "use strict"; - function v() { - v.history = v.history || [], v.history.push(arguments); - if ("object" == typeof console) { - var a = console[console.warn ? "warn" : "log"], b = Array.prototype.slice.call(arguments), c; - typeof arguments[0] == "string" && (b[0] = "qTip2: " + b[0]), c = a.apply ? a.apply(console, b) : a(b) - } - } - function w(b) { - var e; - if (!b || "object" != typeof b) - return c; - if (b.metadata === d || "object" != typeof b.metadata) - b.metadata = {type: b.metadata}; - if ("content"in b) { - if (b.content === d || "object" != typeof b.content || b.content.jquery) - b.content = {text: b.content}; - e = b.content.text || c, !a.isFunction(e) && (!e && !e.attr || e.length < 1 || "object" == typeof e && !e.jquery) && (b.content.text = c); - if ("title"in b.content) { - if (b.content.title === d || "object" != typeof b.content.title) - b.content.title = {text: b.content.title}; - e = b.content.title.text || c, !a.isFunction(e) && (!e && !e.attr || e.length < 1 || "object" == typeof e && !e.jquery) && (b.content.title.text = c) - } - } - return"position"in b && (b.position === d || "object" != typeof b.position) && (b.position = {my: b.position, at: b.position}), "show"in b && (b.show === d || "object" != typeof b.show) && (b.show.jquery ? b.show = {target: b.show} : b.show = {event: b.show}), "hide"in b && (b.hide === d || "object" != typeof b.hide) && (b.hide.jquery ? b.hide = {target: b.hide} : b.hide = {event: b.hide}), "style"in b && (b.style === d || "object" != typeof b.style) && (b.style = {classes: b.style}), a.each(g, function () { - this.sanitize && this.sanitize(b) - }), b - } - function x(r, s, v, x) { - function H(a) { - var b = 0, c, d = s, e = a.split("."); - while (d = d[e[b++]]) - b < e.length && (c = d); - return[c || s, e.pop()] - } - function I() { - var a = s.style.widget; - D.toggleClass(k, a).toggleClass(n, s.style.def && !a), F.content.toggleClass(k + "-content", a), F.titlebar && F.titlebar.toggleClass(k + "-header", a), F.button && F.button.toggleClass(j + "-icon", !a) - } - function J(a) { - F.title && (F.titlebar.remove(), F.titlebar = F.title = F.button = d, a !== c && y.reposition()) - } - function K() { - var b = s.content.title.button, d = typeof b == "string", e = d ? b : "Close tooltip"; - F.button && F.button.remove(), b.jquery ? F.button = b : F.button = a("", {"class": "ui-state-default ui-tooltip-close " + (s.style.widget ? "" : j + "-icon"), title: e, "aria-label": e}).prepend(a("", {"class": "ui-icon ui-icon-close", html: "×"})), F.button.appendTo(F.titlebar).attr("role", "button").click(function (a) { - return D.hasClass(l) || y.hide(a), c - }), y.redraw() - } - function L() { - var c = A + "-title"; - F.titlebar && J(), F.titlebar = a("
", {"class": j + "-titlebar " + (s.style.widget ? "ui-widget-header" : "")}).append(F.title = a("
", {id: c, "class": j + "-title", "aria-atomic": b})).insertBefore(F.content).delegate(".ui-tooltip-close", "mousedown keydown mouseup keyup mouseout", function (b) { - a(this).toggleClass("ui-state-active ui-state-focus", b.type.substr(-4) === "down") - }).delegate(".ui-tooltip-close", "mouseover mouseout", function (b) { - a(this).toggleClass("ui-state-hover", b.type === "mouseover") - }), s.content.title.button ? K() : y.rendered && y.redraw() - } - function M(a) { - var b = F.button, d = F.title; - if (!y.rendered) - return c; - a ? (d || L(), K()) : b.remove() - } - function N(b, d) { - var e = F.title; - if (!y.rendered || !b) - return c; - a.isFunction(b) && (b = b.call(r, G.event, y)); - if (b === c || !b && b !== "") - return J(c); - b.jquery && b.length > 0 ? e.empty().append(b.css({display: "block"})) : e.html(b), y.redraw(), d !== c && y.rendered && D[0].offsetWidth > 0 && y.reposition(G.event) - } - function O(b, d) { - function g(b) { - function i(e) { - e && (delete h[e.src], clearTimeout(y.timers.img[e.src]), a(e).unbind(E)), a.isEmptyObject(h) && (y.redraw(), d !== c && y.reposition(G.event), b()) - } - var g, h = {}; - if ((g = f.find("img[src]:not([height]):not([width])")).length === 0) - return i(); - g.each(function (b, c) { - if (h[c.src] !== e) - return; - var d = 0, f = 3; - (function g() { - if (c.height || c.width || d > f) - return i(c); - d += 1, y.timers.img[c.src] = setTimeout(g, 700) - })(), a(c).bind("error" + E + " load" + E, function () { - i(this) - }), h[c.src] = c - }) - } - var f = F.content; - return!y.rendered || !b ? c : (a.isFunction(b) && (b = b.call(r, G.event, y) || ""), b.jquery && b.length > 0 ? f.empty().append(b.css({display: "block"})) : f.html(b), y.rendered < 0 ? D.queue("fx", g) : (C = 0, g(a.noop)), y) - } - function P() { - function j(a) { - if (D.hasClass(l)) - return c; - clearTimeout(y.timers.show), clearTimeout(y.timers.hide); - var d = function () { - y.toggle(b, a) - }; - s.show.delay > 0 ? y.timers.show = setTimeout(d, s.show.delay) : d() - } - function k(b) { - if (D.hasClass(l) || B || C) - return c; - var f = a(b.relatedTarget || b.target), g = f.closest(m)[0] === D[0], h = f[0] === e.show[0]; - clearTimeout(y.timers.show), clearTimeout(y.timers.hide); - if (d.target === "mouse" && g || s.hide.fixed && /mouse(out|leave|move)/.test(b.type) && (g || h)) { - try { - b.preventDefault(), b.stopImmediatePropagation() - } catch (i) { - } - return - } - s.hide.delay > 0 ? y.timers.hide = setTimeout(function () { - y.hide(b) - }, s.hide.delay) : y.hide(b) - } - function n(a) { - if (D.hasClass(l)) - return c; - clearTimeout(y.timers.inactive), y.timers.inactive = setTimeout(function () { - y.hide(a) - }, s.hide.inactive) - } - function o(a) { - y.rendered && D[0].offsetWidth > 0 && y.reposition(a) - } - var d = s.position, e = {show: s.show.target, hide: s.hide.target, viewport: a(d.viewport), document: a(document), body: a(document.body), window: a(window)}, g = {show: a.trim("" + s.show.event).split(" "), hide: a.trim("" + s.hide.event).split(" ")}, i = a.browser.msie && parseInt(a.browser.version, 10) === 6; - D.bind("mouseenter" + E + " mouseleave" + E, function (a) { - var b = a.type === "mouseenter"; - b && y.focus(a), D.toggleClass(p, b) - }), s.hide.fixed && (e.hide = e.hide.add(D), D.bind("mouseover" + E, function () { - D.hasClass(l) || clearTimeout(y.timers.hide) - })), /mouse(out|leave)/i.test(s.hide.event) ? s.hide.leave === "window" && e.window.bind("mouseout" + E + " blur" + E, function (a) { - /select|option/.test(a.target) && !a.relatedTarget && y.hide(a) - }) : /mouse(over|enter)/i.test(s.show.event) && e.hide.bind("mouseleave" + E, function (a) { - clearTimeout(y.timers.show) - }), ("" + s.hide.event).indexOf("unfocus") > -1 && d.container.closest("html").bind("mousedown" + E, function (b) { - var c = a(b.target), d = y.rendered && !D.hasClass(l) && D[0].offsetWidth > 0, e = c.parents(m).filter(D[0]).length > 0; - c[0] !== r[0] && c[0] !== D[0] && !e && !r.has(c[0]).length && !c.attr("disabled") && y.hide(b) - }), "number" == typeof s.hide.inactive && (e.show.bind("qtip-" + v + "-inactive", n), a.each(f.inactiveEvents, function (a, b) { - e.hide.add(F.tooltip).bind(b + E + "-inactive", n) - })), a.each(g.hide, function (b, c) { - var d = a.inArray(c, g.show), f = a(e.hide); - d > -1 && f.add(e.show).length === f.length || c === "unfocus" ? (e.show.bind(c + E, function (a) { - D[0].offsetWidth > 0 ? k(a) : j(a) - }), delete g.show[d]) : e.hide.bind(c + E, k) - }), a.each(g.show, function (a, b) { - e.show.bind(b + E, j) - }), "number" == typeof s.hide.distance && e.show.add(D).bind("mousemove" + E, function (a) { - var b = G.origin || {}, c = s.hide.distance, d = Math.abs; - (d(a.pageX - b.pageX) >= c || d(a.pageY - b.pageY) >= c) && y.hide(a) - }), d.target === "mouse" && (e.show.bind("mousemove" + E, function (a) { - h = {pageX: a.pageX, pageY: a.pageY, type: "mousemove"} - }), d.adjust.mouse && (s.hide.event && (D.bind("mouseleave" + E, function (a) { - (a.relatedTarget || a.target) !== e.show[0] && y.hide(a) - }), F.target.bind("mouseenter" + E + " mouseleave" + E, function (a) { - G.onTarget = a.type === "mouseenter" - })), e.document.bind("mousemove" + E, function (a) { - y.rendered && G.onTarget && !D.hasClass(l) && D[0].offsetWidth > 0 && y.reposition(a || h) - }))), (d.adjust.resize || e.viewport.length) && (a.event.special.resize ? e.viewport : e.window).bind("resize" + E, o), (e.viewport.length || i && D.css("position") === "fixed") && e.viewport.bind("scroll" + E, o) - } - function Q() { - var b = [s.show.target[0], s.hide.target[0], y.rendered && F.tooltip[0], s.position.container[0], s.position.viewport[0], window, document]; - y.rendered ? a([]).pushStack(a.grep(b, function (a) { - return typeof a == "object" - })).unbind(E) : s.show.target.unbind(E + "-create") - } - var y = this, z = document.body, A = j + "-" + v, B = 0, C = 0, D = a(), E = ".qtip-" + v, F, G; - y.id = v, y.rendered = c, y.destroyed = c, y.elements = F = {target: r}, y.timers = {img: {}}, y.options = s, y.checks = {}, y.plugins = {}, y.cache = G = {event: {}, target: a(), disabled: c, attr: x, onTarget: c}, y.checks.builtin = {"^id$": function (d, e, g) { - var h = g === b ? f.nextid : g, i = j + "-" + h; - h !== c && h.length > 0 && !a("#" + i).length && (D[0].id = i, F.content[0].id = i + "-content", F.title[0].id = i + "-title") - }, "^content.text$": function (a, b, c) { - O(c) - }, "^content.title.text$": function (a, b, c) { - if (!c) - return J(); - !F.title && c && L(), N(c) - }, "^content.title.button$": function (a, b, c) { - M(c) - }, "^position.(my|at)$": function (a, b, c) { - "string" == typeof c && (a[b] = new g.Corner(c)) - }, "^position.container$": function (a, b, c) { - y.rendered && D.appendTo(c) - }, "^show.ready$": function () { - y.rendered ? y.toggle(b) : y.render(1) - }, "^style.classes$": function (a, b, c) { - D.attr("class", j + " qtip ui-helper-reset " + c) - }, "^style.widget|content.title": I, "^events.(render|show|move|hide|focus|blur)$": function (b, c, d) { - D[(a.isFunction(d) ? "" : "un") + "bind"]("tooltip" + c, d) - }, "^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)": function () { - var a = s.position; - D.attr("tracking", a.target === "mouse" && a.adjust.mouse), Q(), P() - }}, a.extend(y, {render: function (d) { - if (y.rendered) - return y; - var e = s.content.text, f = s.content.title.text, h = s.position, i = a.Event("tooltiprender"); - return a.attr(r[0], "aria-describedby", A), D = F.tooltip = a("
", {id: A, "class": j + " qtip ui-helper-reset " + n + " " + s.style.classes + " " + j + "-pos-" + s.position.my.abbrev(), width: s.style.width || "", height: s.style.height || "", tracking: h.target === "mouse" && h.adjust.mouse, role: "alert", "aria-live": "polite", "aria-atomic": c, "aria-describedby": A + "-content", "aria-hidden": b}).toggleClass(l, G.disabled).data("qtip", y).appendTo(s.position.container).append(F.content = a("
", {"class": j + "-content", id: A + "-content", "aria-atomic": b})), y.rendered = -1, C = 1, B = 1, f && (L(), a.isFunction(f) || N(f, c)), a.isFunction(e) || O(e, c), y.rendered = b, I(), a.each(s.events, function (b, c) { - a.isFunction(c) && D.bind(b === "toggle" ? "tooltipshow tooltiphide" : "tooltip" + b, c) - }), a.each(g, function () { - this.initialize === "render" && this(y) - }), P(), D.queue("fx", function (a) { - i.originalEvent = G.event, D.trigger(i, [y]), C = 0, B = 0, y.redraw(), (s.show.ready || d) && y.toggle(b, G.event, c), a() - }), y - }, get: function (a) { - var b, c; - switch (a.toLowerCase()) { - case"dimensions": - b = {height: D.outerHeight(), width: D.outerWidth()}; - break; - case"offset": - b = g.offset(D, s.position.container); - break; - default: - c = H(a.toLowerCase()), b = c[0][c[1]], b = b.precedance ? b.string() : b - } - return b - }, set: function (e, f) { - function m(a, b) { - var c, d, e; - for (c in k) - for (d in k[c]) - if (e = (new RegExp(d, "i")).exec(a)) - b.push(e), k[c][d].apply(y, b) - } - var g = /^position\.(my|at|adjust|target|container)|style|content|show\.ready/i, h = /^content\.(title|attr)|style/i, i = c, j = c, k = y.checks, l; - return"string" == typeof e ? (l = e, e = {}, e[l] = f) : e = a.extend(b, {}, e), a.each(e, function (b, c) { - var d = H(b.toLowerCase()), f; - f = d[0][d[1]], d[0][d[1]] = "object" == typeof c && c.nodeType ? a(c) : c, e[b] = [d[0], d[1], c, f], i = g.test(b) || i, j = h.test(b) || j - }), w(s), B = C = 1, a.each(e, m), B = C = 0, y.rendered && D[0].offsetWidth > 0 && (i && y.reposition(s.position.target === "mouse" ? d : G.event), j && y.redraw()), y - }, toggle: function (e, f) { - function t() { - e ? (a.browser.msie && D[0].style.removeAttribute("filter"), D.css("overflow", ""), "string" == typeof i.autofocus && a(i.autofocus, D).focus(), i.target.trigger("qtip-" + v + "-inactive")) : D.css({display: "", visibility: "", opacity: "", left: "", top: ""}), r = a.Event("tooltip" + (e ? "visible" : "hidden")), r.originalEvent = f ? G.event : d, D.trigger(r, [y]) - } - if (!y.rendered) - return e ? y.render(1) : y; - var g = e ? "show" : "hide", i = s[g], j = s[e ? "hide" : "show"], k = s.position, l = s.content, n = D[0].offsetWidth > 0, o = e || i.target.length === 1, p = !f || i.target.length < 2 || G.target[0] === f.target, q, r; - (typeof e).search("boolean|number") && (e = !n); - if (!D.is(":animated") && n === e && p) - return y; - if (f) { - if (/over|enter/.test(f.type) && /out|leave/.test(G.event.type) && s.show.target.add(f.target).length === s.show.target.length && D.has(f.relatedTarget).length) - return y; - G.event = a.extend({}, f) - } - return r = a.Event("tooltip" + g), r.originalEvent = f ? G.event : d, D.trigger(r, [y, 90]), r.isDefaultPrevented() ? y : (a.attr(D[0], "aria-hidden", !e), e ? (G.origin = a.extend({}, h), y.focus(f), a.isFunction(l.text) && O(l.text, c), a.isFunction(l.title.text) && N(l.title.text, c), !u && k.target === "mouse" && k.adjust.mouse && (a(document).bind("mousemove.qtip", function (a) { - h = {pageX: a.pageX, pageY: a.pageY, type: "mousemove"} - }), u = b), y.reposition(f, arguments[2]), (r.solo = !!i.solo) && a(m, i.solo).not(D).qtip("hide", r)) : (clearTimeout(y.timers.show), delete G.origin, u && !a(m + '[tracking="true"]:visible', i.solo).not(D).length && (a(document).unbind("mousemove.qtip"), u = c), y.blur(f)), i.effect === c || o === c ? (D[g](), t.call(D)) : a.isFunction(i.effect) ? (D.stop(1, 1), i.effect.call(D, y), D.queue("fx", function (a) { - t(), a() - })) : D.fadeTo(90, e ? 1 : 0, t), e && i.target.trigger("qtip-" + v + "-inactive"), y) - }, show: function (a) { - return y.toggle(b, a) - }, hide: function (a) { - return y.toggle(c, a) - }, focus: function (b) { - if (!y.rendered) - return y; - var c = a(m), d = parseInt(D[0].style.zIndex, 10), e = f.zindex + c.length, g = a.extend({}, b), h, i; - return D.hasClass(o) || (i = a.Event("tooltipfocus"), i.originalEvent = g, D.trigger(i, [y, e]), i.isDefaultPrevented() || (d !== e && (c.each(function () { - this.style.zIndex > d && (this.style.zIndex = this.style.zIndex - 1) - }), c.filter("." + o).qtip("blur", g)), D.addClass(o)[0].style.zIndex = e)), y - }, blur: function (b) { - var c = a.extend({}, b), d; - return D.removeClass(o), d = a.Event("tooltipblur"), d.originalEvent = c, D.trigger(d, [y]), y - }, reposition: function (b, d) { - if (!y.rendered || B) - return y; - B = 1; - var e = s.position.target, f = s.position, i = f.my, k = f.at, l = f.adjust, m = l.method.split(" "), n = D.outerWidth(), o = D.outerHeight(), p = 0, q = 0, r = a.Event("tooltipmove"), t = D.css("position") === "fixed", u = f.viewport, v = {left: 0, top: 0}, w = f.container, x = c, A = y.plugins.tip, C = D[0].offsetWidth > 0, E = {horizontal: m[0], vertical: m[1] = m[1] || m[0], enabled: u.jquery && e[0] !== window && e[0] !== z && l.method !== "none", left: function (a) { - var b = E.horizontal === "shift", c = l.x * (E.horizontal.substr(-6) === "invert" ? 2 : 0), d = -w.offset.left + u.offset.left + u.scrollLeft, e = i.x === "left" ? n : i.x === "right" ? -n : -n / 2, f = k.x === "left" ? p : k.x === "right" ? -p : -p / 2, g = A && A.size ? A.size.width || 0 : 0, h = A && A.corner && A.corner.precedance === "x" && !b ? g : 0, j = d - a + h, m = a + n - u.width - d + h, o = e - (i.precedance === "x" || i.x === i.y ? f : 0) - (k.x === "center" ? p / 2 : 0), q = i.x === "center"; - return b ? (h = A && A.corner && A.corner.precedance === "y" ? g : 0, o = (i.x === "left" ? 1 : -1) * e - h, v.left += j > 0 ? j : m > 0 ? -m : 0, v.left = Math.max(-w.offset.left + u.offset.left + (h && A.corner.x === "center" ? A.offset : 0), a - o, Math.min(Math.max(-w.offset.left + u.offset.left + u.width, a + o), v.left))) : (j > 0 && (i.x !== "left" || m > 0) ? v.left -= o + c : m > 0 && (i.x !== "right" || j > 0) && (v.left -= (q ? -o : o) + c), v.left < d && -v.left > m && (v.left = a)), v.left - a - }, top: function (a) { - var b = E.vertical === "shift", c = l.y * (E.vertical.substr(-6) === "invert" ? 2 : 0), d = -w.offset.top + u.offset.top + u.scrollTop, e = i.y === "top" ? o : i.y === "bottom" ? -o : -o / 2, f = k.y === "top" ? q : k.y === "bottom" ? -q : -q / 2, g = A && A.size ? A.size.height || 0 : 0, h = A && A.corner && A.corner.precedance === "y" && !b ? g : 0, j = d - a + h, m = a + o - u.height - d + h, n = e - (i.precedance === "y" || i.x === i.y ? f : 0) - (k.y === "center" ? q / 2 : 0), p = i.y === "center"; - return b ? (h = A && A.corner && A.corner.precedance === "x" ? g : 0, n = (i.y === "top" ? 1 : -1) * e - h, v.top += j > 0 ? j : m > 0 ? -m : 0, v.top = Math.max(-w.offset.top + u.offset.top + (h && A.corner.x === "center" ? A.offset : 0), a - n, Math.min(Math.max(-w.offset.top + u.offset.top + u.height, a + n), v.top))) : (j > 0 && (i.y !== "top" || m > 0) ? v.top -= n + c : m > 0 && (i.y !== "bottom" || j > 0) && (v.top -= (p ? -n : n) + c), v.top < 0 && -v.top > m && (v.top = a)), v.top - a - }}, H; - if (a.isArray(e) && e.length === 2) - k = {x: "left", y: "top"}, v = {left: e[0], top: e[1]}; - else if (e === "mouse" && (b && b.pageX || G.event.pageX)) - k = {x: "left", y: "top"}, b = (!b || b.type !== "resize" && b.type !== "scroll" ? b && b.pageX && b.type === "mousemove" ? b : h && h.pageX && (l.mouse || !b || !b.pageX) ? {pageX: h.pageX, pageY: h.pageY} : !l.mouse && G.origin && G.origin.pageX && s.show.distance ? G.origin : b : G.event) || b || G.event || h || {}, v = {top: b.pageY, left: b.pageX}; - else { - e === "event" ? b && b.target && b.type !== "scroll" && b.type !== "resize" ? e = G.target = a(b.target) : e = G.target : e = G.target = a(e.jquery ? e : F.target), e = a(e).eq(0); - if (e.length === 0) - return y; - e[0] === document || e[0] === window ? (p = g.iOS ? window.innerWidth : e.width(), q = g.iOS ? window.innerHeight : e.height(), e[0] === window && (v = {top: (u || e).scrollTop(), left: (u || e).scrollLeft()})) : e.is("area") && g.imagemap ? v = g.imagemap(e, k, E.enabled ? m : c) : e[0].namespaceURI === "http://www.w3.org/2000/svg" && g.svg ? v = g.svg(e, k) : (p = e.outerWidth(), q = e.outerHeight(), v = g.offset(e, w)), v.offset && (p = v.width, q = v.height, x = v.flipoffset, v = v.offset); - if (g.iOS < 4.1 && g.iOS > 3.1 || g.iOS == 4.3 || !g.iOS && t) - H = a(window), v.left -= H.scrollLeft(), v.top -= H.scrollTop(); - v.left += k.x === "right" ? p : k.x === "center" ? p / 2 : 0, v.top += k.y === "bottom" ? q : k.y === "center" ? q / 2 : 0 - } - return v.left += l.x + (i.x === "right" ? -n : i.x === "center" ? -n / 2 : 0), v.top += l.y + (i.y === "bottom" ? -o : i.y === "center" ? -o / 2 : 0), E.enabled ? (u = {elem: u, height: u[(u[0] === window ? "h" : "outerH") + "eight"](), width: u[(u[0] === window ? "w" : "outerW") + "idth"](), scrollLeft: t ? 0 : u.scrollLeft(), scrollTop: t ? 0 : u.scrollTop(), offset: u.offset() || {left: 0, top: 0}}, w = {elem: w, scrollLeft: w.scrollLeft(), scrollTop: w.scrollTop(), offset: w.offset() || {left: 0, top: 0}}, v.adjusted = {left: E.horizontal !== "none" ? E.left(v.left) : 0, top: E.vertical !== "none" ? E.top(v.top) : 0}, v.adjusted.left + v.adjusted.top && D.attr("class", D[0].className.replace(/ui-tooltip-pos-\w+/i, j + "-pos-" + i.abbrev())), x && v.adjusted.left && (v.left += x.left), x && v.adjusted.top && (v.top += x.top)) : v.adjusted = {left: 0, top: 0}, r.originalEvent = a.extend({}, b), D.trigger(r, [y, v, u.elem || u]), r.isDefaultPrevented() ? y : (delete v.adjusted, d === c || !C || isNaN(v.left) || isNaN(v.top) || e === "mouse" || !a.isFunction(f.effect) ? D.css(v) : a.isFunction(f.effect) && (f.effect.call(D, y, a.extend({}, v)), D.queue(function (b) { - a(this).css({opacity: "", height: ""}), a.browser.msie && this.style.removeAttribute("filter"), b() - })), B = 0, y) - }, redraw: function () { - if (y.rendered < 1 || C) - return y; - var a = s.position.container, b, c, d, e; - return C = 1, s.style.height && D.css("height", s.style.height), s.style.width ? D.css("width", s.style.width) : (D.css("width", "").addClass(q), c = D.width() + 1, d = D.css("max-width") || "", e = D.css("min-width") || "", b = (d + e).indexOf("%") > -1 ? a.width() / 100 : 0, d = (d.indexOf("%") > -1 ? b : 1) * parseInt(d, 10) || c, e = (e.indexOf("%") > -1 ? b : 1) * parseInt(e, 10) || 0, c = d + e ? Math.min(Math.max(c, e), d) : c, D.css("width", Math.round(c)).removeClass(q)), C = 0, y - }, disable: function (b) { - return"boolean" != typeof b && (b = !D.hasClass(l) && !G.disabled), y.rendered ? (D.toggleClass(l, b), a.attr(D[0], "aria-disabled", b)) : G.disabled = !!b, y - }, enable: function () { - return y.disable(c) - }, destroy: function () { - var c = r[0], d = a.attr(c, t), e = r.data("qtip"); - y.destroyed = b, y.rendered && (D.stop(1, 0).remove(), a.each(y.plugins, function () { - this.destroy && this.destroy() - })), clearTimeout(y.timers.show), clearTimeout(y.timers.hide), Q(); - if (!e || y === e) - a.removeData(c, "qtip"), s.suppress && d && (a.attr(c, "title", d), r.removeAttr(t)), r.removeAttr("aria-describedby"); - return r.unbind(".qtip-" + v), delete i[y.id], r - }}) - } - function y(e, h) { - var i, j, k, l, m, n = a(this), o = a(document.body), p = this === document ? o : n, q = n.metadata ? n.metadata(h.metadata) : d, r = h.metadata.type === "html5" && q ? q[h.metadata.name] : d, s = n.data(h.metadata.name || "qtipopts"); - try { - s = typeof s == "string" ? (new Function("return " + s))() : s - } catch (u) { - v("Unable to parse HTML5 attribute data: " + s) - } - l = a.extend(b, {}, f.defaults, h, typeof s == "object" ? w(s) : d, w(r || q)), j = l.position, l.id = e; - if ("boolean" == typeof l.content.text) { - k = n.attr(l.content.attr); - if (l.content.attr === c || !k) - return v("Unable to locate content for tooltip! Aborting render of tooltip on element: ", n), c; - l.content.text = k - } - j.container.length || (j.container = o), j.target === c && (j.target = p), l.show.target === c && (l.show.target = p), l.show.solo === b && (l.show.solo = j.container.closest("body")), l.hide.target === c && (l.hide.target = p), l.position.viewport === b && (l.position.viewport = j.container), j.container = j.container.eq(0), j.at = new g.Corner(j.at), j.my = new g.Corner(j.my); - if (a.data(this, "qtip")) - if (l.overwrite) - n.qtip("destroy"); - else if (l.overwrite === c) - return c; - return l.suppress && (m = a.attr(this, "title")) && a(this).removeAttr("title").attr(t, m), i = new x(n, l, e, !!k), a.data(this, "qtip", i), n.bind("remove.qtip-" + e + " removeqtip.qtip-" + e, function () { - i.destroy() - }), i - } - function z(d) { - var e = this, g = d.elements.tooltip, h = d.options.content.ajax, i = f.defaults.content.ajax, j = ".qtip-ajax", k = /)<[^<]*)*<\/script>/gi, l = b, m = c, n; - d.checks.ajax = {"^content.ajax": function (a, b, c) { - b === "ajax" && (h = c), b === "once" ? e.init() : h && h.url ? e.load() : g.unbind(j) - }}, a.extend(e, {init: function () { - return h && h.url && g.unbind(j)[h.once ? "one" : "bind"]("tooltipshow" + j, e.load), e - }, load: function (f) { - function r() { - var e; - if (d.destroyed) - return; - l = c, p && (m = b, d.show(f.originalEvent)), (e = i.complete || h.complete) && a.isFunction(e) && e.apply(h.context || d, arguments) - } - function s(b, c, e) { - var f; - if (d.destroyed) - return; - o && (b = a("
").append(b.replace(k, "")).find(o)), (f = i.success || h.success) && a.isFunction(f) ? f.call(h.context || d, b, c, e) : d.set("content.text", b) - } - function t(a, b, c) { - if (d.destroyed || a.status === 0) - return; - d.set("content.text", b + ": " + c) - } - if (m) { - m = c; - return - } - var g = h.url.indexOf(" "), j = h.url, o, p = !h.loading && l; - if (p) - try { - f.preventDefault() - } catch (q) { - } - else if (f && f.isDefaultPrevented()) - return e; - n && n.abort && n.abort(), g > -1 && (o = j.substr(g), j = j.substr(0, g)), n = a.ajax(a.extend({error: i.error || t, context: d}, h, {url: j, success: s, complete: r})) - }, destroy: function () { - n && n.abort && n.abort(), d.destroyed = b - }}), e.init() - } - function A(b) { - var c = this, d = b.elements, e = d.tooltip, f = ".bgiframe-" + b.id; - a.extend(c, {init: function () { - d.bgiframe = a(''), d.bgiframe.appendTo(e), e.bind("tooltipmove" + f, c.adjust) - }, adjust: function () { - var a = b.get("dimensions"), c = b.plugins.tip, f = d.tip, g, h; - h = parseInt(e.css("border-left-width"), 10) || 0, h = {left: -h, top: -h}, c && f && (g = c.corner.precedance === "x" ? ["width", "left"] : ["height", "top"], h[g[1]] -= f[g[0]]()), d.bgiframe.css(h).css(a) - }, destroy: function () { - d.bgiframe.remove(), e.unbind(f) - }}), c.init() - } - function B(d) { - var e = this, f = d.options.show.modal, h = d.elements, i = h.tooltip, j = "#qtip-overlay", k = ".qtipmodal", l = k + d.id, n = "is-modal-qtip", p = a(document.body), q; - d.checks.modal = {"^show.modal.(on|blur)$": function () { - e.init(), h.overlay.toggle(i.is(":visible")) - }}, a.extend(e, {init: function () { - return f.on ? (q = e.create(), i.attr(n, b).css("z-index", g.modal.zindex + a(m + "[" + n + "]").length).unbind(k).unbind(l).bind("tooltipshow" + k + " tooltiphide" + k, function (b, c, d) { - var f = b.originalEvent; - if (b.target === i[0]) - if (f && b.type === "tooltiphide" && /mouse(leave|enter)/.test(f.type) && a(f.relatedTarget).closest(q[0]).length) - try { - b.preventDefault() - } catch (g) { - } - else - (!f || f && !f.solo) && e[b.type.replace("tooltip", "")](b, d) - }).bind("tooltipfocus" + k, function (b) { - if (b.isDefaultPrevented() || b.target !== i[0]) - return; - var c = a(m).filter("[" + n + "]"), d = g.modal.zindex + c.length, e = parseInt(i[0].style.zIndex, 10); - q[0].style.zIndex = d - 1, c.each(function () { - this.style.zIndex > e && (this.style.zIndex -= 1) - }), c.end().filter("." + o).qtip("blur", b.originalEvent), i.addClass(o)[0].style.zIndex = d; - try { - b.preventDefault() - } catch (f) { - } - }).bind("tooltiphide" + k, function (b) { - b.target === i[0] && a("[" + n + "]").filter(":visible").not(i).last().qtip("focus", b) - }), f.escape && a(window).unbind(l).bind("keydown" + l, function (a) { - a.keyCode === 27 && i.hasClass(o) && d.hide(a) - }), f.blur && h.overlay.unbind(l).bind("click" + l, function (a) { - i.hasClass(o) && d.hide(a) - }), e) : e - }, create: function () { - function d() { - q.css({height: a(window).height(), width: a(window).width()}) - } - var b = a(j); - return b.length ? h.overlay = b.insertAfter(a(m).last()) : (q = h.overlay = a("
", {id: j.substr(1), html: "
", mousedown: function () { - return c - }}).insertAfter(a(m).last()), a(window).unbind(k).bind("resize" + k, d), d(), q) - }, toggle: function (d, g, h) { - if (d && d.isDefaultPrevented()) - return e; - var j = f.effect, k = g ? "show" : "hide", o = q.is(":visible"), r = a("[" + n + "]").filter(":visible").not(i), s; - return q || (q = e.create()), q.is(":animated") && o === g || !g && r.length ? e : (g ? (q.css({left: 0, top: 0}), q.toggleClass("blurs", f.blur), p.bind("focusin" + l, function (b) { - var d = a(b.target), e = d.closest(".qtip"), f = e.length < 1 ? c : parseInt(e[0].style.zIndex, 10) > parseInt(i[0].style.zIndex, 10); - !f && a(b.target).closest(m)[0] !== i[0] && i.find("input:visible").filter(":first").focus() - })) : p.undelegate("*", "focusin" + l), q.stop(b, c), a.isFunction(j) ? j.call(q, g) : j === c ? q[k]() : q.fadeTo(parseInt(h, 10) || 90, g ? 1 : 0, function () { - g || a(this).hide() - }), g || q.queue(function (a) { - q.css({left: "", top: ""}), a() - }), e) - }, show: function (a, c) { - return e.toggle(a, b, c) - }, hide: function (a, b) { - return e.toggle(a, c, b) - }, destroy: function () { - var b = q; - return b && (b = a("[" + n + "]").not(i).length < 1, b ? (h.overlay.remove(), a(window).unbind(k)) : h.overlay.unbind(k + d.id), p.undelegate("*", "focusin" + l)), i.removeAttr(n).unbind(k) - }}), e.init() - } - function C(a, b, c) { - var d = Math.ceil(b / 2), e = Math.ceil(c / 2), f = {bottomright: [[0, 0], [b, c], [b, 0]], bottomleft: [[0, 0], [b, 0], [0, c]], topright: [[0, c], [b, 0], [b, c]], topleft: [[0, 0], [0, c], [b, c]], topcenter: [[0, c], [d, 0], [b, c]], bottomcenter: [[0, 0], [b, 0], [d, c]], rightcenter: [[0, 0], [b, e], [0, c]], leftcenter: [[b, 0], [b, c], [0, e]]}; - return f.lefttop = f.bottomright, f.righttop = f.bottomleft, f.leftbottom = f.topright, f.rightbottom = f.topleft, f[a.string()] - } - function D(f, h) { - function t() { - var a = n.width; - n.width = n.height, n.height = a - } - function u() { - n.width = j.width, n.height = j.height - } - function v(a, d, g, h) { - if (!k.tip) - return; - var l = i.corner.clone(), n = g.adjusted, o = f.options.position.adjust.method.split(" "), p = o[0], q = o[1] || o[0], r = {left: c, top: c, x: 0, y: 0}, s, t = {}, u; - i.corner.fixed !== b && (p === "shift" && l.precedance === "x" && n.left && l.y !== "center" ? l.precedance = l.precedance === "x" ? "y" : "x" : p !== "shift" && n.left && (l.x = l.x === "center" ? n.left > 0 ? "left" : "right" : l.x === "left" ? "right" : "left"), q === "shift" && l.precedance === "y" && n.top && l.x !== "center" ? l.precedance = l.precedance === "y" ? "x" : "y" : q !== "shift" && n.top && (l.y = l.y === "center" ? n.top > 0 ? "top" : "bottom" : l.y === "top" ? "bottom" : "top"), l.string() !== m.corner.string() && (m.top !== n.top || m.left !== n.left) && i.update(l, c)), s = i.position(l, n), s.right !== e && (s.left = -s.right), s.bottom !== e && (s.top = -s.bottom), s.user = Math.max(0, j.offset); - if (r.left = p === "shift" && !!n.left) - l.x === "center" ? t["margin-left"] = r.x = s["margin-left"] - n.left : (u = s.right !== e ? [n.left, -s.left] : [-n.left, s.left], (r.x = Math.max(u[0], u[1])) > u[0] && (g.left -= n.left, r.left = c), t[s.right !== e ? "right" : "left"] = r.x); - if (r.top = q === "shift" && !!n.top) - l.y === "center" ? t["margin-top"] = r.y = s["margin-top"] - n.top : (u = s.bottom !== e ? [n.top, -s.top] : [-n.top, s.top], (r.y = Math.max(u[0], u[1])) > u[0] && (g.top -= n.top, r.top = c), t[s.bottom !== e ? "bottom" : "top"] = r.y); - k.tip.css(t).toggle(!(r.x && r.y || l.x === "center" && r.y || l.y === "center" && r.x)), g.left -= s.left.charAt ? s.user : p !== "shift" || r.top || !r.left && !r.top ? s.left : 0, g.top -= s.top.charAt ? s.user : q !== "shift" || r.left || !r.left && !r.top ? s.top : 0, m.left = n.left, m.top = n.top, m.corner = l.clone() - } - function w(a, b, c) { - b = b ? b : a[a.precedance]; - var d = l.hasClass(q), e = k.titlebar && a.y === "top", f = e ? k.titlebar : k.content, g = "border-" + b + "-width", h; - return l.addClass(q), h = parseInt(f.css(g), 10), h = (c ? h || parseInt(l.css(g), 10) : h) || 0, l.toggleClass(q, d), h - } - function x(b) { - var c = k.titlebar && b.y === "top", d = c ? k.titlebar : k.content, e = a.browser.mozilla, f = e ? "-moz-" : a.browser.webkit ? "-webkit-" : "", g = b.y + (e ? "" : "-") + b.x, h = f + (e ? "border-radius-" + g : "border-" + g + "-radius"); - return parseInt(d.css(h), 10) || parseInt(l.css(h), 10) || 0 - } - function y(a) { - var b = a.precedance === "y", c = n[b ? "width" : "height"], d = n[b ? "height" : "width"], e = a.string().indexOf("center") > -1, f = c * (e ? .5 : 1), g = Math.pow, h = Math.round, i, j, k, l = Math.sqrt(g(f, 2) + g(d, 2)), m = [p / f * l, p / d * l]; - return m[2] = Math.sqrt(g(m[0], 2) - g(p, 2)), m[3] = Math.sqrt(g(m[1], 2) - g(p, 2)), i = l + m[2] + m[3] + (e ? 0 : m[0]), j = i / l, k = [h(j * d), h(j * c)], {height: k[b ? 0 : 1], width: k[b ? 1 : 0]} - } - var i = this, j = f.options.style.tip, k = f.elements, l = k.tooltip, m = {top: 0, left: 0}, n = {width: j.width, height: j.height}, o = {}, p = j.border || 0, r = ".qtip-tip", s = !!(a("")[0] || {}).getContext; - i.corner = d, i.mimic = d, i.border = p, i.offset = j.offset, i.size = n, f.checks.tip = {"^position.my|style.tip.(corner|mimic|border)$": function () { - i.init() || i.destroy(), f.reposition() - }, "^style.tip.(height|width)$": function () { - n = {width: j.width, height: j.height}, i.create(), i.update(), f.reposition() - }, "^content.title.text|style.(classes|widget)$": function () { - k.tip && k.tip.length && i.update() - }}, a.extend(i, {init: function () { - var b = i.detectCorner() && (s || a.browser.msie); - return b && (i.create(), i.update(), l.unbind(r).bind("tooltipmove" + r, v)), b - }, detectCorner: function () { - var a = j.corner, d = f.options.position, e = d.at, h = d.my.string ? d.my.string() : d.my; - return a === c || h === c && e === c ? c : (a === b ? i.corner = new g.Corner(h) : a.string || (i.corner = new g.Corner(a), i.corner.fixed = b), m.corner = new g.Corner(i.corner.string()), i.corner.string() !== "centercenter") - }, detectColours: function (b) { - var c, d, e, g = k.tip.css("cssText", ""), h = b || i.corner, m = h[h.precedance], p = "border-" + m + "-color", r = "border" + m.charAt(0) + m.substr(1) + "Color", s = /rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i, t = "background-color", u = "transparent", v = " !important", w = a(document.body).css("color"), x = f.elements.content.css("color"), y = k.titlebar && (h.y === "top" || h.y === "center" && g.position().top + n.height / 2 + j.offset < k.titlebar.outerHeight(1)), z = y ? k.titlebar : k.content; - l.addClass(q), o.fill = d = g.css(t), o.border = e = g[0].style[r] || g.css(p) || l.css(p); - if (!d || s.test(d)) - o.fill = z.css(t) || u, s.test(o.fill) && (o.fill = l.css(t) || d); - if (!e || s.test(e) || e === w) - o.border = z.css(p) || u, s.test(o.border) && (o.border = e); - a("*", g).add(g).css("cssText", t + ":" + u + v + ";border:0" + v + ";"), l.removeClass(q) - }, create: function () { - var b = n.width, c = n.height, d; - k.tip && k.tip.remove(), k.tip = a("
", {"class": "ui-tooltip-tip"}).css({width: b, height: c}).prependTo(l), s ? a("").appendTo(k.tip)[0].getContext("2d").save() : (d = '', k.tip.html(d + d), a("*", k.tip).bind("click mousedown", function (a) { - a.stopPropagation() - })) - }, update: function (e, f) { - var h = k.tip, l = h.children(), q = n.width, r = n.height, v = "px solid ", x = "px dashed transparent", z = j.mimic, A = Math.round, B, D, E, F, G; - e || (e = m.corner || i.corner), z === c ? z = e : (z = new g.Corner(z), z.precedance = e.precedance, z.x === "inherit" ? z.x = e.x : z.y === "inherit" ? z.y = e.y : z.x === z.y && (z[e.precedance] = e[e.precedance])), B = z.precedance, e.precedance === "x" ? t() : u(), k.tip.css({width: q = n.width, height: r = n.height}), i.detectColours(e), o.border !== "transparent" && o.border !== "#123456" ? (p = w(e, d, b), j.border === 0 && p > 0 && (o.fill = o.border), i.border = p = j.border !== b ? j.border : p) : i.border = p = 0, E = C(z, q, r), i.size = G = y(e), h.css(G), e.precedance === "y" ? F = [A(z.x === "left" ? p : z.x === "right" ? G.width - q - p : (G.width - q) / 2), A(z.y === "top" ? G.height - r : 0)] : F = [A(z.x === "left" ? G.width - q : 0), A(z.y === "top" ? p : z.y === "bottom" ? G.height - r - p : (G.height - r) / 2)], s ? (l.attr(G), D = l[0].getContext("2d"), D.restore(), D.save(), D.clearRect(0, 0, 3e3, 3e3), D.translate(F[0], F[1]), D.beginPath(), D.moveTo(E[0][0], E[0][1]), D.lineTo(E[1][0], E[1][1]), D.lineTo(E[2][0], E[2][1]), D.closePath(), D.fillStyle = o.fill, D.strokeStyle = o.border, D.lineWidth = p * 2, D.lineJoin = "miter", D.miterLimit = 100, p && D.stroke(), D.fill()) : (E = "m" + E[0][0] + "," + E[0][1] + " l" + E[1][0] + "," + E[1][1] + " " + E[2][0] + "," + E[2][1] + " xe", F[2] = p && /^(r|b)/i.test(e.string()) ? parseFloat(a.browser.version, 10) === 8 ? 2 : 1 : 0, l.css({antialias: "" + (z.string().indexOf("center") > -1), left: F[0] - F[2] * Number(B === "x"), top: F[1] - F[2] * Number(B === "y"), width: q + p, height: r + p}).each(function (b) { - var c = a(this); - c[c.prop ? "prop" : "attr"]({coordsize: q + p + " " + (r + p), path: E, fillcolor: o.fill, filled: !!b, stroked: !b}).css({display: p || b ? "block" : "none"}), !b && c.html() === "" && c.html('') - })), f !== c && i.position(e) - }, position: function (d) { - var e = k.tip, f = {}, g = Math.max(0, j.offset), h, l, m; - return j.corner === c || !e ? c : (d = d || i.corner, h = d.precedance, l = y(d), m = [d.x, d.y], h === "x" && m.reverse(), a.each(m, function (a, c) { - var e, i; - c === "center" ? (e = h === "y" ? "left" : "top", f[e] = "50%", f["margin-" + e] = -Math.round(l[h === "y" ? "width" : "height"] / 2) + g) : (e = w(d, c, b), i = x(d), f[c] = a ? p ? w(d, c) : 0 : g + (i > e ? i : 0)) - }), f[d[h]] -= l[h === "x" ? "width" : "height"], e.css({top: "", bottom: "", left: "", right: "", margin: ""}).css(f), f) - }, destroy: function () { - k.tip && k.tip.remove(), k.tip = !1, l.unbind(r) - }}), i.init() - } - var b = !0, c = !1, d = null, e, f, g, h, i = {}, j = "ui-tooltip", k = "ui-widget", l = "ui-state-disabled", m = "div.qtip." + j, n = j + "-default", o = j + "-focus", p = j + "-hover", q = j + "-fluid", r = "-31000px", s = "_replacedByqTip", t = "oldtitle", u; - f = a.fn.qtip = function (g, h, i) { - var j = ("" + g).toLowerCase(), k = d, l = a.makeArray(arguments).slice(1), m = l[l.length - 1], n = this[0] ? a.data(this[0], "qtip") : d; - if (!arguments.length && n || j === "api") - return n; - if ("string" == typeof g) - return this.each(function () { - var d = a.data(this, "qtip"); - if (!d) - return b; - m && m.timeStamp && (d.cache.event = m); - if (j !== "option" && j !== "options" || !h) - d[j] && d[j].apply(d[j], l); - else { - if (!a.isPlainObject(h) && i === e) - return k = d.get(h), c; - d.set(h, i) - } - }), k !== d ? k : this; - if ("object" == typeof g || !arguments.length) - return n = w(a.extend(b, {}, g)), f.bind.call(this, n, m) - }, f.bind = function (d, j) { - return this.each(function (k) { - function r(b) { - function d() { - p.render(typeof b == "object" || l.show.ready), m.show.add(m.hide).unbind(o) - } - if (p.cache.disabled) - return c; - p.cache.event = a.extend({}, b), p.cache.target = b ? a(b.target) : [e], l.show.delay > 0 ? (clearTimeout(p.timers.show), p.timers.show = setTimeout(d, l.show.delay), n.show !== n.hide && m.hide.bind(n.hide, function () { - clearTimeout(p.timers.show) - })) : d() - } - var l, m, n, o, p, q; - q = a.isArray(d.id) ? d.id[k] : d.id, q = !q || q === c || q.length < 1 || i[q] ? f.nextid++ : i[q] = q, o = ".qtip-" + q + "-create", p = y.call(this, q, d); - if (p === c) - return b; - l = p.options, a.each(g, function () { - this.initialize === "initialize" && this(p) - }), m = {show: l.show.target, hide: l.hide.target}, n = {show: a.trim("" + l.show.event).replace(/ /g, o + " ") + o, hide: a.trim("" + l.hide.event).replace(/ /g, o + " ") + o}, /mouse(over|enter)/i.test(n.show) && !/mouse(out|leave)/i.test(n.hide) && (n.hide += " mouseleave" + o), m.show.bind("mousemove" + o, function (a) { - h = {pageX: a.pageX, pageY: a.pageY, type: "mousemove"}, p.cache.onTarget = b - }), m.show.bind(n.show, r), (l.show.ready || l.prerender) && r(j) - }) - }, g = f.plugins = {Corner: function (a) { - a = ("" + a).replace(/([A-Z])/, " $1").replace(/middle/gi, "center").toLowerCase(), this.x = (a.match(/left|right/i) || a.match(/center/) || ["inherit"])[0].toLowerCase(), this.y = (a.match(/top|bottom|center/i) || ["inherit"])[0].toLowerCase(); - var b = a.charAt(0); - this.precedance = b === "t" || b === "b" ? "y" : "x", this.string = function () { - return this.precedance === "y" ? this.y + this.x : this.x + this.y - }, this.abbrev = function () { - var a = this.x.substr(0, 1), b = this.y.substr(0, 1); - return a === b ? a : a === "c" || a !== "c" && b !== "c" ? b + a : a + b - }, this.clone = function () { - return{x: this.x, y: this.y, precedance: this.precedance, string: this.string, abbrev: this.abbrev, clone: this.clone} - } - }, offset: function (b, c) { - function j(a, b) { - d.left += b * a.scrollLeft(), d.top += b * a.scrollTop() - } - var d = b.offset(), e = b.closest("body")[0], f = c, g, h, i; - if (f) { - do - f.css("position") !== "static" && (h = f.position(), d.left -= h.left + (parseInt(f.css("borderLeftWidth"), 10) || 0) + (parseInt(f.css("marginLeft"), 10) || 0), d.top -= h.top + (parseInt(f.css("borderTopWidth"), 10) || 0) + (parseInt(f.css("marginTop"), 10) || 0), !g && (i = f.css("overflow")) !== "hidden" && i !== "visible" && (g = f)); - while ((f = a(f[0].offsetParent)).length); - g && g[0] !== e && j(g, 1) - } - return d - }, iOS: parseFloat(("" + (/CPU.*OS ([0-9_]{1,3})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0, ""])[1]).replace("undefined", "3_2").replace("_", ".")) || c, fn: {attr: function (b, c) { - if (this.length) { - var d = this[0], e = "title", f = a.data(d, "qtip"); - if (b === e && f && "object" == typeof f && f.options.suppress) - return arguments.length < 2 ? a.attr(d, t) : (f && f.options.content.attr === e && f.cache.attr && f.set("content.text", c), this.attr(t, c)) - } - return a.fn["attr" + s].apply(this, arguments) - }, clone: function (b) { - var c = a([]), d = "title", e = a.fn["clone" + s].apply(this, arguments); - return b || e.filter("[" + t + "]").attr("title", function () { - return a.attr(this, t) - }).removeAttr(t), e - }}}, a.each(g.fn, function (c, d) { - if (!d || a.fn[c + s]) - return b; - var e = a.fn[c + s] = a.fn[c]; - a.fn[c] = function () { - return d.apply(this, arguments) || e.apply(this, arguments) - } - }), a.ui || (a["cleanData" + s] = a.cleanData, a.cleanData = function (b) { - for (var c = 0, d; (d = b[c]) !== e; c++) - try { - a(d).triggerHandler("removeqtip") - } catch (f) { - } - a["cleanData" + s](b) - }), f.version = "2.0.0pre", f.nextid = 0, f.inactiveEvents = "click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "), f.zindex = 15e3, f.defaults = {prerender: c, id: c, overwrite: b, suppress: b, content: {text: b, attr: "title", title: {text: c, button: c}}, position: {my: "top left", at: "bottom right", target: c, container: c, viewport: c, adjust: {x: 0, y: 0, mouse: b, resize: b, method: "flip flip"}, effect: function (b, d, e) { - a(this).animate(d, {duration: 200, queue: c}) - }}, show: {target: c, event: "mouseenter", effect: b, delay: 90, solo: c, ready: c, autofocus: c}, hide: {target: c, event: "mouseleave", effect: b, delay: 0, fixed: c, inactive: c, leave: "window", distance: c}, style: {classes: "", widget: c, width: c, height: c, def: b}, events: {render: d, move: d, show: d, hide: d, toggle: d, visible: d, hidden: d, focus: d, blur: d}}, g.ajax = function (a) { - var b = a.plugins.ajax; - return"object" == typeof b ? b : a.plugins.ajax = new z(a) - }, g.ajax.initialize = "render", g.ajax.sanitize = function (a) { - var b = a.content, c; - b && "ajax"in b && (c = b.ajax, typeof c != "object" && (c = a.content.ajax = {url: c}), "boolean" != typeof c.once && c.once && (c.once = !!c.once)) - }, a.extend(b, f.defaults, {content: {ajax: {loading: b, once: b}}}), g.bgiframe = function (b) { - var d = a.browser, e = b.plugins.bgiframe; - return a("select, object").length < 1 || !d.msie || ("" + d.version).charAt(0) !== "6" ? c : "object" == typeof e ? e : b.plugins.bgiframe = new A(b) - }, g.bgiframe.initialize = "render", g.imagemap = function (b, c, d) { - function n(a, b, c) { - var d = 0, e = 1, f = 1, g = 0, h = 0, i = a.width, j = a.height; - while (i > 0 && j > 0 && e > 0 && f > 0) { - i = Math.floor(i / 2), j = Math.floor(j / 2), c.x === "left" ? e = i : c.x === "right" ? e = a.width - i : e += Math.floor(i / 2), c.y === "top" ? f = j : c.y === "bottom" ? f = a.height - j : f += Math.floor(j / 2), d = b.length; - while (d--) { - if (b.length < 2) - break; - g = b[d][0] - a.offset.left, h = b[d][1] - a.offset.top, (c.x === "left" && g >= e || c.x === "right" && g <= e || c.x === "center" && (g < e || g > a.width - e) || c.y === "top" && h >= f || c.y === "bottom" && h <= f || c.y === "center" && (h < f || h > a.height - f)) && b.splice(d, 1) - } - } - return{left: b[0][0], top: b[0][1]} - } - b.jquery || (b = a(b)); - var e = (b[0].shape || b.attr("shape")).toLowerCase(), f = (b[0].coords || b.attr("coords")).split(","), g = [], h = a('img[usemap="#' + b.parent("map").attr("name") + '"]'), i = h.offset(), j = {width: 0, height: 0, offset: {top: 1e10, right: 0, bottom: 0, left: 1e10}}, k = 0, l = 0, m; - i.left += Math.ceil((h.outerWidth() - h.width()) / 2), i.top += Math.ceil((h.outerHeight() - h.height()) / 2); - if (e === "poly") { - k = f.length; - while (k--) - l = [parseInt(f[--k], 10), parseInt(f[k + 1], 10)], l[0] > j.offset.right && (j.offset.right = l[0]), l[0] < j.offset.left && (j.offset.left = l[0]), l[1] > j.offset.bottom && (j.offset.bottom = l[1]), l[1] < j.offset.top && (j.offset.top = l[1]), g.push(l) - } else - g = a.map(f, function (a) { - return parseInt(a, 10) - }); - switch (e) { - case"rect": - j = {width: Math.abs(g[2] - g[0]), height: Math.abs(g[3] - g[1]), offset: {left: Math.min(g[0], g[2]), top: Math.min(g[1], g[3])}}; - break; - case"circle": - j = {width: g[2] + 2, height: g[2] + 2, offset: {left: g[0], top: g[1]}}; - break; - case"poly": - a.extend(j, {width: Math.abs(j.offset.right - j.offset.left), height: Math.abs(j.offset.bottom - j.offset.top)}), c.string() === "centercenter" ? j.offset = {left: j.offset.left + j.width / 2, top: j.offset.top + j.height / 2} : (j.offset = n(j, g.slice(), c), d && (d[0] === "flip" || d[1] === "flip") && (j.flipoffset = n(j, g.slice(), {x: c.x === "left" ? "right" : c.x === "right" ? "left" : "center", y: c.y === "top" ? "bottom" : c.y === "bottom" ? "top" : "center"}), j.flipoffset.left -= j.offset.left, j.flipoffset.top -= j.offset.top)), j.width = j.height = 0 - } - return j.offset.left += i.left, j.offset.top += i.top, j - }, g.modal = function (a) { - var b = a.plugins.modal; - return"object" == typeof b ? b : a.plugins.modal = new B(a) - }, g.modal.initialize = "render", g.modal.sanitize = function (a) { - a.show && (typeof a.show.modal != "object" ? a.show.modal = {on: !!a.show.modal} : typeof a.show.modal.on == "undefined" && (a.show.modal.on = b)) - }, g.modal.zindex = f.zindex + 1e3, a.extend(b, f.defaults, {show: {modal: {on: c, effect: b, blur: b, escape: b}}}), g.svg = function (b, c) { - var d = a(document), e = b[0], f = {width: 0, height: 0, offset: {top: 1e10, left: 1e10}}, g, h, i, j, k; - if (e.getBBox && e.parentNode) { - g = e.getBBox(), h = e.getScreenCTM(), i = e.farthestViewportElement || e; - if (!i.createSVGPoint) - return f; - j = i.createSVGPoint(), j.x = g.x, j.y = g.y, k = j.matrixTransform(h), f.offset.left = k.x, f.offset.top = k.y, j.x += g.width, j.y += g.height, k = j.matrixTransform(h), f.width = k.x - f.offset.left, f.height = k.y - f.offset.top, f.offset.left += d.scrollLeft(), f.offset.top += d.scrollTop() - } - return f - }, g.tip = function (a) { - var b = a.plugins.tip; - return"object" == typeof b ? b : a.plugins.tip = new D(a) - }, g.tip.initialize = "render", g.tip.sanitize = function (a) { - var c = a.style, d; - c && "tip"in c && (d = a.style.tip, typeof d != "object" && (a.style.tip = {corner: d}), /string|boolean/i.test(typeof d.corner) || (d.corner = b), typeof d.width != "number" && delete d.width, typeof d.height != "number" && delete d.height, typeof d.border != "number" && d.border !== b && delete d.border, typeof d.offset != "number" && delete d.offset) - }, a.extend(b, f.defaults, {style: {tip: {corner: b, mimic: c, width: 6, height: 6, border: b, offset: 0}}}) -}); \ No newline at end of file +/* qTip2 v2.2.1 | Plugins: tips modal viewport svg imagemap ie6 | Styles: core basic css3 | qtip2.com | Licensed MIT | Sat Sep 06 2014 23:12:07 */ + +!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=F,this.elements={target:a},this._id=S+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:E,attr:e,onTooltip:E,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=E}function f(a){return a===F||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?E:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?E:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==E,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,F,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||E)&&(b.title=E))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===D?{ready:D}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(R,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(ab)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(D,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(ab)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(W)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(E,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(ab)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+S+" "))+"."+S,function(){var a=y.api[d.attr(this,U)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):F,p="html5"===f.metadata.type&&o?o[f.metadata.name]:F,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(D,{},y.defaults,f,"object"==typeof q?h(q):F,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===E||!j)return E;k.content.text=j}if(i.container.length||(i.container=m),i.target===E&&(i.target=n),k.show.target===E&&(k.show.target=n),k.show.solo===D&&(k.show.solo=i.container.closest("body")),k.hide.target===E&&(k.hide.target=n),k.position.viewport===D&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new A(i.at,D),i.my=new A(i.my),a.data(S))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===E)return E;return a.attr(T,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(cb,l).attr("title",""),g=new e(a,k,c,!!j),a.data(S,g),g}function s(a){return a.charAt(0).toUpperCase()+a.slice(1)}function t(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+rb.join(f+" ")+f).split(" "),h=0;if(qb[b])return a.css(qb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return qb[b]=d,e}function u(a,b){return Math.ceil(parseFloat(t(a,b)))}function v(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function w(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}function x(a){this._ns="ie6",this.init(this.qtip=a)}var y,z,A,B,C,D=!0,E=!1,F=null,G="x",H="y",I="width",J="height",K="top",L="left",M="bottom",N="right",O="center",P="flipinvert",Q="shift",R={},S="qtip",T="data-hasqtip",U="data-qtip-id",V=["ui-widget","ui-tooltip"],W="."+S,X="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Y=S+"-fixed",Z=S+"-default",$=S+"-focus",_=S+"-hover",ab=S+"-disabled",bb="_replacedByqTip",cb="oldtitle",db={ie:function(){for(var a=4,c=b.createElement("div");(c.innerHTML="")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||E};z=e.prototype,z._when=function(a){return d.when.apply(d,a)},z.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),f.posClass=this._createPosClass((this.position={my:k.my,at:k.at}).my),this.tooltip=g.tooltip=b=d("
",{id:this._id,"class":[S,Z,e.style.classes,f.posClass].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":E,"aria-describedby":this._id+"-content","aria-hidden":D}).toggleClass(ab,this.disabled).attr(U,this.id).data(S,this).appendTo(k.container).append(g.content=d("
",{"class":S+"-content",id:this._id+"-content","aria-atomic":D})),this.rendered=-1,this.positioning=D,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,E))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,E)),this.rendered=D,this._setWidget(),d.each(R,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=E,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(D,f.event,E),c.hiddenDuringWait=E}),y.api[this.id]=this,this},z.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=D;var a,b=this.target,c=b.attr(cb);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)clearTimeout(this.timers[a]);b.removeData(S).removeAttr(U).removeAttr(T).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(cb),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=F,delete y.api[this.id]}}return this.destroyed?this.target:(a===D&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},B=z.checks={builtin:{"^id$":function(a,b,c,e){var f=c===D?y.nextid:c,g=S+"-"+f;f!==E&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new A(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(D)||this.toggle(D))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Z,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},z.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var eb=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,fb=/^prerender|show\.ready/i;z.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=E,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&fb.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=eb.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=D,d.each(a,d.proxy(j,this)),this.positioning=E,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?F:this.cache.event),this},z._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=D,a.then(function(a){return e.waiting=E,c._update(a,b)},F,function(a){return c._update(a,b)})):a===E||!a&&""!==a?E:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):E},z._waitForContent=function(a){var b=this.cache;return b.waiting=D,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=E}).promise()},z._updateContent=function(a,b){this._update(a,this.elements.content,b)},z._updateTitle=function(a,b){this._update(a,this.elements.title,b)===E&&this._removeTitle(E)},z._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("
",{"class":S+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("
",{id:b,"class":S+"-title","aria-atomic":D})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},z._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=F,a!==E&&this.reposition())},z._createPosClass=function(a){return S+"-pos-"+(a||this.options.position.my).abbrev()},z.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=D;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(E),u=k.outerHeight(E),v=0,w=0,x=k.css("position"),y={left:0,top:0},z=k[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=q[0].ownerDocument,F=this.mouse;if(d.isArray(m)&&2===m.length)o={x:L,y:K},y={left:m[0],top:m[1]};else if("mouse"===m)o={x:L,y:K},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:F&&F.pageX&&(c=F),"static"!==x&&(y=q.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),y={left:c.pageX-y.left+(g&&g.left||0),top:c.pageY-y.top+(g&&g.top||0)},r.mouse&&A&&F&&(y.left-=(F.scrollX||0)-B.scrollLeft(),y.top-=(F.scrollY||0)-B.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=db.iOS?a.innerWidth:m.width(),w=db.iOS?a.innerHeight:m.height(),m[0]===a&&(y={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):R.imagemap&&m.is("area")?f=R.imagemap(this,m,o,R.viewport?s:E):R.svg&&m&&m[0].ownerSVGElement?f=R.svg(this,m,o,R.viewport?s:E):(v=m.outerWidth(E),w=m.outerHeight(E),y=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,y=f.position),y=this.reposition.offset(m,y,q),(db.iOS>3.1&&db.iOS<4.1||db.iOS>=4.3&&db.iOS<4.33||!db.iOS&&"fixed"===x)&&(y.left-=B.scrollLeft(),y.top-=B.scrollTop()),(!f||f&&f.adjustable!==E)&&(y.left+=o.x===N?v:o.x===O?v/2:0,y.top+=o.y===M?w:o.y===O?w/2:0)}return y.left+=r.x+(n.x===N?-t:n.x===O?-t/2:0),y.top+=r.y+(n.y===M?-u:n.y===O?-u/2:0),R.viewport?(h=y.adjusted=R.viewport(this,y,l,v,w,t,u),g&&h.left&&(y.left+=g.left),g&&h.top&&(y.top+=g.top),h.my&&(this.position.my=h.my)):y.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&k.removeClass(j.posClass).addClass(j.posClass=i),this._trigger("move",[y,p.elem||p],c)?(delete y.adjusted,e===E||!z||isNaN(y.left)||isNaN(y.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(y):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},y)),k.queue(function(a){d(this).css({opacity:"",height:""}),db.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=E,this):this},z.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!db.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var gb=(A=z.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,O).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?H:G}).prototype;gb.invert=function(a,b){this[a]=this[a]===L?N:this[a]===N?L:b||this[a]},gb.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===H||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},gb.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},gb.clone=function(){return new A(this.string(),this.forceY)},z.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=D),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=(this.options[a?"hide":"show"],this.options.position),n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?F:!!this._trigger(k,[90]),this.destroyed?this:(i!==E&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,E),d.isFunction(n.title)&&this._updateTitle(n.title,E),!C&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+S,this._storeMouse),C=D),o||g.css("width",g.outerWidth(E)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(W,l.solo)).not(g).not(l.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,C&&!d(W+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+S),C=E),this.blur(c)),j=d.proxy(function(){a?(db.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===E||q===E?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},z.show=function(a){return this.toggle(D,a)},z.hide=function(a){return this.toggle(E,a)},z.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(W),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=y.zindex+b.length;return c.hasClass($)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+$).qtip("blur",a)),c.addClass($)[0].style.zIndex=f),this},z.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass($),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},z.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(ab):this.disabled):"boolean"!=typeof a&&(a=D),this.rendered&&this.tooltip.toggleClass(ab,a).attr("aria-disabled",a),this.disabled=!!a,this)},z.enable=function(){return this.disable(E)},z._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("",{"class":"qtip-close "+(this.options.style.widget?"":S+"-icon"),title:g,"aria-label":g}).prepend(d("",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(ab)||a.hide(b),E})},z._updateButton=function(a){if(!this.rendered)return E;var b=this.elements.button;a?this._createButton():b.remove()},z._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(ab);c.removeClass(ab),ab=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(ab,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Z,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(S+"-icon",!a)},z._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},z._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},z._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},z._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||F,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=E,!e.isDefaultPrevented()},z._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},z._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?E:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=D}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):E}),(c.show.ready||c.prerender)&&b.call(this,a)},z._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Y)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(ab)&&this.tooltip[0].offsetWidth>0,e=b.parents(W).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),y.inactiveEvents,o)),this._bindEvents(r,s,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):E}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(ab)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},z._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(W,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Y)&&!c.hasClass(ab)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(_,b)}),q("["+U+"]",X,o)}),y=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=F,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],S):F;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,S);if(!a)return D;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),E;a.set(b,e)}}),g!==F?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(D,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===E||c.length<1||y.api[c]?y.nextid++:c,b=r(d(this),c,k),b===E?D:(y.api[c]=b,d.each(R,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,y.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,cb):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(cb,b))}return d.fn["attr"+bb].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+bb].apply(this,arguments));return a||b.filter("["+cb+"]").attr("title",function(){return d.attr(this,cb)}).removeAttr(cb),b}},function(a,b){if(!b||d.fn[a+bb])return D;var c=d.fn[a+bb]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+bb]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(T))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+bb].apply(this,arguments)}),y.version="2.2.1",y.nextid=0,y.inactiveEvents=X,y.zindex=15e3,y.defaults={prerender:E,id:E,overwrite:D,suppress:D,content:{text:D,attr:"title",title:E,button:E},position:{my:"top left",at:"bottom right",target:E,container:E,viewport:E,adjust:{x:0,y:0,mouse:D,scroll:D,resize:D,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:E})}},show:{target:E,event:"mouseenter",effect:D,delay:90,solo:E,ready:E,autofocus:E},hide:{target:E,event:"mouseleave",effect:D,delay:0,fixed:E,inactive:E,leave:"window",distance:E},style:{classes:"",widget:E,width:E,height:E,def:D},events:{render:F,move:F,show:F,hide:F,toggle:F,visible:F,hidden:F,focus:F,blur:F}};var hb,ib="margin",jb="border",kb="color",lb="background-color",mb="transparent",nb=" !important",ob=!!b.createElement("canvas").getContext,pb=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,qb={},rb=["Webkit","O","Moz","ms"];if(ob)var sb=a.devicePixelRatio||1,tb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),ub=sb/tb;else var vb=function(a,b,c){return"'};d.extend(v.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("
",{"class":S+"-tip"}).prependTo(a.tooltip),ob?(b=d("").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=vb("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===K||a.y===O&&this.element.position().top+this.size[1]/2+this.options.offsetl&&!pb.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==D?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===H?[s(r.x===L?l:r.x===N?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===K?k[1]-q[1]:0)]:[s(r.x===L?k[0]-q[0]:0),s(r.y===K?l:r.y===M?k[1]-q[1]-l:(k[1]-q[1])/2)],ob?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,ub),i=this._calculateTip(r,this.size,ub),o.attr(I,k[0]*ub).attr(J,k[1]*ub),o.css(I,k[0]).css(J,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*ub,j[1]*ub),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===db.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(O)>-1),left:j[0]-j[2]*Number(f===G),top:j[1]-j[2]*Number(f===H),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(vb("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==E&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return E;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===G&&e.reverse(),d.each(e,function(d,e){var h,k,l; +e===O?(h=c===H?L:K,j[h]="50%",j[ib+"-"+h]=-Math.round(b[c===H?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))}),j[a[c]]-=b[c===G?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===Q&&j.precedance===b&&k[d]&&j[c]!==O?j.precedance=j.precedance===G?H:G:a!==Q&&k[d]&&(j[b]=j[b]===O?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===O?p[ib+"-"+b]=o[a]=g[ib+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=E),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:E,top:E,x:0,y:0},p={};this.corner.fixed!==D&&(e(m,G,H,L,N),e(n,H,G,K,M),(j.string()!==i.corner.string()||i.cornerTop!==k.top||i.cornerLeft!==k.left)&&this.update(j,E)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===Q&&!!k.left)&&f(G,L,N),(o.top=n===Q&&!!k.top)&&f(H,K,M),this.element.css(p).toggle(!(o.x&&o.y||j.x===O&&o.y||j.y===O&&o.x)),d.left-=g.left.charAt?g.user:m!==Q||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==Q||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),hb=R.tip=function(a){return new v(a,a.options.style.tip)},hb.initialize="render",hb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=D)}},B.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(D,y.defaults,{style:{tip:{corner:D,mimic:E,width:6,height:6,border:D,offset:0}}});var wb,xb,yb="qtip-modal",zb="."+yb;xb=function(){function a(a){if(d.expr[":"].focusable)return d.expr[":"].focusable;var b,c,e,f=!isNaN(d.attr(a,"tabindex")),g=a.nodeName&&a.nodeName.toLowerCase();return"area"===g?(b=a.parentNode,c=b.name,a.href&&c&&"map"===b.nodeName.toLowerCase()?(e=d("img[usemap=#"+c+"]")[0],!!e&&e.is(":visible")):!1):/input|select|textarea|button|object/.test(g)?!a.disabled:"a"===g?a.href||f:f}function c(a){k.length<1&&a.length?a.not("body").blur():k.first().focus()}function e(a){if(i.is(":visible")){var b,e=d(a.target),h=f.tooltip,j=e.closest(W);b=j.length<1?E:parseInt(j[0].style.zIndex,10)>parseInt(h[0].style.zIndex,10),b||e.closest(W)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("
",{id:"qtip-overlay",html:"
",mousedown:function(){return E}}).hide(),d(b.body).bind("focusin"+zb,e),d(b).bind("keydown"+zb,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+zb,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==E?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(zb).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==E&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==E||!e&&p.length?j:(i.stop(D,E),d.isFunction(m)?m.call(i,e):m===E?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(zb).length||i.detach(),a()}),h=e,f.destroyed&&(f=F),j)}}),j.init()},xb=new xb,d.extend(w.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=xb.elem,b.addClass(yb).css("z-index",y.modal_zindex+d(zb).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(xb.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(zb),f=y.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);xb.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+$).qtip("blur",a.originalEvent),b.addClass($)[0].style.zIndex=f,xb.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),void a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(zb).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this)):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:void xb.toggle(this.qtip,!!b,c)},destroy:function(){this.qtip.tooltip.removeClass(yb),this.qtip._unbind(this.qtip.tooltip,this._ns),xb.toggle(this.qtip,E),delete this.qtip.elements.overlay}}),wb=R.modal=function(a){return new w(a,a.options.show.modal)},wb.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=D))},y.modal_zindex=y.zindex-200,wb.initialize="render",B.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(D,y.defaults,{show:{modal:{on:E,effect:D,blur:D,stealfocus:D,escape:D}}}),R.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],s=u[a],t=v[a],w=c===Q,x=s===f?j:s===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=q[f]+r[f]-(n?0:m[f]),A=z-k,B=k+j-(h===I?o:p)-z,C=x-(u.precedance===a||s===u[b]?y:0)-(t===O?i/2:0);return w?(C=(s===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-m[f]+r[f],k-C,Math.min(Math.max(-m[f]+r[f]+(h===I?o:p),k+C),d[f],"center"===s?k-x:1e9))):(e*=c===P?2:0,A>0&&(s!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(s!==g||A>0)&&(d[f]-=(s===O?-C:C)+e,l.invert(a,g)),d[f]B&&(d[f]=k,l=u.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s=e.target,t=c.elements.tooltip,u=e.my,v=e.at,w=e.adjust,x=w.method.split(" "),y=x[0],z=x[1]||x[0],A=e.viewport,B=e.container,C=(c.cache,{left:0,top:0});return A.jquery&&s[0]!==a&&s[0]!==b.body&&"none"!==w.method?(m=B.offset()||C,n="static"===B.css("position"),k="fixed"===t.css("position"),o=A[0]===a?A.width():A.outerWidth(E),p=A[0]===a?A.height():A.outerHeight(E),q={left:k?0:A.scrollLeft(),top:k?0:A.scrollTop()},r=A.offset()||C,("shift"!==y||"shift"!==z)&&(l=u.clone()),C={left:"none"!==y?j(G,H,y,w.x,L,N,I,f,h):0,top:"none"!==z?j(H,G,z,w.y,K,M,J,g,i):0,my:l}):C},R.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:E},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]f.position.bottom&&(f.position.bottom=c[1]),c[1]0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===L?i=d:b.x===N?i=f.width-d:i+=Math.floor(d/2),b.y===K?j=e:b.y===M?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===L&&k>=i||b.x===N&&i>=k||b.x===O&&(i>k||k>f.width-i)||b.y===K&&l>=j||b.y===M&&j>=l||b.y===O&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=R.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:E}},circle:function(a,b,c,d){return R.polys.ellipse(a,b,c,c,d)}},R.svg=function(a,c,e){for(var f,g,h,i,j,k,l,m,n,o=(d(b),c[0]),p=d(o.ownerSVGElement),q=o.ownerDocument,r=(parseInt(c.css("stroke-width"),10)||0)/2;!o.getBBox;)o=o.parentNode;if(!o.getBBox||!o.parentNode)return E;switch(o.nodeName){case"ellipse":case"circle":m=R.polys.ellipse(o.cx.baseVal.value,o.cy.baseVal.value,(o.rx||o.r).baseVal.value+r,(o.ry||o.r).baseVal.value+r,e);break;case"line":case"polygon":case"polyline":for(l=o.points||[{x:o.x1.baseVal.value,y:o.y1.baseVal.value},{x:o.x2.baseVal.value,y:o.y2.baseVal.value}],m=[],k=-1,i=l.numberOfItems||l.length;++k';d.extend(x.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Bb).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("
",{id:S+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(E),width:c.outerWidth(E)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[I,L]:[J,K],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(J,f.height),f.width?e.css(I,f.width):(e.css(I,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1)*parseInt(c,10)||b,d=(d.indexOf("%")>-1?a:1)*parseInt(d,10)||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(I,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Ab=R.ie6=function(a){return 6===db.ie?new x(a):E},Ab.initialize="render",B.ie6={"^content|style$":function(){this.redraw()}}})}(window,document); +//# sourceMappingURL=jquery.qtip.min.js.map \ No newline at end of file From eb880757b244858e984822abeef265c9e082ca69 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Wed, 10 Dec 2014 10:12:43 -0500 Subject: [PATCH 02/19] NIFI-27: - Latest version of slickgrid. --- .../src/main/webapp/WEB-INF/pages/canvas.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/cluster.jsp | 2 +- .../main/webapp/WEB-INF/pages/counters.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/history.jsp | 2 +- .../main/webapp/WEB-INF/pages/provenance.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/summary.jsp | 2 +- .../main/webapp/WEB-INF/pages/templates.jsp | 2 +- .../src/main/webapp/WEB-INF/pages/users.jsp | 2 +- .../js/jquery/jquery.event.drag-2.0.min.js | 194 - .../js/jquery/jquery.event.drag-2.2.min.js | 6 + .../js/jquery/slickgrid/MIT-LICENSE.txt | 20 + .../jquery/slickgrid/css/images/collapse.gif | Bin 0 -> 846 bytes .../js/jquery/slickgrid/css/images/expand.gif | Bin 0 -> 851 bytes .../slickgrid/css/slick-default-theme.css | 68 +- .../js/jquery/slickgrid/css/slick.grid.css | 173 +- .../slickgrid/plugins/slick.autotooltips.js | 125 +- .../plugins/slick.cellrangedecorator.js | 126 +- .../plugins/slick.cellrangeselector.js | 218 +- .../plugins/slick.cellselectionmodel.js | 240 +- .../plugins/slick.rowselectionmodel.js | 365 +- .../webapp/js/jquery/slickgrid/slick.core.js | 846 +-- .../js/jquery/slickgrid/slick.dataview.js | 1982 +++--- .../js/jquery/slickgrid/slick.editors.js | 1004 +-- .../js/jquery/slickgrid/slick.formatters.js | 86 +- .../webapp/js/jquery/slickgrid/slick.grid.js | 6254 +++++++++-------- 25 files changed, 6262 insertions(+), 5461 deletions(-) delete mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.0.min.js create mode 100644 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.2.min.js create mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/MIT-LICENSE.txt create mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/images/collapse.gif create mode 100755 nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/images/expand.gif diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp index c8f2ff735d..09c8207098 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/canvas.jsp @@ -48,7 +48,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp index e3e7b86bbe..a0bda249dc 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/cluster.jsp @@ -36,7 +36,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp index 21ee50862c..2678bf4235 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/counters.jsp @@ -36,7 +36,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp index 61be72761f..19d9e90230 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/history.jsp @@ -36,7 +36,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp index 2f5191886e..f3c9a881ee 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/provenance.jsp @@ -38,7 +38,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp index b34f0e6db5..e8a8e4c7b0 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/summary.jsp @@ -38,7 +38,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp index c7c0293d63..889485f4b7 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/templates.jsp @@ -37,7 +37,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp index 770dad577b..9ff887b802 100644 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/pages/users.jsp @@ -38,7 +38,7 @@ - + diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.0.min.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.0.min.js deleted file mode 100755 index 146b20aa17..0000000000 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.0.min.js +++ /dev/null @@ -1,194 +0,0 @@ -/*! - * jquery.event.drag - v 2.0.0 - * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com - * Open Source MIT License - http://threedubmedia.com/code/license - */ -; -(function (f) { - f.fn.drag = function (b, a, d) { - var e = typeof b == "string" ? b : "", k = f.isFunction(b) ? b : f.isFunction(a) ? a : null; - if (e.indexOf("drag") !== 0) - e = "drag" + e; - d = (b == k ? a : d) || {}; - return k ? this.bind(e, d, k) : this.trigger(e) - }; - var i = f.event, h = i.special, c = h.drag = {defaults: {which: 1, distance: 0, not: ":input", handle: null, relative: false, drop: true, click: false}, datakey: "dragdata", livekey: "livedrag", add: function (b) { - var a = f.data(this, c.datakey), d = b.data || {}; - a.related += 1; - if (!a.live && b.selector) { - a.live = true; - i.add(this, "draginit." + c.livekey, c.delegate) - } - f.each(c.defaults, function (e) { - if (d[e] !== undefined) - a[e] = d[e] - }) - }, remove: function () { - f.data(this, c.datakey).related -= 1 - }, setup: function () { - if (!f.data(this, c.datakey)) { - var b = f.extend({related: 0}, c.defaults); - f.data(this, c.datakey, b); - i.add(this, "mousedown", c.init, b); - this.attachEvent && this.attachEvent("ondragstart", c.dontstart) - } - }, teardown: function () { - if (!f.data(this, c.datakey).related) { - f.removeData(this, c.datakey); - i.remove(this, "mousedown", c.init); - i.remove(this, "draginit", c.delegate); - c.textselect(true); - this.detachEvent && this.detachEvent("ondragstart", c.dontstart) - } - }, init: function (b) { - var a = b.data, d; - if (!(a.which > 0 && b.which != a.which)) - if (!f(b.target).is(a.not)) - if (!(a.handle && !f(b.target).closest(a.handle, b.currentTarget).length)) { - a.propagates = 1; - a.interactions = [c.interaction(this, a)]; - a.target = b.target; - a.pageX = b.pageX; - a.pageY = b.pageY; - a.dragging = null; - d = c.hijack(b, "draginit", a); - if (a.propagates) { - if ((d = c.flatten(d)) && d.length) { - a.interactions = []; - f.each(d, function () { - a.interactions.push(c.interaction(this, a)) - }) - } - a.propagates = a.interactions.length; - a.drop !== false && h.drop && h.drop.handler(b, a); - c.textselect(false); - i.add(document, "mousemove mouseup", c.handler, a); - return false - } - } - }, interaction: function (b, a) { - return{drag: b, callback: new c.callback, droppable: [], offset: f(b)[a.relative ? "position" : "offset"]() || {top: 0, left: 0}} - }, handler: function (b) { - var a = b.data; - switch (b.type) { - case !a.dragging && "mousemove": - if (Math.pow(b.pageX - a.pageX, 2) + Math.pow(b.pageY - a.pageY, 2) < Math.pow(a.distance, 2)) - break; - b.target = a.target; - c.hijack(b, "dragstart", a); - if (a.propagates) - a.dragging = true; - case "mousemove": - if (a.dragging) { - c.hijack(b, "drag", a); - if (a.propagates) { - a.drop !== false && h.drop && h.drop.handler(b, a); - break - } - b.type = "mouseup" - } - case "mouseup": - i.remove(document, "mousemove mouseup", c.handler); - if (a.dragging) { - a.drop !== false && h.drop && h.drop.handler(b, a); - c.hijack(b, "dragend", a) - } - c.textselect(true); - if (a.click === false && a.dragging) { - jQuery.event.triggered = true; - setTimeout(function () { - jQuery.event.triggered = false - }, 20); - a.dragging = false - } - break - } - }, delegate: function (b) { - var a = [], d, e = f.data(this, "events") || {}; - f.each(e.live || [], function (k, j) { - if (j.preType.indexOf("drag") === 0) - if (d = f(b.target).closest(j.selector, b.currentTarget)[0]) { - i.add(d, j.origType + "." + c.livekey, j.origHandler, j.data); - f.inArray(d, a) < 0 && a.push(d) - } - }); - if (!a.length) - return false; - return f(a).bind("dragend." + c.livekey, function () { - i.remove(this, "." + c.livekey) - }) - }, hijack: function (b, a, d, e, k) { - if (d) { - var j = {event: b.originalEvent, type: b.type}, n = a.indexOf("drop") ? "drag" : "drop", l, o = e || 0, g, m; - e = !isNaN(e) ? e : d.interactions.length; - b.type = a; - b.originalEvent = null; - d.results = []; - do - if (g = d.interactions[o]) - if (!(a !== "dragend" && g.cancelled)) { - m = c.properties(b, d, g); - g.results = []; - f(k || g[n] || d.droppable).each(function (q, p) { - l = (m.target = p) ? i.handle.call(p, b, m) : null; - if (l === false) { - if (n == "drag") { - g.cancelled = true; - d.propagates -= 1 - } - if (a == "drop") - g[n][q] = null - } else if (a == "dropinit") - g.droppable.push(c.element(l) || p); - if (a == "dragstart") - g.proxy = f(c.element(l) || g.drag)[0]; - g.results.push(l); - delete b.result; - if (a !== "dropinit") - return l - }); - d.results[o] = c.flatten(g.results); - if (a == "dropinit") - g.droppable = c.flatten(g.droppable); - a == "dragstart" && !g.cancelled && m.update() - } - while (++o < e); - b.type = j.type; - b.originalEvent = j.event; - return c.flatten(d.results) - } - }, properties: function (b, a, d) { - var e = d.callback; - e.drag = d.drag; - e.proxy = d.proxy || d.drag; - e.startX = a.pageX; - e.startY = a.pageY; - e.deltaX = b.pageX - a.pageX; - e.deltaY = b.pageY - a.pageY; - e.originalX = d.offset.left; - e.originalY = d.offset.top; - e.offsetX = b.pageX - (a.pageX - e.originalX); - e.offsetY = b.pageY - (a.pageY - e.originalY); - e.drop = c.flatten((d.drop || []).slice()); - e.available = c.flatten((d.droppable || []).slice()); - return e - }, element: function (b) { - if (b && (b.jquery || b.nodeType == 1)) - return b - }, flatten: function (b) { - return f.map(b, function (a) { - return a && a.jquery ? f.makeArray(a) : a && a.length ? c.flatten(a) : a - }) - }, textselect: function (b) { - f(document)[b ? "unbind" : "bind"]("selectstart", c.dontstart).attr("unselectable", b ? "off" : "on").css("MozUserSelect", b ? "" : "none") - }, dontstart: function () { - return false - }, callback: function () { - }}; - c.callback.prototype = {update: function () { - h.drop && this.available.length && f.each(this.available, function (b) { - h.drop.locate(this, b) - }) - }}; - h.draginit = h.dragstart = h.dragend = c -})(jQuery); \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.2.min.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.2.min.js new file mode 100644 index 0000000000..cff8ed6538 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/jquery.event.drag-2.2.min.js @@ -0,0 +1,6 @@ +/*! + * jquery.event.drag - v 2.2 + * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com + * Open Source MIT License - http://threedubmedia.com/code/license + */ +;(function(e){e.fn.drag=function(k,g,j){var i=typeof k=="string"?k:"",h=e.isFunction(k)?k:e.isFunction(g)?g:null;if(i.indexOf("drag")!==0){i="drag"+i}j=(k==h?g:j)||{};return h?this.bind(i,j,h):this.trigger(i)};var b=e.event,a=b.special,d=a.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",noBubble:true,add:function(i){var h=e.data(this,d.datakey),g=i.data||{};h.related+=1;e.each(d.defaults,function(j,k){if(g[j]!==undefined){h[j]=g[j]}})},remove:function(){e.data(this,d.datakey).related-=1},setup:function(){if(e.data(this,d.datakey)){return}var g=e.extend({related:0},d.defaults);e.data(this,d.datakey,g);b.add(this,"touchstart mousedown",d.init,g);if(this.attachEvent){this.attachEvent("ondragstart",d.dontstart)}},teardown:function(){var g=e.data(this,d.datakey)||{};if(g.related){return}e.removeData(this,d.datakey);b.remove(this,"touchstart mousedown",d.init);d.textselect(true);if(this.detachEvent){this.detachEvent("ondragstart",d.dontstart)}},init:function(i){if(d.touched){return}var g=i.data,h;if(i.which!=0&&g.which>0&&i.which!=g.which){return}if(e(i.target).is(g.not)){return}if(g.handle&&!e(i.target).closest(g.handle,i.currentTarget).length){return}d.touched=i.type=="touchstart"?this:null;g.propagates=1;g.mousedown=this;g.interactions=[d.interaction(this,g)];g.target=i.target;g.pageX=i.pageX;g.pageY=i.pageY;g.dragging=null;h=d.hijack(i,"draginit",g);if(!g.propagates){return}h=d.flatten(h);if(h&&h.length){g.interactions=[];e.each(h,function(){g.interactions.push(d.interaction(this,g))})}g.propagates=g.interactions.length;if(g.drop!==false&&a.drop){a.drop.handler(i,g)}d.textselect(false);if(d.touched){b.add(d.touched,"touchmove touchend",d.handler,g)}else{b.add(document,"mousemove mouseup",d.handler,g)}if(!d.touched||g.live){return false}},interaction:function(h,g){var i=e(h)[g.relative?"position":"offset"]()||{top:0,left:0};return{drag:h,callback:new d.callback(),droppable:[],offset:i}},handler:function(h){var g=h.data;switch(h.type){case !g.dragging&&"touchmove":h.preventDefault();case !g.dragging&&"mousemove":if(Math.pow(h.pageX-g.pageX,2)+Math.pow(h.pageY-g.pageY,2)0){e.removeData(this,"suppress."+g.type);return}return f.apply(this,arguments)};var c=b.fixHooks.touchstart=b.fixHooks.touchmove=b.fixHooks.touchend=b.fixHooks.touchcancel={props:"clientX clientY pageX pageY screenX screenY".split(" "),filter:function(h,i){if(i){var g=(i.touches&&i.touches[0])||(i.changedTouches&&i.changedTouches[0])||null;if(g){e.each(c.props,function(j,k){h[k]=g[k]})}}return h}};a.draginit=a.dragstart=a.dragend=d})(jQuery); \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/MIT-LICENSE.txt b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/MIT-LICENSE.txt new file mode 100755 index 0000000000..60f65425c0 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2010 Michael Leibman, http://github.com/mleibman/slickgrid + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/images/collapse.gif b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/images/collapse.gif new file mode 100755 index 0000000000000000000000000000000000000000..01e691450c48632dc92a40a8c2b509bf99987225 GIT binary patch literal 846 zcmZ?wbhEHb$FyaIl$)g-gQVfI}k_i-?$k!^A~S3=)P?0Tm31hZvXy UI%HM~I5JIC=Ul}jAi!V^09i~Z*8l(j literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/images/expand.gif b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/images/expand.gif new file mode 100755 index 0000000000000000000000000000000000000000..1b24ef1248de55c6140895f6760758a1579f14cf GIT binary patch literal 851 zcmZ?wbhEHb$FyaIl$)g-gPK!J(0fMMMlpH!w1DF=kxpFl=aGX3~-h X>0od?I!Q%XL14k81*aJp85yhr3QsCm literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick-default-theme.css b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick-default-theme.css index c68b703282..6b45f3e821 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick-default-theme.css +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick-default-theme.css @@ -31,24 +31,24 @@ classes should alter those! } .slick-headerrow { - background: #fafafa; + background: #fafafa; } .slick-headerrow-column { - background: #fafafa; - border-bottom: 0; - height: 100%; + background: #fafafa; + border-bottom: 0; + height: 100%; } .slick-row.ui-state-active { - background: #F5F7D7; + background: #F5F7D7; } .slick-row { - position: absolute; - background: white; - border: 0px; - line-height: 20px; + position: absolute; + background: white; + border: 0px; + line-height: 20px; } .slick-row:hover { @@ -56,37 +56,37 @@ classes should alter those! } .slick-row.selected { - z-index: 10; + z-index: 10; background: #DFE8F6 !important; } .slick-cell { - padding-left: 4px; - padding-right: 4px; + padding-left: 4px; + padding-right: 4px; border-style: solid !important; } .slick-group { - border-bottom: 2px solid silver; + border-bottom: 2px solid silver; } .slick-group-toggle { - width: 9px; - height: 9px; - margin-right: 5px; + width: 9px; + height: 9px; + margin-right: 5px; } .slick-group-toggle.expanded { - background: url(../../../../images/collapse.gif) no-repeat center center; + background: url(images/collapse.gif) no-repeat center center; } .slick-group-toggle.collapsed { - background: url(../../../../images/expand.gif) no-repeat center center; + background: url(images/expand.gif) no-repeat center center; } .slick-group-totals { - color: gray; - background: white; + color: gray; + background: white; } .slick-cell.selected { @@ -100,22 +100,36 @@ classes should alter those! } .slick-sortable-placeholder { - background: silver !important; + background: silver !important; } -.slick-row[row$="1"], .slick-row[row$="3"], .slick-row[row$="5"], .slick-row[row$="7"], .slick-row[row$="9"] { - background: #fafafa; +.slick-row.odd { + background: #fafafa; } .slick-row.ui-state-active { - background: #F5F7D7; + background: #F5F7D7; } .slick-row.loading { - opacity: 0.5; - filter: alpha(opacity = 50); + opacity: 0.5; + filter: alpha(opacity = 50); } .slick-cell.invalid { - border-color: red; + border-color: red; + -moz-animation-duration: 0.2s; + -webkit-animation-duration: 0.2s; + -moz-animation-name: slickgrid-invalid-hilite; + -webkit-animation-name: slickgrid-invalid-hilite; +} + +@-moz-keyframes slickgrid-invalid-hilite { + from { box-shadow: 0 0 6px red; } + to { box-shadow: none; } +} + +@-webkit-keyframes slickgrid-invalid-hilite { + from { box-shadow: 0 0 6px red; } + to { box-shadow: none; } } \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css index 2e8f390594..de94dbfe45 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css @@ -6,153 +6,152 @@ classes should alter those! */ .slick-header.ui-state-default, .slick-headerrow.ui-state-default { - width: 100%; - overflow: hidden; - border-left: 0px; + width: 100%; + overflow: hidden; + border-left: 0px; } .slick-header-columns, .slick-headerrow-columns { - width: 999999px; - position: relative; - white-space: nowrap; - cursor: default; - overflow: hidden; + position: relative; + white-space: nowrap; + cursor: default; + overflow: hidden; } .slick-header-column.ui-state-default { - position: relative; - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - height: 16px; - line-height: 16px; - margin: 0; - padding: 4px; - border-right: 1px solid silver; - border-left: 0px; - border-top: 0px; - border-bottom: 0px; - float: left; + position: relative; + display: inline-block; + overflow: hidden; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + height: 16px; + line-height: 16px; + margin: 0; + padding: 4px; + border-right: 1px solid silver; + border-left: 0px; + border-top: 0px; + border-bottom: 0px; + float: left; } .slick-headerrow-column.ui-state-default { - padding: 4px; + padding: 4px; } .slick-header-column-sorted { - font-style: italic; + font-style: italic; } .slick-sort-indicator { - display: inline-block; - width: 8px; - height: 5px; - margin-left: 4px; + display: inline-block; + width: 8px; + height: 5px; + margin-left: 4px; + margin-top: 6px; + /*float: left;*/ } .slick-sort-indicator-desc { - background: url(images/sort-desc.gif); + background: url(images/sort-desc.gif); } .slick-sort-indicator-asc { - background: url(images/sort-asc.gif); + background: url(images/sort-asc.gif); } .slick-resizable-handle { - position: absolute; - font-size: 0.1px; - display: block; - cursor: col-resize; - width: 4px; - right: 0px; - top: 0; - height: 100%; + position: absolute; + font-size: 0.1px; + display: block; + cursor: col-resize; + width: 4px; + right: 0px; + top: 0; + height: 100%; } .slick-sortable-placeholder { - background: silver; + background: silver; } .grid-canvas { - position: relative; - outline: 0; + position: relative; + outline: 0; } .slick-row.ui-widget-content, .slick-row.ui-state-active { - position: absolute; - border: 0px; - width: 100%; + position: absolute; + border: 0px; + width: 100%; } .slick-cell, .slick-headerrow-column { - position: absolute; - - border: 1px solid transparent; - border-right: 1px dotted silver; - border-bottom-color: silver; - - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; - z-index: 1; - padding: 1px 2px 2px 1px; - margin: 0; - - white-space: nowrap; - - cursor: default; + position: absolute; + border: 1px solid transparent; + border-right: 1px dotted silver; + border-bottom-color: silver; + overflow: hidden; + -o-text-overflow: ellipsis; + text-overflow: ellipsis; + vertical-align: middle; + z-index: 1; + padding: 1px 2px 2px 1px; + margin: 0; + white-space: nowrap; + cursor: default; } .slick-group { } .slick-group-toggle { - display: inline-block; + display: inline-block; } .slick-cell.highlighted { - background: lightskyblue; - background: rgba(0, 0, 255, 0.2); - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - transition: all 0.5s; + background: lightskyblue; + background: rgba(0, 0, 255, 0.2); + -webkit-transition: all 0.5s; + -moz-transition: all 0.5s; + -o-transition: all 0.5s; + transition: all 0.5s; } .slick-cell.flashing { - border: 1px solid red !important; + border: 1px solid red !important; } .slick-cell.editable { - z-index: 11; - overflow: visible; - background: white; - border-color: black; - border-style: solid; + z-index: 11; + overflow: visible; + background: white; + border-color: black; + border-style: solid; } .slick-cell:focus { - outline: none; + outline: none; } .slick-reorder-proxy { - display: inline-block; - background: blue; - opacity: 0.15; - filter: alpha(opacity = 15); - cursor: move; + display: inline-block; + background: blue; + opacity: 0.15; + filter: alpha(opacity = 15); + cursor: move; } .slick-reorder-guide { - display: inline-block; - height: 2px; - background: blue; - opacity: 0.7; - filter: alpha(opacity = 70); + display: inline-block; + height: 2px; + background: blue; + opacity: 0.7; + filter: alpha(opacity = 70); } .slick-selection { - z-index: 10; - position: absolute; - border: 2px dashed black; -} \ No newline at end of file + z-index: 10; + position: absolute; + border: 2px dashed black; +} diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.autotooltips.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.autotooltips.js index bce0beab6c..955684f2aa 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.autotooltips.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.autotooltips.js @@ -1,48 +1,83 @@ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "AutoTooltips": AutoTooltips - } - }); - - - function AutoTooltips(options) { - var _grid; - var _self = this; - var _defaults = { - maxToolTipLength: null - }; - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _grid = grid; - _grid.onMouseEnter.subscribe(handleMouseEnter); - } - - function destroy() { - _grid.onMouseEnter.unsubscribe(handleMouseEnter); - } - - function handleMouseEnter(e, args) { - var cell = _grid.getCellFromEvent(e); - if (cell) { - var node = _grid.getCellNode(cell.row, cell.cell); - if ($(node).innerWidth() < node.scrollWidth) { - var text = $.trim($(node).text()); - if (options.maxToolTipLength && text.length > options.maxToolTipLength) { - text = text.substr(0, options.maxToolTipLength - 3) + "..."; - } - $(node).attr("title", text); - } else { - $(node).attr("title", ""); - } - } - } - - $.extend(this, { - "init": init, - "destroy": destroy - }); + // Register namespace + $.extend(true, window, { + "Slick": { + "AutoTooltips": AutoTooltips } + }); + + /** + * AutoTooltips plugin to show/hide tooltips when columns are too narrow to fit content. + * @constructor + * @param {boolean} [options.enableForCells=true] - Enable tooltip for grid cells + * @param {boolean} [options.enableForHeaderCells=false] - Enable tooltip for header cells + * @param {number} [options.maxToolTipLength=null] - The maximum length for a tooltip + */ + function AutoTooltips(options) { + var _grid; + var _self = this; + var _defaults = { + enableForCells: true, + enableForHeaderCells: false, + maxToolTipLength: null + }; + + /** + * Initialize plugin. + */ + function init(grid) { + options = $.extend(true, {}, _defaults, options); + _grid = grid; + if (options.enableForCells) _grid.onMouseEnter.subscribe(handleMouseEnter); + if (options.enableForHeaderCells) _grid.onHeaderMouseEnter.subscribe(handleHeaderMouseEnter); + } + + /** + * Destroy plugin. + */ + function destroy() { + if (options.enableForCells) _grid.onMouseEnter.unsubscribe(handleMouseEnter); + if (options.enableForHeaderCells) _grid.onHeaderMouseEnter.unsubscribe(handleHeaderMouseEnter); + } + + /** + * Handle mouse entering grid cell to add/remove tooltip. + * @param {jQuery.Event} e - The event + */ + function handleMouseEnter(e) { + var cell = _grid.getCellFromEvent(e); + if (cell) { + var $node = $(_grid.getCellNode(cell.row, cell.cell)); + var text; + if ($node.innerWidth() < $node[0].scrollWidth) { + text = $.trim($node.text()); + if (options.maxToolTipLength && text.length > options.maxToolTipLength) { + text = text.substr(0, options.maxToolTipLength - 3) + "..."; + } + } else { + text = ""; + } + $node.attr("title", text); + } + } + + /** + * Handle mouse entering header cell to add/remove tooltip. + * @param {jQuery.Event} e - The event + * @param {object} args.column - The column definition + */ + function handleHeaderMouseEnter(e, args) { + var column = args.column, + $node = $(e.target).closest(".slick-header-column"); + if (!column.toolTip) { + $node.attr("title", ($node.innerWidth() < $node[0].scrollWidth) ? column.name : ""); + } + } + + // Public API + $.extend(this, { + "init": init, + "destroy": destroy + }); + } })(jQuery); \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangedecorator.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangedecorator.js index eb2d506deb..0cbe71d48d 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangedecorator.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangedecorator.js @@ -1,64 +1,66 @@ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellRangeDecorator": CellRangeDecorator - } - }); - - /*** - * Displays an overlay on top of a given cell range. - * - * TODO: - * Currently, it blocks mouse events to DOM nodes behind it. - * Use FF and WebKit-specific "pointer-events" CSS style, or some kind of event forwarding. - * Could also construct the borders separately using 4 individual DIVs. - * - * @param {Grid} grid - * @param {Object} options - */ - function CellRangeDecorator(grid, options) { - var _elem; - var _defaults = { - selectionCss: { - "zIndex": "9999", - "border": "2px dashed red" - } - }; - - options = $.extend(true, {}, _defaults, options); - - - function show(range) { - if (!_elem) { - _elem = $("
", {css: options.selectionCss}) - .css("position", "absolute") - .appendTo(grid.getCanvasNode()); - } - - var from = grid.getCellNodeBox(range.fromRow, range.fromCell); - var to = grid.getCellNodeBox(range.toRow, range.toCell); - - _elem.css({ - top: from.top - 1, - left: from.left - 1, - height: to.bottom - from.top - 2, - width: to.right - from.left - 2 - }); - - return _elem; - } - - function hide() { - if (_elem) { - _elem.remove(); - _elem = null; - } - } - - $.extend(this, { - "show": show, - "hide": hide - }); + // register namespace + $.extend(true, window, { + "Slick": { + "CellRangeDecorator": CellRangeDecorator } -})(jQuery); \ No newline at end of file + }); + + /*** + * Displays an overlay on top of a given cell range. + * + * TODO: + * Currently, it blocks mouse events to DOM nodes behind it. + * Use FF and WebKit-specific "pointer-events" CSS style, or some kind of event forwarding. + * Could also construct the borders separately using 4 individual DIVs. + * + * @param {Grid} grid + * @param {Object} options + */ + function CellRangeDecorator(grid, options) { + var _elem; + var _defaults = { + selectionCssClass: 'slick-range-decorator', + selectionCss: { + "zIndex": "9999", + "border": "2px dashed red" + } + }; + + options = $.extend(true, {}, _defaults, options); + + + function show(range) { + if (!_elem) { + _elem = $("
", {css: options.selectionCss}) + .addClass(options.selectionCssClass) + .css("position", "absolute") + .appendTo(grid.getCanvasNode()); + } + + var from = grid.getCellNodeBox(range.fromRow, range.fromCell); + var to = grid.getCellNodeBox(range.toRow, range.toCell); + + _elem.css({ + top: from.top - 1, + left: from.left - 1, + height: to.bottom - from.top - 2, + width: to.right - from.left - 2 + }); + + return _elem; + } + + function hide() { + if (_elem) { + _elem.remove(); + _elem = null; + } + } + + $.extend(this, { + "show": show, + "hide": hide + }); + } +})(jQuery); diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangeselector.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangeselector.js index 04d2f90dc0..520b17f3c4 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangeselector.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellrangeselector.js @@ -1,111 +1,113 @@ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellRangeSelector": CellRangeSelector - } - }); - - - function CellRangeSelector(options) { - var _grid; - var _canvas; - var _dragging; - var _decorator; - var _self = this; - var _defaults = { - selectionCss: { - "border": "2px dashed blue" - } - }; - - - function init(grid) { - options = $.extend(true, {}, _defaults, options); - _decorator = new Slick.CellRangeDecorator(grid, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onDragInit.subscribe(handleDragInit); - _grid.onDragStart.subscribe(handleDragStart); - _grid.onDrag.subscribe(handleDrag); - _grid.onDragEnd.subscribe(handleDragEnd); - } - - function destroy() { - _grid.onDragInit.unsubscribe(handleDragInit); - _grid.onDragStart.unsubscribe(handleDragStart); - _grid.onDrag.unsubscribe(handleDrag); - _grid.onDragEnd.unsubscribe(handleDragEnd); - } - - function handleDragInit(e, dd) { - // prevent the grid from cancelling drag'n'drop by default - e.stopImmediatePropagation(); - } - - function handleDragStart(e, dd) { - var cell = _grid.getCellFromEvent(e); - if (_self.onBeforeCellRangeSelected.notify(cell) !== false) { - if (_grid.canCellBeSelected(cell.row, cell.cell)) { - _dragging = true; - e.stopImmediatePropagation(); - } - } - if (!_dragging) { - return; - } - - var start = _grid.getCellFromPoint( - dd.startX - $(_canvas).offset().left, - dd.startY - $(_canvas).offset().top); - - dd.range = {start: start, end: {}}; - - return _decorator.show(new Slick.Range(start.row, start.cell)); - } - - function handleDrag(e, dd) { - if (!_dragging) { - return; - } - e.stopImmediatePropagation(); - - var end = _grid.getCellFromPoint( - e.pageX - $(_canvas).offset().left, - e.pageY - $(_canvas).offset().top); - - if (!_grid.canCellBeSelected(end.row, end.cell)) { - return; - } - - dd.range.end = end; - _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell)); - } - - function handleDragEnd(e, dd) { - if (!_dragging) { - return; - } - - _dragging = false; - e.stopImmediatePropagation(); - - _decorator.hide(); - _self.onCellRangeSelected.notify({ - range: new Slick.Range( - dd.range.start.row, - dd.range.start.cell, - dd.range.end.row, - dd.range.end.cell - ) - }); - } - - $.extend(this, { - "init": init, - "destroy": destroy, - "onBeforeCellRangeSelected": new Slick.Event(), - "onCellRangeSelected": new Slick.Event() - }); + // register namespace + $.extend(true, window, { + "Slick": { + "CellRangeSelector": CellRangeSelector } + }); + + + function CellRangeSelector(options) { + var _grid; + var _canvas; + var _dragging; + var _decorator; + var _self = this; + var _handler = new Slick.EventHandler(); + var _defaults = { + selectionCss: { + "border": "2px dashed blue" + } + }; + + + function init(grid) { + options = $.extend(true, {}, _defaults, options); + _decorator = new Slick.CellRangeDecorator(grid, options); + _grid = grid; + _canvas = _grid.getCanvasNode(); + _handler + .subscribe(_grid.onDragInit, handleDragInit) + .subscribe(_grid.onDragStart, handleDragStart) + .subscribe(_grid.onDrag, handleDrag) + .subscribe(_grid.onDragEnd, handleDragEnd); + } + + function destroy() { + _handler.unsubscribeAll(); + } + + function handleDragInit(e, dd) { + // prevent the grid from cancelling drag'n'drop by default + e.stopImmediatePropagation(); + } + + function handleDragStart(e, dd) { + var cell = _grid.getCellFromEvent(e); + if (_self.onBeforeCellRangeSelected.notify(cell) !== false) { + if (_grid.canCellBeSelected(cell.row, cell.cell)) { + _dragging = true; + e.stopImmediatePropagation(); + } + } + if (!_dragging) { + return; + } + + _grid.focus(); + + var start = _grid.getCellFromPoint( + dd.startX - $(_canvas).offset().left, + dd.startY - $(_canvas).offset().top); + + dd.range = {start: start, end: {}}; + + return _decorator.show(new Slick.Range(start.row, start.cell)); + } + + function handleDrag(e, dd) { + if (!_dragging) { + return; + } + e.stopImmediatePropagation(); + + var end = _grid.getCellFromPoint( + e.pageX - $(_canvas).offset().left, + e.pageY - $(_canvas).offset().top); + + if (!_grid.canCellBeSelected(end.row, end.cell)) { + return; + } + + dd.range.end = end; + _decorator.show(new Slick.Range(dd.range.start.row, dd.range.start.cell, end.row, end.cell)); + } + + function handleDragEnd(e, dd) { + if (!_dragging) { + return; + } + + _dragging = false; + e.stopImmediatePropagation(); + + _decorator.hide(); + _self.onCellRangeSelected.notify({ + range: new Slick.Range( + dd.range.start.row, + dd.range.start.cell, + dd.range.end.row, + dd.range.end.cell + ) + }); + } + + $.extend(this, { + "init": init, + "destroy": destroy, + + "onBeforeCellRangeSelected": new Slick.Event(), + "onCellRangeSelected": new Slick.Event() + }); + } })(jQuery); \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellselectionmodel.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellselectionmodel.js index 9f0730a12c..74bc3eb70e 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellselectionmodel.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.cellselectionmodel.js @@ -1,90 +1,154 @@ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "CellSelectionModel": CellSelectionModel - } - }); - - - function CellSelectionModel(options) { - var _grid; - var _canvas; - var _ranges = []; - var _self = this; - var _selector = new Slick.CellRangeSelector({ - "selectionCss": { - "border": "2px solid black" - } - }); - var _options; - var _defaults = { - selectActiveCell: true - }; - - - function init(grid) { - _options = $.extend(true, {}, _defaults, options); - _grid = grid; - _canvas = _grid.getCanvasNode(); - _grid.onActiveCellChanged.subscribe(handleActiveCellChange); - grid.registerPlugin(_selector); - _selector.onCellRangeSelected.subscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected); - } - - function destroy() { - _grid.onActiveCellChanged.unsubscribe(handleActiveCellChange); - _selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected); - _selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected); - _grid.unregisterPlugin(_selector); - } - - function removeInvalidRanges(ranges) { - var result = []; - - for (var i = 0; i < ranges.length; i++) { - var r = ranges[i]; - if (_grid.canCellBeSelected(r.fromRow, r.fromCell) && _grid.canCellBeSelected(r.toRow, r.toCell)) { - result.push(r); - } - } - - return result; - } - - function setSelectedRanges(ranges) { - _ranges = removeInvalidRanges(ranges); - _self.onSelectedRangesChanged.notify(_ranges); - } - - function getSelectedRanges() { - return _ranges; - } - - function handleBeforeCellRangeSelected(e, args) { - if (_grid.getEditorLock().isActive()) { - e.stopPropagation(); - return false; - } - } - - function handleCellRangeSelected(e, args) { - setSelectedRanges([args.range]); - } - - function handleActiveCellChange(e, args) { - if (_options.selectActiveCell) { - setSelectedRanges([new Slick.Range(args.row, args.cell)]); - } - } - - $.extend(this, { - "getSelectedRanges": getSelectedRanges, - "setSelectedRanges": setSelectedRanges, - "init": init, - "destroy": destroy, - "onSelectedRangesChanged": new Slick.Event() - }); + // register namespace + $.extend(true, window, { + "Slick": { + "CellSelectionModel": CellSelectionModel } -})(jQuery); \ No newline at end of file + }); + + + function CellSelectionModel(options) { + var _grid; + var _canvas; + var _ranges = []; + var _self = this; + var _selector = new Slick.CellRangeSelector({ + "selectionCss": { + "border": "2px solid black" + } + }); + var _options; + var _defaults = { + selectActiveCell: true + }; + + + function init(grid) { + _options = $.extend(true, {}, _defaults, options); + _grid = grid; + _canvas = _grid.getCanvasNode(); + _grid.onActiveCellChanged.subscribe(handleActiveCellChange); + _grid.onKeyDown.subscribe(handleKeyDown); + grid.registerPlugin(_selector); + _selector.onCellRangeSelected.subscribe(handleCellRangeSelected); + _selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected); + } + + function destroy() { + _grid.onActiveCellChanged.unsubscribe(handleActiveCellChange); + _grid.onKeyDown.unsubscribe(handleKeyDown); + _selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected); + _selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected); + _grid.unregisterPlugin(_selector); + } + + function removeInvalidRanges(ranges) { + var result = []; + + for (var i = 0; i < ranges.length; i++) { + var r = ranges[i]; + if (_grid.canCellBeSelected(r.fromRow, r.fromCell) && _grid.canCellBeSelected(r.toRow, r.toCell)) { + result.push(r); + } + } + + return result; + } + + function setSelectedRanges(ranges) { + _ranges = removeInvalidRanges(ranges); + _self.onSelectedRangesChanged.notify(_ranges); + } + + function getSelectedRanges() { + return _ranges; + } + + function handleBeforeCellRangeSelected(e, args) { + if (_grid.getEditorLock().isActive()) { + e.stopPropagation(); + return false; + } + } + + function handleCellRangeSelected(e, args) { + setSelectedRanges([args.range]); + } + + function handleActiveCellChange(e, args) { + if (_options.selectActiveCell && args.row != null && args.cell != null) { + setSelectedRanges([new Slick.Range(args.row, args.cell)]); + } + } + + function handleKeyDown(e) { + /*** + * Кey codes + * 37 left + * 38 up + * 39 right + * 40 down + */ + var ranges, last; + var active = _grid.getActiveCell(); + + if ( active && e.shiftKey && !e.ctrlKey && !e.altKey && + (e.which == 37 || e.which == 39 || e.which == 38 || e.which == 40) ) { + + ranges = getSelectedRanges(); + if (!ranges.length) + ranges.push(new Slick.Range(active.row, active.cell)); + + // keyboard can work with last range only + last = ranges.pop(); + + // can't handle selection out of active cell + if (!last.contains(active.row, active.cell)) + last = new Slick.Range(active.row, active.cell); + + var dRow = last.toRow - last.fromRow, + dCell = last.toCell - last.fromCell, + // walking direction + dirRow = active.row == last.fromRow ? 1 : -1, + dirCell = active.cell == last.fromCell ? 1 : -1; + + if (e.which == 37) { + dCell -= dirCell; + } else if (e.which == 39) { + dCell += dirCell ; + } else if (e.which == 38) { + dRow -= dirRow; + } else if (e.which == 40) { + dRow += dirRow; + } + + // define new selection range + var new_last = new Slick.Range(active.row, active.cell, active.row + dirRow*dRow, active.cell + dirCell*dCell); + if (removeInvalidRanges([new_last]).length) { + ranges.push(new_last); + var viewRow = dirRow > 0 ? new_last.toRow : new_last.fromRow; + var viewCell = dirCell > 0 ? new_last.toCell : new_last.fromCell; + _grid.scrollRowIntoView(viewRow); + _grid.scrollCellIntoView(viewRow, viewCell); + } + else + ranges.push(last); + + setSelectedRanges(ranges); + + e.preventDefault(); + e.stopPropagation(); + } + } + + $.extend(this, { + "getSelectedRanges": getSelectedRanges, + "setSelectedRanges": setSelectedRanges, + + "init": init, + "destroy": destroy, + + "onSelectedRangesChanged": new Slick.Event() + }); + } +})(jQuery); diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.rowselectionmodel.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.rowselectionmodel.js index af966c0b73..0de8dd3a40 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.rowselectionmodel.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/plugins/slick.rowselectionmodel.js @@ -1,184 +1,187 @@ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "RowSelectionModel": RowSelectionModel - } - }); - - function RowSelectionModel(options) { - var _grid; - var _ranges = []; - var _self = this; - var _handler = new Slick.EventHandler(); - var _inHandler; - var _options; - var _defaults = { - selectActiveRow: true - }; - - function init(grid) { - _options = $.extend(true, {}, _defaults, options); - _grid = grid; - _handler.subscribe(_grid.onActiveCellChanged, - wrapHandler(handleActiveCellChange)); - _handler.subscribe(_grid.onKeyDown, - wrapHandler(handleKeyDown)); - _handler.subscribe(_grid.onClick, - wrapHandler(handleClick)); - } - - function destroy() { - _handler.unsubscribeAll(); - } - - function wrapHandler(handler) { - return function () { - if (!_inHandler) { - _inHandler = true; - handler.apply(this, arguments); - _inHandler = false; - } - }; - } - - function rangesToRows(ranges) { - var rows = []; - for (var i = 0; i < ranges.length; i++) { - for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { - rows.push(j); - } - } - return rows; - } - - function rowsToRanges(rows) { - var ranges = []; - var lastCell = _grid.getColumns().length - 1; - for (var i = 0; i < rows.length; i++) { - ranges.push(new Slick.Range(rows[i], 0, rows[i], lastCell)); - } - return ranges; - } - - function getRowsRange(from, to) { - var i, rows = []; - for (i = from; i <= to; i++) { - rows.push(i); - } - for (i = to; i < from; i++) { - rows.push(i); - } - return rows; - } - - function getSelectedRows() { - return rangesToRows(_ranges); - } - - function setSelectedRows(rows) { - setSelectedRanges(rowsToRanges(rows)); - } - - function setSelectedRanges(ranges) { - _ranges = ranges; - _self.onSelectedRangesChanged.notify(_ranges); - } - - function getSelectedRanges() { - return _ranges; - } - - function handleActiveCellChange(e, data) { - if (_options.selectActiveRow) { - setSelectedRanges([new Slick.Range(data.row, 0, data.row, _grid.getColumns().length - 1)]); - } - } - - function handleKeyDown(e) { - var activeRow = _grid.getActiveCell(); - if (activeRow && e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && (e.which == 38 || e.which == 40)) { - var selectedRows = getSelectedRows(); - selectedRows.sort(function (x, y) { - return x - y - }); - - if (!selectedRows.length) { - selectedRows = [activeRow.row]; - } - - var top = selectedRows[0]; - var bottom = selectedRows[selectedRows.length - 1]; - var active; - - if (e.which == 40) { - active = activeRow.row < bottom || top == bottom ? ++bottom : ++top; - } else { - active = activeRow.row < bottom ? --bottom : --top; - } - - if (active >= 0 && active < _grid.getDataLength()) { - _grid.scrollRowIntoView(active); - _ranges = rowsToRanges(getRowsRange(top, bottom)); - setSelectedRanges(_ranges); - } - - e.preventDefault(); - e.stopPropagation(); - } - } - - function handleClick(e) { - var cell = _grid.getCellFromEvent(e); - if (!cell || !_grid.canCellBeActive(cell.row, cell.cell)) { - return false; - } - - var selection = rangesToRows(_ranges); - var idx = $.inArray(cell.row, selection); - - if (!e.ctrlKey && !e.shiftKey && !e.metaKey) { - return false; - } - else if (_grid.getOptions().multiSelect) { - if (idx === -1 && (e.ctrlKey || e.metaKey)) { - selection.push(cell.row); - _grid.setActiveCell(cell.row, cell.cell); - } else if (idx !== -1 && (e.ctrlKey || e.metaKey)) { - selection = $.grep(selection, function (o, i) { - return (o !== cell.row); - }); - _grid.setActiveCell(cell.row, cell.cell); - } else if (selection.length && e.shiftKey) { - var last = selection.pop(); - var from = Math.min(cell.row, last); - var to = Math.max(cell.row, last); - selection = []; - for (var i = from; i <= to; i++) { - if (i !== last) { - selection.push(i); - } - } - selection.push(last); - _grid.setActiveCell(cell.row, cell.cell); - } - } - - _ranges = rowsToRanges(selection); - setSelectedRanges(_ranges); - e.stopImmediatePropagation(); - - return true; - } - - $.extend(this, { - "getSelectedRows": getSelectedRows, - "setSelectedRows": setSelectedRows, - "getSelectedRanges": getSelectedRanges, - "setSelectedRanges": setSelectedRanges, - "init": init, - "destroy": destroy, - "onSelectedRangesChanged": new Slick.Event() - }); + // register namespace + $.extend(true, window, { + "Slick": { + "RowSelectionModel": RowSelectionModel } + }); + + function RowSelectionModel(options) { + var _grid; + var _ranges = []; + var _self = this; + var _handler = new Slick.EventHandler(); + var _inHandler; + var _options; + var _defaults = { + selectActiveRow: true + }; + + function init(grid) { + _options = $.extend(true, {}, _defaults, options); + _grid = grid; + _handler.subscribe(_grid.onActiveCellChanged, + wrapHandler(handleActiveCellChange)); + _handler.subscribe(_grid.onKeyDown, + wrapHandler(handleKeyDown)); + _handler.subscribe(_grid.onClick, + wrapHandler(handleClick)); + } + + function destroy() { + _handler.unsubscribeAll(); + } + + function wrapHandler(handler) { + return function () { + if (!_inHandler) { + _inHandler = true; + handler.apply(this, arguments); + _inHandler = false; + } + }; + } + + function rangesToRows(ranges) { + var rows = []; + for (var i = 0; i < ranges.length; i++) { + for (var j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { + rows.push(j); + } + } + return rows; + } + + function rowsToRanges(rows) { + var ranges = []; + var lastCell = _grid.getColumns().length - 1; + for (var i = 0; i < rows.length; i++) { + ranges.push(new Slick.Range(rows[i], 0, rows[i], lastCell)); + } + return ranges; + } + + function getRowsRange(from, to) { + var i, rows = []; + for (i = from; i <= to; i++) { + rows.push(i); + } + for (i = to; i < from; i++) { + rows.push(i); + } + return rows; + } + + function getSelectedRows() { + return rangesToRows(_ranges); + } + + function setSelectedRows(rows) { + setSelectedRanges(rowsToRanges(rows)); + } + + function setSelectedRanges(ranges) { + _ranges = ranges; + _self.onSelectedRangesChanged.notify(_ranges); + } + + function getSelectedRanges() { + return _ranges; + } + + function handleActiveCellChange(e, data) { + if (_options.selectActiveRow && data.row != null) { + setSelectedRanges([new Slick.Range(data.row, 0, data.row, _grid.getColumns().length - 1)]); + } + } + + function handleKeyDown(e) { + var activeRow = _grid.getActiveCell(); + if (activeRow && e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && (e.which == 38 || e.which == 40)) { + var selectedRows = getSelectedRows(); + selectedRows.sort(function (x, y) { + return x - y + }); + + if (!selectedRows.length) { + selectedRows = [activeRow.row]; + } + + var top = selectedRows[0]; + var bottom = selectedRows[selectedRows.length - 1]; + var active; + + if (e.which == 40) { + active = activeRow.row < bottom || top == bottom ? ++bottom : ++top; + } else { + active = activeRow.row < bottom ? --bottom : --top; + } + + if (active >= 0 && active < _grid.getDataLength()) { + _grid.scrollRowIntoView(active); + _ranges = rowsToRanges(getRowsRange(top, bottom)); + setSelectedRanges(_ranges); + } + + e.preventDefault(); + e.stopPropagation(); + } + } + + function handleClick(e) { + var cell = _grid.getCellFromEvent(e); + if (!cell || !_grid.canCellBeActive(cell.row, cell.cell)) { + return false; + } + + if (!_grid.getOptions().multiSelect || ( + !e.ctrlKey && !e.shiftKey && !e.metaKey)) { + return false; + } + + var selection = rangesToRows(_ranges); + var idx = $.inArray(cell.row, selection); + + if (idx === -1 && (e.ctrlKey || e.metaKey)) { + selection.push(cell.row); + _grid.setActiveCell(cell.row, cell.cell); + } else if (idx !== -1 && (e.ctrlKey || e.metaKey)) { + selection = $.grep(selection, function (o, i) { + return (o !== cell.row); + }); + _grid.setActiveCell(cell.row, cell.cell); + } else if (selection.length && e.shiftKey) { + var last = selection.pop(); + var from = Math.min(cell.row, last); + var to = Math.max(cell.row, last); + selection = []; + for (var i = from; i <= to; i++) { + if (i !== last) { + selection.push(i); + } + } + selection.push(last); + _grid.setActiveCell(cell.row, cell.cell); + } + + _ranges = rowsToRanges(selection); + setSelectedRanges(_ranges); + e.stopImmediatePropagation(); + + return true; + } + + $.extend(this, { + "getSelectedRows": getSelectedRows, + "setSelectedRows": setSelectedRows, + + "getSelectedRanges": getSelectedRanges, + "setSelectedRanges": setSelectedRanges, + + "init": init, + "destroy": destroy, + + "onSelectedRangesChanged": new Slick.Event() + }); + } })(jQuery); \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.core.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.core.js index aea3567e9f..2f097b1db6 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.core.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.core.js @@ -5,419 +5,463 @@ */ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Event": Event, - "EventData": EventData, - "EventHandler": EventHandler, - "Range": Range, - "NonDataRow": NonDataItem, - "Group": Group, - "GroupTotals": GroupTotals, - "EditorLock": EditorLock, - /*** - * A global singleton editor lock. - * @class GlobalEditorLock - * @static - * @constructor - */ - "GlobalEditorLock": new EditorLock() - } - }); + // register namespace + $.extend(true, window, { + "Slick": { + "Event": Event, + "EventData": EventData, + "EventHandler": EventHandler, + "Range": Range, + "NonDataRow": NonDataItem, + "Group": Group, + "GroupTotals": GroupTotals, + "EditorLock": EditorLock, + + /*** + * A global singleton editor lock. + * @class GlobalEditorLock + * @static + * @constructor + */ + "GlobalEditorLock": new EditorLock() + } + }); + + /*** + * An event object for passing data to event handlers and letting them control propagation. + *

This is pretty much identical to how W3C and jQuery implement events.

+ * @class EventData + * @constructor + */ + function EventData() { + var isPropagationStopped = false; + var isImmediatePropagationStopped = false; /*** - * An event object for passing data to event handlers and letting them control propagation. - *

This is pretty much identical to how W3C and jQuery implement events.

- * @class EventData - * @constructor + * Stops event from propagating up the DOM tree. + * @method stopPropagation */ - function EventData() { - var isPropagationStopped = false; - var isImmediatePropagationStopped = false; - - /*** - * Stops event from propagating up the DOM tree. - * @method stopPropagation - */ - this.stopPropagation = function () { - isPropagationStopped = true; - }; - - /*** - * Returns whether stopPropagation was called on this event object. - * @method isPropagationStopped - * @return {Boolean} - */ - this.isPropagationStopped = function () { - return isPropagationStopped; - }; - - /*** - * Prevents the rest of the handlers from being executed. - * @method stopImmediatePropagation - */ - this.stopImmediatePropagation = function () { - isImmediatePropagationStopped = true; - }; - - /*** - * Returns whether stopImmediatePropagation was called on this event object.\ - * @method isImmediatePropagationStopped - * @return {Boolean} - */ - this.isImmediatePropagationStopped = function () { - return isImmediatePropagationStopped; - } - } - - /*** - * A simple publisher-subscriber implementation. - * @class Event - * @constructor - */ - function Event() { - var handlers = []; - - /*** - * Adds an event handler to be called when the event is fired. - *

Event handler will receive two arguments - an EventData and the data - * object the event was fired with.

- * @method subscribe - * @param fn {Function} Event handler. - */ - this.subscribe = function (fn) { - handlers.push(fn); - }; - - /*** - * Removes an event handler added with subscribe(fn). - * @method unsubscribe - * @param fn {Function} Event handler to be removed. - */ - this.unsubscribe = function (fn) { - for (var i = handlers.length - 1; i >= 0; i--) { - if (handlers[i] === fn) { - handlers.splice(i, 1); - } - } - }; - - /*** - * Fires an event notifying all subscribers. - * @method notify - * @param args {Object} Additional data object to be passed to all handlers. - * @param e {EventData} - * Optional. - * An EventData object to be passed to all handlers. - * For DOM events, an existing W3C/jQuery event object can be passed in. - * @param scope {Object} - * Optional. - * The scope ("this") within which the handler will be executed. - * If not specified, the scope will be set to the Event instance. - */ - this.notify = function (args, e, scope) { - e = e || new EventData(); - scope = scope || this; - - var returnValue; - for (var i = 0; i < handlers.length && !(e.isPropagationStopped() || e.isImmediatePropagationStopped()); i++) { - returnValue = handlers[i].call(scope, e, args); - } - - return returnValue; - }; - } - - function EventHandler() { - var handlers = []; - - this.subscribe = function (event, handler) { - handlers.push({ - event: event, - handler: handler - }); - event.subscribe(handler); - }; - - this.unsubscribe = function (event, handler) { - var i = handlers.length; - while (i--) { - if (handlers[i].event === event && - handlers[i].handler === handler) { - handlers.splice(i, 1); - event.unsubscribe(handler); - return; - } - } - }; - - this.unsubscribeAll = function () { - var i = handlers.length; - while (i--) { - handlers[i].event.unsubscribe(handlers[i].handler); - } - handlers = []; - } - } - - /*** - * A structure containing a range of cells. - * @class Range - * @constructor - * @param fromRow {Integer} Starting row. - * @param fromCell {Integer} Starting cell. - * @param toRow {Integer} Optional. Ending row. Defaults to fromRow. - * @param toCell {Integer} Optional. Ending cell. Defaults to fromCell. - */ - function Range(fromRow, fromCell, toRow, toCell) { - if (toRow === undefined && toCell === undefined) { - toRow = fromRow; - toCell = fromCell; - } - - /*** - * @property fromRow - * @type {Integer} - */ - this.fromRow = Math.min(fromRow, toRow); - - /*** - * @property fromCell - * @type {Integer} - */ - this.fromCell = Math.min(fromCell, toCell); - - /*** - * @property toRow - * @type {Integer} - */ - this.toRow = Math.max(fromRow, toRow); - - /*** - * @property toCell - * @type {Integer} - */ - this.toCell = Math.max(fromCell, toCell); - - /*** - * Returns whether a range represents a single row. - * @method isSingleRow - * @return {Boolean} - */ - this.isSingleRow = function () { - return this.fromRow == this.toRow; - }; - - /*** - * Returns whether a range represents a single cell. - * @method isSingleCell - * @return {Boolean} - */ - this.isSingleCell = function () { - return this.fromRow == this.toRow && this.fromCell == this.toCell; - }; - - /*** - * Returns whether a range contains a given cell. - * @method contains - * @param row {Integer} - * @param cell {Integer} - * @return {Boolean} - */ - this.contains = function (row, cell) { - return row >= this.fromRow && row <= this.toRow && - cell >= this.fromCell && cell <= this.toCell; - }; - - /*** - * Returns a readable representation of a range. - * @method toString - * @return {String} - */ - this.toString = function () { - if (this.isSingleCell()) { - return "(" + this.fromRow + ":" + this.fromCell + ")"; - } - else { - return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")"; - } - } - } - - - /*** - * A base class that all special / non-data rows (like Group and GroupTotals) derive from. - * @class NonDataItem - * @constructor - */ - function NonDataItem() { - this.__nonDataRow = true; - } - - - /*** - * Information about a group of rows. - * @class Group - * @extends Slick.NonDataItem - * @constructor - */ - function Group() { - this.__group = true; - this.__updated = false; - - /*** - * Number of rows in the group. - * @property count - * @type {Integer} - */ - this.count = 0; - - /*** - * Grouping value. - * @property value - * @type {Object} - */ - this.value = null; - - /*** - * Formatted display value of the group. - * @property title - * @type {String} - */ - this.title = null; - - /*** - * Whether a group is collapsed. - * @property collapsed - * @type {Boolean} - */ - this.collapsed = false; - - /*** - * GroupTotals, if any. - * @property totals - * @type {GroupTotals} - */ - this.totals = null; - } - - Group.prototype = new NonDataItem(); - - /*** - * Compares two Group instances. - * @method equals - * @return {Boolean} - * @param group {Group} Group instance to compare to. - */ - Group.prototype.equals = function (group) { - return this.value === group.value && - this.count === group.count && - this.collapsed === group.collapsed; + this.stopPropagation = function () { + isPropagationStopped = true; }; /*** - * Information about group totals. - * An instance of GroupTotals will be created for each totals row and passed to the aggregators - * so that they can store arbitrary data in it. That data can later be accessed by group totals - * formatters during the display. - * @class GroupTotals - * @extends Slick.NonDataItem - * @constructor + * Returns whether stopPropagation was called on this event object. + * @method isPropagationStopped + * @return {Boolean} */ - function GroupTotals() { - this.__groupTotals = true; - - /*** - * Parent Group. - * @param group - * @type {Group} - */ - this.group = null; - } - - GroupTotals.prototype = new NonDataItem(); + this.isPropagationStopped = function () { + return isPropagationStopped; + }; /*** - * A locking helper to track the active edit controller and ensure that only a single controller - * can be active at a time. This prevents a whole class of state and validation synchronization - * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress - * and attempt a commit or cancel before proceeding. - * @class EditorLock - * @constructor + * Prevents the rest of the handlers from being executed. + * @method stopImmediatePropagation */ - function EditorLock() { - var activeEditController = null; + this.stopImmediatePropagation = function () { + isImmediatePropagationStopped = true; + }; - /*** - * Returns true if a specified edit controller is active (has the edit lock). - * If the parameter is not specified, returns true if any edit controller is active. - * @method isActive - * @param editController {EditController} - * @return {Boolean} - */ - this.isActive = function (editController) { - return (editController ? activeEditController === editController : activeEditController !== null); - }; - - /*** - * Sets the specified edit controller as the active edit controller (acquire edit lock). - * If another edit controller is already active, and exception will be thrown. - * @method activate - * @param editController {EditController} edit controller acquiring the lock - */ - this.activate = function (editController) { - if (editController === activeEditController) { // already activated? - return; - } - if (activeEditController !== null) { - throw "SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController"; - } - if (!editController.commitCurrentEdit) { - throw "SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()"; - } - if (!editController.cancelCurrentEdit) { - throw "SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()"; - } - activeEditController = editController; - }; - - /*** - * Unsets the specified edit controller as the active edit controller (release edit lock). - * If the specified edit controller is not the active one, an exception will be thrown. - * @method deactivate - * @param editController {EditController} edit controller releasing the lock - */ - this.deactivate = function (editController) { - if (activeEditController !== editController) { - throw "SlickGrid.EditorLock.deactivate: specified editController is not the currently active one"; - } - activeEditController = null; - }; - - /*** - * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit - * controller and returns whether the commit attempt was successful (commit may fail due to validation - * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded - * and false otherwise. If no edit controller is active, returns true. - * @method commitCurrentEdit - * @return {Boolean} - */ - this.commitCurrentEdit = function () { - return (activeEditController ? activeEditController.commitCurrentEdit() : true); - }; - - /*** - * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit - * controller and returns whether the edit was successfully cancelled. If no edit controller is - * active, returns true. - * @method cancelCurrentEdit - * @return {Boolean} - */ - this.cancelCurrentEdit = function cancelCurrentEdit() { - return (activeEditController ? activeEditController.cancelCurrentEdit() : true); - }; + /*** + * Returns whether stopImmediatePropagation was called on this event object.\ + * @method isImmediatePropagationStopped + * @return {Boolean} + */ + this.isImmediatePropagationStopped = function () { + return isImmediatePropagationStopped; } + } + + /*** + * A simple publisher-subscriber implementation. + * @class Event + * @constructor + */ + function Event() { + var handlers = []; + + /*** + * Adds an event handler to be called when the event is fired. + *

Event handler will receive two arguments - an EventData and the data + * object the event was fired with.

+ * @method subscribe + * @param fn {Function} Event handler. + */ + this.subscribe = function (fn) { + handlers.push(fn); + }; + + /*** + * Removes an event handler added with subscribe(fn). + * @method unsubscribe + * @param fn {Function} Event handler to be removed. + */ + this.unsubscribe = function (fn) { + for (var i = handlers.length - 1; i >= 0; i--) { + if (handlers[i] === fn) { + handlers.splice(i, 1); + } + } + }; + + /*** + * Fires an event notifying all subscribers. + * @method notify + * @param args {Object} Additional data object to be passed to all handlers. + * @param e {EventData} + * Optional. + * An EventData object to be passed to all handlers. + * For DOM events, an existing W3C/jQuery event object can be passed in. + * @param scope {Object} + * Optional. + * The scope ("this") within which the handler will be executed. + * If not specified, the scope will be set to the Event instance. + */ + this.notify = function (args, e, scope) { + e = e || new EventData(); + scope = scope || this; + + var returnValue; + for (var i = 0; i < handlers.length && !(e.isPropagationStopped() || e.isImmediatePropagationStopped()); i++) { + returnValue = handlers[i].call(scope, e, args); + } + + return returnValue; + }; + } + + function EventHandler() { + var handlers = []; + + this.subscribe = function (event, handler) { + handlers.push({ + event: event, + handler: handler + }); + event.subscribe(handler); + + return this; // allow chaining + }; + + this.unsubscribe = function (event, handler) { + var i = handlers.length; + while (i--) { + if (handlers[i].event === event && + handlers[i].handler === handler) { + handlers.splice(i, 1); + event.unsubscribe(handler); + return; + } + } + + return this; // allow chaining + }; + + this.unsubscribeAll = function () { + var i = handlers.length; + while (i--) { + handlers[i].event.unsubscribe(handlers[i].handler); + } + handlers = []; + + return this; // allow chaining + } + } + + /*** + * A structure containing a range of cells. + * @class Range + * @constructor + * @param fromRow {Integer} Starting row. + * @param fromCell {Integer} Starting cell. + * @param toRow {Integer} Optional. Ending row. Defaults to fromRow. + * @param toCell {Integer} Optional. Ending cell. Defaults to fromCell. + */ + function Range(fromRow, fromCell, toRow, toCell) { + if (toRow === undefined && toCell === undefined) { + toRow = fromRow; + toCell = fromCell; + } + + /*** + * @property fromRow + * @type {Integer} + */ + this.fromRow = Math.min(fromRow, toRow); + + /*** + * @property fromCell + * @type {Integer} + */ + this.fromCell = Math.min(fromCell, toCell); + + /*** + * @property toRow + * @type {Integer} + */ + this.toRow = Math.max(fromRow, toRow); + + /*** + * @property toCell + * @type {Integer} + */ + this.toCell = Math.max(fromCell, toCell); + + /*** + * Returns whether a range represents a single row. + * @method isSingleRow + * @return {Boolean} + */ + this.isSingleRow = function () { + return this.fromRow == this.toRow; + }; + + /*** + * Returns whether a range represents a single cell. + * @method isSingleCell + * @return {Boolean} + */ + this.isSingleCell = function () { + return this.fromRow == this.toRow && this.fromCell == this.toCell; + }; + + /*** + * Returns whether a range contains a given cell. + * @method contains + * @param row {Integer} + * @param cell {Integer} + * @return {Boolean} + */ + this.contains = function (row, cell) { + return row >= this.fromRow && row <= this.toRow && + cell >= this.fromCell && cell <= this.toCell; + }; + + /*** + * Returns a readable representation of a range. + * @method toString + * @return {String} + */ + this.toString = function () { + if (this.isSingleCell()) { + return "(" + this.fromRow + ":" + this.fromCell + ")"; + } + else { + return "(" + this.fromRow + ":" + this.fromCell + " - " + this.toRow + ":" + this.toCell + ")"; + } + } + } + + + /*** + * A base class that all special / non-data rows (like Group and GroupTotals) derive from. + * @class NonDataItem + * @constructor + */ + function NonDataItem() { + this.__nonDataRow = true; + } + + + /*** + * Information about a group of rows. + * @class Group + * @extends Slick.NonDataItem + * @constructor + */ + function Group() { + this.__group = true; + + /** + * Grouping level, starting with 0. + * @property level + * @type {Number} + */ + this.level = 0; + + /*** + * Number of rows in the group. + * @property count + * @type {Integer} + */ + this.count = 0; + + /*** + * Grouping value. + * @property value + * @type {Object} + */ + this.value = null; + + /*** + * Formatted display value of the group. + * @property title + * @type {String} + */ + this.title = null; + + /*** + * Whether a group is collapsed. + * @property collapsed + * @type {Boolean} + */ + this.collapsed = false; + + /*** + * GroupTotals, if any. + * @property totals + * @type {GroupTotals} + */ + this.totals = null; + + /** + * Rows that are part of the group. + * @property rows + * @type {Array} + */ + this.rows = []; + + /** + * Sub-groups that are part of the group. + * @property groups + * @type {Array} + */ + this.groups = null; + + /** + * A unique key used to identify the group. This key can be used in calls to DataView + * collapseGroup() or expandGroup(). + * @property groupingKey + * @type {Object} + */ + this.groupingKey = null; + } + + Group.prototype = new NonDataItem(); + + /*** + * Compares two Group instances. + * @method equals + * @return {Boolean} + * @param group {Group} Group instance to compare to. + */ + Group.prototype.equals = function (group) { + return this.value === group.value && + this.count === group.count && + this.collapsed === group.collapsed && + this.title === group.title; + }; + + /*** + * Information about group totals. + * An instance of GroupTotals will be created for each totals row and passed to the aggregators + * so that they can store arbitrary data in it. That data can later be accessed by group totals + * formatters during the display. + * @class GroupTotals + * @extends Slick.NonDataItem + * @constructor + */ + function GroupTotals() { + this.__groupTotals = true; + + /*** + * Parent Group. + * @param group + * @type {Group} + */ + this.group = null; + + /*** + * Whether the totals have been fully initialized / calculated. + * Will be set to false for lazy-calculated group totals. + * @param initialized + * @type {Boolean} + */ + this.initialized = false; + } + + GroupTotals.prototype = new NonDataItem(); + + /*** + * A locking helper to track the active edit controller and ensure that only a single controller + * can be active at a time. This prevents a whole class of state and validation synchronization + * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress + * and attempt a commit or cancel before proceeding. + * @class EditorLock + * @constructor + */ + function EditorLock() { + var activeEditController = null; + + /*** + * Returns true if a specified edit controller is active (has the edit lock). + * If the parameter is not specified, returns true if any edit controller is active. + * @method isActive + * @param editController {EditController} + * @return {Boolean} + */ + this.isActive = function (editController) { + return (editController ? activeEditController === editController : activeEditController !== null); + }; + + /*** + * Sets the specified edit controller as the active edit controller (acquire edit lock). + * If another edit controller is already active, and exception will be thrown. + * @method activate + * @param editController {EditController} edit controller acquiring the lock + */ + this.activate = function (editController) { + if (editController === activeEditController) { // already activated? + return; + } + if (activeEditController !== null) { + throw "SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController"; + } + if (!editController.commitCurrentEdit) { + throw "SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()"; + } + if (!editController.cancelCurrentEdit) { + throw "SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()"; + } + activeEditController = editController; + }; + + /*** + * Unsets the specified edit controller as the active edit controller (release edit lock). + * If the specified edit controller is not the active one, an exception will be thrown. + * @method deactivate + * @param editController {EditController} edit controller releasing the lock + */ + this.deactivate = function (editController) { + if (activeEditController !== editController) { + throw "SlickGrid.EditorLock.deactivate: specified editController is not the currently active one"; + } + activeEditController = null; + }; + + /*** + * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit + * controller and returns whether the commit attempt was successful (commit may fail due to validation + * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded + * and false otherwise. If no edit controller is active, returns true. + * @method commitCurrentEdit + * @return {Boolean} + */ + this.commitCurrentEdit = function () { + return (activeEditController ? activeEditController.commitCurrentEdit() : true); + }; + + /*** + * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit + * controller and returns whether the edit was successfully cancelled. If no edit controller is + * active, returns true. + * @method cancelCurrentEdit + * @return {Boolean} + */ + this.cancelCurrentEdit = function cancelCurrentEdit() { + return (activeEditController ? activeEditController.cancelCurrentEdit() : true); + }; + } })(jQuery); diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.dataview.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.dataview.js index 07f5900b7f..f1c1b5e34f 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.dataview.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.dataview.js @@ -1,914 +1,1126 @@ (function ($) { - $.extend(true, window, { - Slick: { - Data: { - DataView: DataView, - Aggregators: { - Avg: AvgAggregator, - Min: MinAggregator, - Max: MaxAggregator, - Sum: SumAggregator - } - } + $.extend(true, window, { + Slick: { + Data: { + DataView: DataView, + Aggregators: { + Avg: AvgAggregator, + Min: MinAggregator, + Max: MaxAggregator, + Sum: SumAggregator } - }); + } + } + }); + /*** + * A sample Model implementation. + * Provides a filtered view of the underlying data. + * + * Relies on the data item having an "id" property uniquely identifying it. + */ + function DataView(options) { + var self = this; + + var defaults = { + groupItemMetadataProvider: null, + inlineFilters: false + }; + + + // private + var idProperty = "id"; // property holding a unique row id + var items = []; // data by index + var rows = []; // data by row + var idxById = {}; // indexes by id + var rowsById = null; // rows by id; lazy-calculated + var filter = null; // filter function + var updated = null; // updated item ids + var suspend = false; // suspends the recalculation + var sortAsc = true; + var fastSortField; + var sortComparer; + var refreshHints = {}; + var prevRefreshHints = {}; + var filterArgs; + var filteredItems = []; + var compiledFilter; + var compiledFilterWithCaching; + var filterCache = []; + + // grouping + var groupingInfoDefaults = { + getter: null, + formatter: null, + comparer: function(a, b) { return a.value - b.value; }, + predefinedValues: [], + aggregators: [], + aggregateEmpty: false, + aggregateCollapsed: false, + aggregateChildGroups: false, + collapsed: false, + displayTotalsRow: true, + lazyTotalsCalculation: false + }; + var groupingInfos = []; + var groups = []; + var toggledGroupsByLevel = []; + var groupingDelimiter = ':|:'; + + var pagesize = 0; + var pagenum = 0; + var totalRows = 0; + + // events + var onRowCountChanged = new Slick.Event(); + var onRowsChanged = new Slick.Event(); + var onPagingInfoChanged = new Slick.Event(); + + options = $.extend(true, {}, defaults, options); + + + function beginUpdate() { + suspend = true; + } + + function endUpdate() { + suspend = false; + refresh(); + } + + function setRefreshHints(hints) { + refreshHints = hints; + } + + function setFilterArgs(args) { + filterArgs = args; + } + + function updateIdxById(startingIndex) { + startingIndex = startingIndex || 0; + var id; + for (var i = startingIndex, l = items.length; i < l; i++) { + id = items[i][idProperty]; + if (id === undefined) { + throw "Each data element must implement a unique 'id' property"; + } + idxById[id] = i; + } + } + + function ensureIdUniqueness() { + var id; + for (var i = 0, l = items.length; i < l; i++) { + id = items[i][idProperty]; + if (id === undefined || idxById[id] !== i) { + throw "Each data element must implement a unique 'id' property"; + } + } + } + + function getItems() { + return items; + } + + function setItems(data, objectIdProperty) { + if (objectIdProperty !== undefined) { + idProperty = objectIdProperty; + } + items = filteredItems = data; + idxById = {}; + updateIdxById(); + ensureIdUniqueness(); + refresh(); + } + + function setPagingOptions(args) { + if (args.pageSize != undefined) { + pagesize = args.pageSize; + pagenum = pagesize ? Math.min(pagenum, Math.max(0, Math.ceil(totalRows / pagesize) - 1)) : 0; + } + + if (args.pageNum != undefined) { + pagenum = Math.min(args.pageNum, Math.max(0, Math.ceil(totalRows / pagesize) - 1)); + } + + onPagingInfoChanged.notify(getPagingInfo(), null, self); + + refresh(); + } + + function getPagingInfo() { + var totalPages = pagesize ? Math.max(1, Math.ceil(totalRows / pagesize)) : 1; + return {pageSize: pagesize, pageNum: pagenum, totalRows: totalRows, totalPages: totalPages}; + } + + function sort(comparer, ascending) { + sortAsc = ascending; + sortComparer = comparer; + fastSortField = null; + if (ascending === false) { + items.reverse(); + } + items.sort(comparer); + if (ascending === false) { + items.reverse(); + } + idxById = {}; + updateIdxById(); + refresh(); + } + /*** - * A sample Model implementation. - * Provides a filtered view of the underlying data. - * - * Relies on the data item having an "id" property uniquely identifying it. + * Provides a workaround for the extremely slow sorting in IE. + * Does a [lexicographic] sort on a give column by temporarily overriding Object.prototype.toString + * to return the value of that field and then doing a native Array.sort(). */ - function DataView(options) { - var self = this; + function fastSort(field, ascending) { + sortAsc = ascending; + fastSortField = field; + sortComparer = null; + var oldToString = Object.prototype.toString; + Object.prototype.toString = (typeof field == "function") ? field : function () { + return this[field] + }; + // an extra reversal for descending sort keeps the sort stable + // (assuming a stable native sort implementation, which isn't true in some cases) + if (ascending === false) { + items.reverse(); + } + items.sort(); + Object.prototype.toString = oldToString; + if (ascending === false) { + items.reverse(); + } + idxById = {}; + updateIdxById(); + refresh(); + } - var defaults = { - groupItemMetadataProvider: null, - inlineFilters: false - }; + function reSort() { + if (sortComparer) { + sort(sortComparer, sortAsc); + } else if (fastSortField) { + fastSort(fastSortField, sortAsc); + } + } + function setFilter(filterFn) { + filter = filterFn; + if (options.inlineFilters) { + compiledFilter = compileFilter(); + compiledFilterWithCaching = compileFilterWithCaching(); + } + refresh(); + } - // private - var idProperty = "id"; // property holding a unique row id - var items = []; // data by index - var rows = []; // data by row - var idxById = {}; // indexes by id - var rowsById = null; // rows by id; lazy-calculated - var filter = null; // filter function - var updated = null; // updated item ids - var suspend = false; // suspends the recalculation - var sortAsc = true; - var fastSortField; - var sortComparer; - var refreshHints = {}; - var prevRefreshHints = {}; - var filterArgs; - var filteredItems = []; - var compiledFilter; - var compiledFilterWithCaching; - var filterCache = []; + function getGrouping() { + return groupingInfos; + } - // grouping - var groupingGetter; - var groupingGetterIsAFn; - var groupingFormatter; - var groupingComparer; - var groups = []; - var collapsedGroups = {}; - var aggregators; - var aggregateCollapsed = false; - var compiledAccumulators; + function setGrouping(groupingInfo) { + if (!options.groupItemMetadataProvider) { + options.groupItemMetadataProvider = new Slick.Data.GroupItemMetadataProvider(); + } - var pagesize = 0; - var pagenum = 0; - var totalRows = 0; + groups = []; + toggledGroupsByLevel = []; + groupingInfo = groupingInfo || []; + groupingInfos = (groupingInfo instanceof Array) ? groupingInfo : [groupingInfo]; - // events - var onRowCountChanged = new Slick.Event(); - var onRowsChanged = new Slick.Event(); - var onPagingInfoChanged = new Slick.Event(); + for (var i = 0; i < groupingInfos.length; i++) { + var gi = groupingInfos[i] = $.extend(true, {}, groupingInfoDefaults, groupingInfos[i]); + gi.getterIsAFn = typeof gi.getter === "function"; - options = $.extend(true, {}, defaults, options); - - - function beginUpdate() { - suspend = true; + // pre-compile accumulator loops + gi.compiledAccumulators = []; + var idx = gi.aggregators.length; + while (idx--) { + gi.compiledAccumulators[idx] = compileAccumulatorLoop(gi.aggregators[idx]); } - function endUpdate() { - suspend = false; - refresh(); + toggledGroupsByLevel[i] = {}; + } + + refresh(); + } + + /** + * @deprecated Please use {@link setGrouping}. + */ + function groupBy(valueGetter, valueFormatter, sortComparer) { + if (valueGetter == null) { + setGrouping([]); + return; + } + + setGrouping({ + getter: valueGetter, + formatter: valueFormatter, + comparer: sortComparer + }); + } + + /** + * @deprecated Please use {@link setGrouping}. + */ + function setAggregators(groupAggregators, includeCollapsed) { + if (!groupingInfos.length) { + throw new Error("At least one grouping must be specified before calling setAggregators()."); + } + + groupingInfos[0].aggregators = groupAggregators; + groupingInfos[0].aggregateCollapsed = includeCollapsed; + + setGrouping(groupingInfos); + } + + function getItemByIdx(i) { + return items[i]; + } + + function getIdxById(id) { + return idxById[id]; + } + + function ensureRowsByIdCache() { + if (!rowsById) { + rowsById = {}; + for (var i = 0, l = rows.length; i < l; i++) { + rowsById[rows[i][idProperty]] = i; + } + } + } + + function getRowById(id) { + ensureRowsByIdCache(); + return rowsById[id]; + } + + function getItemById(id) { + return items[idxById[id]]; + } + + function mapIdsToRows(idArray) { + var rows = []; + ensureRowsByIdCache(); + for (var i = 0, l = idArray.length; i < l; i++) { + var row = rowsById[idArray[i]]; + if (row != null) { + rows[rows.length] = row; + } + } + return rows; + } + + function mapRowsToIds(rowArray) { + var ids = []; + for (var i = 0, l = rowArray.length; i < l; i++) { + if (rowArray[i] < rows.length) { + ids[ids.length] = rows[rowArray[i]][idProperty]; + } + } + return ids; + } + + function updateItem(id, item) { + if (idxById[id] === undefined || id !== item[idProperty]) { + throw "Invalid or non-matching id"; + } + items[idxById[id]] = item; + if (!updated) { + updated = {}; + } + updated[id] = true; + refresh(); + } + + function insertItem(insertBefore, item) { + items.splice(insertBefore, 0, item); + updateIdxById(insertBefore); + refresh(); + } + + function addItem(item) { + items.push(item); + updateIdxById(items.length - 1); + refresh(); + } + + function deleteItem(id) { + var idx = idxById[id]; + if (idx === undefined) { + throw "Invalid id"; + } + delete idxById[id]; + items.splice(idx, 1); + updateIdxById(idx); + refresh(); + } + + function getLength() { + return rows.length; + } + + function getItem(i) { + var item = rows[i]; + + // if this is a group row, make sure totals are calculated and update the title + if (item && item.__group && item.totals && !item.totals.initialized) { + var gi = groupingInfos[item.level]; + if (!gi.displayTotalsRow) { + calculateTotals(item.totals); + item.title = gi.formatter ? gi.formatter(item) : item.value; + } + } + // if this is a totals row, make sure it's calculated + else if (item && item.__groupTotals && !item.initialized) { + calculateTotals(item); + } + + return item; + } + + function getItemMetadata(i) { + var item = rows[i]; + if (item === undefined) { + return null; + } + + // overrides for grouping rows + if (item.__group) { + return options.groupItemMetadataProvider.getGroupRowMetadata(item); + } + + // overrides for totals rows + if (item.__groupTotals) { + return options.groupItemMetadataProvider.getTotalsRowMetadata(item); + } + + return null; + } + + function expandCollapseAllGroups(level, collapse) { + if (level == null) { + for (var i = 0; i < groupingInfos.length; i++) { + toggledGroupsByLevel[i] = {}; + groupingInfos[i].collapsed = collapse; + } + } else { + toggledGroupsByLevel[level] = {}; + groupingInfos[level].collapsed = collapse; + } + refresh(); + } + + /** + * @param level {Number} Optional level to collapse. If not specified, applies to all levels. + */ + function collapseAllGroups(level) { + expandCollapseAllGroups(level, true); + } + + /** + * @param level {Number} Optional level to expand. If not specified, applies to all levels. + */ + function expandAllGroups(level) { + expandCollapseAllGroups(level, false); + } + + function expandCollapseGroup(level, groupingKey, collapse) { + toggledGroupsByLevel[level][groupingKey] = groupingInfos[level].collapsed ^ collapse; + refresh(); + } + + /** + * @param varArgs Either a Slick.Group's "groupingKey" property, or a + * variable argument list of grouping values denoting a unique path to the row. For + * example, calling collapseGroup('high', '10%') will collapse the '10%' subgroup of + * the 'high' group. + */ + function collapseGroup(varArgs) { + var args = Array.prototype.slice.call(arguments); + var arg0 = args[0]; + if (args.length == 1 && arg0.indexOf(groupingDelimiter) != -1) { + expandCollapseGroup(arg0.split(groupingDelimiter).length - 1, arg0, true); + } else { + expandCollapseGroup(args.length - 1, args.join(groupingDelimiter), true); + } + } + + /** + * @param varArgs Either a Slick.Group's "groupingKey" property, or a + * variable argument list of grouping values denoting a unique path to the row. For + * example, calling expandGroup('high', '10%') will expand the '10%' subgroup of + * the 'high' group. + */ + function expandGroup(varArgs) { + var args = Array.prototype.slice.call(arguments); + var arg0 = args[0]; + if (args.length == 1 && arg0.indexOf(groupingDelimiter) != -1) { + expandCollapseGroup(arg0.split(groupingDelimiter).length - 1, arg0, false); + } else { + expandCollapseGroup(args.length - 1, args.join(groupingDelimiter), false); + } + } + + function getGroups() { + return groups; + } + + function extractGroups(rows, parentGroup) { + var group; + var val; + var groups = []; + var groupsByVal = {}; + var r; + var level = parentGroup ? parentGroup.level + 1 : 0; + var gi = groupingInfos[level]; + + for (var i = 0, l = gi.predefinedValues.length; i < l; i++) { + val = gi.predefinedValues[i]; + group = groupsByVal[val]; + if (!group) { + group = new Slick.Group(); + group.value = val; + group.level = level; + group.groupingKey = (parentGroup ? parentGroup.groupingKey + groupingDelimiter : '') + val; + groups[groups.length] = group; + groupsByVal[val] = group; + } + } + + for (var i = 0, l = rows.length; i < l; i++) { + r = rows[i]; + val = gi.getterIsAFn ? gi.getter(r) : r[gi.getter]; + group = groupsByVal[val]; + if (!group) { + group = new Slick.Group(); + group.value = val; + group.level = level; + group.groupingKey = (parentGroup ? parentGroup.groupingKey + groupingDelimiter : '') + val; + groups[groups.length] = group; + groupsByVal[val] = group; } - function setRefreshHints(hints) { - refreshHints = hints; + group.rows[group.count++] = r; + } + + if (level < groupingInfos.length - 1) { + for (var i = 0; i < groups.length; i++) { + group = groups[i]; + group.groups = extractGroups(group.rows, group); + } + } + + groups.sort(groupingInfos[level].comparer); + + return groups; + } + + function calculateTotals(totals) { + var group = totals.group; + var gi = groupingInfos[group.level]; + var isLeafLevel = (group.level == groupingInfos.length); + var agg, idx = gi.aggregators.length; + + if (!isLeafLevel && gi.aggregateChildGroups) { + // make sure all the subgroups are calculated + var i = group.groups.length; + while (i--) { + if (!group.groups[i].initialized) { + calculateTotals(group.groups[i]); + } + } + } + + while (idx--) { + agg = gi.aggregators[idx]; + agg.init(); + if (!isLeafLevel && gi.aggregateChildGroups) { + gi.compiledAccumulators[idx].call(agg, group.groups); + } else { + gi.compiledAccumulators[idx].call(agg, group.rows); + } + agg.storeResult(totals); + } + totals.initialized = true; + } + + function addGroupTotals(group) { + var gi = groupingInfos[group.level]; + var totals = new Slick.GroupTotals(); + totals.group = group; + group.totals = totals; + if (!gi.lazyTotalsCalculation) { + calculateTotals(totals); + } + } + + function addTotals(groups, level) { + level = level || 0; + var gi = groupingInfos[level]; + var groupCollapsed = gi.collapsed; + var toggledGroups = toggledGroupsByLevel[level]; + var idx = groups.length, g; + while (idx--) { + g = groups[idx]; + + if (g.collapsed && !gi.aggregateCollapsed) { + continue; } - function setFilterArgs(args) { - filterArgs = args; + // Do a depth-first aggregation so that parent group aggregators can access subgroup totals. + if (g.groups) { + addTotals(g.groups, level + 1); } - function updateIdxById(startingIndex) { - startingIndex = startingIndex || 0; - var id; - for (var i = startingIndex, l = items.length; i < l; i++) { - id = items[i][idProperty]; - if (id === undefined) { - throw "Each data element must implement a unique 'id' property"; - } - idxById[id] = i; + if (gi.aggregators.length && ( + gi.aggregateEmpty || g.rows.length || (g.groups && g.groups.length))) { + addGroupTotals(g); + } + + g.collapsed = groupCollapsed ^ toggledGroups[g.groupingKey]; + g.title = gi.formatter ? gi.formatter(g) : g.value; + } + } + + function flattenGroupedRows(groups, level) { + level = level || 0; + var gi = groupingInfos[level]; + var groupedRows = [], rows, gl = 0, g; + for (var i = 0, l = groups.length; i < l; i++) { + g = groups[i]; + groupedRows[gl++] = g; + + if (!g.collapsed) { + rows = g.groups ? flattenGroupedRows(g.groups, level + 1) : g.rows; + for (var j = 0, jj = rows.length; j < jj; j++) { + groupedRows[gl++] = rows[j]; + } + } + + if (g.totals && gi.displayTotalsRow && (!g.collapsed || gi.aggregateCollapsed)) { + groupedRows[gl++] = g.totals; + } + } + return groupedRows; + } + + function getFunctionInfo(fn) { + var fnRegex = /^function[^(]*\(([^)]*)\)\s*{([\s\S]*)}$/; + var matches = fn.toString().match(fnRegex); + return { + params: matches[1].split(","), + body: matches[2] + }; + } + + function compileAccumulatorLoop(aggregator) { + var accumulatorInfo = getFunctionInfo(aggregator.accumulate); + var fn = new Function( + "_items", + "for (var " + accumulatorInfo.params[0] + ", _i=0, _il=_items.length; _i<_il; _i++) {" + + accumulatorInfo.params[0] + " = _items[_i]; " + + accumulatorInfo.body + + "}" + ); + fn.displayName = fn.name = "compiledAccumulatorLoop"; + return fn; + } + + function compileFilter() { + var filterInfo = getFunctionInfo(filter); + + var filterBody = filterInfo.body + .replace(/return false\s*([;}]|$)/gi, "{ continue _coreloop; }$1") + .replace(/return true\s*([;}]|$)/gi, "{ _retval[_idx++] = $item$; continue _coreloop; }$1") + .replace(/return ([^;}]+?)\s*([;}]|$)/gi, + "{ if ($1) { _retval[_idx++] = $item$; }; continue _coreloop; }$2"); + + // This preserves the function template code after JS compression, + // so that replace() commands still work as expected. + var tpl = [ + //"function(_items, _args) { ", + "var _retval = [], _idx = 0; ", + "var $item$, $args$ = _args; ", + "_coreloop: ", + "for (var _i = 0, _il = _items.length; _i < _il; _i++) { ", + "$item$ = _items[_i]; ", + "$filter$; ", + "} ", + "return _retval; " + //"}" + ].join(""); + tpl = tpl.replace(/\$filter\$/gi, filterBody); + tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]); + tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]); + + var fn = new Function("_items,_args", tpl); + fn.displayName = fn.name = "compiledFilter"; + return fn; + } + + function compileFilterWithCaching() { + var filterInfo = getFunctionInfo(filter); + + var filterBody = filterInfo.body + .replace(/return false\s*([;}]|$)/gi, "{ continue _coreloop; }$1") + .replace(/return true\s*([;}]|$)/gi, "{ _cache[_i] = true;_retval[_idx++] = $item$; continue _coreloop; }$1") + .replace(/return ([^;}]+?)\s*([;}]|$)/gi, + "{ if ((_cache[_i] = $1)) { _retval[_idx++] = $item$; }; continue _coreloop; }$2"); + + // This preserves the function template code after JS compression, + // so that replace() commands still work as expected. + var tpl = [ + //"function(_items, _args, _cache) { ", + "var _retval = [], _idx = 0; ", + "var $item$, $args$ = _args; ", + "_coreloop: ", + "for (var _i = 0, _il = _items.length; _i < _il; _i++) { ", + "$item$ = _items[_i]; ", + "if (_cache[_i]) { ", + "_retval[_idx++] = $item$; ", + "continue _coreloop; ", + "} ", + "$filter$; ", + "} ", + "return _retval; " + //"}" + ].join(""); + tpl = tpl.replace(/\$filter\$/gi, filterBody); + tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]); + tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]); + + var fn = new Function("_items,_args,_cache", tpl); + fn.displayName = fn.name = "compiledFilterWithCaching"; + return fn; + } + + function uncompiledFilter(items, args) { + var retval = [], idx = 0; + + for (var i = 0, ii = items.length; i < ii; i++) { + if (filter(items[i], args)) { + retval[idx++] = items[i]; + } + } + + return retval; + } + + function uncompiledFilterWithCaching(items, args, cache) { + var retval = [], idx = 0, item; + + for (var i = 0, ii = items.length; i < ii; i++) { + item = items[i]; + if (cache[i]) { + retval[idx++] = item; + } else if (filter(item, args)) { + retval[idx++] = item; + cache[i] = true; + } + } + + return retval; + } + + function getFilteredAndPagedItems(items) { + if (filter) { + var batchFilter = options.inlineFilters ? compiledFilter : uncompiledFilter; + var batchFilterWithCaching = options.inlineFilters ? compiledFilterWithCaching : uncompiledFilterWithCaching; + + if (refreshHints.isFilterNarrowing) { + filteredItems = batchFilter(filteredItems, filterArgs); + } else if (refreshHints.isFilterExpanding) { + filteredItems = batchFilterWithCaching(items, filterArgs, filterCache); + } else if (!refreshHints.isFilterUnchanged) { + filteredItems = batchFilter(items, filterArgs); + } + } else { + // special case: if not filtering and not paging, the resulting + // rows collection needs to be a copy so that changes due to sort + // can be caught + filteredItems = pagesize ? items : items.concat(); + } + + // get the current page + var paged; + if (pagesize) { + if (filteredItems.length < pagenum * pagesize) { + pagenum = Math.floor(filteredItems.length / pagesize); + } + paged = filteredItems.slice(pagesize * pagenum, pagesize * pagenum + pagesize); + } else { + paged = filteredItems; + } + + return {totalRows: filteredItems.length, rows: paged}; + } + + function getRowDiffs(rows, newRows) { + var item, r, eitherIsNonData, diff = []; + var from = 0, to = newRows.length; + + if (refreshHints && refreshHints.ignoreDiffsBefore) { + from = Math.max(0, + Math.min(newRows.length, refreshHints.ignoreDiffsBefore)); + } + + if (refreshHints && refreshHints.ignoreDiffsAfter) { + to = Math.min(newRows.length, + Math.max(0, refreshHints.ignoreDiffsAfter)); + } + + for (var i = from, rl = rows.length; i < to; i++) { + if (i >= rl) { + diff[diff.length] = i; + } else { + item = newRows[i]; + r = rows[i]; + + if ((groupingInfos.length && (eitherIsNonData = (item.__nonDataRow) || (r.__nonDataRow)) && + item.__group !== r.__group || + item.__group && !item.equals(r)) + || (eitherIsNonData && + // no good way to compare totals since they are arbitrary DTOs + // deep object comparison is pretty expensive + // always considering them 'dirty' seems easier for the time being + (item.__groupTotals || r.__groupTotals)) + || item[idProperty] != r[idProperty] + || (updated && updated[item[idProperty]]) + ) { + diff[diff.length] = i; + } + } + } + return diff; + } + + function recalc(_items) { + rowsById = null; + + if (refreshHints.isFilterNarrowing != prevRefreshHints.isFilterNarrowing || + refreshHints.isFilterExpanding != prevRefreshHints.isFilterExpanding) { + filterCache = []; + } + + var filteredItems = getFilteredAndPagedItems(_items); + totalRows = filteredItems.totalRows; + var newRows = filteredItems.rows; + + groups = []; + if (groupingInfos.length) { + groups = extractGroups(newRows); + if (groups.length) { + addTotals(groups); + newRows = flattenGroupedRows(groups); + } + } + + var diff = getRowDiffs(rows, newRows); + + rows = newRows; + + return diff; + } + + function refresh() { + if (suspend) { + return; + } + + var countBefore = rows.length; + var totalRowsBefore = totalRows; + + var diff = recalc(items, filter); // pass as direct refs to avoid closure perf hit + + // if the current page is no longer valid, go to last page and recalc + // we suffer a performance penalty here, but the main loop (recalc) remains highly optimized + if (pagesize && totalRows < pagenum * pagesize) { + pagenum = Math.max(0, Math.ceil(totalRows / pagesize) - 1); + diff = recalc(items, filter); + } + + updated = null; + prevRefreshHints = refreshHints; + refreshHints = {}; + + if (totalRowsBefore != totalRows) { + onPagingInfoChanged.notify(getPagingInfo(), null, self); + } + if (countBefore != rows.length) { + onRowCountChanged.notify({previous: countBefore, current: rows.length}, null, self); + } + if (diff.length > 0) { + onRowsChanged.notify({rows: diff}, null, self); + } + } + + /*** + * Wires the grid and the DataView together to keep row selection tied to item ids. + * This is useful since, without it, the grid only knows about rows, so if the items + * move around, the same rows stay selected instead of the selection moving along + * with the items. + * + * NOTE: This doesn't work with cell selection model. + * + * @param grid {Slick.Grid} The grid to sync selection with. + * @param preserveHidden {Boolean} Whether to keep selected items that go out of the + * view due to them getting filtered out. + * @param preserveHiddenOnSelectionChange {Boolean} Whether to keep selected items + * that are currently out of the view (see preserveHidden) as selected when selection + * changes. + * @return {Slick.Event} An event that notifies when an internal list of selected row ids + * changes. This is useful since, in combination with the above two options, it allows + * access to the full list selected row ids, and not just the ones visible to the grid. + * @method syncGridSelection + */ + function syncGridSelection(grid, preserveHidden, preserveHiddenOnSelectionChange) { + var self = this; + var inHandler; + var selectedRowIds = self.mapRowsToIds(grid.getSelectedRows()); + var onSelectedRowIdsChanged = new Slick.Event(); + + function setSelectedRowIds(rowIds) { + if (selectedRowIds.join(",") == rowIds.join(",")) { + return; + } + + selectedRowIds = rowIds; + + onSelectedRowIdsChanged.notify({ + "grid": grid, + "ids": selectedRowIds + }, new Slick.EventData(), self); + } + + function update() { + if (selectedRowIds.length > 0) { + inHandler = true; + var selectedRows = self.mapIdsToRows(selectedRowIds); + if (!preserveHidden) { + setSelectedRowIds(self.mapRowsToIds(selectedRows)); + } + grid.setSelectedRows(selectedRows); + inHandler = false; + } + } + + grid.onSelectedRowsChanged.subscribe(function(e, args) { + if (inHandler) { return; } + var newSelectedRowIds = self.mapRowsToIds(grid.getSelectedRows()); + if (!preserveHiddenOnSelectionChange || !grid.getOptions().multiSelect) { + setSelectedRowIds(newSelectedRowIds); + } else { + // keep the ones that are hidden + var existing = $.grep(selectedRowIds, function(id) { return self.getRowById(id) === undefined; }); + // add the newly selected ones + setSelectedRowIds(existing.concat(newSelectedRowIds)); + } + }); + + this.onRowsChanged.subscribe(update); + + this.onRowCountChanged.subscribe(update); + + return onSelectedRowIdsChanged; + } + + function syncGridCellCssStyles(grid, key) { + var hashById; + var inHandler; + + // since this method can be called after the cell styles have been set, + // get the existing ones right away + storeCellCssStyles(grid.getCellCssStyles(key)); + + function storeCellCssStyles(hash) { + hashById = {}; + for (var row in hash) { + var id = rows[row][idProperty]; + hashById[id] = hash[row]; + } + } + + function update() { + if (hashById) { + inHandler = true; + ensureRowsByIdCache(); + var newHash = {}; + for (var id in hashById) { + var row = rowsById[id]; + if (row != undefined) { + newHash[row] = hashById[id]; } + } + grid.setCellCssStyles(key, newHash); + inHandler = false; } + } - function ensureIdUniqueness() { - var id; - for (var i = 0, l = items.length; i < l; i++) { - id = items[i][idProperty]; - if (id === undefined || idxById[id] !== i) { - throw "Each data element must implement a unique 'id' property"; - } - } + grid.onCellCssStylesChanged.subscribe(function(e, args) { + if (inHandler) { return; } + if (key != args.key) { return; } + if (args.hash) { + storeCellCssStyles(args.hash); } + }); - function getItems() { - return items; + this.onRowsChanged.subscribe(update); + + this.onRowCountChanged.subscribe(update); + } + + $.extend(this, { + // methods + "beginUpdate": beginUpdate, + "endUpdate": endUpdate, + "setPagingOptions": setPagingOptions, + "getPagingInfo": getPagingInfo, + "getItems": getItems, + "setItems": setItems, + "setFilter": setFilter, + "sort": sort, + "fastSort": fastSort, + "reSort": reSort, + "setGrouping": setGrouping, + "getGrouping": getGrouping, + "groupBy": groupBy, + "setAggregators": setAggregators, + "collapseAllGroups": collapseAllGroups, + "expandAllGroups": expandAllGroups, + "collapseGroup": collapseGroup, + "expandGroup": expandGroup, + "getGroups": getGroups, + "getIdxById": getIdxById, + "getRowById": getRowById, + "getItemById": getItemById, + "getItemByIdx": getItemByIdx, + "mapRowsToIds": mapRowsToIds, + "mapIdsToRows": mapIdsToRows, + "setRefreshHints": setRefreshHints, + "setFilterArgs": setFilterArgs, + "refresh": refresh, + "updateItem": updateItem, + "insertItem": insertItem, + "addItem": addItem, + "deleteItem": deleteItem, + "syncGridSelection": syncGridSelection, + "syncGridCellCssStyles": syncGridCellCssStyles, + + // data provider methods + "getLength": getLength, + "getItem": getItem, + "getItemMetadata": getItemMetadata, + + // events + "onRowCountChanged": onRowCountChanged, + "onRowsChanged": onRowsChanged, + "onPagingInfoChanged": onPagingInfoChanged + }); + } + + function AvgAggregator(field) { + this.field_ = field; + + this.init = function () { + this.count_ = 0; + this.nonNullCount_ = 0; + this.sum_ = 0; + }; + + this.accumulate = function (item) { + var val = item[this.field_]; + this.count_++; + if (val != null && val !== "" && val !== NaN) { + this.nonNullCount_++; + this.sum_ += parseFloat(val); + } + }; + + this.storeResult = function (groupTotals) { + if (!groupTotals.avg) { + groupTotals.avg = {}; + } + if (this.nonNullCount_ != 0) { + groupTotals.avg[this.field_] = this.sum_ / this.nonNullCount_; + } + }; + } + + function MinAggregator(field) { + this.field_ = field; + + this.init = function () { + this.min_ = null; + }; + + this.accumulate = function (item) { + var val = item[this.field_]; + if (val != null && val !== "" && val !== NaN) { + if (this.min_ == null || val < this.min_) { + this.min_ = val; } + } + }; - function setItems(data, objectIdProperty) { - if (objectIdProperty !== undefined) { - idProperty = objectIdProperty; - } - items = filteredItems = data; - idxById = {}; - updateIdxById(); - ensureIdUniqueness(); - refresh(); + this.storeResult = function (groupTotals) { + if (!groupTotals.min) { + groupTotals.min = {}; + } + groupTotals.min[this.field_] = this.min_; + } + } + + function MaxAggregator(field) { + this.field_ = field; + + this.init = function () { + this.max_ = null; + }; + + this.accumulate = function (item) { + var val = item[this.field_]; + if (val != null && val !== "" && val !== NaN) { + if (this.max_ == null || val > this.max_) { + this.max_ = val; } - - function setPagingOptions(args) { - if (args.pageSize != undefined) { - pagesize = args.pageSize; - pagenum = pagesize ? Math.min(pagenum, Math.max(0, Math.ceil(totalRows / pagesize) - 1)) : 0; - } - - if (args.pageNum != undefined) { - pagenum = Math.min(args.pageNum, Math.max(0, Math.ceil(totalRows / pagesize) - 1)); - } - - onPagingInfoChanged.notify(getPagingInfo(), null, self); - - refresh(); - } - - function getPagingInfo() { - var totalPages = pagesize ? Math.max(1, Math.ceil(totalRows / pagesize)) : 1; - return {pageSize: pagesize, pageNum: pagenum, totalRows: totalRows, totalPages: totalPages}; - } - - function sort(comparer, ascending) { - sortAsc = ascending; - sortComparer = comparer; - fastSortField = null; - if (ascending === false) { - items.reverse(); - } - items.sort(comparer); - if (ascending === false) { - items.reverse(); - } - idxById = {}; - updateIdxById(); - refresh(); - } - - /*** - * Provides a workaround for the extremely slow sorting in IE. - * Does a [lexicographic] sort on a give column by temporarily overriding Object.prototype.toString - * to return the value of that field and then doing a native Array.sort(). - */ - function fastSort(field, ascending) { - sortAsc = ascending; - fastSortField = field; - sortComparer = null; - var oldToString = Object.prototype.toString; - Object.prototype.toString = (typeof field == "function") ? field : function () { - return this[field] - }; - // an extra reversal for descending sort keeps the sort stable - // (assuming a stable native sort implementation, which isn't true in some cases) - if (ascending === false) { - items.reverse(); - } - items.sort(); - Object.prototype.toString = oldToString; - if (ascending === false) { - items.reverse(); - } - idxById = {}; - updateIdxById(); - refresh(); - } - - function reSort() { - if (sortComparer) { - sort(sortComparer, sortAsc); - } else if (fastSortField) { - fastSort(fastSortField, sortAsc); - } - } - - function setFilter(filterFn) { - filter = filterFn; - if (options.inlineFilters) { - compiledFilter = compileFilter(); - compiledFilterWithCaching = compileFilterWithCaching(); - } - refresh(); - } - - function groupBy(valueGetter, valueFormatter, sortComparer) { - if (!options.groupItemMetadataProvider) { - options.groupItemMetadataProvider = new Slick.Data.GroupItemMetadataProvider(); - } - - groupingGetter = valueGetter; - groupingGetterIsAFn = typeof groupingGetter === "function"; - groupingFormatter = valueFormatter; - groupingComparer = sortComparer; - collapsedGroups = {}; - groups = []; - refresh(); - } - - function setAggregators(groupAggregators, includeCollapsed) { - aggregators = groupAggregators; - aggregateCollapsed = (includeCollapsed !== undefined) - ? includeCollapsed : aggregateCollapsed; - - // pre-compile accumulator loops - compiledAccumulators = []; - var idx = aggregators.length; - while (idx--) { - compiledAccumulators[idx] = compileAccumulatorLoop(aggregators[idx]); - } - - refresh(); - } - - function getItemByIdx(i) { - return items[i]; - } - - function getIdxById(id) { - return idxById[id]; - } - - function ensureRowsByIdCache() { - if (!rowsById) { - rowsById = {}; - for (var i = 0, l = rows.length; i < l; i++) { - rowsById[rows[i][idProperty]] = i; - } - } - } - - function getRowById(id) { - ensureRowsByIdCache(); - return rowsById[id]; - } - - function getItemById(id) { - return items[idxById[id]]; - } - - function mapIdsToRows(idArray) { - var rows = []; - ensureRowsByIdCache(); - for (var i = 0; i < idArray.length; i++) { - var row = rowsById[idArray[i]]; - if (row != null) { - rows[rows.length] = row; - } - } - return rows; - } - - function mapRowsToIds(rowArray) { - var ids = []; - for (var i = 0; i < rowArray.length; i++) { - if (rowArray[i] < rows.length) { - ids[ids.length] = rows[rowArray[i]][idProperty]; - } - } - return ids; - } - - function updateItem(id, item) { - if (idxById[id] === undefined || id !== item[idProperty]) { - throw "Invalid or non-matching id"; - } - items[idxById[id]] = item; - if (!updated) { - updated = {}; - } - updated[id] = true; - refresh(); - } - - function insertItem(insertBefore, item) { - items.splice(insertBefore, 0, item); - updateIdxById(insertBefore); - refresh(); - } - - function addItem(item) { - items.push(item); - updateIdxById(items.length - 1); - refresh(); - } - - function deleteItem(id) { - var idx = idxById[id]; - if (idx === undefined) { - throw "Invalid id"; - } - delete idxById[id]; - items.splice(idx, 1); - updateIdxById(idx); - refresh(); - } - - function getLength() { - return rows.length; - } - - function getItem(i) { - return rows[i]; - } - - function getItemMetadata(i) { - var item = rows[i]; - if (item === undefined) { - return null; - } - - // overrides for group rows - if (item.__group) { - return options.groupItemMetadataProvider.getGroupRowMetadata(item); - } - - // overrides for totals rows - if (item.__groupTotals) { - return options.groupItemMetadataProvider.getTotalsRowMetadata(item); - } - - return null; - } - - function collapseGroup(groupingValue) { - collapsedGroups[groupingValue] = true; - refresh(); - } - - function expandGroup(groupingValue) { - delete collapsedGroups[groupingValue]; - refresh(); - } - - function getGroups() { - return groups; - } - - function extractGroups(rows) { - var group; - var val; - var groups = []; - var groupsByVal = []; - var r; - - for (var i = 0, l = rows.length; i < l; i++) { - r = rows[i]; - val = (groupingGetterIsAFn) ? groupingGetter(r) : r[groupingGetter]; - val = val || 0; - group = groupsByVal[val]; - if (!group) { - group = new Slick.Group(); - group.count = 0; - group.value = val; - group.rows = []; - groups[groups.length] = group; - groupsByVal[val] = group; - } - - group.rows[group.count++] = r; - } - - return groups; - } - - // TODO: lazy totals calculation - function calculateGroupTotals(group) { - if (group.collapsed && !aggregateCollapsed) { - return; - } - - // TODO: try moving iterating over groups into compiled accumulator - var totals = new Slick.GroupTotals(); - var agg, idx = aggregators.length; - while (idx--) { - agg = aggregators[idx]; - agg.init(); - compiledAccumulators[idx].call(agg, group.rows); - agg.storeResult(totals); - } - totals.group = group; - group.totals = totals; - } - - function calculateTotals(groups) { - var idx = groups.length; - while (idx--) { - calculateGroupTotals(groups[idx]); - } - } - - function finalizeGroups(groups) { - var idx = groups.length, g; - while (idx--) { - g = groups[idx]; - g.collapsed = (g.value in collapsedGroups); - g.title = groupingFormatter ? groupingFormatter(g) : g.value; - } - } - - function flattenGroupedRows(groups) { - var groupedRows = [], gl = 0, g; - for (var i = 0, l = groups.length; i < l; i++) { - g = groups[i]; - groupedRows[gl++] = g; - - if (!g.collapsed) { - for (var j = 0, jj = g.rows.length; j < jj; j++) { - groupedRows[gl++] = g.rows[j]; - } - } - - if (g.totals && (!g.collapsed || aggregateCollapsed)) { - groupedRows[gl++] = g.totals; - } - } - return groupedRows; - } - - function getFunctionInfo(fn) { - var fnRegex = /^function[^(]*\(([^)]*)\)\s*{([\s\S]*)}$/; - var matches = fn.toString().match(fnRegex); - return { - params: matches[1].split(","), - body: matches[2] - }; - } - - function compileAccumulatorLoop(aggregator) { - var accumulatorInfo = getFunctionInfo(aggregator.accumulate); - var fn = new Function( - "_items", - "for (var " + accumulatorInfo.params[0] + ", _i=0, _il=_items.length; _i<_il; _i++) {" + - accumulatorInfo.params[0] + " = _items[_i]; " + - accumulatorInfo.body + - "}" - ); - fn.displayName = fn.name = "compiledAccumulatorLoop"; - return fn; - } - - function compileFilter() { - var filterInfo = getFunctionInfo(filter); - - var filterBody = filterInfo.body - .replace(/return false[;}]/gi, "{ continue _coreloop; }") - .replace(/return true[;}]/gi, "{ _retval[_idx++] = $item$; continue _coreloop; }") - .replace(/return ([^;}]+?);/gi, - "{ if ($1) { _retval[_idx++] = $item$; }; continue _coreloop; }"); - - // This preserves the function template code after JS compression, - // so that replace() commands still work as expected. - var tpl = [ - //"function(_items, _args) { ", - "var _retval = [], _idx = 0; ", - "var $item$, $args$ = _args; ", - "_coreloop: ", - "for (var _i = 0, _il = _items.length; _i < _il; _i++) { ", - "$item$ = _items[_i]; ", - "$filter$; ", - "} ", - "return _retval; " - //"}" - ].join(""); - tpl = tpl.replace(/\$filter\$/gi, filterBody); - tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]); - tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]); - - var fn = new Function("_items,_args", tpl); - fn.displayName = fn.name = "compiledFilter"; - return fn; - } - - function compileFilterWithCaching() { - var filterInfo = getFunctionInfo(filter); - - var filterBody = filterInfo.body - .replace(/return false[;}]/gi, "{ continue _coreloop; }") - .replace(/return true[;}]/gi, "{ _cache[_i] = true;_retval[_idx++] = $item$; continue _coreloop; }") - .replace(/return ([^;}]+?);/gi, - "{ if ((_cache[_i] = $1)) { _retval[_idx++] = $item$; }; continue _coreloop; }"); - - // This preserves the function template code after JS compression, - // so that replace() commands still work as expected. - var tpl = [ - //"function(_items, _args, _cache) { ", - "var _retval = [], _idx = 0; ", - "var $item$, $args$ = _args; ", - "_coreloop: ", - "for (var _i = 0, _il = _items.length; _i < _il; _i++) { ", - "$item$ = _items[_i]; ", - "if (_cache[_i]) { ", - "_retval[_idx++] = $item$; ", - "continue _coreloop; ", - "} ", - "$filter$; ", - "} ", - "return _retval; " - //"}" - ].join(""); - tpl = tpl.replace(/\$filter\$/gi, filterBody); - tpl = tpl.replace(/\$item\$/gi, filterInfo.params[0]); - tpl = tpl.replace(/\$args\$/gi, filterInfo.params[1]); - - var fn = new Function("_items,_args,_cache", tpl); - fn.displayName = fn.name = "compiledFilterWithCaching"; - return fn; - } - - function uncompiledFilter(items, args) { - var retval = [], idx = 0; - - for (var i = 0, ii = items.length; i < ii; i++) { - if (filter(items[i], args)) { - retval[idx++] = items[i]; - } - } - - return retval; - } - - function uncompiledFilterWithCaching(items, args, cache) { - var retval = [], idx = 0, item; - - for (var i = 0, ii = items.length; i < ii; i++) { - item = items[i]; - if (cache[i]) { - retval[idx++] = item; - } else if (filter(item, args)) { - retval[idx++] = item; - cache[i] = true; - } - } - - return retval; - } - - function getFilteredAndPagedItems(items) { - if (filter) { - var batchFilter = options.inlineFilters ? compiledFilter : uncompiledFilter; - var batchFilterWithCaching = options.inlineFilters ? compiledFilterWithCaching : uncompiledFilterWithCaching; - - if (refreshHints.isFilterNarrowing) { - filteredItems = batchFilter(filteredItems, filterArgs); - } else if (refreshHints.isFilterExpanding) { - filteredItems = batchFilterWithCaching(items, filterArgs, filterCache); - } else if (!refreshHints.isFilterUnchanged) { - filteredItems = batchFilter(items, filterArgs); - } - } else { - // special case: if not filtering and not paging, the resulting - // rows collection needs to be a copy so that changes due to sort - // can be caught - filteredItems = pagesize ? items : items.concat(); - } - - // get the current page - var paged; - if (pagesize) { - if (filteredItems.length < pagenum * pagesize) { - pagenum = Math.floor(filteredItems.length / pagesize); - } - paged = filteredItems.slice(pagesize * pagenum, pagesize * pagenum + pagesize); - } else { - paged = filteredItems; - } - - return {totalRows: filteredItems.length, rows: paged}; - } - - function getRowDiffs(rows, newRows) { - var item, r, eitherIsNonData, diff = []; - var from = 0, to = newRows.length; - - if (refreshHints && refreshHints.ignoreDiffsBefore) { - from = Math.max(0, - Math.min(newRows.length, refreshHints.ignoreDiffsBefore)); - } - - if (refreshHints && refreshHints.ignoreDiffsAfter) { - to = Math.min(newRows.length, - Math.max(0, refreshHints.ignoreDiffsAfter)); - } - - for (var i = from, rl = rows.length; i < to; i++) { - if (i >= rl) { - diff[diff.length] = i; - } else { - item = newRows[i]; - r = rows[i]; - - if ((groupingGetter && (eitherIsNonData = (item.__nonDataRow) || (r.__nonDataRow)) && - item.__group !== r.__group || - item.__updated || - item.__group && !item.equals(r)) - || (aggregators && eitherIsNonData && - // no good way to compare totals since they are arbitrary DTOs - // deep object comparison is pretty expensive - // always considering them 'dirty' seems easier for the time being - (item.__groupTotals || r.__groupTotals)) - || item[idProperty] != r[idProperty] - || (updated && updated[item[idProperty]]) - ) { - diff[diff.length] = i; - } - } - } - return diff; - } - - function recalc(_items) { - rowsById = null; - - if (refreshHints.isFilterNarrowing != prevRefreshHints.isFilterNarrowing || - refreshHints.isFilterExpanding != prevRefreshHints.isFilterExpanding) { - filterCache = []; - } - - var filteredItems = getFilteredAndPagedItems(_items); - totalRows = filteredItems.totalRows; - var newRows = filteredItems.rows; - - groups = []; - if (groupingGetter != null) { - groups = extractGroups(newRows); - if (groups.length) { - finalizeGroups(groups); - if (aggregators) { - calculateTotals(groups); - } - groups.sort(groupingComparer); - newRows = flattenGroupedRows(groups); - } - } - - var diff = getRowDiffs(rows, newRows); - - rows = newRows; - - return diff; - } - - function refresh() { - if (suspend) { - return; - } - - var countBefore = rows.length; - var totalRowsBefore = totalRows; - - var diff = recalc(items, filter); // pass as direct refs to avoid closure perf hit - - // if the current page is no longer valid, go to last page and recalc - // we suffer a performance penalty here, but the main loop (recalc) remains highly optimized - if (pagesize && totalRows < pagenum * pagesize) { - pagenum = Math.max(0, Math.ceil(totalRows / pagesize) - 1); - diff = recalc(items, filter); - } - - updated = null; - prevRefreshHints = refreshHints; - refreshHints = {}; - - if (totalRowsBefore != totalRows) { - onPagingInfoChanged.notify(getPagingInfo(), null, self); - } - if (countBefore != rows.length) { - onRowCountChanged.notify({previous: countBefore, current: rows.length}, null, self); - } - if (diff.length > 0) { - onRowsChanged.notify({rows: diff}, null, self); - } - } - - function syncGridSelection(grid, preserveHidden) { - var self = this; - var selectedRowIds = self.mapRowsToIds(grid.getSelectedRows()); - ; - var inHandler; - - grid.onSelectedRowsChanged.subscribe(function (e, args) { - if (inHandler) { - return; - } - selectedRowIds = self.mapRowsToIds(grid.getSelectedRows()); - }); - - this.onRowsChanged.subscribe(function (e, args) { - if (selectedRowIds.length > 0) { - inHandler = true; - var selectedRows = self.mapIdsToRows(selectedRowIds); - if (!preserveHidden) { - selectedRowIds = self.mapRowsToIds(selectedRows); - } - grid.setSelectedRows(selectedRows); - inHandler = false; - } - }); - } - - function syncGridCellCssStyles(grid, key) { - var hashById; - var inHandler; - - // since this method can be called after the cell styles have been set, - // get the existing ones right away - storeCellCssStyles(grid.getCellCssStyles(key)); - - function storeCellCssStyles(hash) { - hashById = {}; - for (var row in hash) { - var id = rows[row][idProperty]; - hashById[id] = hash[row]; - } - } - - grid.onCellCssStylesChanged.subscribe(function (e, args) { - if (inHandler) { - return; - } - if (key != args.key) { - return; - } - if (args.hash) { - storeCellCssStyles(args.hash); - } - }); - - this.onRowsChanged.subscribe(function (e, args) { - if (hashById) { - inHandler = true; - ensureRowsByIdCache(); - var newHash = {}; - for (var id in hashById) { - var row = rowsById[id]; - if (row != undefined) { - newHash[row] = hashById[id]; - } - } - grid.setCellCssStyles(key, newHash); - inHandler = false; - } - }); - } - - return { - // methods - "beginUpdate": beginUpdate, - "endUpdate": endUpdate, - "setPagingOptions": setPagingOptions, - "getPagingInfo": getPagingInfo, - "getItems": getItems, - "setItems": setItems, - "setFilter": setFilter, - "sort": sort, - "fastSort": fastSort, - "reSort": reSort, - "groupBy": groupBy, - "setAggregators": setAggregators, - "collapseGroup": collapseGroup, - "expandGroup": expandGroup, - "getGroups": getGroups, - "getIdxById": getIdxById, - "getRowById": getRowById, - "getItemById": getItemById, - "getItemByIdx": getItemByIdx, - "mapRowsToIds": mapRowsToIds, - "mapIdsToRows": mapIdsToRows, - "setRefreshHints": setRefreshHints, - "setFilterArgs": setFilterArgs, - "refresh": refresh, - "updateItem": updateItem, - "insertItem": insertItem, - "addItem": addItem, - "deleteItem": deleteItem, - "syncGridSelection": syncGridSelection, - "syncGridCellCssStyles": syncGridCellCssStyles, - // data provider methods - "getLength": getLength, - "getItem": getItem, - "getItemMetadata": getItemMetadata, - // events - "onRowCountChanged": onRowCountChanged, - "onRowsChanged": onRowsChanged, - "onPagingInfoChanged": onPagingInfoChanged - }; - } - - function AvgAggregator(field) { - this.field_ = field; - - this.init = function () { - this.count_ = 0; - this.nonNullCount_ = 0; - this.sum_ = 0; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - this.count_++; - if (val != null && val != "" && val != NaN) { - this.nonNullCount_++; - this.sum_ += parseFloat(val); - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.avg) { - groupTotals.avg = {}; - } - if (this.nonNullCount_ != 0) { - groupTotals.avg[this.field_] = this.sum_ / this.nonNullCount_; - } - }; - } - - function MinAggregator(field) { - this.field_ = field; - - this.init = function () { - this.min_ = null; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - if (val != null && val != "" && val != NaN) { - if (this.min_ == null || val < this.min_) { - this.min_ = val; - } - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.min) { - groupTotals.min = {}; - } - groupTotals.min[this.field_] = this.min_; - } - } - - function MaxAggregator(field) { - this.field_ = field; - - this.init = function () { - this.max_ = null; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - if (val != null && val != "" && val != NaN) { - if (this.max_ == null || val > this.max_) { - this.max_ = val; - } - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.max) { - groupTotals.max = {}; - } - groupTotals.max[this.field_] = this.max_; - } - } - - function SumAggregator(field) { - this.field_ = field; - - this.init = function () { - this.sum_ = null; - }; - - this.accumulate = function (item) { - var val = item[this.field_]; - if (val != null && val != "" && val != NaN) { - this.sum_ += parseFloat(val); - } - }; - - this.storeResult = function (groupTotals) { - if (!groupTotals.sum) { - groupTotals.sum = {}; - } - groupTotals.sum[this.field_] = this.sum_; - } - } - - // TODO: add more built-in aggregators - // TODO: merge common aggregators in one to prevent needles iterating - - })(jQuery); \ No newline at end of file + } + }; + + this.storeResult = function (groupTotals) { + if (!groupTotals.max) { + groupTotals.max = {}; + } + groupTotals.max[this.field_] = this.max_; + } + } + + function SumAggregator(field) { + this.field_ = field; + + this.init = function () { + this.sum_ = null; + }; + + this.accumulate = function (item) { + var val = item[this.field_]; + if (val != null && val !== "" && val !== NaN) { + this.sum_ += parseFloat(val); + } + }; + + this.storeResult = function (groupTotals) { + if (!groupTotals.sum) { + groupTotals.sum = {}; + } + groupTotals.sum[this.field_] = this.sum_; + } + } + + // TODO: add more built-in aggregators + // TODO: merge common aggregators in one to prevent needles iterating + +})(jQuery); diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.editors.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.editors.js index 2d8a48205a..04b20d2fad 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.editors.js +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/slick.editors.js @@ -5,508 +5,508 @@ */ (function ($) { - // register namespace - $.extend(true, window, { - "Slick": { - "Editors": { - "Text": TextEditor, - "Integer": IntegerEditor, - "Date": DateEditor, - "YesNoSelect": YesNoSelectEditor, - "Checkbox": CheckboxEditor, - "PercentComplete": PercentCompleteEditor, - "LongText": LongTextEditor + // register namespace + $.extend(true, window, { + "Slick": { + "Editors": { + "Text": TextEditor, + "Integer": IntegerEditor, + "Date": DateEditor, + "YesNoSelect": YesNoSelectEditor, + "Checkbox": CheckboxEditor, + "PercentComplete": PercentCompleteEditor, + "LongText": LongTextEditor + } + } + }); + + function TextEditor(args) { + var $input; + var defaultValue; + var scope = this; + + this.init = function () { + $input = $("") + .appendTo(args.container) + .bind("keydown.nav", function (e) { + if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { + e.stopImmediatePropagation(); } + }) + .focus() + .select(); + }; + + this.destroy = function () { + $input.remove(); + }; + + this.focus = function () { + $input.focus(); + }; + + this.getValue = function () { + return $input.val(); + }; + + this.setValue = function (val) { + $input.val(val); + }; + + this.loadValue = function (item) { + defaultValue = item[args.column.field] || ""; + $input.val(defaultValue); + $input[0].defaultValue = defaultValue; + $input.select(); + }; + + this.serializeValue = function () { + return $input.val(); + }; + + this.applyValue = function (item, state) { + item[args.column.field] = state; + }; + + this.isValueChanged = function () { + return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); + }; + + this.validate = function () { + if (args.column.validator) { + var validationResults = args.column.validator($input.val()); + if (!validationResults.valid) { + return validationResults; } - }); - - function TextEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $("") - .appendTo(args.container) - .bind("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }) - .focus() - .select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.getValue = function () { - return $input.val(); - }; - - this.setValue = function (val) { - $input.val(val); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field] || ""; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (args.column.validator) { - var validationResults = args.column.validator($input.val()); - if (!validationResults.valid) { - return validationResults; - } - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function IntegerEditor(args) { - var $input; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - - $input.bind("keydown.nav", function (e) { - if (e.keyCode === $.ui.keyCode.LEFT || e.keyCode === $.ui.keyCode.RIGHT) { - e.stopImmediatePropagation(); - } - }); - - $input.appendTo(args.container); - $input.focus().select(); - }; - - this.destroy = function () { - $input.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - if (isNaN($input.val())) { - return { - valid: false, - msg: "Please enter a valid integer" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function DateEditor(args) { - var $input; - var defaultValue; - var scope = this; - var calendarOpen = false; - - this.init = function () { - $input = $(""); - $input.appendTo(args.container); - $input.focus().select(); - $input.datepicker({ - showOn: "button", - buttonImageOnly: true, - buttonImage: "../images/calendar.gif", - beforeShow: function () { - calendarOpen = true - }, - onClose: function () { - calendarOpen = false - } - }); - $input.width($input.width() - 18); - }; - - this.destroy = function () { - $.datepicker.dpDiv.stop(true, true); - $input.datepicker("hide"); - $input.datepicker("destroy"); - $input.remove(); - }; - - this.show = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).show(); - } - }; - - this.hide = function () { - if (calendarOpen) { - $.datepicker.dpDiv.stop(true, true).hide(); - } - }; - - this.position = function (position) { - if (!calendarOpen) { - return; - } - $.datepicker.dpDiv - .css("top", position.top + 30) - .css("left", position.left); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - $input.val(defaultValue); - $input[0].defaultValue = defaultValue; - $input.select(); - }; - - this.serializeValue = function () { - return $input.val(); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function YesNoSelectEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - $select.val((defaultValue = item[args.column.field]) ? "yes" : "no"); - $select.select(); - }; - - this.serializeValue = function () { - return ($select.val() == "yes"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.val() != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function CheckboxEditor(args) { - var $select; - var defaultValue; - var scope = this; - - this.init = function () { - $select = $(""); - $select.appendTo(args.container); - $select.focus(); - }; - - this.destroy = function () { - $select.remove(); - }; - - this.focus = function () { - $select.focus(); - }; - - this.loadValue = function (item) { - defaultValue = item[args.column.field]; - if (defaultValue) { - $select.attr("checked", "checked"); - } else { - $select.removeAttr("checked"); - } - }; - - this.serializeValue = function () { - return $select.attr("checked"); - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return ($select.attr("checked") != defaultValue); - }; - - this.validate = function () { - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - function PercentCompleteEditor(args) { - var $input, $picker; - var defaultValue; - var scope = this; - - this.init = function () { - $input = $(""); - $input.width($(args.container).innerWidth() - 25); - $input.appendTo(args.container); - - $picker = $("

").appendTo(args.container); - $picker.append("
"); - - $picker.find(".editor-percentcomplete-buttons").append("

"); - - $input.focus().select(); - - $picker.find(".editor-percentcomplete-slider").slider({ - orientation: "vertical", - range: "min", - value: defaultValue, - slide: function (event, ui) { - $input.val(ui.value) - } - }); - - $picker.find(".editor-percentcomplete-buttons button").bind("click", function (e) { - $input.val($(this).attr("val")); - $picker.find(".editor-percentcomplete-slider").slider("value", $(this).attr("val")); - }) - }; - - this.destroy = function () { - $input.remove(); - $picker.remove(); - }; - - this.focus = function () { - $input.focus(); - }; - - this.loadValue = function (item) { - $input.val(defaultValue = item[args.column.field]); - $input.select(); - }; - - this.serializeValue = function () { - return parseInt($input.val(), 10) || 0; - }; - - this.applyValue = function (item, state) { - item[args.column.field] = state; - }; - - this.isValueChanged = function () { - return (!($input.val() == "" && defaultValue == null)) && ((parseInt($input.val(), 10) || 0) != defaultValue); - }; - - this.validate = function () { - if (isNaN(parseInt($input.val(), 10))) { - return { - valid: false, - msg: "Please enter a valid positive number" - }; - } - - return { - valid: true, - msg: null - }; - }; - - this.init(); - } - - /* - * An example of a "detached" editor. - * The UI is added onto document BODY and .position(), .show() and .hide() are implemented. - * KeyDown events are also handled to provide handling for Tab, Shift-Tab, Esc and Ctrl-Enter. - */ - function LongTextEditor(args) { - var $input, $wrapper; - var defaultValue; - var scope = this; - - this.init = function () { - var $container = $("body"); - - $wrapper = $("
") - .appendTo($container); - - $input = $("",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("' : ""); - a._keyEvent = false; - return I - }, _generateMonthYearHeader: function (a, b, c, e, f, h, i, g) { - var j = this._get(a, "changeMonth"), l = this._get(a, "changeYear"), u = this._get(a, "showMonthAfterYear"), k = '
', - o = ""; - if (h || !j) - o += '' + i[b] + ""; - else { - i = e && e.getFullYear() == c; - var m = f && f.getFullYear() == c; - o += '" - } - u || (k += o + (h || !(j && - l) ? " " : "")); - a.yearshtml = ""; - if (h || !l) - k += '' + c + ""; - else { - g = this._get(a, "yearRange").split(":"); - var r = (new Date).getFullYear(); - i = function (s) { - s = s.match(/c[+-].*/) ? c + parseInt(s.substring(1), 10) : s.match(/[+-].*/) ? r + parseInt(s, 10) : parseInt(s, 10); - return isNaN(s) ? r : s - }; - b = i(g[0]); - g = Math.max(b, i(g[1] || "")); - b = e ? Math.max(b, e.getFullYear()) : b; - g = f ? Math.min(g, f.getFullYear()) : g; - for (a.yearshtml += '"; - if (d.browser.mozilla) - k += '"; - else { - k += a.yearshtml; - a.yearshtml = null - } - } - k += this._get(a, "yearSuffix"); - if (u) - k += (h || !(j && l) ? " " : "") + o; - k += "
"; - return k - }, _adjustInstDate: function (a, b, c) { - var e = - a.drawYear + (c == "Y" ? b : 0), f = a.drawMonth + (c == "M" ? b : 0); - b = Math.min(a.selectedDay, this._getDaysInMonth(e, f)) + (c == "D" ? b : 0); - e = this._restrictMinMax(a, this._daylightSavingAdjust(new Date(e, f, b))); - a.selectedDay = e.getDate(); - a.drawMonth = a.selectedMonth = e.getMonth(); - a.drawYear = a.selectedYear = e.getFullYear(); - if (c == "M" || c == "Y") - this._notifyChange(a) - }, _restrictMinMax: function (a, b) { - var c = this._getMinMaxDate(a, "min"); - a = this._getMinMaxDate(a, "max"); - b = c && b < c ? c : b; - return b = a && b > a ? a : b - }, _notifyChange: function (a) { - var b = this._get(a, - "onChangeMonthYear"); - if (b) - b.apply(a.input ? a.input[0] : null, [a.selectedYear, a.selectedMonth + 1, a]) - }, _getNumberOfMonths: function (a) { - a = this._get(a, "numberOfMonths"); - return a == null ? [1, 1] : typeof a == "number" ? [1, a] : a - }, _getMinMaxDate: function (a, b) { - return this._determineDate(a, this._get(a, b + "Date"), null) - }, _getDaysInMonth: function (a, b) { - return 32 - this._daylightSavingAdjust(new Date(a, b, 32)).getDate() - }, _getFirstDayOfMonth: function (a, b) { - return(new Date(a, b, 1)).getDay() - }, _canAdjustMonth: function (a, b, c, e) { - var f = this._getNumberOfMonths(a); - c = this._daylightSavingAdjust(new Date(c, e + (b < 0 ? b : f[0] * f[1]), 1)); - b < 0 && c.setDate(this._getDaysInMonth(c.getFullYear(), c.getMonth())); - return this._isInRange(a, c) - }, _isInRange: function (a, b) { - var c = this._getMinMaxDate(a, "min"); - a = this._getMinMaxDate(a, "max"); - return(!c || b.getTime() >= c.getTime()) && (!a || b.getTime() <= a.getTime()) - }, _getFormatConfig: function (a) { - var b = this._get(a, "shortYearCutoff"); - b = typeof b != "string" ? b : (new Date).getFullYear() % 100 + parseInt(b, 10); - return{shortYearCutoff: b, dayNamesShort: this._get(a, - "dayNamesShort"), dayNames: this._get(a, "dayNames"), monthNamesShort: this._get(a, "monthNamesShort"), monthNames: this._get(a, "monthNames")} - }, _formatDate: function (a, b, c, e) { - if (!b) { - a.currentDay = a.selectedDay; - a.currentMonth = a.selectedMonth; - a.currentYear = a.selectedYear - } - b = b ? typeof b == "object" ? b : this._daylightSavingAdjust(new Date(e, c, b)) : this._daylightSavingAdjust(new Date(a.currentYear, a.currentMonth, a.currentDay)); - return this.formatDate(this._get(a, "dateFormat"), b, this._getFormatConfig(a)) - }}); - d.fn.datepicker = - function (a) { - if (!this.length) - return this; - if (!d.datepicker.initialized) { - d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv); - d.datepicker.initialized = true - } - var b = Array.prototype.slice.call(arguments, 1); - if (typeof a == "string" && (a == "isDisabled" || a == "getDate" || a == "widget")) - return d.datepicker["_" + a + "Datepicker"].apply(d.datepicker, [this[0]].concat(b)); - if (a == "option" && arguments.length == 2 && typeof arguments[1] == "string") - return d.datepicker["_" + a + "Datepicker"].apply(d.datepicker, - [this[0]].concat(b)); - return this.each(function () { - typeof a == "string" ? d.datepicker["_" + a + "Datepicker"].apply(d.datepicker, [this].concat(b)) : d.datepicker._attachDatepicker(this, a) - }) - }; - d.datepicker = new K; - d.datepicker.initialized = false; - d.datepicker.uuid = (new Date).getTime(); - d.datepicker.version = "1.8.10"; - window["DP_jQuery_" + y] = d -})(jQuery); -;/* - * jQuery UI Progressbar 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function (b, d) { - b.widget("ui.progressbar", {options: {value: 0, max: 100}, min: 0, _create: function () { - this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role: "progressbar", "aria-valuemin": this.min, "aria-valuemax": this.options.max, "aria-valuenow": this._value()}); - this.valueDiv = b("
").appendTo(this.element); - this.oldValue = this._value(); - this._refreshValue() - }, destroy: function () { - this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); - this.valueDiv.remove(); - b.Widget.prototype.destroy.apply(this, arguments) - }, value: function (a) { - if (a === d) - return this._value(); - this._setOption("value", a); - return this - }, _setOption: function (a, c) { - if (a === "value") { - this.options.value = c; - this._refreshValue(); - this._value() === this.options.max && this._trigger("complete") - } - b.Widget.prototype._setOption.apply(this, arguments) - }, _value: function () { - var a = this.options.value; - if (typeof a !== "number") - a = 0; - return Math.min(this.options.max, Math.max(this.min, a)) - }, _percentage: function () { - return 100 * - this._value() / this.options.max - }, _refreshValue: function () { - var a = this.value(), c = this._percentage(); - if (this.oldValue !== a) { - this.oldValue = a; - this._trigger("change") - } - this.valueDiv.toggleClass("ui-corner-right", a === this.options.max).width(c.toFixed(0) + "%"); - this.element.attr("aria-valuenow", a) - }}); - b.extend(b.ui.progressbar, {version: "1.8.10"}) -})(jQuery); -;/* - * jQuery UI Effects 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects || function (f, j) { - function n(c) { - var a; - if (c && c.constructor == Array && c.length == 3) - return c; - if (a = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)) - return[parseInt(a[1], 10), parseInt(a[2], 10), parseInt(a[3], 10)]; - if (a = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)) - return[parseFloat(a[1]) * 2.55, parseFloat(a[2]) * 2.55, parseFloat(a[3]) * 2.55]; - if (a = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)) - return[parseInt(a[1], - 16), parseInt(a[2], 16), parseInt(a[3], 16)]; - if (a = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)) - return[parseInt(a[1] + a[1], 16), parseInt(a[2] + a[2], 16), parseInt(a[3] + a[3], 16)]; - if (/rgba\(0, 0, 0, 0\)/.exec(c)) - return o.transparent; - return o[f.trim(c).toLowerCase()] - } - function s(c, a) { - var b; - do { - b = f.curCSS(c, a); - if (b != "" && b != "transparent" || f.nodeName(c, "body")) - break; - a = "backgroundColor" - } while (c = c.parentNode); - return n(b) - } - function p() { - var c = document.defaultView ? document.defaultView.getComputedStyle(this, null) : this.currentStyle, - a = {}, b, d; - if (c && c.length && c[0] && c[c[0]]) - for (var e = c.length; e--; ) { - b = c[e]; - if (typeof c[b] == "string") { - d = b.replace(/\-(\w)/g, function (g, h) { - return h.toUpperCase() - }); - a[d] = c[b] - } - } - else - for (b in c) - if (typeof c[b] === "string") - a[b] = c[b]; - return a - } - function q(c) { - var a, b; - for (a in c) { - b = c[a]; - if (b == null || f.isFunction(b) || a in t || /scrollbar/.test(a) || !/color/i.test(a) && isNaN(parseFloat(b))) - delete c[a] - } - return c - } - function u(c, a) { - var b = {_: 0}, d; - for (d in a) - if (c[d] != a[d]) - b[d] = a[d]; - return b - } - function k(c, a, b, d) { - if (typeof c == "object") { - d = - a; - b = null; - a = c; - c = a.effect - } - if (f.isFunction(a)) { - d = a; - b = null; - a = {} - } - if (typeof a == "number" || f.fx.speeds[a]) { - d = b; - b = a; - a = {} - } - if (f.isFunction(b)) { - d = b; - b = null - } - a = a || {}; - b = b || a.duration; - b = f.fx.off ? 0 : typeof b == "number" ? b : b in f.fx.speeds ? f.fx.speeds[b] : f.fx.speeds._default; - d = d || a.complete; - return[c, a, b, d] - } - function m(c) { - if (!c || typeof c === "number" || f.fx.speeds[c]) - return true; - if (typeof c === "string" && !f.effects[c]) - return true; - return false - } - f.effects = {}; - f.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", - "borderTopColor", "borderColor", "color", "outlineColor"], function (c, a) { - f.fx.step[a] = function (b) { - if (!b.colorInit) { - b.start = s(b.elem, a); - b.end = n(b.end); - b.colorInit = true - } - b.elem.style[a] = "rgb(" + Math.max(Math.min(parseInt(b.pos * (b.end[0] - b.start[0]) + b.start[0], 10), 255), 0) + "," + Math.max(Math.min(parseInt(b.pos * (b.end[1] - b.start[1]) + b.start[1], 10), 255), 0) + "," + Math.max(Math.min(parseInt(b.pos * (b.end[2] - b.start[2]) + b.start[2], 10), 255), 0) + ")" - } - }); - var o = {aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, - 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, - 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0], transparent: [255, 255, 255]}, r = ["add", "remove", "toggle"], t = {border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1}; - f.effects.animateClass = function (c, a, b, - d) { - if (f.isFunction(b)) { - d = b; - b = null - } - return this.queue("fx", function () { - var e = f(this), g = e.attr("style") || " ", h = q(p.call(this)), l, v = e.attr("className"); - f.each(r, function (w, i) { - c[i] && e[i + "Class"](c[i]) - }); - l = q(p.call(this)); - e.attr("className", v); - e.animate(u(h, l), a, b, function () { - f.each(r, function (w, i) { - c[i] && e[i + "Class"](c[i]) - }); - if (typeof e.attr("style") == "object") { - e.attr("style").cssText = ""; - e.attr("style").cssText = g - } else - e.attr("style", g); - d && d.apply(this, arguments) - }); - h = f.queue(this); - l = h.splice(h.length - 1, 1)[0]; - h.splice(1, 0, l); - f.dequeue(this) - }) - }; - f.fn.extend({_addClass: f.fn.addClass, addClass: function (c, a, b, d) { - return a ? f.effects.animateClass.apply(this, [{add: c}, a, b, d]) : this._addClass(c) - }, _removeClass: f.fn.removeClass, removeClass: function (c, a, b, d) { - return a ? f.effects.animateClass.apply(this, [{remove: c}, a, b, d]) : this._removeClass(c) - }, _toggleClass: f.fn.toggleClass, toggleClass: function (c, a, b, d, e) { - return typeof a == "boolean" || a === j ? b ? f.effects.animateClass.apply(this, [a ? {add: c} : {remove: c}, b, d, e]) : this._toggleClass(c, - a) : f.effects.animateClass.apply(this, [{toggle: c}, a, b, d]) - }, switchClass: function (c, a, b, d, e) { - return f.effects.animateClass.apply(this, [{add: a, remove: c}, b, d, e]) - }}); - f.extend(f.effects, {version: "1.8.10", save: function (c, a) { - for (var b = 0; b < a.length; b++) - a[b] !== null && c.data("ec.storage." + a[b], c[0].style[a[b]]) - }, restore: function (c, a) { - for (var b = 0; b < a.length; b++) - a[b] !== null && c.css(a[b], c.data("ec.storage." + a[b])) - }, setMode: function (c, a) { - if (a == "toggle") - a = c.is(":hidden") ? "show" : "hide"; - return a - }, getBaseline: function (c, - a) { - var b; - switch (c[0]) { - case "top": - b = 0; - break; - case "middle": - b = 0.5; - break; - case "bottom": - b = 1; - break; - default: - b = c[0] / a.height - } - switch (c[1]) { - case "left": - c = 0; - break; - case "center": - c = 0.5; - break; - case "right": - c = 1; - break; - default: - c = c[1] / a.width - } - return{x: c, y: b} - }, createWrapper: function (c) { - if (c.parent().is(".ui-effects-wrapper")) - return c.parent(); - var a = {width: c.outerWidth(true), height: c.outerHeight(true), "float": c.css("float")}, b = f("
").addClass("ui-effects-wrapper").css({fontSize: "100%", background: "transparent", - border: "none", margin: 0, padding: 0}); - c.wrap(b); - b = c.parent(); - if (c.css("position") == "static") { - b.css({position: "relative"}); - c.css({position: "relative"}) - } else { - f.extend(a, {position: c.css("position"), zIndex: c.css("z-index")}); - f.each(["top", "left", "bottom", "right"], function (d, e) { - a[e] = c.css(e); - if (isNaN(parseInt(a[e], 10))) - a[e] = "auto" - }); - c.css({position: "relative", top: 0, left: 0, right: "auto", bottom: "auto"}) - } - return b.css(a).show() - }, removeWrapper: function (c) { - if (c.parent().is(".ui-effects-wrapper")) - return c.parent().replaceWith(c); - return c - }, setTransition: function (c, a, b, d) { - d = d || {}; - f.each(a, function (e, g) { - unit = c.cssUnit(g); - if (unit[0] > 0) - d[g] = unit[0] * b + unit[1] - }); - return d - }}); - f.fn.extend({effect: function (c) { - var a = k.apply(this, arguments), b = {options: a[1], duration: a[2], callback: a[3]}; - a = b.options.mode; - var d = f.effects[c]; - if (f.fx.off || !d) - return a ? this[a](b.duration, b.callback) : this.each(function () { - b.callback && b.callback.call(this) - }); - return d.call(this, b) - }, _show: f.fn.show, show: function (c) { - if (m(c)) - return this._show.apply(this, arguments); - else { - var a = k.apply(this, arguments); - a[1].mode = "show"; - return this.effect.apply(this, a) - } - }, _hide: f.fn.hide, hide: function (c) { - if (m(c)) - return this._hide.apply(this, arguments); - else { - var a = k.apply(this, arguments); - a[1].mode = "hide"; - return this.effect.apply(this, a) - } - }, __toggle: f.fn.toggle, toggle: function (c) { - if (m(c) || typeof c === "boolean" || f.isFunction(c)) - return this.__toggle.apply(this, arguments); - else { - var a = k.apply(this, arguments); - a[1].mode = "toggle"; - return this.effect.apply(this, a) - } - }, cssUnit: function (c) { - var a = this.css(c), - b = []; - f.each(["em", "px", "%", "pt"], function (d, e) { - if (a.indexOf(e) > 0) - b = [parseFloat(a), e] - }); - return b - }}); - f.easing.jswing = f.easing.swing; - f.extend(f.easing, {def: "easeOutQuad", swing: function (c, a, b, d, e) { - return f.easing[f.easing.def](c, a, b, d, e) - }, easeInQuad: function (c, a, b, d, e) { - return d * (a /= e) * a + b - }, easeOutQuad: function (c, a, b, d, e) { - return-d * (a /= e) * (a - 2) + b - }, easeInOutQuad: function (c, a, b, d, e) { - if ((a /= e / 2) < 1) - return d / 2 * a * a + b; - return-d / 2 * (--a * (a - 2) - 1) + b - }, easeInCubic: function (c, a, b, d, e) { - return d * (a /= e) * a * a + b - }, easeOutCubic: function (c, - a, b, d, e) { - return d * ((a = a / e - 1) * a * a + 1) + b - }, easeInOutCubic: function (c, a, b, d, e) { - if ((a /= e / 2) < 1) - return d / 2 * a * a * a + b; - return d / 2 * ((a -= 2) * a * a + 2) + b - }, easeInQuart: function (c, a, b, d, e) { - return d * (a /= e) * a * a * a + b - }, easeOutQuart: function (c, a, b, d, e) { - return-d * ((a = a / e - 1) * a * a * a - 1) + b - }, easeInOutQuart: function (c, a, b, d, e) { - if ((a /= e / 2) < 1) - return d / 2 * a * a * a * a + b; - return-d / 2 * ((a -= 2) * a * a * a - 2) + b - }, easeInQuint: function (c, a, b, d, e) { - return d * (a /= e) * a * a * a * a + b - }, easeOutQuint: function (c, a, b, d, e) { - return d * ((a = a / e - 1) * a * a * a * a + 1) + b - }, easeInOutQuint: function (c, - a, b, d, e) { - if ((a /= e / 2) < 1) - return d / 2 * a * a * a * a * a + b; - return d / 2 * ((a -= 2) * a * a * a * a + 2) + b - }, easeInSine: function (c, a, b, d, e) { - return-d * Math.cos(a / e * (Math.PI / 2)) + d + b - }, easeOutSine: function (c, a, b, d, e) { - return d * Math.sin(a / e * (Math.PI / 2)) + b - }, easeInOutSine: function (c, a, b, d, e) { - return-d / 2 * (Math.cos(Math.PI * a / e) - 1) + b - }, easeInExpo: function (c, a, b, d, e) { - return a == 0 ? b : d * Math.pow(2, 10 * (a / e - 1)) + b - }, easeOutExpo: function (c, a, b, d, e) { - return a == e ? b + d : d * (-Math.pow(2, -10 * a / e) + 1) + b - }, easeInOutExpo: function (c, a, b, d, e) { - if (a == 0) - return b; - if (a == - e) - return b + d; - if ((a /= e / 2) < 1) - return d / 2 * Math.pow(2, 10 * (a - 1)) + b; - return d / 2 * (-Math.pow(2, -10 * --a) + 2) + b - }, easeInCirc: function (c, a, b, d, e) { - return-d * (Math.sqrt(1 - (a /= e) * a) - 1) + b - }, easeOutCirc: function (c, a, b, d, e) { - return d * Math.sqrt(1 - (a = a / e - 1) * a) + b - }, easeInOutCirc: function (c, a, b, d, e) { - if ((a /= e / 2) < 1) - return-d / 2 * (Math.sqrt(1 - a * a) - 1) + b; - return d / 2 * (Math.sqrt(1 - (a -= 2) * a) + 1) + b - }, easeInElastic: function (c, a, b, d, e) { - c = 1.70158; - var g = 0, h = d; - if (a == 0) - return b; - if ((a /= e) == 1) - return b + d; - g || (g = e * 0.3); - if (h < Math.abs(d)) { - h = d; - c = g / 4 - } else - c = - g / (2 * Math.PI) * Math.asin(d / h); - return-(h * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * e - c) * 2 * Math.PI / g)) + b - }, easeOutElastic: function (c, a, b, d, e) { - c = 1.70158; - var g = 0, h = d; - if (a == 0) - return b; - if ((a /= e) == 1) - return b + d; - g || (g = e * 0.3); - if (h < Math.abs(d)) { - h = d; - c = g / 4 - } else - c = g / (2 * Math.PI) * Math.asin(d / h); - return h * Math.pow(2, -10 * a) * Math.sin((a * e - c) * 2 * Math.PI / g) + d + b - }, easeInOutElastic: function (c, a, b, d, e) { - c = 1.70158; - var g = 0, h = d; - if (a == 0) - return b; - if ((a /= e / 2) == 2) - return b + d; - g || (g = e * 0.3 * 1.5); - if (h < Math.abs(d)) { - h = d; - c = g / 4 - } else - c = g / (2 * Math.PI) * Math.asin(d / - h); - if (a < 1) - return-0.5 * h * Math.pow(2, 10 * (a -= 1)) * Math.sin((a * e - c) * 2 * Math.PI / g) + b; - return h * Math.pow(2, -10 * (a -= 1)) * Math.sin((a * e - c) * 2 * Math.PI / g) * 0.5 + d + b - }, easeInBack: function (c, a, b, d, e, g) { - if (g == j) - g = 1.70158; - return d * (a /= e) * a * ((g + 1) * a - g) + b - }, easeOutBack: function (c, a, b, d, e, g) { - if (g == j) - g = 1.70158; - return d * ((a = a / e - 1) * a * ((g + 1) * a + g) + 1) + b - }, easeInOutBack: function (c, a, b, d, e, g) { - if (g == j) - g = 1.70158; - if ((a /= e / 2) < 1) - return d / 2 * a * a * (((g *= 1.525) + 1) * a - g) + b; - return d / 2 * ((a -= 2) * a * (((g *= 1.525) + 1) * a + g) + 2) + b - }, easeInBounce: function (c, - a, b, d, e) { - return d - f.easing.easeOutBounce(c, e - a, 0, d, e) + b - }, easeOutBounce: function (c, a, b, d, e) { - return(a /= e) < 1 / 2.75 ? d * 7.5625 * a * a + b : a < 2 / 2.75 ? d * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + b : a < 2.5 / 2.75 ? d * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + b : d * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + b - }, easeInOutBounce: function (c, a, b, d, e) { - if (a < e / 2) - return f.easing.easeInBounce(c, a * 2, 0, d, e) * 0.5 + b; - return f.easing.easeOutBounce(c, a * 2 - e, 0, d, e) * 0.5 + d * 0.5 + b - }}) -}(jQuery); -;/* - * jQuery UI Effects Blind 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Blind - * - * Depends: - * jquery.effects.core.js - */ -(function (b) { - b.effects.blind = function (c) { - return this.queue(function () { - var a = b(this), g = ["position", "top", "bottom", "left", "right"], f = b.effects.setMode(a, c.options.mode || "hide"), d = c.options.direction || "vertical"; - b.effects.save(a, g); - a.show(); - var e = b.effects.createWrapper(a).css({overflow: "hidden"}), h = d == "vertical" ? "height" : "width"; - d = d == "vertical" ? e.height() : e.width(); - f == "show" && e.css(h, 0); - var i = {}; - i[h] = f == "show" ? d : 0; - e.animate(i, c.duration, c.options.easing, function () { - f == "hide" && a.hide(); - b.effects.restore(a, - g); - b.effects.removeWrapper(a); - c.callback && c.callback.apply(a[0], arguments); - a.dequeue() - }) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Bounce 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Bounce - * - * Depends: - * jquery.effects.core.js - */ -(function (e) { - e.effects.bounce = function (b) { - return this.queue(function () { - var a = e(this), l = ["position", "top", "bottom", "left", "right"], h = e.effects.setMode(a, b.options.mode || "effect"), d = b.options.direction || "up", c = b.options.distance || 20, m = b.options.times || 5, i = b.duration || 250; - /show|hide/.test(h) && l.push("opacity"); - e.effects.save(a, l); - a.show(); - e.effects.createWrapper(a); - var f = d == "up" || d == "down" ? "top" : "left"; - d = d == "up" || d == "left" ? "pos" : "neg"; - c = b.options.distance || (f == "top" ? a.outerHeight({margin: true}) / 3 : a.outerWidth({margin: true}) / - 3); - if (h == "show") - a.css("opacity", 0).css(f, d == "pos" ? -c : c); - if (h == "hide") - c /= m * 2; - h != "hide" && m--; - if (h == "show") { - var g = {opacity: 1}; - g[f] = (d == "pos" ? "+=" : "-=") + c; - a.animate(g, i / 2, b.options.easing); - c /= 2; - m-- - } - for (g = 0; g < m; g++) { - var j = {}, k = {}; - j[f] = (d == "pos" ? "-=" : "+=") + c; - k[f] = (d == "pos" ? "+=" : "-=") + c; - a.animate(j, i / 2, b.options.easing).animate(k, i / 2, b.options.easing); - c = h == "hide" ? c * 2 : c / 2 - } - if (h == "hide") { - g = {opacity: 0}; - g[f] = (d == "pos" ? "-=" : "+=") + c; - a.animate(g, i / 2, b.options.easing, function () { - a.hide(); - e.effects.restore(a, l); - e.effects.removeWrapper(a); - b.callback && b.callback.apply(this, arguments) - }) - } else { - j = {}; - k = {}; - j[f] = (d == "pos" ? "-=" : "+=") + c; - k[f] = (d == "pos" ? "+=" : "-=") + c; - a.animate(j, i / 2, b.options.easing).animate(k, i / 2, b.options.easing, function () { - e.effects.restore(a, l); - e.effects.removeWrapper(a); - b.callback && b.callback.apply(this, arguments) - }) - } - a.queue("fx", function () { - a.dequeue() - }); - a.dequeue() - }) - } -})(jQuery); -;/* - * jQuery UI Effects Clip 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Clip - * - * Depends: - * jquery.effects.core.js - */ -(function (b) { - b.effects.clip = function (e) { - return this.queue(function () { - var a = b(this), i = ["position", "top", "bottom", "left", "right", "height", "width"], f = b.effects.setMode(a, e.options.mode || "hide"), c = e.options.direction || "vertical"; - b.effects.save(a, i); - a.show(); - var d = b.effects.createWrapper(a).css({overflow: "hidden"}); - d = a[0].tagName == "IMG" ? d : a; - var g = {size: c == "vertical" ? "height" : "width", position: c == "vertical" ? "top" : "left"}; - c = c == "vertical" ? d.height() : d.width(); - if (f == "show") { - d.css(g.size, 0); - d.css(g.position, - c / 2) - } - var h = {}; - h[g.size] = f == "show" ? c : 0; - h[g.position] = f == "show" ? 0 : c / 2; - d.animate(h, {queue: false, duration: e.duration, easing: e.options.easing, complete: function () { - f == "hide" && a.hide(); - b.effects.restore(a, i); - b.effects.removeWrapper(a); - e.callback && e.callback.apply(a[0], arguments); - a.dequeue() - }}) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Drop 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Drop - * - * Depends: - * jquery.effects.core.js - */ -(function (c) { - c.effects.drop = function (d) { - return this.queue(function () { - var a = c(this), h = ["position", "top", "bottom", "left", "right", "opacity"], e = c.effects.setMode(a, d.options.mode || "hide"), b = d.options.direction || "left"; - c.effects.save(a, h); - a.show(); - c.effects.createWrapper(a); - var f = b == "up" || b == "down" ? "top" : "left"; - b = b == "up" || b == "left" ? "pos" : "neg"; - var g = d.options.distance || (f == "top" ? a.outerHeight({margin: true}) / 2 : a.outerWidth({margin: true}) / 2); - if (e == "show") - a.css("opacity", 0).css(f, b == "pos" ? -g : g); - var i = {opacity: e == - "show" ? 1 : 0}; - i[f] = (e == "show" ? b == "pos" ? "+=" : "-=" : b == "pos" ? "-=" : "+=") + g; - a.animate(i, {queue: false, duration: d.duration, easing: d.options.easing, complete: function () { - e == "hide" && a.hide(); - c.effects.restore(a, h); - c.effects.removeWrapper(a); - d.callback && d.callback.apply(this, arguments); - a.dequeue() - }}) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Explode 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Explode - * - * Depends: - * jquery.effects.core.js - */ -(function (j) { - j.effects.explode = function (a) { - return this.queue(function () { - var c = a.options.pieces ? Math.round(Math.sqrt(a.options.pieces)) : 3, d = a.options.pieces ? Math.round(Math.sqrt(a.options.pieces)) : 3; - a.options.mode = a.options.mode == "toggle" ? j(this).is(":visible") ? "hide" : "show" : a.options.mode; - var b = j(this).show().css("visibility", "hidden"), g = b.offset(); - g.top -= parseInt(b.css("marginTop"), 10) || 0; - g.left -= parseInt(b.css("marginLeft"), 10) || 0; - for (var h = b.outerWidth(true), i = b.outerHeight(true), e = 0; e < c; e++) - for (var f = - 0; f < d; f++) - b.clone().appendTo("body").wrap("
").css({position: "absolute", visibility: "visible", left: -f * (h / d), top: -e * (i / c)}).parent().addClass("ui-effects-explode").css({position: "absolute", overflow: "hidden", width: h / d, height: i / c, left: g.left + f * (h / d) + (a.options.mode == "show" ? (f - Math.floor(d / 2)) * (h / d) : 0), top: g.top + e * (i / c) + (a.options.mode == "show" ? (e - Math.floor(c / 2)) * (i / c) : 0), opacity: a.options.mode == "show" ? 0 : 1}).animate({left: g.left + f * (h / d) + (a.options.mode == "show" ? 0 : (f - Math.floor(d / 2)) * (h / d)), top: g.top + - e * (i / c) + (a.options.mode == "show" ? 0 : (e - Math.floor(c / 2)) * (i / c)), opacity: a.options.mode == "show" ? 1 : 0}, a.duration || 500); - setTimeout(function () { - a.options.mode == "show" ? b.css({visibility: "visible"}) : b.css({visibility: "visible"}).hide(); - a.callback && a.callback.apply(b[0]); - b.dequeue(); - j("div.ui-effects-explode").remove() - }, a.duration || 500) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Fade 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fade - * - * Depends: - * jquery.effects.core.js - */ -(function (b) { - b.effects.fade = function (a) { - return this.queue(function () { - var c = b(this), d = b.effects.setMode(c, a.options.mode || "hide"); - c.animate({opacity: d}, {queue: false, duration: a.duration, easing: a.options.easing, complete: function () { - a.callback && a.callback.apply(this, arguments); - c.dequeue() - }}) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Fold 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * jquery.effects.core.js - */ -(function (c) { - c.effects.fold = function (a) { - return this.queue(function () { - var b = c(this), j = ["position", "top", "bottom", "left", "right"], d = c.effects.setMode(b, a.options.mode || "hide"), g = a.options.size || 15, h = !!a.options.horizFirst, k = a.duration ? a.duration / 2 : c.fx.speeds._default / 2; - c.effects.save(b, j); - b.show(); - var e = c.effects.createWrapper(b).css({overflow: "hidden"}), f = d == "show" != h, l = f ? ["width", "height"] : ["height", "width"]; - f = f ? [e.width(), e.height()] : [e.height(), e.width()]; - var i = /([0-9]+)%/.exec(g); - if (i) - g = parseInt(i[1], - 10) / 100 * f[d == "hide" ? 0 : 1]; - if (d == "show") - e.css(h ? {height: 0, width: g} : {height: g, width: 0}); - h = {}; - i = {}; - h[l[0]] = d == "show" ? f[0] : g; - i[l[1]] = d == "show" ? f[1] : 0; - e.animate(h, k, a.options.easing).animate(i, k, a.options.easing, function () { - d == "hide" && b.hide(); - c.effects.restore(b, j); - c.effects.removeWrapper(b); - a.callback && a.callback.apply(b[0], arguments); - b.dequeue() - }) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Highlight 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * jquery.effects.core.js - */ -(function (b) { - b.effects.highlight = function (c) { - return this.queue(function () { - var a = b(this), e = ["backgroundImage", "backgroundColor", "opacity"], d = b.effects.setMode(a, c.options.mode || "show"), f = {backgroundColor: a.css("backgroundColor")}; - if (d == "hide") - f.opacity = 0; - b.effects.save(a, e); - a.show().css({backgroundImage: "none", backgroundColor: c.options.color || "#ffff99"}).animate(f, {queue: false, duration: c.duration, easing: c.options.easing, complete: function () { - d == "hide" && a.hide(); - b.effects.restore(a, e); - d == "show" && !b.support.opacity && - this.style.removeAttribute("filter"); - c.callback && c.callback.apply(this, arguments); - a.dequeue() - }}) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Pulsate 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * jquery.effects.core.js - */ -(function (d) { - d.effects.pulsate = function (a) { - return this.queue(function () { - var b = d(this), c = d.effects.setMode(b, a.options.mode || "show"); - times = (a.options.times || 5) * 2 - 1; - duration = a.duration ? a.duration / 2 : d.fx.speeds._default / 2; - isVisible = b.is(":visible"); - animateTo = 0; - if (!isVisible) { - b.css("opacity", 0).show(); - animateTo = 1 - } - if (c == "hide" && isVisible || c == "show" && !isVisible) - times--; - for (c = 0; c < times; c++) { - b.animate({opacity: animateTo}, duration, a.options.easing); - animateTo = (animateTo + 1) % 2 - } - b.animate({opacity: animateTo}, duration, - a.options.easing, function () { - animateTo == 0 && b.hide(); - a.callback && a.callback.apply(this, arguments) - }); - b.queue("fx", function () { - b.dequeue() - }).dequeue() - }) - } -})(jQuery); -;/* - * jQuery UI Effects Scale 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Scale - * - * Depends: - * jquery.effects.core.js - */ -(function (c) { - c.effects.puff = function (b) { - return this.queue(function () { - var a = c(this), e = c.effects.setMode(a, b.options.mode || "hide"), g = parseInt(b.options.percent, 10) || 150, h = g / 100, i = {height: a.height(), width: a.width()}; - c.extend(b.options, {fade: true, mode: e, percent: e == "hide" ? g : 100, from: e == "hide" ? i : {height: i.height * h, width: i.width * h}}); - a.effect("scale", b.options, b.duration, b.callback); - a.dequeue() - }) - }; - c.effects.scale = function (b) { - return this.queue(function () { - var a = c(this), e = c.extend(true, {}, b.options), g = c.effects.setMode(a, - b.options.mode || "effect"), h = parseInt(b.options.percent, 10) || (parseInt(b.options.percent, 10) == 0 ? 0 : g == "hide" ? 0 : 100), i = b.options.direction || "both", f = b.options.origin; - if (g != "effect") { - e.origin = f || ["middle", "center"]; - e.restore = true - } - f = {height: a.height(), width: a.width()}; - a.from = b.options.from || (g == "show" ? {height: 0, width: 0} : f); - h = {y: i != "horizontal" ? h / 100 : 1, x: i != "vertical" ? h / 100 : 1}; - a.to = {height: f.height * h.y, width: f.width * h.x}; - if (b.options.fade) { - if (g == "show") { - a.from.opacity = 0; - a.to.opacity = 1 - } - if (g == "hide") { - a.from.opacity = - 1; - a.to.opacity = 0 - } - } - e.from = a.from; - e.to = a.to; - e.mode = g; - a.effect("size", e, b.duration, b.callback); - a.dequeue() - }) - }; - c.effects.size = function (b) { - return this.queue(function () { - var a = c(this), e = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"], g = ["position", "top", "bottom", "left", "right", "overflow", "opacity"], h = ["width", "height", "overflow"], i = ["fontSize"], f = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], k = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], - p = c.effects.setMode(a, b.options.mode || "effect"), n = b.options.restore || false, m = b.options.scale || "both", l = b.options.origin, j = {height: a.height(), width: a.width()}; - a.from = b.options.from || j; - a.to = b.options.to || j; - if (l) { - l = c.effects.getBaseline(l, j); - a.from.top = (j.height - a.from.height) * l.y; - a.from.left = (j.width - a.from.width) * l.x; - a.to.top = (j.height - a.to.height) * l.y; - a.to.left = (j.width - a.to.width) * l.x - } - var d = {from: {y: a.from.height / j.height, x: a.from.width / j.width}, to: {y: a.to.height / j.height, x: a.to.width / j.width}}; - if (m == "box" || m == "both") { - if (d.from.y != d.to.y) { - e = e.concat(f); - a.from = c.effects.setTransition(a, f, d.from.y, a.from); - a.to = c.effects.setTransition(a, f, d.to.y, a.to) - } - if (d.from.x != d.to.x) { - e = e.concat(k); - a.from = c.effects.setTransition(a, k, d.from.x, a.from); - a.to = c.effects.setTransition(a, k, d.to.x, a.to) - } - } - if (m == "content" || m == "both") - if (d.from.y != d.to.y) { - e = e.concat(i); - a.from = c.effects.setTransition(a, i, d.from.y, a.from); - a.to = c.effects.setTransition(a, i, d.to.y, a.to) - } - c.effects.save(a, n ? e : g); - a.show(); - c.effects.createWrapper(a); - a.css("overflow", "hidden").css(a.from); - if (m == "content" || m == "both") { - f = f.concat(["marginTop", "marginBottom"]).concat(i); - k = k.concat(["marginLeft", "marginRight"]); - h = e.concat(f).concat(k); - a.find("*[width]").each(function () { - child = c(this); - n && c.effects.save(child, h); - var o = {height: child.height(), width: child.width()}; - child.from = {height: o.height * d.from.y, width: o.width * d.from.x}; - child.to = {height: o.height * d.to.y, width: o.width * d.to.x}; - if (d.from.y != d.to.y) { - child.from = c.effects.setTransition(child, f, d.from.y, child.from); - child.to = c.effects.setTransition(child, f, d.to.y, child.to) - } - if (d.from.x != d.to.x) { - child.from = c.effects.setTransition(child, k, d.from.x, child.from); - child.to = c.effects.setTransition(child, k, d.to.x, child.to) - } - child.css(child.from); - child.animate(child.to, b.duration, b.options.easing, function () { - n && c.effects.restore(child, h) - }) - }) - } - a.animate(a.to, {queue: false, duration: b.duration, easing: b.options.easing, complete: function () { - a.to.opacity === 0 && a.css("opacity", a.from.opacity); - p == "hide" && a.hide(); - c.effects.restore(a, - n ? e : g); - c.effects.removeWrapper(a); - b.callback && b.callback.apply(this, arguments); - a.dequeue() - }}) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Shake 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Shake - * - * Depends: - * jquery.effects.core.js - */ -(function (d) { - d.effects.shake = function (a) { - return this.queue(function () { - var b = d(this), j = ["position", "top", "bottom", "left", "right"]; - d.effects.setMode(b, a.options.mode || "effect"); - var c = a.options.direction || "left", e = a.options.distance || 20, l = a.options.times || 3, f = a.duration || a.options.duration || 140; - d.effects.save(b, j); - b.show(); - d.effects.createWrapper(b); - var g = c == "up" || c == "down" ? "top" : "left", h = c == "up" || c == "left" ? "pos" : "neg"; - c = {}; - var i = {}, k = {}; - c[g] = (h == "pos" ? "-=" : "+=") + e; - i[g] = (h == "pos" ? "+=" : "-=") + e * 2; - k[g] = - (h == "pos" ? "-=" : "+=") + e * 2; - b.animate(c, f, a.options.easing); - for (e = 1; e < l; e++) - b.animate(i, f, a.options.easing).animate(k, f, a.options.easing); - b.animate(i, f, a.options.easing).animate(c, f / 2, a.options.easing, function () { - d.effects.restore(b, j); - d.effects.removeWrapper(b); - a.callback && a.callback.apply(this, arguments) - }); - b.queue("fx", function () { - b.dequeue() - }); - b.dequeue() - }) - } -})(jQuery); -;/* - * jQuery UI Effects Slide 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Slide - * - * Depends: - * jquery.effects.core.js - */ -(function (c) { - c.effects.slide = function (d) { - return this.queue(function () { - var a = c(this), h = ["position", "top", "bottom", "left", "right"], f = c.effects.setMode(a, d.options.mode || "show"), b = d.options.direction || "left"; - c.effects.save(a, h); - a.show(); - c.effects.createWrapper(a).css({overflow: "hidden"}); - var g = b == "up" || b == "down" ? "top" : "left"; - b = b == "up" || b == "left" ? "pos" : "neg"; - var e = d.options.distance || (g == "top" ? a.outerHeight({margin: true}) : a.outerWidth({margin: true})); - if (f == "show") - a.css(g, b == "pos" ? isNaN(e) ? "-" + e : -e : e); - var i = {}; - i[g] = (f == "show" ? b == "pos" ? "+=" : "-=" : b == "pos" ? "-=" : "+=") + e; - a.animate(i, {queue: false, duration: d.duration, easing: d.options.easing, complete: function () { - f == "hide" && a.hide(); - c.effects.restore(a, h); - c.effects.removeWrapper(a); - d.callback && d.callback.apply(this, arguments); - a.dequeue() - }}) - }) - } -})(jQuery); -;/* - * jQuery UI Effects Transfer 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/Transfer - * - * Depends: - * jquery.effects.core.js - */ -(function (e) { - e.effects.transfer = function (a) { - return this.queue(function () { - var b = e(this), c = e(a.options.to), d = c.offset(); - c = {top: d.top, left: d.left, height: c.innerHeight(), width: c.innerWidth()}; - d = b.offset(); - var f = e('
').appendTo(document.body).addClass(a.options.className).css({top: d.top, left: d.left, height: b.innerHeight(), width: b.innerWidth(), position: "absolute"}).animate(c, a.duration, a.options.easing, function () { - f.remove(); - a.callback && a.callback.apply(b[0], arguments); - b.dequeue() - }) - }) - } -})(jQuery); -; \ No newline at end of file diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css index de94dbfe45..3ecf3d2a04 100755 --- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/slickgrid/css/slick.grid.css @@ -8,7 +8,8 @@ classes should alter those! .slick-header.ui-state-default, .slick-headerrow.ui-state-default { width: 100%; overflow: hidden; - border-left: 0px; + /*border-left: 0px;*/ + border: 0px; } .slick-header-columns, .slick-headerrow-columns { diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/animated-overlay.gif b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/animated-overlay.gif new file mode 100755 index 0000000000000000000000000000000000000000..d441f75ebfbdf26a265dfccd670120d25c0a341c GIT binary patch literal 1738 zcmZ|OX;ji_6b5ixNYt8>l?gOuO)6lU%W(mxn(`>1S(XO;u`D+P%xqBvMr|w-Vyr1s z7R|Cn0b8|Hu<=Zmv1mFqh9Fj!NuZfKB2MP$e75`XJ@>=!y!Ux9xR3x;EW!q1^V>X| znVFuRUN`NqJ2)ybXh%e__h!!pv(M|S3+?9F%(K}zyE40MGyhWF5-IDgL&=%2-9`Nk z!1@8uk4t%_{(K~>N;sK&dzJbwJ=$kYTlL=$%#0Pfh>U{%i@~wWbvYsD_K-D`&+u1( z#Ma`>%q<^UhzGvi(hyE`zCD{-=2|zL5>wnB=DE!U?(CZG%q4@lDnCq_%&3DCla#(X zmBhDD+RN$aMWWHm?ig*>1Onn6~r?Ma~N2JKAxN>H%UtRyRqS)6Um!-Tz%-r=& zQmTb^JFIe3W^-kAm`}`2P|niMh>RYyd)S^f(dbrx965?rzbhP|XeP}o&&DSZ4|oYQ z)I{f!SfycYw?3=9W;o-B%U5xs(pP267X~9-7L|4WzaYexC0GtG8wWygm63rF{llCEraxzkc=IxvFQ-y37=_;e5 zJLq^gsSO0Ayz?a>E_?{dmUc+t#qv$)XN8$<<}rQ#)lsiw+pmL&J>~+hgpo>i$m+;l zZIa_ZRIfSeT$~v5d`EBV&*k`apPgjv&B|+d`Q!nyu{L4rs%ZfoF0*Kq8I%ByOcFpL zK=>wzofZo<+0GZLCnWM3oQ^pb(gRSf02;~cEn@LJ>~XB9IkEX{$N#Z`m%>S!U{uPx zloI%bLdo$Adxlh(Uv^yX7s5G&C zLwNRG>~T?G{kzupp8EcyLGPoPf)@&9Wqfw_l&uU-6cexk%5;uQg%wb=0k_733{i#& z1a2p)gV3S2+QG1-K9tZ}E~I<(P0r2aFFY-c{o?TUOz3Xjod#TLE2A_c?*T7t z=1>~%YW450{Qqno4t`}gvLnuMrcu8+#xEBoY%2_+Mb#Z6S38+r*M4O`-+!zl(@m`D zQsi|GA2l3gEy}LFe<#Hv8?$_L#u8E|3-bP$*La*E>B{X!Sy4i6?TKam!49aXCAW4S*P_O^H4^*DpiA40o}Uqw~Eo&veh1`|8i zD2$x+>_b^bXE4N;AW=5>iYak2%!JAh0j1*k1{p#iRCjbB7!cSws~U{1IA@acLII$t z$>X#A+^s6iJ5~DFG!xa?>z{=lxtdi1rzbM-(nqAu3D8h-&64xo6|E!p?pK0xT;qoK z`6%+SpBk+~M?nO}>2mTw!A{yZ6O>Z@kwSd4;8aWU5z!P~tQl?u==^+R`{OmOS}oZh zOXQ3{6kuz?Is^n^L7;9ieB9C+8B{>t+pDrlq4xGDDn#T#3T5$l1g`FTQkU;b-981j zNm{zC`$wn7etklM#qHI4=3m5gwa6DNS{?Z!vSObi_od{4eUo=_S2BKNpkSdiqe(k9WtkeM79;2-%CFbb)aB=&H1?i1}uwFzoZQ(38Kn1zBP ORn*B%u*Wk|4g3!*Rv{Mv literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100755 index 0000000000000000000000000000000000000000..b1776f83964b7ed6030d7ef3be96a9b2593594c5 GIT binary patch literal 212 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F1SA+{?>A)!QcOwS?k)_>#w|r1Kptm-M`SUO z_5fqIli7AahM1>|V~EA+ zRdP`(kYX@0Ff`FMG}1M&2r)FWGBLL@umG~H3=B^DTu(vKkei>9nO2Eg!!E)68$b;V Mp00i_>zopr0HxP700000 literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100755 index 0000000000000000000000000000000000000000..79969e67b4f32f892201d720f6bf1e7c2493a773 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F2qYNp$opRhQcOwS?k)_Bce{j_0C}7R9+AaB z+5?Q;PG;Ky8A6^ejv*T7lYj6t@hpC#;TbB#aBAWwna#KLs)4eqC9V-ADTyViR>?)F zK#IZ0z|ch3&`8(7BE-B7HAvZrIGp!Q02A@cIL!br*Pgg&e IbxsLQ0Inc6a#?2AmP!?*K(O3p^r= zfwTu0yPeFo12TF&T^vI^j=w#x$i?I+((tf;UXnmgbH|3oY>pC!)f}(GR!16S-u+#{ ze6YEqRkW=8vGl=5qArKM<9}TC-}iEvB{zdaTcX5$wyRTK&ALcptHiCLb|dQ=paup{S3j3^ HP6RXUCGx5b?-VBQkUm|IuXOmYJrBRJgj{Vx zMbNnqUkncy+qa2-mWYc>swkcIuvGK#>(0d)B7)5f`@$Ei28nH~0h*~=;u=wsl30>z zm0Xkxq!^403{7+mjdTqxLJWrplHa=PsvQH#I51dX#)4hEMTnu1m5I5Pfd!ClWnggH=Xwf?hTQy=%(P0}8g>ch-vDZ0 N@O1TaS?83{1OU0#PW1o) literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100755 index 0000000000000000000000000000000000000000..aa32f1029984945d7dac8221c8966f686acdd372 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^j6gI&fCnc6a#?2AmP!?*K(O3p^r= zfwTu0yPeFo12VciT^vI^j=w#>k(V)1qW$CZ|6)SVV-&*#dav<$DMuV&n0Dbpw@aQ44$rjF6*2UngGy5bGQHi literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 0000000000000000000000000000000000000000..6b6b7580e2bf3302560653164506881e92366b12 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^j6j?s03;ZUuHXC*q?nSt-Ch3w7g=q17Rci)@Q5r1 z(jH*!b~4)z$cXZEaSV~ToLo`U+vu0Ue0cG9p8hWqa?gxxGLm=1A1u)Cewe3oSeCaf zI$k30UHXoTXA5lSJe(zTcE%W-S*bfB&J`pw9sa4-R?IGW?p~6`>jMSP&M+u3 zY@9al)zrvpHlQu4C9V-ADTyViR>?)FK#IZ0z|ch3&`8(7BE-Ot{4q9c^pg%OaK6Yqo^RG1puHty#h|2KYM!0=6gsy z8K9N2ybORo_{i$}QxC&U!O-)`D*V04jXAvq04SIhWh8ZcmyYuM?QKT_N5t*AU(|QC z`lq$EU`=GRI-njZ~u1-;J zSpxW8s+8ZMNsT7C(ScC@%+dXT2`5OBK{NYzHIl}|fVm<#cVSZaTx4gZ#=ndYA?trE z*6TOz8pLN8)cZ%(jWU6016qi+&ST(E3poFxz)GO7?ns4Wd{sg6kxQTmL$*&wk(S=K$M@P?Munwuq zWpM@@uUSqtb(TBVY*0%vp-ci{#N|Bp1#gR2R88&G%GMTNt4dmpUv5q&(y??C+EdGx z^JMZn!W*sC`$Pq%Yy~Hv?6x_%KeSn<0q?>=uGu^SY6-q%nd(JuwichK;boIJ_-fyGyo^c4iY)A4BFhl?YQfV)08Q5_obCJr8fY>U@@(?vtN5m8P`}$qD`_kA>55yU-@P^ZRLJ_laU~!}(Rt(~B z*Pf<2{k90cRH&ln57cc5VTw3tSO#TgPA~;0XZw3MpoF>RcKil}aXxZB{o!lMAco5S zcLq5TI|R6H8NCl?4tr-bwWQr#pSefD;oreJ`lvswaSON4i10%-7mk0?(AG-4immor z9H;RPv``uPMyYGv35PQ3#I&K80$TUcafx9gc$5^QWtc^hKQ^>_pb{zK6I)3dha47l zMOh(I%FYcqR#kVuh}Mk)^S;D)Cxuc!zlK%Dv`iIyE8&+nf*5rtP1BTlyDn^><9K;4 z86HgzNU+-iY)M0k26h`GJbr$2v|jnk6BISCO0}8%9!|oIBbm{1ob>!^6i=MlT|7=*X+;ne9tR&Tj43aU9ArmELhOGSph*ju7e0 zYHszpZ43?at3oE&I`=O4aO;k3@bXQ_KNgrzV&Erv;lH7G_7gT}xW8_3g}$cV)&hx@ zYcUdC{$amhqC{s6*|bQF?YwftfxXdDp3w97O2XZqJ=NlFU1lx+aeT9&2iH2yn07J^ ztU-gzPxI4j#y;Uy{$)I>mqUAdBrF5*7pj+E+*bTTeA=fxIFu=5pGuXB5|)+_+1{r8 zm8$PM6~1?KX=8>&M*M0-XZPlN+&wr&nAHNBaL18_-*@5a^O&O4CPT|wZ3FZnZd-C_ zH%chjeO1Zgy;R2Ck=^a(pJl6MGUyuGHf{?aBrD`Kwg!@e)(OJO8Y`h7o%fL?F#D`N zw01>z0l$1@#M+TJtVZm4=9#)x^#Y(Zl@Ebaem?a_E4>Asn;+5z;n78y2x$|mIz;O> z=LA-DK)*rCDV(<`6`a%5`f$pTt4j6V?re;<6#zlcYS=z~zbMxCn4|Aq`ybn;`Yu(M zRQ7aw=ZAaHH2QDR@p;~L^Ee>-Xs`)p+LnQLdTty4iF-cE$Ip`0&1|%;cot!b=382q zjoCNIppu|H;KaMDM0mG7o<*plHL^)L)BbRn3O93K^U5vlkFT$V*n{J-g=v8HK1iyS zkcDIddGxjI2MhJ*+7Gv159IhVUw>#_3=zn^)~PspO+}59SBd0bC9Yfmh?IbudsuTQ zs>wKH7)IU;lwDck|EfN~QWDkOsu@QFHTkh5@jz->*n>j?y!t-Q25xPj+jMj}qE|L^ zdz)(LOe}E7P|?r?N(=*viyJWUmfwRL*o+Up#fQ*J&V!{MbRu@ASoF4Nl@p4R2!9bJ zR!QjqMZqUY?HLrta{d5Pm)=#eaPlk;$Wm$l%EgbDrB|HE;n+%AL-@KljyJ$BA_iaM zP)Kd7-V-ch+1BL1t>6*m6ZBwdjNj|Fyld1F!?5V>)ldXR>P!Rj3LED89~o@qgh#^3 zKtM4kL=@Dv*QCmt1Bup$INwW$t zL+1r$`czGIu8vi{pV4iS$b6q#J&lwt4t|X@10PiH(e5m&>|mPY|Y-yP{%yD$l=)8rL4gJOpu`d(OFrMe~mjf(@;A$NnP)fU0ZrvGrh5_ zR+kH}c)V1D6I!>%^(53m>chfOlFRwCR6=|mLMblmWoE|kgs%d~H)HWXF|MSZ;o2_} zXoxip6j`P0QN=B~cDr@!Ny#S|(6ZMufMpw&*m_O!&Dzsk0pne$HmbGFW6h>xHpL0$ z^PKoZn-a8}b=lFAzh#=Z&GFFT%|`1$BYV{nbjK7gUq#u^DBp_(fwj`7A>Q4e3i$5gx_ar5~?}| z$Ub&(Fa@w&P3KB4DbMsJCZe}JYcT)=?domj_Rh)E`4#PU_DO`Cgba05#QNE}FioF( z=4Md%aF7NiUxK~b!>ebhc5L^qFwByIXttRI$WT7mp9ikZw?ahlNbP2Ca>QLStmNsM z(!auaRz=i>{(u2B*`{rbsA09d5x7{{z_?Px2h0}Pe2D~p`VlaJ0ES_Thk>=0Rmd3S zYJ5h-tSsZ?2*M(q0V*^3yu+ivH1wBIwn)Zw4qcOPwpKsj#c73oBpt~g@JZl@xaF3p zjp^nk{3z_k9p5BBP@tTLBoD(FE5thlRi{Ke`0dw4x+q_U`=IV7Z27i)h!b{M*PH~O zvP84UTa8k!_`Ve6qw0fXK<<>SsWK2@SAj3bDK!WviJbS^KywBI^3@G#Z6bGw>A)l` zAA-a6kj(}iFX9+o&KZz^9z|pFU@9#Vtqcp^be)t4j2eVO$DsA#jGtLC8C)q?tUev<+IIJeJw3T9Jq6P!x9#p1GC%eb8^%g7!6 z?OZ}**`n3EA`CDV)#}py(4D`5*ptAEAD}=RshDW-m-R z`F&t(TUAhng?~RKl(X|XU0jvrKIhxaj;9yAJf)IDd<|U$T420XAzk6oX*$Au{cOQd zYKnKl`Aj+h$9cvUY@ofkUGFB}1-j%`rnFWpY77eX{szQS;pUo|@Pny%-FjRr_Ph}P ztkuc*^^$OJfH0S1&<8&9HN<|S;_Bk13Sd&{H!grmkE{$UZg#4-ey$jc{p8tsF6!2w z7`t{H-*|Ju7Nm1m*6R`0`WS3{@8D8ZwkC;DU!-W@kL7`q^KhCi_qXF4qELoxv}}t! zhjdI4vD4iOR`iU6<=!d(_Q6*VG3ImELiV0niI9|tyq-8*vfX;O2x&_F*_7=95Q%cD zg_NlR{D?lVr!d@H16ixqJV-g=MHu!%lPcG_qK?OKOf%M=t?)bL+BlQ=I>I-PlwYI| z<9nv1Va@DcVZA$ICZ$ud@3&~a6cu-0v?g&L8;-XXHxMf&#`VZDdh0my=WRtSE&Y;< zVg_7+N=`2pt=<@ea??J{Eo8pV^xkcl5-{y>cEat<*1+zqU+dD*-Jg1CAKeS$qcHW@o|oG89!xPQPd zU=J4_*A#&=u=9@msmvJUmw0|kA;Abe(w2}A7>H21@&B*2Xv#@1)UZ_1d$xdR=0Du(XO=y~j*0KU{3=idQ*cV;P@94qdtTkab}qSRStk zo+LnSpdmLX9#Z+hF1a+r2!UVIgkoiOtHEa4+i+h@1;_N`br*+EPYDDIvIAL;9`fgW zv`3n!m25FWgg%{relJHjtU51_W2G0p+ww`G-U@Nn^$)AGn5R;YH}- zkx2bCjV%Q>D-`$(=xy7mye}|whf8=0p*U|y;s@c3{nM893||#oww%UZ zKGQqQ0mNF-f;|?j+jiJYOcP>u+`YlenadQp5O%s6&_VJyM7x9xowxNLpArM|3nz$W zqvav(0Vew1Cu7%_BPEDk2{Vvh=OCW-FRIfDQR;xNSZ=Uqww6=-hw$Jeo>+WT0KnmlNYsak$hb_KIdXVRrq|4 zc?l!EgE{dGxxYZ+E8~BK2SBtVuHRh|`#D8+iAg8D$Ko*^l`dx{Rx}5xH}$awqp;5^ z!Sjb?OiUDikL(Ag%PyI0zkKmYHH~FQ7P)QGg{VW|i4WHh`CulLA`rhuK6S%n^Q~e8 zGB&(6yFYe{h|U~)r+u3!T?^r}}eT&_*XZsk)gDqoI#goBdqU$eB&8 zADcQBiq`C0s8z}2f24R-qf;lpq5g&SMm1;>_sw1A*VKy&12j49ya&fUirm5+vlz`( zPz+V7TI72^(gP#-&3A4!TVRXUwP_sRH=)Ng(b1O@qu3L<)|}g3&0?{f{sgw05M(5f zfEl$_N3qf~^pkf|C)P#RTMlulrarg046JtX@ezPQ8Au7^WxnrUKcf;<}H4s$6v(9)V1%S6QX+2kM5j_wN&$+H&Ll?PU?h`gC3q=8_Gr}pfn6( zD^qHZLJ|)R9Ni^U0gpI$sh~Sbt`oNlgH*tB%dc|dBJI9SEbHfjVa(dN0vIQ<5489B zUt?1`&EX-;?dI2)ugv&1>#Q2=;~t(t*o-g=&*_OgR6bIl8A$@8&lqNp(u_eX*mukT z@kt{=LVp({=X0XDT9{_0j4hklmuc72Dpr}qTf6dVkHzRWT(_L`dk+e7E5prT{=J7+ zau}%_SG)z*oDcekL5mhi=#Z!wJqlUp=BdY1fjX`H^@0|m#kO=Ozci8%WR%*YFaDk{WIi==sHQdKM-E@nZ~$zoYV{Z$zAr@SXm=Ieg4AiPmFfNJjWYzvFdG zA&;;NZ(4#%_Mm0Y6z5<**tK(1@Fz^J9=6KaPtb7id=(!4(3LBi=!pTkIsw-=m${TB z(u#26e%y8`PZas8ha=O(#@(E-<;+P8}A(sQ|tN^1Y-XY_6{ z4i@bvxR}9%cAo0U4bL#nF8RP{@Vb}iO@(kCmbcx~{SVw#yEH9}&#-l-Q@BB>SM63) z)M8*Q#?r;=@5^PuXzT_+9Iw);!3epn349KNTgXw2BDl^#39d=z40T?)ZeH?j#TWR< zV#2R^_)Br>O6;>UrqGn&SbXGapKO)o>qac~!#5!uLw%~`V?2s}8z1z}lKspGrb(>Q zW!28Hzj|t>gyu;57~@?)?sZ--dTUOT zgPs0iapE~VL7vqWW~T1ynETw ze|$G{1Wj+g$^n`e7_2wkNYt{pviHdQwo*m1pLa=ghj3e}7EV^h=0K($(9ZvciWCNbHa4$!5H} z@Uag+U45D?uq;cWYMb%vf!|+SckQdvN`Hz*nZG)Wu|iV6Eht%=ASH4asU_QSO%V&> zK)P9&^FpxR+ldG$hmRQOv6p6t4D&)pdcqgb1pb9FMGpL3kf2S7AIf>8_5@gljRK0a zuo8%h_4TE&G3_|i8s5kmN5sREEvF^ZpV&;TN}=4aD2EFsm7bNVbW|D;YwS?4zHnOk zRh2=*`eU(1sNXiurRQ-FX-&CUNLT&(^BU3Gm1MX-A#Ry3-5;_0%2QzBK$!bRmR9DD za|pF*NMS730`zczmK)~$ig`Y;iJ{UA_P=mTvIEThFi!YeO={FwGykGpbHhn|wppyS=;NW{OKezi zj!2ZSoc@n7mvY}Y^gR(1mL&a*$(=g3OoVMm6xx^^OnCd6{fh7mACHiAl}_HiQD$Uc zrFFMj=+XE?>Z0qD4*{rUx2f;dx@5j(nsN*OS8cAdS7z1`@!P;TmfUguONB$VdwhK% zos$YG4>4D_?sYd))nMrZb@Ae(!C=;edumLXZ^h~WQh*iL8L7QzF?Z-vu2qt7JdbpS zFf~Wo-1403{&H{q=g0Ys=>hLk#IokWMm?&W^-bk*fc_?<#IrBY6r}2ShlICVkcn{c zdPW(7i&(}tc#oPw25ga|D>6A8Rc`0dT-}~TZxP8Df0p_)yc-j%EA_U!r^X8pCt23Q zi)I*&v@KR({{@KG3Gzy#Qg&#jSDk(PxA>sb2K6WNXBmF>EL?FXyPz(yCvnUh<==#| zQ8MTU8VS>zBhlVdeTVXCxM#c!iv++wbZS7eNcIu#53%vURlwJ;_@D zBDxn|woIw|J7?|q1}EDLG((i=_duGUnx`2+m{fttG2`%ejStF5eEX@wrz&{?7KV8` z&9YImZ&%Z6@NjmzP!{IUan00WfazVIDzm0ryF}hHmFB!n`==y5?-{3R zb-DvwqBJ)Q9&0F+DLhI89+Z}Y#^$uUB-C-MVz6ls7GhBwW>WkFa}wYM}(!*H8ZZ;s71H_{Q&d>X1aCe{>Lo>BgRnjU+x#Iub%bWrCk?Eo8)94 zGN3I@nIw1gGVfjzabx9H+z@G)4<1bDs}yBF7c4twl5_?uWjy}f1szOl^lS+Uaw|cA z*qg|L3HN?s8CLqSeKTRPHf>}sncYz2z-S9R@^7mEAOTC?iE=`egZF42l9-R z2qCk%SD^mlA^bv9^gf%_4@ayP|1p%er#h(hCU%SKh4^t-H9J*ecyEWk(ywYw zi2gO++su-c3H`Za?>+JL;5G*N-UO~Aif+W^i`U&~^k@*}+NLT0jf#X*W_HD&`?Cc* zon5kT9xfLGw084X3;(gEk%G@1gt`R&Z*ja5+oM-BP-u^unAQm-KkNEt9Ok`8EgkiX zNTdGXL+z`l-6wfOB>Hlb9Qr-v%^}%dj6WKcGgamJRvv9_<-rwdBPI&i-=o`j##)=IO5~R!mtE2BOMpe$Ck|v1uyKkgw0yCudF6`J zk$H>43vwO~4vTQ{x8vLxM?C%%nFGj+fEobk8aA1U^E@sd%qN-bCDeC`f6QE%u1n8X%chuzE|55OZ1tEqgxVtWCFJ-41*!|2 zkGcm&d8~?;W9(>R)`2YqEs{B_kylO->cRzZp}AgX3~W01<9zrP9?b2~)D$AGe)9NP z#X#Drknh{m-4Uagtbvz}rI)RUwTJDK0q}D3@NsbSa&YtLaPy1s@rm$ob8riZaC5)1 zfF}Q2fQze*!#ltKKfplDm-8ur{BI*@yT0@CvGlM7NZPns+0rVySlZcY*;?B8xsTb3 QJ~;stWz}Trq%1=J3#jBGg8%>k literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-icons_2e83ff_256x240.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 0000000000000000000000000000000000000000..84b601bf0f726bf95801da487deaf2344a32e4b8 GIT binary patch literal 4549 zcmeHK_fr#0w@yL`C4e;PN)$zq7MdV6lwcrqkj_hxqSBk95FkiZx)cEg;gu=~5ouB+ z6hWGRp=l@)L3)uU1VTRa&U`cXhx;GgXLk0S-Pvc(?z1yz&UtKVe1nx)fEfS)ue-5sSDU*q&uA_^$iYBH`q)KEs@euwErLfRY0(1#rISo+aPme3jja6Jebk6?NN@* z#hd;JcZ>j++yLtZH6Cpg8g|}J!|?%oN?9H)v|o>ZQT*-LaOJ0^rBubXFqj(kLD_UJMQ}V=jE>zt4&o&-@Lq= zik3Np9XDyTG$8i7UtF9`AGi09bg5NFc0!mME*KyN<>26u1zk#AYhqFz7uNfX*!+2! zJfYdnQZ~@ZsV&LQZ3wy(ni!OsOBMlCg0?IXpJg=JJUB-|*MUslDQU*lFcDn-X9-MB zI*=c;-cUi-Uu0o^N^)wF3Y;6Py$Of@G%DiFwvYeK90=V~z&wEB(>rpPL~wbm1G;L( zTwFroER(ntbSrdNTH)9cv)H(tY^wVgUGe_Q`Q&73K{V16k@q_~U+bM9FuddH)*u6( z>4Gh#Aj3w0z=+|$b6?)U(1tz(U=mbrAS}msYrUaiGTkf3Okb@ufxr#R0JB^>N073a z^cs&Jzm|OlHSh(i?lHlGLC)RvryT-jbndG_qWz~gL8nsuMYE1(kLFS?q<{0=gI!6$ zLBQ3ZPt(m|SXF?hX@SC)@b{H8SF-H@u|3nhnm_`eU$=$ZGif}sQISZzOQ@iG%9z|0 zYi4!+I?&;<;OJ1N8zTqd3XV{%br592W6`dnl=DvR9TC)eY#aE%=o2Y2dQhA3M;4JP zDo|CJ5Yn#U^Hm3YvWs{;AAs0;1ilJzenZS_T5Tp=ekuIHNbi5dnX=rS&H6?hL`gP} zOe4P?50lMr7EpXxC(A$)YD42zQmlw&kc_c6d8~Y3gAA_hKWa&ub#_e6`++`SE$-!oDpa=J?txIm2D?1$C@l{mFhYepBcuPxCs9yKSS{mzH zExNUGt62TzU2FntqseVBo@eW4&T?%+3=>|7@Q_K#z#aJRIbijhic?|mKY($16fe_# zV5p4Ai|c%yGlM|2l#hgHTO3AW7YONN!8l4W+?(2K>41@2< zDq*W&h3_Q^xGqk%os!Tw@q8cqJjhe#lL0)EnG+4QZG=whwv*zdibt3@HuKL)0Bg}+ z>Mg{m++0J>vyMrY1vtz%6`d`-i9b9rJ>x_VmB>N zW^mW;U~x;Hf*t58r?QBje)~yjutyJ>+6h_;kBQwFSsDs*bpiA`=N0PLWe&>{YP8%HepZuQ zQ3ok5pKcslG;3oHi{Rv7xBD0zab*4CNNB;CUPh*+1Zm2RKTnvFbnP?wbZscY^P<0J z*|?G04|fZvi^U->jmBpTj z2kiF^K`s>AD=ap@6!bUqY=rN6+Z(#o*VH+cD!s{{hvy(PWCdV0aIN3p>|$03Q&uj5 zMQ4#|RTISsYqdi+A0MF9My1-u|zVl z13~+&Ag%IbHk3A}A!-bfzU4yyjGn+fEPT^n9Rlzu7@7OAz3XB`7-2YSlVfZQTx27i z-^}U-8sNUrbPREK&0%{C#%51SsO02FL=ao%3S5132Vi@bCIx(rRrqLiwiKG-NZxRq zqR-O)2Xr`-pPE_iggPbfx1N~>Uz*3MJ-rmi#OzF-pYKwK5DHxpD=AE35q6+HEp`q+ zr@Sy)cp$k<0Gtx9vII5;gzDR zz5yy;6D8MbhrxQkN2xh!CBNj*c0`>&xOdn=F%|=IX#@Cp;1iTk#ybf|jbPdL`e;BM zZVj&+_&A%zBQfvM$d#RzR_MGD^*s@!3@nt!5i4ZzcjOzuuI^#p{+YsnO(uqT`e>i1 zo1s5{3K^F8P7}_uv4lV!)HM-IV*FxV`>AdToaeCW-G$3d(eHGs?-o~_k--`U+=hAhy z>y!3|zTmF&aVcp`4$gf0L?b+x8%7N$IWXEwLAIvwaglA5+olz}Rg;&nSg@_BO7? zx!=kk28&Y#Yv2n%dS##9JmQ5~(-q#|_k1s_?CM|hHo>wvc`Okr=;#kZDYMM=QcH(6 zrf(4Sa%wkO8hX$KVRFj$-j&LN0P5q!s5AV6CIKr)^#SVxrTdig*DeY$xclK#g)BS% zk#~8wc(LF-eJZ^W;pO*2pVU!dqpvYiWSKdxU)JiyK?aiK3>$*@TU-oB=%@3htmfWW z^vY4~Qw?uH8_16GeSjk54z&ZU_MSFEcUZIP6uOd)4 zxb7<|Gf;8GhPTX3QX{<5&FyF%Tbc>bD%fW%?obzJa(#MaHjN46HMLKSu0WS<7(dzR zf3!42cfh?WlOHY~*LL{K#2(~IGf`iZM=pA?D_*hvdP(ya-BPVmn)fW=M>?-%M2H~w zSc!C=Llxtc^tYYJObm?InjIMjnB9u}o6+y%#PhSQs)SzDs15D)pl9rCq>&Fc!-q@h z#VZ$%1ZH!G0Pk~!JFK0;sEXLg+`xienG2eg8|~>={CvlX(y2UyK|1oY!+pC5!4|VN z@wl%+lnxAmws7l$q^s@qC)c#(@Fg<`kM~t(i%v2WJjh{X*PmdSlri*tG(uB0|zq>NV z!O6?;q+<7BKc6?8be;b+w~Rn7T2v`}zdhm)Pxh(=6=5@gmb)>+xn{rP9F;ubQ#V&; z-o#9dox9QMDQMHd`EpA*L0+W3VaLmMyKT*Bxa7erP+2#4#sf4{e?6Xr*%4tjVzLh@ zU?^ij-!pLv>2K4Wdc*x8;c96WgQtnX8SZalAVHyP1>E#i?htP7_@HkWXyBmc`GgHH}(A(+3VPA{smjz?G$Yqqv~9P6D8 z-<|ziz;ZlG1Yzgg=-j)~zAiC6)|e!{qD0+j!Gdt67t(bu%wQ9Nd zouo$xpXt%D0Wn?(kRh`n=yh%V;KD-M$_NVtsGP@zh(c=cV|=>LMFU#+vpG$TBSw=X zX#;-GS6Q-gIml9ccWmPzO&HGsq_ZRFfmytOoykCMRbe{F2k6#e^0`@hJ=`<}`1fi` zf+vfgs#L$wm=Bf%YlAI9#BVDtg$9fT7HwHX=HLF5@GOf#Okg%ToTg>{FvzBpb_obt zH@2!A;G^5^HE(rld#-k^$WOYRWCueG_Oq^ZWZTL)~e?S~dHhwC7=ZHRh zrk!EF>gQ*!yL&wNH+tahOouoz+z9%oCCbCh|knXKmcNFK^7FJ$uQn+rSl)p4D(9&X3o0 z_QTl6E*(d(HaMg?19n(0$!}A47*#ODU<0XhXCIB?J6DA3+t3ofXCiA!QO7g_9?QxE&;%|( zCB#lEXNt+0o}?8CrgjmoM+FZ9d*^3olg^ERe2)42i2rTONO}SH)FR2!s83D4K}Mfw z3`A!?} z%Rxw+AXn!gHx-uvw^IXs|MU z|2M%#{eko;f&Whg3t#u3VCMigfR?N8EjO6HxASc`b2n$#hyJ~8YNv+)`bcBlDs9Z8 F{{S81aohj^ literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-icons_454545_256x240.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-icons_454545_256x240.png new file mode 100755 index 0000000000000000000000000000000000000000..b6db1acdd433be80a472b045018f25c7f2cf7e08 GIT binary patch literal 6992 zcmZ{Jbx<76vhMDpfgr(y1`QHmaR~%lf_s1jS=@pJ3$lb=+yex64eoA%#UZ#ua0rVB z4KA18y{BHibKiM?%ydsxclFFS(>*ocgsQ8`;o(r?0000y1$l@j004Yc0Y}*AkG*V$ zv*e=ynJURa0J5d86F477Pd>?iaCwyS|J~jW*uDV(DD4#>Qtv!|9i+qTEablQNm$h= z&CE0X2ukQD(>|w9dGqdIX)YvBF@CS!Mo^03TqmwrllgV%KEo6shFx2oEehu^_cs!f zI;sw@aCA*YlEb$oWY?7%>bM;vUhxUi8np5~I@-VX^5GP5$Q`;Z0hf{15s`~)=nCIT z{KYcN=k)##CFFtF75!TrmQf$AG#Q`<^mG!=GIt&I#)o3-O*Wp{;A<1pI!eg?%2!!r z+zIv$wg$i}8}QOLFS=Xh+Qf4z6c-3wKnenV={H5)s729tL?tzQ^60h+rL#RDkR9~+ z^_M@C6WcitD=p^@wd$vx=;$W_mKfVOT6DDpbQ*tH$WpY5W`$H_qLZA(#re#!6)VtF zU@=7mmXUgOhjUus3l*37VNtNse7@B=>Cbiybh7iER2KOM?LhHBd$Upgt#lg+ZJO>l zxu833ex$XTUzvt!1q~LKA%ec^+*T{O{SPQ(pFDup!nZyM z??tIZc$9{v1Y+SUAeG0mvyl#&=ASO^c8)eTyrwZPrzrpP0P9l?A~{ukG)rOFeYVzq zzu|jZ{LNIs8{QUR*bR_jTemA#oduSf;ShdMO^19Z>hkCO(lWs5*T9y%kfQN0f&ePMv;kDisnr5y%7Wrrkwm3!>`zkB=ovcMAt8MEi~kp?m~ zfWU+~+`1LPuo*U~q+a~EcRcReTnZNxiS+zq!!}lR zeC}vfalp8A^dS5nePlmnMN9rV3866Yi&80me{+~71G`Bj)*jfaXC->#4ZTZKVig!J z1sxFCsdnX?F1@QQ!y+DnQc#eV>Noq!Bo%`R zCQ(53=NDNlW2@k8qW!H~j_$u4zW?zk{Da=f+F198-BsfYtYx*vT12>Pt)AGzy!EVs zB0VwU_wS7GmWz*gW3S&S4eB^Ikb#?0hD)7@zncvPpPsoT6)u8I%Ht5%p9-&@W`@hc zq>oG88M2fHhXn%KZXGzY2F)1UTR-Q#+b_iw#CvyW?X`v|_ZA%MNpC*Dt{+LRUQnfk zJ#pQcGi+Q?`h$vw+Vikh3-*uOV-5153P)ZBY5uhIuNpC?A?bRAZMWn_lu^$clDy-R zkAAPp*&jG%+0HBqQ(;%y7q1e^@eJH5@ngdrb>fH-qIkxR_W}0#N*2|w#hXUD=x0r8 zy;J7sx_ljR@Mt|^G`#6J=g;0tKIqUStGERM$dkQD1x7457!u%4xHiuJPXhk?nT47~qxNz753wpc%qyIWt|2Ng z_jZkTS6_=NSpP0`k-*q*!1RwZ7kAa1iYPUBI`_{S`|0r!((875#MsbVYZpzro`{uf z(1NYO8h`jJw@%C5!ogzs0E3AdeT3r!-m5A%6m)WJd@OVqIw|h!g`c(HYFw{tAtMv7 zf~zrF<(N8g1IBi$`-{PxQGBAk=_oNT7T1q1DM*sgATLMGy?22&M;JYSQcROI(mCZO zrNL>`KU*`J9mvW29TSQ zkoggZFYh@$?q0|Ls(JrF-t`htX7Yi_9`gjWYB?yFY$yG)m>;!D;Qm<7oB`IQ9R!DfGF|6|Lc08UQd%kf4i5$?|TTc-!(vs0SxuxHT<;OjH9i4e{GK~!f`;xI@rxNGkLi8b55(Sd*g+p zGjYqlGqEGPtnp91>kXd2jVuJ>OJu~$i8odw^qZQlVq(9gxX?It0+90@^LE$XUvX3N zYFylu(xzXrg!cz0Z87@>Rw6x%oMv6t3g%g*5|s+smzs5B@4 zQdQajJm^V%qeYzAG{oijbDQ8&j8RHRdk2HC?b zV<;R)jv?Sl!c;LWU_We`Z2jWOd+kH_J@Z$95xP9)r;Ax6!_6saYmjYY5Ks9y`#?!k zN(oS#K)=3{j>W@Q1mz)BlkO5`Z<%b-vMvUXFp7AHB>gGW@fzDRUCUnD!`So=6d|Lx>37E~b1{9RyEuRtrtcuQJ^tUmgo zhb<0OkTo!V02@;9VB8iT-7pVBircZJI_{zQv?gH7!;RKgHSi>Kq}dA!W_^Sl#=qD3 z+`y>QW9Mh)Kx+}|p_#5tl!}lt8|Ut%A7{&Df`k(5UFz^Sxr^&`POLSj#4?sBGE@Io zflPsOi(#MK73=H=>0!Q6?-LnsJiBoV%J;ha!$zCs9vHjNbcB1uI!*6LsM0VJl1w#n z5?fA%styL%3a)f+`4tZgo4#lE(`KyN(YKX|x8Xr>C4LmVGyxeye;oqGOyZrIk-|&2 zH=>-)NFueW{txOInI0Jnh>Fv_pqcb2@>sI>8v+^thI6@@+8peFs$AVKr}Hy7xu*ei zzZKr}$BOlvrC_F*`hU>D5fne(E?~z>+*@ex;50yyJakvscvIIlNy{S#Iu(uHVm&?6 z_3)RW)}4q&837WM>W!rh6^9QPzEl|p7-^Q5j#PJo$hTRj93U>As?(ZBT$$xK*P+0= z%_E)qOWKFt3r__z;xyBA5iV<$X1Ak@)>Nh1rtY%aT)}s>3Cn^Ln*vJD9a+zDnB~1z zs=tYH)ulLW1$s5~MB=Lf-k?YHb(w{y+u?uG(Ni(9`c+vb6HN1Yd%{8v*0`5>Mbq|E z%*ec`G8>KPyaGI(XtBDo{#^BxS@qO&vo|soFnQG3KEWrXDu70Yp^|fwmaALR}Dq>mmq6--TcV!Y%+e{!D*vU9fGS z<%;Ey>wOvVc?qn&@oRaC76jk2xictE><+gzs=!l1?bIh@Gom*TLZu$L_WX|B$26~G z!^+GtV9NzY__{Q|E^PPZC`eDFOfL;BiRPYPdABimd$v_@e zG63JrX4tQK$UbZ4J&&9Rg31G7d#N=dU#s9l2w#YhP&YS2$_a)Jy`D>#pZ4bAm+kPBOTt7`F=X)SbvJ!-6(%(D{u+KCqiJ zRGXraN!wWAdGBZD@S=-~Q!Xj=W$ns`%vFnK^T|l<&L0 zzF7Bc?KnKf0A%D0QiTyl0dcPy%TcSb$9qw7?c=_!DSw`zfME>V7ij#{%VhudH28{o zB55x8hm|#bDh?JaBPy!D^5#_j6%KNs7O1MDTG0$gG+RG&=DPP$Z7Eq>o5QTqBlKM{ zj^|5TOK*)mJW>iw(%AE6x@TT?rCuXBr2nns!2DZ0jlEl_rK11Pvj5PEb;6$B64$f; zERSKwc2z;}!v;6PLa%7PCMhJGW8i+@E7K}jP*->$-&BM7r)M%uguJ3*Z?-Gyn7t>y zlX2%l=&H(;(=~bPefDs?FpX!~vID-_KFsht{e0^=C3~s=l0nFeCDxkqPn%S{T;1}+ z^U0WV=8@02j-Yz`tg4+)X$O%kr*=8Kg)FuQPj0kXW^<1Vev#ZU`V4Wk+$IUdpKUb) zA_@fW>Lvt)rG$PE1PXAZ^+Nm?i#{6T`AW$d z2??rAo9}!(Wd%cbqQ(jLCvX=k4{J}kTh9o-)w`Lz<*y@X9U>0Aq+4ScSd{uv43}>L z9fmRPY!UcoY6o0`0USeBojif~*aKg`lf9lIIa)!gi6BRh8KNLjvUrs;91hLeqNMfS zCQsMu*9PMJRnWW>B;?z-E_w#`b$O1M=!ks8f7%8uYJ5zV zb;bZW_aSz$O%y-~?coWMpn7I_3YtpxTCDF?i7SbIPWAJOUt0~A??@T?@A$N|MeKTq z2HV2r=je7q7CfLiEc=-zX_E8siX%3%b-3(#7t5d+wwN^kB&%sK&3#nEr}z`}huWTw z-a3Q95`#gv;|I&a5zK|hXwC?#MqesKYAoSAA>mbf2=v=88JipZkQESDO_4Ps$kz*|4RJ3yvIWZ(OZC(W-A(zud&mfCZK^;Oi|X%ZRX1hZBT zqnpyTnlv%DBQlFDxy!t{M-l2Xl*0Y9l6-ouT0IY94V$H?@y|jxP{!KLsQjeY)MhU; zRB8L00(@^S1y`)}7ZmBGyr3^6hQ)>|Drp@DQc*@O`bt)$FjkAiFIR-J!9I!)7|YbJ z*6qbWVtG3~rx7*O;o9L3n^rgsEYi$?9HB0seONi*k)4n`wFA-;{p&gOwG}Y*@h)&> z_-g8#>+&|yv>BaL26{Od*MPOvzmx8GU@;c!aw-e=P=hW9Q<&!B{)6h4^iq1Ygnsr- zo+fT7G36pt8>MaZ*E)l9LRgerM@rjlo6ilV1|R|9)XPS@C!8Bm;w6fKDOV=9F{-Up zBpQZC1*Q|aZxzho42Yz~(N!V&AXawORuO{-EV$yGAFpg_WD7IDS7lL>Ig6rEpO3DAu^g-j&ztiixx<2cgQT(plWMHMwg?kpj!iiHLN+#}^m>=I zbNlI`>K~il&*C=+LlPd(HgkH`v{IVAU4(GnChq5-B*) z;$OjD*q;8{KjVAe>{Bn7YQw9A^jCAzbKCS(uX<__ZYp#YUc~*;3`Bsx;;@{QmMFEY z!i&@AvT67wy~hi+nMg8sVemK5s^3C#WCL?2v4OgBUW#uo4x&%KQy=X=&{olMee1*U zOc6w-6bVAzCQuG%yo7@uGq8s2v(dv}QSNSy_#_&t+<-idI-bpVK$@6JE?B4)kEKs+uQfI> zB!h$3d-=Xs_RoXFn?X|KM&-Wq!BWOq^O~xKjMWT<8ECHW>y|gm!V|%I`?=XiQ>7-~ zNL&kxvvV{_+NV`)R%AEI!D?9LY5sN`)*Q7&Ro6LFK4LjCpC&l^Y$^1sDkT0(Y=?PA; zvnObr1IRdBOGnJZ%fn9FE#yM)@?qA5Pb9;+Qqw@R>$as%$@QquyB4&Y0y;a^T;Ryg zB5&=eoyRGGbQeSJvQRXLx-Ej~ zHzi-1nbaQshcckghwHloKb%AEB^iHtwEfDr!B>}KXJYm<{6d=Ok5`07247mGu1Tol zmXG5;+oO>=5yet))qw1u?8xh0gq;xbDeF*<=^5#YYAmpzH;U>>o|7y zGX#Cr;a*1yMqm`yKK*@xTID=-`S2Pq1&TIK80~pa9;K45;Y}PK^H<8-O=+M zg~JK=P)9YRP5cD`AH+4{!~1o2);!I;2YLYfyM6ob9X4p*%it*pF#2Gx2Q;@m(3l$8 zw~IL=5G{TunViCbw!f2#k>zuPzH|EVEY(xP7_NrCYJA6pehay57n3e|3ziZ43S|zI zyeuV>a1F8Li~WL>Y)Kv@x`FvY34o_a&td}LU+va5?;eukqEA}a4wT*b*{)YBLl&WT z;$whurm@d-2&%g`#>tzPsq*AT{n9;?quB4LXc%dj4Y}a&J+AX0RpTY~YMSkpymzvp zce@5k3`B@shWuaKcSI#kiSLMK_rJ)y|IRvkO8-S}H9FO1IgI`pWYyV1 zIj^f>bKh9DF#43)Qn^5&m$*=2x?gZWD`1YIaj-llqtR-tqgOJW`w-nkR=+(M(-TO6 z#)#HO!8gH3K;spVB&3|gJq)he8Y+k<{<5S=iM3Et0shdrf% z04s}TObTG{5JuP^|I^H>;26f8+}M9X)qp7@E8JuT^WwwJ4CC;Dwyg<3KM4H%0gtkN znWhR38|$IQ=m%AjKH!nnFCWaW$TWULM2B`7i39|~KSK7W!%aGUB(S!hn467}0rgW_ z>cZih-~$qNlZU*Rwu3Fe55HFc7CdlrHOm!8LBK4oT9`CHeO?6-Px74);WjWx0nOu_ z08mbu^=6-3IL_=LfF(_i?J>p=ghET<+~F2LT(UwyviW|3BiL~@R>lcpuyb<3>FAZ zkmbGIJ!jwU+aLE<-@aAd=d0V*UG?1rZ7pRYd>VWJ06?UwqVNg;KznQgj&U&`?~3_8 zGLHh?MqOC}08>3;XMB9Z^HMSPeUvKyyp#rAr2qgLKUD=;y`Y7|yihm$-tc~D$9W=G zs$KsH?0L0bDFu}Lv_-8Byl|sU^Fyr4w-ruJ{qi&-r)73d7M0A3qE}E(mwUW%g);Mu z%CD(UI7oWi*)@exJxXw4CgFWb9-_BFs&A_*oPYD&^)RYvJ&4xi`2O-AZJoVbaO|2n zZ@s*A_%%HITLh6Kh{##REa>|@I45#I7(_^I0iYq~0|>C<<~$8x4R~S!P|&Ewa}!p@ zyx{@#cuJGUWZHV5r|&8-ss>-#A3V21192ficY@z$BF;{Fu2AF)pk_xljY@;pushQ_ z-0W8?^5Sw7&!wHuREAa(P%zm-Bp~q@3W1Zgr`n5}_%xftb8@}Rc4lg`4?u~)r}+D8~y!MZhPHlf%HERSaTF*T`sTBYB&!#+@6`1T+jdF zRnZ6@t7W*j6zkj@KBR7T*|JVj6>d7vdwNKbg-w7K|c_r-sJ$5Xkhb zW5L&t(Z{`l(40g&077&Tk}^_9wWo+4_68u*T@gC+RM6Ut#46%-o}~W_#@xud&dOy* zN`@)Pngg1k;ir7r^bfzQofqdk)x!k?r%SsW4KOHXF|w1sZgZo%WIxL&_7G^!=3LFZ z+naJPDbXCcG$#s{gmwmbFvE#$JqvjE(KMLXvP8`Hnu$jh8hVEtfpFeO(7goW72ic@qZ`tGbA*1fBpI)1X{U%_ zF8dce|M~6z6D}XY*mJrKGnu!f%nEUYjM7(g;VkZSjG| zw_IBtV^A~vrbOB5PE_#mC$w&Fjea2Juv(}rznb)0sLC=>bR?i%STt%8cMAo;ixMG* zk}sSsZX{x`+r$nl{eC$x{t|%JM_@rp}w^x@{ON1W&MDsvN?n-~`-&9PJUt*O0Vn*We}MzmHUzW>$-Lzzdg zOafa8Yd_0ljkJVwc)76^L$7bS22V(W@FhL}2A zb(v1FsgC%u-a^SwEwj>O{-#XQm$6AvjO}$krsCWc-37%$Y`KH*|>DL zKnd%O{0Qdc=?Kk0mQQo|au=4xQ^&{EZB+pX2H0|TiTRc=f0!Uma-tQ2sYV&HJv8lx#&dMtO4We+8rk;O4FM zhXyW21Q3ax-ua_=mmGY!9IbS>gq1aTM8?(r!?+R18k#xO)veq(PXRO4_!oF1Tv3nbyn>9h_0)&%U1kh55Vz+rFetsKj zRwM|)v}^8gp)G3w`I~F&g;txw#HFOLp&9@MR};!-&BmJteKTzp{G>uK6Zru{eb{}Y z%`~~)A-_O~+yQ!hzHujuGc)gp2-(-plF+2O=_6qG8{{0pVujRx%-M=!T8gY{#Z#Li zv(YbAQMqyGZFE_1d|Tn>ACL)MIkSw)!B{nVlIP3>L$4Hn4Afe(0k&~edDm~O-TYNQ z-F!f&CM(NrCyOq?%cvtTHX`|-8^V9>e@`XRoZkLmaTZLW28ft8589E7>-aO7_yun1 zyUj(ADq(Lg^|t5O^to=8sx!0j*tS&g?h77#B1i7aPytT4n}VBPI#2VosgdDMCcHXd z=~OvSE@f)_a5ebVMQeKGWi~BL17H{UThZ>qD{trw%IFXYx#n(gN!E)@_U>7k-$L!} z3~}NADQ{^_cA|S?Dq~>pkUT4_ZqR+dcNa7^X!h9#k^MF7KE2oNSvUzjnk7yGfJL9{ z-jJ!NTH4d}chw}rpUKnU6cRc1UtWSlnOi>pRLTKsR|+hDXm+#C7^)-SYzb;$C{;Fk zs>~8+)nphUCVl6_wF<}xCaC3cZDbgd=J9u@jv4ss!8mPikH`q`1-cuwcP z&yz=Yzw2ZH=%O@wrer2o$G%;8PQ{IaN%4?wX5L)G23jblq~g`Ml*tK~sCtc$HavG- zC2u74)g>-Ysb(8SglA8)USXD0wo23JCcET+DqXbc#_^5(#a3j7FGa6^e`khi!c7p> zU|2tYc2Bn>r0V#0k4mg6M}sPrgn!HzoxnP(;njBab~mKK;x+G%c4qtM4)!~#KJ|&; z(Pm@Vwn$-ji#30DqOt-VH>whhLJY^mr_5i1O`lDcpDLvBq1RUA#F`r54sZ(Y)|L$- zjc(lAWlT4`&y1e?aFbc5r+`s-t{UphpuEqECxt2P?D5xEv~Rp|vlFpo-$Swuw3jaR ziCj)A**Bck5&&-B4ZWYmWp5`T3EXH)ok{v;Cl^R@2zhO6 z!S?}GuR~z!jq`v7vkm%KewmdtlW7d7`OihUTQp1FrKCB;0MlA7Ko#fcp2o;7vI}bH zg=GlpqcnLDEcV`44DMpBPIb|PIR@&d8*|F?)vD{|ZgA75+etndI$1ShiX`tyN||+< zbYNimEx^l>Hv@X8J^s1QC_E<@rs~c2y+UdfbuBO5$QLd4`wWA&N` zws@aacvH&KriK~8A2?#DGo`km@SNEg(veO?x!5hgM^jLI zAc6-KP2=IrWB&W_ai_>qFaNmk1)Tw`{=+3Hj05;MM~=?gXkJAbu2RGrPa{a z_$dxvm_n7Y{zqs$rlp|-1sl5C%me7-K6BYs@k4{T9@(!dC*5ru7SrES5D%sl>J@L`rgjV2n1M`_yAcxOT>(XWQ)#c*BIGwW z;Uh2P(BDxz+z5zU!4cnc>DJ29^7S6jYxU}}$@gqrJg8Bn_)1rb+rxX@L)>2PJnGk! zgmBm<%Uv}LeWsYJDYZ?BJ+0FjPCPq)_|oLAQMe9!Yq?HTMI&~W&EO+g9_tKEp9)*g znp1hljDG~_))}zNPTXW=OnH~j_;K+~ec`G0Z^7_l009G&c|zu&t~CnfcJ(z{8^;q% zhWMc-COwXB93$TU78nyT=H}jo#@r2Q5ZTdONrvT-hb57R8Mk_Eh9DcI1wP?mnw1nY ztic`DhdRDr-I_(PIYicn)|}CZQvOU8XV5F)}nF#@6HTsw|iDHwsrxfBkZa9ic(#a3) z3-pT-_g9!AfZFjWIR-WYXwIFFth+jM$dC5OZl$)Zc zFAAo&g26}VX=&TfmeSi`%zsS*5=2XCl`Fnu$v5}NQ zv$6Xv9>%CW9xDld9bN9|;FRpMg9n>obNUb&Co2SJJg2frDsI^dU}XqPYIqaLai2(j zo2QWHnD7@>pOKvF4DeR9p~U7@!!pu~tD_&Zak+C{Vu2wwvHm{rTNJ4a-%6CghY+W= zVsFdkEoBKk;+^CLl-IMhEb&l+vriCuI5#V@fe8MeyWO za6zAlz3J(VZ>FS++Yuk9Di5+_r4_6~m?fA5;rr%4;}t@+d~J~tAJ zI}t13if`D(v?=#y>SLZWl*k}wosI#n2&p4?xH3W)&UVDelm+LwLgs1&T7mCsTy)R& zJH81oc6>8cyCMIG(Wjex?}B|1XyMFg#>~U#nJ8lbaaES)f1i&1o=~F{NJgX{%r0_C94ZkcJky>+< zX=~DK##TB&sG~U8hr_=(9Q@Qr5bzdNZMo%B(PJ!u960!86QU>?`KT?1-_Nr1be3n>Ftv@(9WATydpeFu7emOJl8R zR$-3^li`aoFOvip!_gG($mTD8yhZcCyeEe;I5y>$cM9`_NPOew@}p2MtS75k*!db{ zNXa~Kms4KB=JtJfs4GcjjsXQT4OS~;Jt(mLC^H|ycOpi$fnfe?9sS}62gpL>O!4z` z|HFweukO)WL9^&wOBz>j4p%GZy=R<@XRSM-7ti08IM){J7Jj@`f3(zxq}>ty zJs(5i?l=U6K;}j(c0}VuL0n8uBsRHwZKgLOuUlWk614H4yCYtt`}thR$GrTfgef#0 zlMnFE%KbSXpur?^JpE3{~LbXA0`~QV<9DSFdRA+Uxudj zy(%(`yj44}=wQrYSL(|Yx@!!!NCIC!O_A-$d&%#kwwkpizZ+{-qhu+didG-J6Bos` zI5#Vfw4%Q0?5|(7*$nC{*I8lw+Wb*4+t(0V`%`|sEP*+x6ucS;uIF9DTxDIP33y3e zl=$;I?^4|uW-|q?h&{_9%XY$I@SyrHV?_y5Sa6o;xAdhxEKPh5;$`<2OZtz2Gqq=W zLU&ro+HttGtSG<4e#g6)$Cr0jVT0&E%6B59OiK8H?Uvduju2wgbiOsF#`3E#Iy58MYiz-7x%ZMa$+8w-%heWX|8%D(mca18T z7|EbThNC7eRRspNnaCe)Io&pKutTnQu+}XYg%zC}io(f^x80E)lqN4P)9(%Xeh7uhtuYahWVK8kK^Z5eY6noTl7h2L zegI$aj1bi>+1i%E+Q$k`mzTr%dpc!Rvx|QI6yB3~&h2U5L0LE-QTH~k+g$K8jl!>N z^tLcQdT*|Z9**vUW@O(Nl+i%^Wf&x{Co9`)oE!S6R@=M!?10HtMh9TPW#IFq zrWao@)}HAL=5VdtP)gTg`j=mj3t4!{=+n)_soL%Yyytk=9Z-FskUNlhRSby?w6_IA=vXdEUmgH>PfKgVEK|aR%t-?(I;5}GQT)1siE)~31oDP zTHpYg3HM~3csfrT=jcNg{R`p`k2)-mqquot9INKrWhOO(OLh59NNZ~4lzpMj6k6L~ zLbwA;BcLK;+Q+5zKHwVfrZq2f%}C9Ch;*TQKSO4J1PKVn8S6$*7=}=T0`s99bd$3 zV8%Z%;=UQ}nOlDpl}Uz&q`$3teG$<`8Tm#1tJnuRq44o-TH#LYLSDwxTRx9m@$xHHW(a~UkGYLa z8KJAf(7XInf6#STHuj1w^F)8UA=7d=^7?9jqEE;?jNE)U_5;_8)IdsFiikl!eI*5) zxb}6*|9Go;^jCMZy3;yXBTeNk5-TkXZBtC6oC0Ii(%;7 z{IhoB$jWLfbFBGEl8o|J0c3ucF<@^NlCn~xgh+M7y0}yXT+Bk`kdWAiZ88(^>t`DQ zXPg|c=69SY^6@Rgg7fi2jkK-obqK!QKxz=l$KnubZOh*MQ$vkUAMizrf0xL*(WqVC z{!@j7hLHwyVHCsb^C}T{9YrKLYJE9g{-1I3Kh)4H$&xZmmHl(j)-uaMNLJ+gX53q;z3%Watu14E4+4r7vXEZQO0B^lo za_(k(@}E*}_4U1pf_0n@#h3TzB4Kh?V_M@l=3Um4Ts?fa&Y~UQ+J8$rI}!RwON0xd zfRv1;82uBTi$BKwQNZW%Hq_e5{);mddrfAD!^*J%0_fYQMK@YhLMS%98(|~;CeWbq zJk%+L8p;n6@Os1lT=LKOCuLahw-^+Xx|Xl(m_5OU8f3skDb_3&8*(_yDg%7MM1t;q z7ir$sKOjp1$aSIjZ&Sv)N`U`cTDRR0z00FLwIw{>#-yMEmuL9 zP*TMRx*$QTrh!Wx;D~0}KE$woROV=Lf#yL~+so#D_XEOZ5MU(S;E+{KI`X^>&lu3W zF}BMzZYJqsbGd*nar62CCu7Gc(}fVz^YKU23qM68KRatbdvRMI`$qu~0Pzd*fCP9z z{CXg;xS*goKZpk;Dh>j1SRvE?#lYRu&ec=nGObUhvX0uk5Yug1rarB_5Rks)||))pAy^{{xH72U-9C literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-icons_cd0a0a_256x240.png b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 0000000000000000000000000000000000000000..ed5b6b0930f672fa08e9b9bdbe5e55370fd1dc30 GIT binary patch literal 4549 zcmeHK_fr#0w@yL`geFb85=9ZDg(gT1B^Y{@&P$M@(wm?VAV^iZ6afX{l`04kX;LH< zK}rM+O=%H9dXY{bwJ9FloCniR>m>KvO00029E=t=B z005r3fGv8Ovw1>S@91oU#l*k@Nnl|3|M6c1ENt=tu$i-nh-9Ha@DWUNJl)V+K5v2h0 zO|NV+KtMDp|K7>aE2#FGeR<1S-6taL-Vx%T-)BL9cl2**1LA2fpw1RhUzAP2nf>FV z06M)MY5>4F7hP=)i-+IW9T=S_>)9Z^s5i^m&m2DJbCkXtbNTY?>bHv3rmCdxo?cBw z%k04pn^bBV5c9(~F3!4-)9Yut#40^2K1>B03=m;tV`GyBT}fSQf+~**>U=?L{<=yU zS8r!38|Y-$6ldi$0No2s49v_W2>~iWTNa2fQtB-3>?5F?K&V$rno%`O2%G;!44sn> zmPoxf2KUV&ihMiS}P~#rrMilaeU~(MS(O-a&M}#(REXc*pfE0v!%| z$%b5zVaI~e8s4`k8`1sbNBtIM}QfvASFn&-}ENvOp3o~)>7|LU&@8_Z(ew~D-JmH zzaIE`x;YG^4Dc{1klPacv6ALOvKb(@XS!A6Cjt6z+QRLiYLBgz#1il0D`=k4CwIk~ zT3);fw12`sGT7-#&xXH-#aC+_1{!mjw<{^+yq9@T1ht;n1UxkSJQ*2H(4_yFMWhJx zRTUSEoqggU`p0u)^(B?eOz7L(d3d1SbTN4I)u+Q7NWTrW?!{Hs@gay1=aCHH9G{gn!wSTUqF~8HG zSu3}U)m`4jBrrD`-v#5iwtnR-*Cxb3aSHfHPz60V;QJSV)$dA&!_ zl<~`(Je@NHpi0Uoe6$S~Ew&2;eTJdTzTr4?+Y9&Xs?yZI%`nhKz5s6m8A&-ks)D%H zMd!?{FLzx_Q=*Bj{j1#vp|*o;w1-}5G$HXS7SnumvriQI_f1EIjco(o1;wO zF5SVR7F-28jH~R5LcZeDkcYdP4deQhq@@8E;5vKa!>p&)v*2zd*7YclBZEDM9ZO}< zUyDt?>c!2k&pm+$S%(Mo=pa)&K}+E=u^YongMlv2fL^D(LfyK|A!&S#hMU~4>PZ*W zVT$wTTSw;2n&_h%ClxB2t%9E6%QAIuuAaq!(XW(7ZG>C9hr z9+_qdiymMCvCF}UnbnS{GxC1xxoPl~d92E_D{)W;C(`_UmnsBb=z>^Dfr>=fg8DRA*?b-I z!l>Z^q%uBmO1#n%*a#4+t;Gsb>)7Gg`Q&x|vJN8Ad`P%Y9H#uzXyL^M zsCZ47RI3>V>-`a>;;51QicQl2b@A}QQ3u&b1jwNY;NgOglSAq6B^)<`r9bHE1M0AA zIPHKZ*-Y+?4 z{q;-0pu}eyf1ZUYgwbAA9RU^L73tbfbxmNufKlx(TyBbfuT_1&nDTZ-@K4&5_E*6y z85_4NS2Lq0$*9z2-viS}FG5D*AK<3DCw6S}8x}3AdQZD+SlceGi?$rd^LkxK*V?X6 z+8dN1;0+$7-96%@Rj%pXX&p;@Z|JLNkfFXLwW#(~}@!qow>+x#9;a`mij9E)=Y ziXREZsr)tYg`d6B&u$-cGg{FU2JL%%kXCf@t9h4T(VRS*h~#(h1ECa|=6WfmgB#Pg zh&nm7n@kNo`glQ7%J$y1$^w7NlfjS0xOkN;-m~~yy!b@3|r{uizduwUKstA zsPE`A+Z zM_6j0;+i#gnX9;3c%`fB@j9k76QEJBPhZ@jDhhRZc5FJ04&yelON_42FWWGBy3_x7 zX^`fSb5$xoTr{rj=(({S$c1XGx+sfW^kkL4X7lZe`fr-0T7@*PS-{V9Zi|Qze$LSn z$vpci`YFlpJCT`a7`GKGG7d1i75O)#2Vq6?vn{IxUe>4#?)B);*jh^>A8v*ZmC}k< zE*$gC<_-crF_F0e1-nw0)GIgI)35pZj25L+xCnt-va>^dy9oXk(>Bq# zZ-L|vG@iO}=aRUK&CRDbG-PlkGlx(1TTaWjq}HESmDXTs8NI&;)>!DPjkH&M5pw7; zfGCIf;q->uGyN0Cw>oO<_PN;$>?HzYzqX#pGb1>*2n~a;B94>12Q3iq@M6jt0Ox-C zjC9j`om$u5ls~mN{+^SYq5)Ph_ju6QQFmt=31F7`&~&BMcACglC+Ye&!u?m=*Rg|1 zqGMkXufLU(<_(wZ#pkO9A~a=q^X>qU9UhZ>P_bB%$si>UG>eEV!HfKqv&JQKbxrOo z+`#TuSD|Gg7|1dERt>>~v-`+*?HUOcu41NcSR;cIeFOBCc(0|M} zx@#u@?&aBXP=$;ziBK4Y1RTou^OuO@biT1XCbSm{ovL$M?(ZHS{v^lo#0M~CyH$)b zSY`u5_^0+ANbhp9N7oArCqvZ6IV}Cb8S3S3fJAjd59Jr2l{t&cv_l$#w*YdWn`6W1 zVW@r&YU6Jj@lY^<&C<3%!6GSR@Wn`ky6!;r1Ga@SQ~h)U!(~@OY|=(Je#38fWt5Gb zo9=1F?xTJlFZkq5-m}~?%xK=COx`Y{N#|Y+{9>h5)c)+J_ugtuS z86UlHtJQq`5!1bw15G5MMtb*lvf!kVC2O-hOtwWRe&U!-Zo3?!*k%Y5jZ ze0=zYRzKE1#uEWDU@!o^sjVk0ETpXrGeLlgc^rr+q#7^UyZb^kpoKS^-NYzjBuSh) z;QL~gDI1%EEX8%lHWH|UI5r@SEnWxA!s%DmRLJCA*Ac6nl*As*PQ=J=7d4&gTdi&l@*~@h1}~YkCm#{IYSE zq75(0%@^uKD-lQRcdrN%tl-4Gb{=;Wu8M-`jzsFHSx8YRq1PQQ>ayI@L)-_lFCIRv z@N@E7GtvQLObg|ICvPvo#Wo`uYZsA_*XD{jO7x9EQD_$5@Sx;4io23#ToG=8>U;CX zywCjJqkyZga#P~Zu*6KpAW$VQ%9{EdR#(O15U%qGO$miH#z0c4fEW3z_yIaWvWJndH4=+VGin zx}oz3F@>1;5c$J7P&G^3_D*1yqg2}D*WW8S6e*r{Hg)RBd-$ZeT3U-Ju$wNSGGvqX zKHQtNUn*Pk^duUK4%OaSO|{BAofJYxevJB}iCy>Mj(NOiC*E}zxH73@ITVTYv7XphlM}N#K+U0bMN`_b$&SNgo?*un4ti5-~ywV z$XVq~Ha^#rv?2y=7vgwa@F<{nes(tL!Z67DgvXco-^OfG$Nzy!BuNtWxydKc@H3T; zPnMnS-YNtKMVI~z-D5>}mYT0)yKIoba_3LCUe7#Sy-dMOOIH;=SG;9;ZLaAQoVa1M7S0)fcpeDrf^ofpkq5zey7XLK&v1c>SS>t^* z5NRFg;uPqr@bYoF@Al~b zCRnRJlsqHw{)u4j;}#g~g4jsuh&)O><~Z~X{24HiGKVa DTfr$v literal 0 HcmV?d00001 diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.css b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.css new file mode 100755 index 0000000000..1ab60528b4 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.css @@ -0,0 +1,1178 @@ +/*! jQuery UI - v1.10.4 - 2014-12-11 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + overflow: hidden; + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertically center icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3; + background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999; + background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited { + color: #212121; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa; + background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-state-default .ui-icon { + background-image: url("images/ui-icons_888888_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-active .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-highlight .ui-icon { + background-image: url("images/ui-icons_2e83ff_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cd0a0a_256x240.png"); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); + border-radius: 8px; +} diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.js new file mode 100755 index 0000000000..ecac757628 --- /dev/null +++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/jquery/ui-smoothness/jquery-ui-1.10.4.js @@ -0,0 +1,15008 @@ +/*! jQuery UI - v1.10.4 - 2014-12-08 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js +* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ + +(function( $, undefined ) { + +var uuid = 0, + runiqueId = /^ui-id-\d+$/; + +// $.ui might exist from components with no dependencies, e.g., $.ui.position +$.ui = $.ui || {}; + +$.extend( $.ui, { + version: "1.10.4", + + keyCode: { + BACKSPACE: 8, + COMMA: 188, + DELETE: 46, + DOWN: 40, + END: 35, + ENTER: 13, + ESCAPE: 27, + HOME: 36, + LEFT: 37, + NUMPAD_ADD: 107, + NUMPAD_DECIMAL: 110, + NUMPAD_DIVIDE: 111, + NUMPAD_ENTER: 108, + NUMPAD_MULTIPLY: 106, + NUMPAD_SUBTRACT: 109, + PAGE_DOWN: 34, + PAGE_UP: 33, + PERIOD: 190, + RIGHT: 39, + SPACE: 32, + TAB: 9, + UP: 38 + } +}); + +// plugins +$.fn.extend({ + focus: (function( orig ) { + return function( delay, fn ) { + return typeof delay === "number" ? + this.each(function() { + var elem = this; + setTimeout(function() { + $( elem ).focus(); + if ( fn ) { + fn.call( elem ); + } + }, delay ); + }) : + orig.apply( this, arguments ); + }; + })( $.fn.focus ), + + scrollParent: function() { + var scrollParent; + if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) { + scrollParent = this.parents().filter(function() { + return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x")); + }).eq(0); + } else { + scrollParent = this.parents().filter(function() { + return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x")); + }).eq(0); + } + + return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent; + }, + + zIndex: function( zIndex ) { + if ( zIndex !== undefined ) { + return this.css( "zIndex", zIndex ); + } + + if ( this.length ) { + var elem = $( this[ 0 ] ), position, value; + while ( elem.length && elem[ 0 ] !== document ) { + // Ignore z-index if position is set to a value where z-index is ignored by the browser + // This makes behavior of this function consistent across browsers + // WebKit always returns auto if the element is positioned + position = elem.css( "position" ); + if ( position === "absolute" || position === "relative" || position === "fixed" ) { + // IE returns 0 when zIndex is not specified + // other browsers return a string + // we ignore the case of nested elements with an explicit value of 0 + //
+ value = parseInt( elem.css( "zIndex" ), 10 ); + if ( !isNaN( value ) && value !== 0 ) { + return value; + } + } + elem = elem.parent(); + } + } + + return 0; + }, + + uniqueId: function() { + return this.each(function() { + if ( !this.id ) { + this.id = "ui-id-" + (++uuid); + } + }); + }, + + removeUniqueId: function() { + return this.each(function() { + if ( runiqueId.test( this.id ) ) { + $( this ).removeAttr( "id" ); + } + }); + } +}); + +// selectors +function focusable( element, isTabIndexNotNaN ) { + var map, mapName, img, + nodeName = element.nodeName.toLowerCase(); + if ( "area" === nodeName ) { + map = element.parentNode; + mapName = map.name; + if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { + return false; + } + img = $( "img[usemap=#" + mapName + "]" )[0]; + return !!img && visible( img ); + } + return ( /input|select|textarea|button|object/.test( nodeName ) ? + !element.disabled : + "a" === nodeName ? + element.href || isTabIndexNotNaN : + isTabIndexNotNaN) && + // the element and all of its ancestors must be visible + visible( element ); +} + +function visible( element ) { + return $.expr.filters.visible( element ) && + !$( element ).parents().addBack().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; +} + +$.extend( $.expr[ ":" ], { + data: $.expr.createPseudo ? + $.expr.createPseudo(function( dataName ) { + return function( elem ) { + return !!$.data( elem, dataName ); + }; + }) : + // support: jQuery <1.8 + function( elem, i, match ) { + return !!$.data( elem, match[ 3 ] ); + }, + + focusable: function( element ) { + return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); + }, + + tabbable: function( element ) { + var tabIndex = $.attr( element, "tabindex" ), + isTabIndexNaN = isNaN( tabIndex ); + return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); + } +}); + +// support: jQuery <1.8 +if ( !$( "
" ).outerWidth( 1 ).jquery ) { + $.each( [ "Width", "Height" ], function( i, name ) { + var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], + type = name.toLowerCase(), + orig = { + innerWidth: $.fn.innerWidth, + innerHeight: $.fn.innerHeight, + outerWidth: $.fn.outerWidth, + outerHeight: $.fn.outerHeight + }; + + function reduce( elem, size, border, margin ) { + $.each( side, function() { + size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; + if ( border ) { + size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; + } + if ( margin ) { + size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; + } + }); + return size; + } + + $.fn[ "inner" + name ] = function( size ) { + if ( size === undefined ) { + return orig[ "inner" + name ].call( this ); + } + + return this.each(function() { + $( this ).css( type, reduce( this, size ) + "px" ); + }); + }; + + $.fn[ "outer" + name] = function( size, margin ) { + if ( typeof size !== "number" ) { + return orig[ "outer" + name ].call( this, size ); + } + + return this.each(function() { + $( this).css( type, reduce( this, size, true, margin ) + "px" ); + }); + }; + }); +} + +// support: jQuery <1.8 +if ( !$.fn.addBack ) { + $.fn.addBack = function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + }; +} + +// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) +if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { + $.fn.removeData = (function( removeData ) { + return function( key ) { + if ( arguments.length ) { + return removeData.call( this, $.camelCase( key ) ); + } else { + return removeData.call( this ); + } + }; + })( $.fn.removeData ); +} + + + + + +// deprecated +$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); + +$.support.selectstart = "onselectstart" in document.createElement( "div" ); +$.fn.extend({ + disableSelection: function() { + return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + ".ui-disableSelection", function( event ) { + event.preventDefault(); + }); + }, + + enableSelection: function() { + return this.unbind( ".ui-disableSelection" ); + } +}); + +$.extend( $.ui, { + // $.ui.plugin is deprecated. Use $.widget() extensions instead. + plugin: { + add: function( module, option, set ) { + var i, + proto = $.ui[ module ].prototype; + for ( i in set ) { + proto.plugins[ i ] = proto.plugins[ i ] || []; + proto.plugins[ i ].push( [ option, set[ i ] ] ); + } + }, + call: function( instance, name, args ) { + var i, + set = instance.plugins[ name ]; + if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) { + return; + } + + for ( i = 0; i < set.length; i++ ) { + if ( instance.options[ set[ i ][ 0 ] ] ) { + set[ i ][ 1 ].apply( instance.element, args ); + } + } + } + }, + + // only used by resizable + hasScroll: function( el, a ) { + + //If overflow is hidden, the element might have extra content, but the user wants to hide it + if ( $( el ).css( "overflow" ) === "hidden") { + return false; + } + + var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", + has = false; + + if ( el[ scroll ] > 0 ) { + return true; + } + + // TODO: determine which cases actually cause this to happen + // if the element doesn't have the scroll set, see if it's possible to + // set the scroll + el[ scroll ] = 1; + has = ( el[ scroll ] > 0 ); + el[ scroll ] = 0; + return has; + } +}); + +})( jQuery ); +(function( $, undefined ) { + +var uuid = 0, + slice = Array.prototype.slice, + _cleanData = $.cleanData; +$.cleanData = function( elems ) { + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} + } + _cleanData( elems ); +}; + +$.widget = function( name, base, prototype ) { + var fullName, existingConstructor, constructor, basePrototype, + // proxiedPrototype allows the provided prototype to remain unmodified + // so that it can be used as a mixin for multiple widgets (#8876) + proxiedPrototype = {}, + namespace = name.split( "." )[ 0 ]; + + name = name.split( "." )[ 1 ]; + fullName = namespace + "-" + name; + + if ( !prototype ) { + prototype = base; + base = $.Widget; + } + + // create selector for plugin + $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { + return !!$.data( elem, fullName ); + }; + + $[ namespace ] = $[ namespace ] || {}; + existingConstructor = $[ namespace ][ name ]; + constructor = $[ namespace ][ name ] = function( options, element ) { + // allow instantiation without "new" keyword + if ( !this._createWidget ) { + return new constructor( options, element ); + } + + // allow instantiation without initializing for simple inheritance + // must use "new" keyword (the code above always passes args) + if ( arguments.length ) { + this._createWidget( options, element ); + } + }; + // extend with the existing constructor to carry over any static properties + $.extend( constructor, existingConstructor, { + version: prototype.version, + // copy the object used to create the prototype in case we need to + // redefine the widget later + _proto: $.extend( {}, prototype ), + // track widgets that inherit from this widget in case this widget is + // redefined after a widget inherits from it + _childConstructors: [] + }); + + basePrototype = new base(); + // we need to make the options hash a property directly on the new instance + // otherwise we'll modify the options hash on the prototype that we're + // inheriting from + basePrototype.options = $.widget.extend( {}, basePrototype.options ); + $.each( prototype, function( prop, value ) { + if ( !$.isFunction( value ) ) { + proxiedPrototype[ prop ] = value; + return; + } + proxiedPrototype[ prop ] = (function() { + var _super = function() { + return base.prototype[ prop ].apply( this, arguments ); + }, + _superApply = function( args ) { + return base.prototype[ prop ].apply( this, args ); + }; + return function() { + var __super = this._super, + __superApply = this._superApply, + returnValue; + + this._super = _super; + this._superApply = _superApply; + + returnValue = value.apply( this, arguments ); + + this._super = __super; + this._superApply = __superApply; + + return returnValue; + }; + })(); + }); + constructor.prototype = $.widget.extend( basePrototype, { + // TODO: remove support for widgetEventPrefix + // always use the name + a colon as the prefix, e.g., draggable:start + // don't prefix for widgets that aren't DOM-based + widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name + }, proxiedPrototype, { + constructor: constructor, + namespace: namespace, + widgetName: name, + widgetFullName: fullName + }); + + // If this widget is being redefined then we need to find all widgets that + // are inheriting from it and redefine all of them so that they inherit from + // the new version of this widget. We're essentially trying to replace one + // level in the prototype chain. + if ( existingConstructor ) { + $.each( existingConstructor._childConstructors, function( i, child ) { + var childPrototype = child.prototype; + + // redefine the child widget using the same prototype that was + // originally used, but inherit from the new version of the base + $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); + }); + // remove the list of existing child constructors from the old constructor + // so the old child constructors can be garbage collected + delete existingConstructor._childConstructors; + } else { + base._childConstructors.push( constructor ); + } + + $.widget.bridge( name, constructor ); +}; + +$.widget.extend = function( target ) { + var input = slice.call( arguments, 1 ), + inputIndex = 0, + inputLength = input.length, + key, + value; + for ( ; inputIndex < inputLength; inputIndex++ ) { + for ( key in input[ inputIndex ] ) { + value = input[ inputIndex ][ key ]; + if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { + // Clone objects + if ( $.isPlainObject( value ) ) { + target[ key ] = $.isPlainObject( target[ key ] ) ? + $.widget.extend( {}, target[ key ], value ) : + // Don't extend strings, arrays, etc. with objects + $.widget.extend( {}, value ); + // Copy everything else by reference + } else { + target[ key ] = value; + } + } + } + } + return target; +}; + +$.widget.bridge = function( name, object ) { + var fullName = object.prototype.widgetFullName || name; + $.fn[ name ] = function( options ) { + var isMethodCall = typeof options === "string", + args = slice.call( arguments, 1 ), + returnValue = this; + + // allow multiple hashes to be passed on init + options = !isMethodCall && args.length ? + $.widget.extend.apply( null, [ options ].concat(args) ) : + options; + + if ( isMethodCall ) { + this.each(function() { + var methodValue, + instance = $.data( this, fullName ); + if ( !instance ) { + return $.error( "cannot call methods on " + name + " prior to initialization; " + + "attempted to call method '" + options + "'" ); + } + if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { + return $.error( "no such method '" + options + "' for " + name + " widget instance" ); + } + methodValue = instance[ options ].apply( instance, args ); + if ( methodValue !== instance && methodValue !== undefined ) { + returnValue = methodValue && methodValue.jquery ? + returnValue.pushStack( methodValue.get() ) : + methodValue; + return false; + } + }); + } else { + this.each(function() { + var instance = $.data( this, fullName ); + if ( instance ) { + instance.option( options || {} )._init(); + } else { + $.data( this, fullName, new object( options, this ) ); + } + }); + } + + return returnValue; + }; +}; + +$.Widget = function( /* options, element */ ) {}; +$.Widget._childConstructors = []; + +$.Widget.prototype = { + widgetName: "widget", + widgetEventPrefix: "", + defaultElement: "
", + options: { + disabled: false, + + // callbacks + create: null + }, + _createWidget: function( options, element ) { + element = $( element || this.defaultElement || this )[ 0 ]; + this.element = $( element ); + this.uuid = uuid++; + this.eventNamespace = "." + this.widgetName + this.uuid; + this.options = $.widget.extend( {}, + this.options, + this._getCreateOptions(), + options ); + + this.bindings = $(); + this.hoverable = $(); + this.focusable = $(); + + if ( element !== this ) { + $.data( element, this.widgetFullName, this ); + this._on( true, this.element, { + remove: function( event ) { + if ( event.target === element ) { + this.destroy(); + } + } + }); + this.document = $( element.style ? + // element within the document + element.ownerDocument : + // element is window or document + element.document || element ); + this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); + } + + this._create(); + this._trigger( "create", null, this._getCreateEventData() ); + this._init(); + }, + _getCreateOptions: $.noop, + _getCreateEventData: $.noop, + _create: $.noop, + _init: $.noop, + + destroy: function() { + this._destroy(); + // we can probably remove the unbind calls in 2.0 + // all event bindings should go through this._on() + this.element + .unbind( this.eventNamespace ) + // 1.9 BC for #7810 + // TODO remove dual storage + .removeData( this.widgetName ) + .removeData( this.widgetFullName ) + // support: jquery <1.6.3 + // http://bugs.jquery.com/ticket/9413 + .removeData( $.camelCase( this.widgetFullName ) ); + this.widget() + .unbind( this.eventNamespace ) + .removeAttr( "aria-disabled" ) + .removeClass( + this.widgetFullName + "-disabled " + + "ui-state-disabled" ); + + // clean up events and states + this.bindings.unbind( this.eventNamespace ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + }, + _destroy: $.noop, + + widget: function() { + return this.element; + }, + + option: function( key, value ) { + var options = key, + parts, + curOption, + i; + + if ( arguments.length === 0 ) { + // don't return a reference to the internal hash + return $.widget.extend( {}, this.options ); + } + + if ( typeof key === "string" ) { + // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } + options = {}; + parts = key.split( "." ); + key = parts.shift(); + if ( parts.length ) { + curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); + for ( i = 0; i < parts.length - 1; i++ ) { + curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; + curOption = curOption[ parts[ i ] ]; + } + key = parts.pop(); + if ( arguments.length === 1 ) { + return curOption[ key ] === undefined ? null : curOption[ key ]; + } + curOption[ key ] = value; + } else { + if ( arguments.length === 1 ) { + return this.options[ key ] === undefined ? null : this.options[ key ]; + } + options[ key ] = value; + } + } + + this._setOptions( options ); + + return this; + }, + _setOptions: function( options ) { + var key; + + for ( key in options ) { + this._setOption( key, options[ key ] ); + } + + return this; + }, + _setOption: function( key, value ) { + this.options[ key ] = value; + + if ( key === "disabled" ) { + this.widget() + .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value ) + .attr( "aria-disabled", value ); + this.hoverable.removeClass( "ui-state-hover" ); + this.focusable.removeClass( "ui-state-focus" ); + } + + return this; + }, + + enable: function() { + return this._setOption( "disabled", false ); + }, + disable: function() { + return this._setOption( "disabled", true ); + }, + + _on: function( suppressDisabledCheck, element, handlers ) { + var delegateElement, + instance = this; + + // no suppressDisabledCheck flag, shuffle arguments + if ( typeof suppressDisabledCheck !== "boolean" ) { + handlers = element; + element = suppressDisabledCheck; + suppressDisabledCheck = false; + } + + // no element argument, shuffle and use this.element + if ( !handlers ) { + handlers = element; + element = this.element; + delegateElement = this.widget(); + } else { + // accept selectors, DOM elements + element = delegateElement = $( element ); + this.bindings = this.bindings.add( element ); + } + + $.each( handlers, function( event, handler ) { + function handlerProxy() { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( !suppressDisabledCheck && + ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) ) { + return; + } + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + + // copy the guid so direct unbinding works + if ( typeof handler !== "string" ) { + handlerProxy.guid = handler.guid = + handler.guid || handlerProxy.guid || $.guid++; + } + + var match = event.match( /^(\w+)\s*(.*)$/ ), + eventName = match[1] + instance.eventNamespace, + selector = match[2]; + if ( selector ) { + delegateElement.delegate( selector, eventName, handlerProxy ); + } else { + element.bind( eventName, handlerProxy ); + } + }); + }, + + _off: function( element, eventName ) { + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; + element.unbind( eventName ).undelegate( eventName ); + }, + + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + + _hoverable: function( element ) { + this.hoverable = this.hoverable.add( element ); + this._on( element, { + mouseenter: function( event ) { + $( event.currentTarget ).addClass( "ui-state-hover" ); + }, + mouseleave: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-hover" ); + } + }); + }, + + _focusable: function( element ) { + this.focusable = this.focusable.add( element ); + this._on( element, { + focusin: function( event ) { + $( event.currentTarget ).addClass( "ui-state-focus" ); + }, + focusout: function( event ) { + $( event.currentTarget ).removeClass( "ui-state-focus" ); + } + }); + }, + + _trigger: function( type, event, data ) { + var prop, orig, + callback = this.options[ type ]; + + data = data || {}; + event = $.Event( event ); + event.type = ( type === this.widgetEventPrefix ? + type : + this.widgetEventPrefix + type ).toLowerCase(); + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; + + // copy original event properties over to the new event + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } + } + } + + this.element.trigger( event, data ); + return !( $.isFunction( callback ) && + callback.apply( this.element[0], [ event ].concat( data ) ) === false || + event.isDefaultPrevented() ); + } +}; + +$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { + $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { + if ( typeof options === "string" ) { + options = { effect: options }; + } + var hasOptions, + effectName = !options ? + method : + options === true || typeof options === "number" ? + defaultEffect : + options.effect || defaultEffect; + options = options || {}; + if ( typeof options === "number" ) { + options = { duration: options }; + } + hasOptions = !$.isEmptyObject( options ); + options.complete = callback; + if ( options.delay ) { + element.delay( options.delay ); + } + if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { + element[ method ]( options ); + } else if ( effectName !== method && element[ effectName ] ) { + element[ effectName ]( options.duration, options.easing, callback ); + } else { + element.queue(function( next ) { + $( this )[ method ](); + if ( callback ) { + callback.call( element[ 0 ] ); + } + next(); + }); + } + }; +}); + +})( jQuery ); +(function( $, undefined ) { + +var mouseHandled = false; +$( document ).mouseup( function() { + mouseHandled = false; +}); + +$.widget("ui.mouse", { + version: "1.10.4", + options: { + cancel: "input,textarea,button,select,option", + distance: 1, + delay: 0 + }, + _mouseInit: function() { + var that = this; + + this.element + .bind("mousedown."+this.widgetName, function(event) { + return that._mouseDown(event); + }) + .bind("click."+this.widgetName, function(event) { + if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { + $.removeData(event.target, that.widgetName + ".preventClickEvent"); + event.stopImmediatePropagation(); + return false; + } + }); + + this.started = false; + }, + + // TODO: make sure destroying one instance of mouse doesn't mess with + // other instances of mouse + _mouseDestroy: function() { + this.element.unbind("."+this.widgetName); + if ( this._mouseMoveDelegate ) { + $(document) + .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate) + .unbind("mouseup."+this.widgetName, this._mouseUpDelegate); + } + }, + + _mouseDown: function(event) { + // don't let more than one widget handle mouseStart + if( mouseHandled ) { return; } + + // we may have missed mouseup (out of window) + (this._mouseStarted && this._mouseUp(event)); + + this._mouseDownEvent = event; + + var that = this, + btnIsLeft = (event.which === 1), + // event.target.nodeName works around a bug in IE 8 with + // disabled inputs (#7620) + elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false); + if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) { + return true; + } + + this.mouseDelayMet = !this.options.delay; + if (!this.mouseDelayMet) { + this._mouseDelayTimer = setTimeout(function() { + that.mouseDelayMet = true; + }, this.options.delay); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = (this._mouseStart(event) !== false); + if (!this._mouseStarted) { + event.preventDefault(); + return true; + } + } + + // Click event may never have fired (Gecko & Opera) + if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) { + $.removeData(event.target, this.widgetName + ".preventClickEvent"); + } + + // these delegates are required to keep context + this._mouseMoveDelegate = function(event) { + return that._mouseMove(event); + }; + this._mouseUpDelegate = function(event) { + return that._mouseUp(event); + }; + $(document) + .bind("mousemove."+this.widgetName, this._mouseMoveDelegate) + .bind("mouseup."+this.widgetName, this._mouseUpDelegate); + + event.preventDefault(); + + mouseHandled = true; + return true; + }, + + _mouseMove: function(event) { + // IE mouseup check - mouseup happened when mouse was out of window + if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { + return this._mouseUp(event); + } + + if (this._mouseStarted) { + this._mouseDrag(event); + return event.preventDefault(); + } + + if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) { + this._mouseStarted = + (this._mouseStart(this._mouseDownEvent, event) !== false); + (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)); + } + + return !this._mouseStarted; + }, + + _mouseUp: function(event) { + $(document) + .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate) + .unbind("mouseup."+this.widgetName, this._mouseUpDelegate); + + if (this._mouseStarted) { + this._mouseStarted = false; + + if (event.target === this._mouseDownEvent.target) { + $.data(event.target, this.widgetName + ".preventClickEvent", true); + } + + this._mouseStop(event); + } + + return false; + }, + + _mouseDistanceMet: function(event) { + return (Math.max( + Math.abs(this._mouseDownEvent.pageX - event.pageX), + Math.abs(this._mouseDownEvent.pageY - event.pageY) + ) >= this.options.distance + ); + }, + + _mouseDelayMet: function(/* event */) { + return this.mouseDelayMet; + }, + + // These are placeholder methods, to be overriden by extending plugin + _mouseStart: function(/* event */) {}, + _mouseDrag: function(/* event */) {}, + _mouseStop: function(/* event */) {}, + _mouseCapture: function(/* event */) { return true; } +}); + +})(jQuery); +(function( $, undefined ) { + +$.ui = $.ui || {}; + +var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + round = Math.round, + rhorizontal = /left|center|right/, + rvertical = /top|center|bottom/, + roffset = /[\+\-]\d+(\.[\d]+)?%?/, + rposition = /^\w+/, + rpercent = /%$/, + _position = $.fn.position; + +function getOffsets( offsets, width, height ) { + return [ + parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), + parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) + ]; +} + +function parseCss( element, property ) { + return parseInt( $.css( element, property ), 10 ) || 0; +} + +function getDimensions( elem ) { + var raw = elem[0]; + if ( raw.nodeType === 9 ) { + return { + width: elem.width(), + height: elem.height(), + offset: { top: 0, left: 0 } + }; + } + if ( $.isWindow( raw ) ) { + return { + width: elem.width(), + height: elem.height(), + offset: { top: elem.scrollTop(), left: elem.scrollLeft() } + }; + } + if ( raw.preventDefault ) { + return { + width: 0, + height: 0, + offset: { top: raw.pageY, left: raw.pageX } + }; + } + return { + width: elem.outerWidth(), + height: elem.outerHeight(), + offset: elem.offset() + }; +} + +$.position = { + scrollbarWidth: function() { + if ( cachedScrollbarWidth !== undefined ) { + return cachedScrollbarWidth; + } + var w1, w2, + div = $( "
" ), + innerDiv = div.children()[0]; + + $( "body" ).append( div ); + w1 = innerDiv.offsetWidth; + div.css( "overflow", "scroll" ); + + w2 = innerDiv.offsetWidth; + + if ( w1 === w2 ) { + w2 = div[0].clientWidth; + } + + div.remove(); + + return (cachedScrollbarWidth = w1 - w2); + }, + getScrollInfo: function( within ) { + var overflowX = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-x" ), + overflowY = within.isWindow || within.isDocument ? "" : + within.element.css( "overflow-y" ), + hasOverflowX = overflowX === "scroll" || + ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), + hasOverflowY = overflowY === "scroll" || + ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); + return { + width: hasOverflowY ? $.position.scrollbarWidth() : 0, + height: hasOverflowX ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function( element ) { + var withinElement = $( element || window ), + isWindow = $.isWindow( withinElement[0] ), + isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; + return { + element: withinElement, + isWindow: isWindow, + isDocument: isDocument, + offset: withinElement.offset() || { left: 0, top: 0 }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: isWindow ? withinElement.width() : withinElement.outerWidth(), + height: isWindow ? withinElement.height() : withinElement.outerHeight() + }; + } +}; + +$.fn.position = function( options ) { + if ( !options || !options.of ) { + return _position.apply( this, arguments ); + } + + // make a copy, we don't want to modify arguments + options = $.extend( {}, options ); + + var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, + target = $( options.of ), + within = $.position.getWithinInfo( options.within ), + scrollInfo = $.position.getScrollInfo( within ), + collision = ( options.collision || "flip" ).split( " " ), + offsets = {}; + + dimensions = getDimensions( target ); + if ( target[0].preventDefault ) { + // force left top to allow flipping + options.at = "left top"; + } + targetWidth = dimensions.width; + targetHeight = dimensions.height; + targetOffset = dimensions.offset; + // clone to reuse original targetOffset later + basePosition = $.extend( {}, targetOffset ); + + // force my and at to have valid horizontal and vertical positions + // if a value is missing or invalid, it will be converted to center + $.each( [ "my", "at" ], function() { + var pos = ( options[ this ] || "" ).split( " " ), + horizontalOffset, + verticalOffset; + + if ( pos.length === 1) { + pos = rhorizontal.test( pos[ 0 ] ) ? + pos.concat( [ "center" ] ) : + rvertical.test( pos[ 0 ] ) ? + [ "center" ].concat( pos ) : + [ "center", "center" ]; + } + pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; + pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; + + // calculate offsets + horizontalOffset = roffset.exec( pos[ 0 ] ); + verticalOffset = roffset.exec( pos[ 1 ] ); + offsets[ this ] = [ + horizontalOffset ? horizontalOffset[ 0 ] : 0, + verticalOffset ? verticalOffset[ 0 ] : 0 + ]; + + // reduce to just the positions without the offsets + options[ this ] = [ + rposition.exec( pos[ 0 ] )[ 0 ], + rposition.exec( pos[ 1 ] )[ 0 ] + ]; + }); + + // normalize collision option + if ( collision.length === 1 ) { + collision[ 1 ] = collision[ 0 ]; + } + + if ( options.at[ 0 ] === "right" ) { + basePosition.left += targetWidth; + } else if ( options.at[ 0 ] === "center" ) { + basePosition.left += targetWidth / 2; + } + + if ( options.at[ 1 ] === "bottom" ) { + basePosition.top += targetHeight; + } else if ( options.at[ 1 ] === "center" ) { + basePosition.top += targetHeight / 2; + } + + atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); + basePosition.left += atOffset[ 0 ]; + basePosition.top += atOffset[ 1 ]; + + return this.each(function() { + var collisionPosition, using, + elem = $( this ), + elemWidth = elem.outerWidth(), + elemHeight = elem.outerHeight(), + marginLeft = parseCss( this, "marginLeft" ), + marginTop = parseCss( this, "marginTop" ), + collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, + collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, + position = $.extend( {}, basePosition ), + myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); + + if ( options.my[ 0 ] === "right" ) { + position.left -= elemWidth; + } else if ( options.my[ 0 ] === "center" ) { + position.left -= elemWidth / 2; + } + + if ( options.my[ 1 ] === "bottom" ) { + position.top -= elemHeight; + } else if ( options.my[ 1 ] === "center" ) { + position.top -= elemHeight / 2; + } + + position.left += myOffset[ 0 ]; + position.top += myOffset[ 1 ]; + + // if the browser doesn't support fractions, then round for consistent results + if ( !$.support.offsetFractions ) { + position.left = round( position.left ); + position.top = round( position.top ); + } + + collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + + $.each( [ "left", "top" ], function( i, dir ) { + if ( $.ui.position[ collision[ i ] ] ) { + $.ui.position[ collision[ i ] ][ dir ]( position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], + my: options.my, + at: options.at, + within: within, + elem : elem + }); + } + }); + + if ( options.using ) { + // adds feedback as second argument to using callback, if present + using = function( props ) { + var left = targetOffset.left - position.left, + right = left + targetWidth - elemWidth, + top = targetOffset.top - position.top, + bottom = top + targetHeight - elemHeight, + feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", + vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" + }; + if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { + feedback.horizontal = "center"; + } + if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { + feedback.vertical = "middle"; + } + if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { + feedback.important = "horizontal"; + } else { + feedback.important = "vertical"; + } + options.using.call( this, props, feedback ); + }; + } + + elem.offset( $.extend( position, { using: using } ) ); + }); +}; + +$.ui.position = { + fit: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, + outerWidth = within.width, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = withinOffset - collisionPosLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, + newOverRight; + + // element is wider than within + if ( data.collisionWidth > outerWidth ) { + // element is initially over the left side of within + if ( overLeft > 0 && overRight <= 0 ) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + // element is initially over right side of within + } else if ( overRight > 0 && overLeft <= 0 ) { + position.left = withinOffset; + // element is initially over both left and right sides of within + } else { + if ( overLeft > overRight ) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } + // too far left -> align with left edge + } else if ( overLeft > 0 ) { + position.left += overLeft; + // too far right -> align with right edge + } else if ( overRight > 0 ) { + position.left -= overRight; + // adjust based on position and margin + } else { + position.left = max( position.left - collisionPosLeft, position.left ); + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.isWindow ? within.scrollTop : within.offset.top, + outerHeight = data.within.height, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = withinOffset - collisionPosTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, + newOverBottom; + + // element is taller than within + if ( data.collisionHeight > outerHeight ) { + // element is initially over the top of within + if ( overTop > 0 && overBottom <= 0 ) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + // element is initially over bottom of within + } else if ( overBottom > 0 && overTop <= 0 ) { + position.top = withinOffset; + // element is initially over both top and bottom of within + } else { + if ( overTop > overBottom ) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } + // too far up -> align with top + } else if ( overTop > 0 ) { + position.top += overTop; + // too far down -> align with bottom edge + } else if ( overBottom > 0 ) { + position.top -= overBottom; + // adjust based on position and margin + } else { + position.top = max( position.top - collisionPosTop, position.top ); + } + } + }, + flip: { + left: function( position, data ) { + var within = data.within, + withinOffset = within.offset.left + within.scrollLeft, + outerWidth = within.width, + offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, + collisionPosLeft = position.left - data.collisionPosition.marginLeft, + overLeft = collisionPosLeft - offsetLeft, + overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, + myOffset = data.my[ 0 ] === "left" ? + -data.elemWidth : + data.my[ 0 ] === "right" ? + data.elemWidth : + 0, + atOffset = data.at[ 0 ] === "left" ? + data.targetWidth : + data.at[ 0 ] === "right" ? + -data.targetWidth : + 0, + offset = -2 * data.offset[ 0 ], + newOverRight, + newOverLeft; + + if ( overLeft < 0 ) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { + position.left += myOffset + atOffset + offset; + } + } + else if ( overRight > 0 ) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function( position, data ) { + var within = data.within, + withinOffset = within.offset.top + within.scrollTop, + outerHeight = within.height, + offsetTop = within.isWindow ? within.scrollTop : within.offset.top, + collisionPosTop = position.top - data.collisionPosition.marginTop, + overTop = collisionPosTop - offsetTop, + overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, + top = data.my[ 1 ] === "top", + myOffset = top ? + -data.elemHeight : + data.my[ 1 ] === "bottom" ? + data.elemHeight : + 0, + atOffset = data.at[ 1 ] === "top" ? + data.targetHeight : + data.at[ 1 ] === "bottom" ? + -data.targetHeight : + 0, + offset = -2 * data.offset[ 1 ], + newOverTop, + newOverBottom; + if ( overTop < 0 ) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) { + position.top += myOffset + atOffset + offset; + } + } + else if ( overBottom > 0 ) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function() { + $.ui.position.flip.left.apply( this, arguments ); + $.ui.position.fit.left.apply( this, arguments ); + }, + top: function() { + $.ui.position.flip.top.apply( this, arguments ); + $.ui.position.fit.top.apply( this, arguments ); + } + } +}; + +// fraction support test +(function () { + var testElement, testElementParent, testElementStyle, offsetLeft, i, + body = document.getElementsByTagName( "body" )[ 0 ], + div = document.createElement( "div" ); + + //Create a "fake body" for testing based on method used in jQuery.support + testElement = document.createElement( body ? "div" : "body" ); + testElementStyle = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if ( body ) { + $.extend( testElementStyle, { + position: "absolute", + left: "-1000px", + top: "-1000px" + }); + } + for ( i in testElementStyle ) { + testElement.style[ i ] = testElementStyle[ i ]; + } + testElement.appendChild( div ); + testElementParent = body || document.documentElement; + testElementParent.insertBefore( testElement, testElementParent.firstChild ); + + div.style.cssText = "position: absolute; left: 10.7432222px;"; + + offsetLeft = $( div ).offset().left; + $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11; + + testElement.innerHTML = ""; + testElementParent.removeChild( testElement ); +})(); + +}( jQuery ) ); +(function( $, undefined ) { + +$.widget("ui.draggable", $.ui.mouse, { + version: "1.10.4", + widgetEventPrefix: "drag", + options: { + addClasses: true, + appendTo: "parent", + axis: false, + connectToSortable: false, + containment: false, + cursor: "auto", + cursorAt: false, + grid: false, + handle: false, + helper: "original", + iframeFix: false, + opacity: false, + refreshPositions: false, + revert: false, + revertDuration: 500, + scope: "default", + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + snap: false, + snapMode: "both", + snapTolerance: 20, + stack: false, + zIndex: false, + + // callbacks + drag: null, + start: null, + stop: null + }, + _create: function() { + + if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) { + this.element[0].style.position = "relative"; + } + if (this.options.addClasses){ + this.element.addClass("ui-draggable"); + } + if (this.options.disabled){ + this.element.addClass("ui-draggable-disabled"); + } + + this._mouseInit(); + + }, + + _destroy: function() { + this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); + this._mouseDestroy(); + }, + + _mouseCapture: function(event) { + + var o = this.options; + + // among others, prevent a drag on a resizable-handle + if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) { + return false; + } + + //Quit if we're not on a valid handle + this.handle = this._getHandle(event); + if (!this.handle) { + return false; + } + + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $("
") + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); + + return true; + + }, + + _mouseStart: function(event) { + + var o = this.options; + + //Create and append the visible helper + this.helper = this._createHelper(event); + + this.helper.addClass("ui-draggable-dragging"); + + //Cache the helper size + this._cacheHelperProportions(); + + //If ddmanager is used for droppables, set the global draggable + if($.ui.ddmanager) { + $.ui.ddmanager.current = this; + } + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Store the helper's css position + this.cssPosition = this.helper.css( "position" ); + this.scrollParent = this.helper.scrollParent(); + this.offsetParent = this.helper.offsetParent(); + this.offsetParentCssPosition = this.offsetParent.css( "position" ); + + //The element's absolute position on the page minus margins + this.offset = this.positionAbs = this.element.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + //Reset scroll cache + this.offset.scroll = false; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + //Generate the original position + this.originalPosition = this.position = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if "cursorAt" is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Set a containment if given in the options + this._setContainment(); + + //Trigger event + callbacks + if(this._trigger("start", event) === false) { + this._clear(); + return false; + } + + //Recache the helper size + this._cacheHelperProportions(); + + //Prepare the droppable offsets + if ($.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(this, event); + } + + + this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position + + //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003) + if ( $.ui.ddmanager ) { + $.ui.ddmanager.dragStart(this, event); + } + + return true; + }, + + _mouseDrag: function(event, noPropagation) { + // reset any necessary cached properties (see #5009) + if ( this.offsetParentCssPosition === "fixed" ) { + this.offset.parent = this._getParentOffset(); + } + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + //Call plugins and callbacks and use the resulting position if something is returned + if (!noPropagation) { + var ui = this._uiHash(); + if(this._trigger("drag", event, ui) === false) { + this._mouseUp({}); + return false; + } + this.position = ui.position; + } + + if(!this.options.axis || this.options.axis !== "y") { + this.helper[0].style.left = this.position.left+"px"; + } + if(!this.options.axis || this.options.axis !== "x") { + this.helper[0].style.top = this.position.top+"px"; + } + if($.ui.ddmanager) { + $.ui.ddmanager.drag(this, event); + } + + return false; + }, + + _mouseStop: function(event) { + + //If we are using droppables, inform the manager about the drop + var that = this, + dropped = false; + if ($.ui.ddmanager && !this.options.dropBehaviour) { + dropped = $.ui.ddmanager.drop(this, event); + } + + //if a drop comes from outside (a sortable) + if(this.dropped) { + dropped = this.dropped; + this.dropped = false; + } + + //if the original element is no longer in the DOM don't bother to continue (see #8269) + if ( this.options.helper === "original" && !$.contains( this.element[ 0 ].ownerDocument, this.element[ 0 ] ) ) { + return false; + } + + if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { + $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { + if(that._trigger("stop", event) !== false) { + that._clear(); + } + }); + } else { + if(this._trigger("stop", event) !== false) { + this._clear(); + } + } + + return false; + }, + + _mouseUp: function(event) { + //Remove frame helpers + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); + + //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) + if( $.ui.ddmanager ) { + $.ui.ddmanager.dragStop(this, event); + } + + return $.ui.mouse.prototype._mouseUp.call(this, event); + }, + + cancel: function() { + + if(this.helper.is(".ui-draggable-dragging")) { + this._mouseUp({}); + } else { + this._clear(); + } + + return this; + + }, + + _getHandle: function(event) { + return this.options.handle ? + !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : + true; + }, + + _createHelper: function(event) { + + var o = this.options, + helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element); + + if(!helper.parents("body").length) { + helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo)); + } + + if(helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) { + helper.css("position", "absolute"); + } + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj === "string") { + obj = obj.split(" "); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ("left" in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ("right" in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ("top" in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ("bottom" in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + //This needs to be actually done for all browsers, since pageX/pageY includes this information + //Ugly IE fix + if((this.offsetParent[0] === document.body) || + (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) { + po = { top: 0, left: 0 }; + } + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition === "relative") { + var p = this.element.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.element.css("marginLeft"),10) || 0), + top: (parseInt(this.element.css("marginTop"),10) || 0), + right: (parseInt(this.element.css("marginRight"),10) || 0), + bottom: (parseInt(this.element.css("marginBottom"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var over, c, ce, + o = this.options; + + if ( !o.containment ) { + this.containment = null; + return; + } + + if ( o.containment === "window" ) { + this.containment = [ + $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, + $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, + $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left, + $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top + ]; + return; + } + + if ( o.containment === "document") { + this.containment = [ + 0, + 0, + $( document ).width() - this.helperProportions.width - this.margins.left, + ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top + ]; + return; + } + + if ( o.containment.constructor === Array ) { + this.containment = o.containment; + return; + } + + if ( o.containment === "parent" ) { + o.containment = this.helper[ 0 ].parentNode; + } + + c = $( o.containment ); + ce = c[ 0 ]; + + if( !ce ) { + return; + } + + over = c.css( "overflow" ) !== "hidden"; + + this.containment = [ + ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), + ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ) , + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right, + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top - this.margins.bottom + ]; + this.relative_container = c; + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) { + pos = this.position; + } + + var mod = d === "absolute" ? 1 : -1, + scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent; + + //Cache the scroll + if (!this.offset.scroll) { + this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()}; + } + + return { + top: ( + pos.top + // The absolute mouse position + this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod ) + ), + left: ( + pos.left + // The absolute mouse position + this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod ) + ) + }; + + }, + + _generatePosition: function(event) { + + var containment, co, top, left, + o = this.options, + scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent, + pageX = event.pageX, + pageY = event.pageY; + + //Cache the scroll + if (!this.offset.scroll) { + this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()}; + } + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + // If we are not dragging yet, we won't check for options + if ( this.originalPosition ) { + if ( this.containment ) { + if ( this.relative_container ){ + co = this.relative_container.offset(); + containment = [ + this.containment[ 0 ] + co.left, + this.containment[ 1 ] + co.top, + this.containment[ 2 ] + co.left, + this.containment[ 3 ] + co.top + ]; + } + else { + containment = this.containment; + } + + if(event.pageX - this.offset.click.left < containment[0]) { + pageX = containment[0] + this.offset.click.left; + } + if(event.pageY - this.offset.click.top < containment[1]) { + pageY = containment[1] + this.offset.click.top; + } + if(event.pageX - this.offset.click.left > containment[2]) { + pageX = containment[2] + this.offset.click.left; + } + if(event.pageY - this.offset.click.top > containment[3]) { + pageY = containment[3] + this.offset.click.top; + } + } + + if(o.grid) { + //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950) + top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY; + pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX; + pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY - // The absolute mouse position + this.offset.click.top - // Click offset (relative to the element) + this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.top + // The offsetParent's offset without borders (offset + border) + ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) + ), + left: ( + pageX - // The absolute mouse position + this.offset.click.left - // Click offset (relative to the element) + this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.left + // The offsetParent's offset without borders (offset + border) + ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) + ) + }; + + }, + + _clear: function() { + this.helper.removeClass("ui-draggable-dragging"); + if(this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) { + this.helper.remove(); + } + this.helper = null; + this.cancelHelperRemoval = false; + }, + + // From now on bulk stuff - mainly helpers + + _trigger: function(type, event, ui) { + ui = ui || this._uiHash(); + $.ui.plugin.call(this, type, [event, ui]); + //The absolute position has to be recalculated after plugins + if(type === "drag") { + this.positionAbs = this._convertPositionTo("absolute"); + } + return $.Widget.prototype._trigger.call(this, type, event, ui); + }, + + plugins: {}, + + _uiHash: function() { + return { + helper: this.helper, + position: this.position, + originalPosition: this.originalPosition, + offset: this.positionAbs + }; + } + +}); + +$.ui.plugin.add("draggable", "connectToSortable", { + start: function(event, ui) { + + var inst = $(this).data("ui-draggable"), o = inst.options, + uiSortable = $.extend({}, ui, { item: inst.element }); + inst.sortables = []; + $(o.connectToSortable).each(function() { + var sortable = $.data(this, "ui-sortable"); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page). + sortable._trigger("activate", event, uiSortable); + } + }); + + }, + stop: function(event, ui) { + + //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper + var inst = $(this).data("ui-draggable"), + uiSortable = $.extend({}, ui, { item: inst.element }); + + $.each(inst.sortables, function() { + if(this.instance.isOver) { + + this.instance.isOver = 0; + + inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance + this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work) + + //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid" + if(this.shouldRevert) { + this.instance.options.revert = this.shouldRevert; + } + + //Trigger the stop of the sortable + this.instance._mouseStop(event); + + this.instance.options.helper = this.instance.options._helper; + + //If the helper has been the original item, restore properties in the sortable + if(inst.options.helper === "original") { + this.instance.currentItem.css({ top: "auto", left: "auto" }); + } + + } else { + this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance + this.instance._trigger("deactivate", event, uiSortable); + } + + }); + + }, + drag: function(event, ui) { + + var inst = $(this).data("ui-draggable"), that = this; + + $.each(inst.sortables, function() { + + var innermostIntersecting = false, + thisSortable = this; + + //Copy over some variables to allow calling the sortable's native _intersectsWith + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + + if(this.instance._intersectsWith(this.instance.containerCache)) { + innermostIntersecting = true; + $.each(inst.sortables, function () { + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + if (this !== thisSortable && + this.instance._intersectsWith(this.instance.containerCache) && + $.contains(thisSortable.instance.element[0], this.instance.element[0]) + ) { + innermostIntersecting = false; + } + return innermostIntersecting; + }); + } + + + if(innermostIntersecting) { + //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once + if(!this.instance.isOver) { + + this.instance.isOver = 1; + //Now we fake the start of dragging for the sortable instance, + //by cloning the list group item, appending it to the sortable and using it as inst.currentItem + //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) + this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it + this.instance.options.helper = function() { return ui.helper[0]; }; + + event.target = this.instance.currentItem[0]; + this.instance._mouseCapture(event, true); + this.instance._mouseStart(event, true, true); + + //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; + + inst._trigger("toSortable", event); + inst.dropped = this.instance.element; //draggable revert needs that + //hack so receive/update callbacks work (mostly) + inst.currentItem = inst.element; + this.instance.fromOutside = inst; + + } + + //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable + if(this.instance.currentItem) { + this.instance._mouseDrag(event); + } + + } else { + + //If it doesn't intersect with the sortable, and it intersected before, + //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval + if(this.instance.isOver) { + + this.instance.isOver = 0; + this.instance.cancelHelperRemoval = true; + + //Prevent reverting on this forced stop + this.instance.options.revert = false; + + // The out event needs to be triggered independently + this.instance._trigger("out", event, this.instance._uiHash(this.instance)); + + this.instance._mouseStop(event, true); + this.instance.options.helper = this.instance.options._helper; + + //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size + this.instance.currentItem.remove(); + if(this.instance.placeholder) { + this.instance.placeholder.remove(); + } + + inst._trigger("fromSortable", event); + inst.dropped = false; //draggable revert needs that + } + + } + + }); + + } +}); + +$.ui.plugin.add("draggable", "cursor", { + start: function() { + var t = $("body"), o = $(this).data("ui-draggable").options; + if (t.css("cursor")) { + o._cursor = t.css("cursor"); + } + t.css("cursor", o.cursor); + }, + stop: function() { + var o = $(this).data("ui-draggable").options; + if (o._cursor) { + $("body").css("cursor", o._cursor); + } + } +}); + +$.ui.plugin.add("draggable", "opacity", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("ui-draggable").options; + if(t.css("opacity")) { + o._opacity = t.css("opacity"); + } + t.css("opacity", o.opacity); + }, + stop: function(event, ui) { + var o = $(this).data("ui-draggable").options; + if(o._opacity) { + $(ui.helper).css("opacity", o._opacity); + } + } +}); + +$.ui.plugin.add("draggable", "scroll", { + start: function() { + var i = $(this).data("ui-draggable"); + if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { + i.overflowOffset = i.scrollParent.offset(); + } + }, + drag: function( event ) { + + var i = $(this).data("ui-draggable"), o = i.options, scrolled = false; + + if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { + + if(!o.axis || o.axis !== "x") { + if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; + } else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) { + i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed; + } + } + + if(!o.axis || o.axis !== "y") { + if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) { + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed; + } else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) { + i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed; + } + } + + } else { + + if(!o.axis || o.axis !== "x") { + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) { + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) { + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + } + + if(!o.axis || o.axis !== "y") { + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) { + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) { + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(i, event); + } + + } +}); + +$.ui.plugin.add("draggable", "snap", { + start: function() { + + var i = $(this).data("ui-draggable"), + o = i.options; + + i.snapElements = []; + + $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() { + var $t = $(this), + $o = $t.offset(); + if(this !== i.element[0]) { + i.snapElements.push({ + item: this, + width: $t.outerWidth(), height: $t.outerHeight(), + top: $o.top, left: $o.left + }); + } + }); + + }, + drag: function(event, ui) { + + var ts, bs, ls, rs, l, r, t, b, i, first, + inst = $(this).data("ui-draggable"), + o = inst.options, + d = o.snapTolerance, + x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, + y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; + + for (i = inst.snapElements.length - 1; i >= 0; i--){ + + l = inst.snapElements[i].left; + r = l + inst.snapElements[i].width; + t = inst.snapElements[i].top; + b = t + inst.snapElements[i].height; + + if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) { + if(inst.snapElements[i].snapping) { + (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + } + inst.snapElements[i].snapping = false; + continue; + } + + if(o.snapMode !== "inner") { + ts = Math.abs(t - y2) <= d; + bs = Math.abs(b - y1) <= d; + ls = Math.abs(l - x2) <= d; + rs = Math.abs(r - x1) <= d; + if(ts) { + ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + } + if(bs) { + ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top; + } + if(ls) { + ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left; + } + if(rs) { + ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left; + } + } + + first = (ts || bs || ls || rs); + + if(o.snapMode !== "outer") { + ts = Math.abs(t - y1) <= d; + bs = Math.abs(b - y2) <= d; + ls = Math.abs(l - x1) <= d; + rs = Math.abs(r - x2) <= d; + if(ts) { + ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top; + } + if(bs) { + ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top; + } + if(ls) { + ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left; + } + if(rs) { + ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left; + } + } + + if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) { + (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item }))); + } + inst.snapElements[i].snapping = (ts || bs || ls || rs || first); + + } + + } +}); + +$.ui.plugin.add("draggable", "stack", { + start: function() { + var min, + o = this.data("ui-draggable").options, + group = $.makeArray($(o.stack)).sort(function(a,b) { + return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0); + }); + + if (!group.length) { return; } + + min = parseInt($(group[0]).css("zIndex"), 10) || 0; + $(group).each(function(i) { + $(this).css("zIndex", min + i); + }); + this.css("zIndex", (min + group.length)); + } +}); + +$.ui.plugin.add("draggable", "zIndex", { + start: function(event, ui) { + var t = $(ui.helper), o = $(this).data("ui-draggable").options; + if(t.css("zIndex")) { + o._zIndex = t.css("zIndex"); + } + t.css("zIndex", o.zIndex); + }, + stop: function(event, ui) { + var o = $(this).data("ui-draggable").options; + if(o._zIndex) { + $(ui.helper).css("zIndex", o._zIndex); + } + } +}); + +})(jQuery); +(function( $, undefined ) { + +function isOverAxis( x, reference, size ) { + return ( x > reference ) && ( x < ( reference + size ) ); +} + +$.widget("ui.droppable", { + version: "1.10.4", + widgetEventPrefix: "drop", + options: { + accept: "*", + activeClass: false, + addClasses: true, + greedy: false, + hoverClass: false, + scope: "default", + tolerance: "intersect", + + // callbacks + activate: null, + deactivate: null, + drop: null, + out: null, + over: null + }, + _create: function() { + + var proportions, + o = this.options, + accept = o.accept; + + this.isover = false; + this.isout = true; + + this.accept = $.isFunction(accept) ? accept : function(d) { + return d.is(accept); + }; + + this.proportions = function( /* valueToWrite */ ) { + if ( arguments.length ) { + // Store the droppable's proportions + proportions = arguments[ 0 ]; + } else { + // Retrieve or derive the droppable's proportions + return proportions ? + proportions : + proportions = { + width: this.element[ 0 ].offsetWidth, + height: this.element[ 0 ].offsetHeight + }; + } + }; + + // Add the reference and positions to the manager + $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || []; + $.ui.ddmanager.droppables[o.scope].push(this); + + (o.addClasses && this.element.addClass("ui-droppable")); + + }, + + _destroy: function() { + var i = 0, + drop = $.ui.ddmanager.droppables[this.options.scope]; + + for ( ; i < drop.length; i++ ) { + if ( drop[i] === this ) { + drop.splice(i, 1); + } + } + + this.element.removeClass("ui-droppable ui-droppable-disabled"); + }, + + _setOption: function(key, value) { + + if(key === "accept") { + this.accept = $.isFunction(value) ? value : function(d) { + return d.is(value); + }; + } + $.Widget.prototype._setOption.apply(this, arguments); + }, + + _activate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) { + this.element.addClass(this.options.activeClass); + } + if(draggable){ + this._trigger("activate", event, this.ui(draggable)); + } + }, + + _deactivate: function(event) { + var draggable = $.ui.ddmanager.current; + if(this.options.activeClass) { + this.element.removeClass(this.options.activeClass); + } + if(draggable){ + this._trigger("deactivate", event, this.ui(draggable)); + } + }, + + _over: function(event) { + + var draggable = $.ui.ddmanager.current; + + // Bail if draggable and droppable are same element + if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) { + return; + } + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) { + this.element.addClass(this.options.hoverClass); + } + this._trigger("over", event, this.ui(draggable)); + } + + }, + + _out: function(event) { + + var draggable = $.ui.ddmanager.current; + + // Bail if draggable and droppable are same element + if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) { + return; + } + + if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.hoverClass) { + this.element.removeClass(this.options.hoverClass); + } + this._trigger("out", event, this.ui(draggable)); + } + + }, + + _drop: function(event,custom) { + + var draggable = custom || $.ui.ddmanager.current, + childrenIntersection = false; + + // Bail if draggable and droppable are same element + if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) { + return false; + } + + this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() { + var inst = $.data(this, "ui-droppable"); + if( + inst.options.greedy && + !inst.options.disabled && + inst.options.scope === draggable.options.scope && + inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) && + $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance) + ) { childrenIntersection = true; return false; } + }); + if(childrenIntersection) { + return false; + } + + if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + if(this.options.activeClass) { + this.element.removeClass(this.options.activeClass); + } + if(this.options.hoverClass) { + this.element.removeClass(this.options.hoverClass); + } + this._trigger("drop", event, this.ui(draggable)); + return this.element; + } + + return false; + + }, + + ui: function(c) { + return { + draggable: (c.currentItem || c.element), + helper: c.helper, + position: c.position, + offset: c.positionAbs + }; + } + +}); + +$.ui.intersect = function(draggable, droppable, toleranceMode) { + + if (!droppable.offset) { + return false; + } + + var draggableLeft, draggableTop, + x1 = (draggable.positionAbs || draggable.position.absolute).left, + y1 = (draggable.positionAbs || draggable.position.absolute).top, + x2 = x1 + draggable.helperProportions.width, + y2 = y1 + draggable.helperProportions.height, + l = droppable.offset.left, + t = droppable.offset.top, + r = l + droppable.proportions().width, + b = t + droppable.proportions().height; + + switch (toleranceMode) { + case "fit": + return (l <= x1 && x2 <= r && t <= y1 && y2 <= b); + case "intersect": + return (l < x1 + (draggable.helperProportions.width / 2) && // Right Half + x2 - (draggable.helperProportions.width / 2) < r && // Left Half + t < y1 + (draggable.helperProportions.height / 2) && // Bottom Half + y2 - (draggable.helperProportions.height / 2) < b ); // Top Half + case "pointer": + draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left); + draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top); + return isOverAxis( draggableTop, t, droppable.proportions().height ) && isOverAxis( draggableLeft, l, droppable.proportions().width ); + case "touch": + return ( + (y1 >= t && y1 <= b) || // Top edge touching + (y2 >= t && y2 <= b) || // Bottom edge touching + (y1 < t && y2 > b) // Surrounded vertically + ) && ( + (x1 >= l && x1 <= r) || // Left edge touching + (x2 >= l && x2 <= r) || // Right edge touching + (x1 < l && x2 > r) // Surrounded horizontally + ); + default: + return false; + } + +}; + +/* + This manager tracks offsets of draggables and droppables +*/ +$.ui.ddmanager = { + current: null, + droppables: { "default": [] }, + prepareOffsets: function(t, event) { + + var i, j, + m = $.ui.ddmanager.droppables[t.options.scope] || [], + type = event ? event.type : null, // workaround for #2317 + list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack(); + + droppablesLoop: for (i = 0; i < m.length; i++) { + + //No disabled and non-accepted + if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) { + continue; + } + + // Filter out elements in the current dragged item + for (j=0; j < list.length; j++) { + if(list[j] === m[i].element[0]) { + m[i].proportions().height = 0; + continue droppablesLoop; + } + } + + m[i].visible = m[i].element.css("display") !== "none"; + if(!m[i].visible) { + continue; + } + + //Activate the droppable if used directly from draggables + if(type === "mousedown") { + m[i]._activate.call(m[i], event); + } + + m[ i ].offset = m[ i ].element.offset(); + m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight }); + + } + + }, + drop: function(draggable, event) { + + var dropped = false; + // Create a copy of the droppables in case the list changes during the drop (#9116) + $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() { + + if(!this.options) { + return; + } + if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) { + dropped = this._drop.call(this, event) || dropped; + } + + if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { + this.isout = true; + this.isover = false; + this._deactivate.call(this, event); + } + + }); + return dropped; + + }, + dragStart: function( draggable, event ) { + //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) + draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { + if( !draggable.options.refreshPositions ) { + $.ui.ddmanager.prepareOffsets( draggable, event ); + } + }); + }, + drag: function(draggable, event) { + + //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse. + if(draggable.options.refreshPositions) { + $.ui.ddmanager.prepareOffsets(draggable, event); + } + + //Run through all droppables and check their positions based on specific tolerance options + $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() { + + if(this.options.disabled || this.greedyChild || !this.visible) { + return; + } + + var parentInstance, scope, parent, + intersects = $.ui.intersect(draggable, this, this.options.tolerance), + c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null); + if(!c) { + return; + } + + if (this.options.greedy) { + // find droppable parents with same scope + scope = this.options.scope; + parent = this.element.parents(":data(ui-droppable)").filter(function () { + return $.data(this, "ui-droppable").options.scope === scope; + }); + + if (parent.length) { + parentInstance = $.data(parent[0], "ui-droppable"); + parentInstance.greedyChild = (c === "isover"); + } + } + + // we just moved into a greedy child + if (parentInstance && c === "isover") { + parentInstance.isover = false; + parentInstance.isout = true; + parentInstance._out.call(parentInstance, event); + } + + this[c] = true; + this[c === "isout" ? "isover" : "isout"] = false; + this[c === "isover" ? "_over" : "_out"].call(this, event); + + // we just moved out of a greedy child + if (parentInstance && c === "isout") { + parentInstance.isout = false; + parentInstance.isover = true; + parentInstance._over.call(parentInstance, event); + } + }); + + }, + dragStop: function( draggable, event ) { + draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); + //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) + if( !draggable.options.refreshPositions ) { + $.ui.ddmanager.prepareOffsets( draggable, event ); + } + } +}; + +})(jQuery); +(function( $, undefined ) { + +function num(v) { + return parseInt(v, 10) || 0; +} + +function isNumber(value) { + return !isNaN(parseInt(value, 10)); +} + +$.widget("ui.resizable", $.ui.mouse, { + version: "1.10.4", + widgetEventPrefix: "resize", + options: { + alsoResize: false, + animate: false, + animateDuration: "slow", + animateEasing: "swing", + aspectRatio: false, + autoHide: false, + containment: false, + ghost: false, + grid: false, + handles: "e,s,se", + helper: false, + maxHeight: null, + maxWidth: null, + minHeight: 10, + minWidth: 10, + // See #7960 + zIndex: 90, + + // callbacks + resize: null, + start: null, + stop: null + }, + _create: function() { + + var n, i, handle, axis, hname, + that = this, + o = this.options; + this.element.addClass("ui-resizable"); + + $.extend(this, { + _aspectRatio: !!(o.aspectRatio), + aspectRatio: o.aspectRatio, + originalElement: this.element, + _proportionallyResizeElements: [], + _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null + }); + + //Wrap the element if it cannot hold child nodes + if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) { + + //Create a wrapper element and set the wrapper to the new current internal element + this.element.wrap( + $("
").css({ + position: this.element.css("position"), + width: this.element.outerWidth(), + height: this.element.outerHeight(), + top: this.element.css("top"), + left: this.element.css("left") + }) + ); + + //Overwrite the original this.element + this.element = this.element.parent().data( + "ui-resizable", this.element.data("ui-resizable") + ); + + this.elementIsWrapper = true; + + //Move margins to the wrapper + this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }); + this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0}); + + //Prevent Safari textarea resize + this.originalResizeStyle = this.originalElement.css("resize"); + this.originalElement.css("resize", "none"); + + //Push the actual element to our proportionallyResize internal array + this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })); + + // avoid IE jump (hard set the margin) + this.originalElement.css({ margin: this.originalElement.css("margin") }); + + // fix handlers offset + this._proportionallyResize(); + + } + + this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" }); + if(this.handles.constructor === String) { + + if ( this.handles === "all") { + this.handles = "n,e,s,w,se,sw,ne,nw"; + } + + n = this.handles.split(","); + this.handles = {}; + + for(i = 0; i < n.length; i++) { + + handle = $.trim(n[i]); + hname = "ui-resizable-"+handle; + axis = $("
"); + + // Apply zIndex to all handles - see #7960 + axis.css({ zIndex: o.zIndex }); + + //TODO : What's going on here? + if ("se" === handle) { + axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se"); + } + + //Insert into internal handles object and append to element + this.handles[handle] = ".ui-resizable-"+handle; + this.element.append(axis); + } + + } + + this._renderAxis = function(target) { + + var i, axis, padPos, padWrapper; + + target = target || this.element; + + for(i in this.handles) { + + if(this.handles[i].constructor === String) { + this.handles[i] = $(this.handles[i], this.element).show(); + } + + //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls) + if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) { + + axis = $(this.handles[i], this.element); + + //Checking the correct pad and border + padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth(); + + //The padding type i have to apply... + padPos = [ "padding", + /ne|nw|n/.test(i) ? "Top" : + /se|sw|s/.test(i) ? "Bottom" : + /^e$/.test(i) ? "Right" : "Left" ].join(""); + + target.css(padPos, padWrapper); + + this._proportionallyResize(); + + } + + //TODO: What's that good for? There's not anything to be executed left + if(!$(this.handles[i]).length) { + continue; + } + } + }; + + //TODO: make renderAxis a prototype function + this._renderAxis(this.element); + + this._handles = $(".ui-resizable-handle", this.element) + .disableSelection(); + + //Matching axis name + this._handles.mouseover(function() { + if (!that.resizing) { + if (this.className) { + axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i); + } + //Axis, default = se + that.axis = axis && axis[1] ? axis[1] : "se"; + } + }); + + //If we want to auto hide the elements + if (o.autoHide) { + this._handles.hide(); + $(this.element) + .addClass("ui-resizable-autohide") + .mouseenter(function() { + if (o.disabled) { + return; + } + $(this).removeClass("ui-resizable-autohide"); + that._handles.show(); + }) + .mouseleave(function(){ + if (o.disabled) { + return; + } + if (!that.resizing) { + $(this).addClass("ui-resizable-autohide"); + that._handles.hide(); + } + }); + } + + //Initialize the mouse interaction + this._mouseInit(); + + }, + + _destroy: function() { + + this._mouseDestroy(); + + var wrapper, + _destroy = function(exp) { + $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing") + .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove(); + }; + + //TODO: Unwrap at same DOM position + if (this.elementIsWrapper) { + _destroy(this.element); + wrapper = this.element; + this.originalElement.css({ + position: wrapper.css("position"), + width: wrapper.outerWidth(), + height: wrapper.outerHeight(), + top: wrapper.css("top"), + left: wrapper.css("left") + }).insertAfter( wrapper ); + wrapper.remove(); + } + + this.originalElement.css("resize", this.originalResizeStyle); + _destroy(this.originalElement); + + return this; + }, + + _mouseCapture: function(event) { + var i, handle, + capture = false; + + for (i in this.handles) { + handle = $(this.handles[i])[0]; + if (handle === event.target || $.contains(handle, event.target)) { + capture = true; + } + } + + return !this.options.disabled && capture; + }, + + _mouseStart: function(event) { + + var curleft, curtop, cursor, + o = this.options, + iniPos = this.element.position(), + el = this.element; + + this.resizing = true; + + // bugfix for http://dev.jquery.com/ticket/1749 + if ( (/absolute/).test( el.css("position") ) ) { + el.css({ position: "absolute", top: el.css("top"), left: el.css("left") }); + } else if (el.is(".ui-draggable")) { + el.css({ position: "absolute", top: iniPos.top, left: iniPos.left }); + } + + this._renderProxy(); + + curleft = num(this.helper.css("left")); + curtop = num(this.helper.css("top")); + + if (o.containment) { + curleft += $(o.containment).scrollLeft() || 0; + curtop += $(o.containment).scrollTop() || 0; + } + + //Store needed variables + this.offset = this.helper.offset(); + this.position = { left: curleft, top: curtop }; + this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: el.width(), height: el.height() }; + this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; + this.originalPosition = { left: curleft, top: curtop }; + this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; + this.originalMousePosition = { left: event.pageX, top: event.pageY }; + + //Aspect Ratio + this.aspectRatio = (typeof o.aspectRatio === "number") ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1); + + cursor = $(".ui-resizable-" + this.axis).css("cursor"); + $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor); + + el.addClass("ui-resizable-resizing"); + this._propagate("start", event); + return true; + }, + + _mouseDrag: function(event) { + + //Increase performance, avoid regex + var data, + el = this.helper, props = {}, + smp = this.originalMousePosition, + a = this.axis, + prevTop = this.position.top, + prevLeft = this.position.left, + prevWidth = this.size.width, + prevHeight = this.size.height, + dx = (event.pageX-smp.left)||0, + dy = (event.pageY-smp.top)||0, + trigger = this._change[a]; + + if (!trigger) { + return false; + } + + // Calculate the attrs that will be change + data = trigger.apply(this, [event, dx, dy]); + + // Put this in the mouseDrag handler since the user can start pressing shift while resizing + this._updateVirtualBoundaries(event.shiftKey); + if (this._aspectRatio || event.shiftKey) { + data = this._updateRatio(data, event); + } + + data = this._respectSize(data, event); + + this._updateCache(data); + + // plugins callbacks need to be called first + this._propagate("resize", event); + + if (this.position.top !== prevTop) { + props.top = this.position.top + "px"; + } + if (this.position.left !== prevLeft) { + props.left = this.position.left + "px"; + } + if (this.size.width !== prevWidth) { + props.width = this.size.width + "px"; + } + if (this.size.height !== prevHeight) { + props.height = this.size.height + "px"; + } + el.css(props); + + if (!this._helper && this._proportionallyResizeElements.length) { + this._proportionallyResize(); + } + + // Call the user callback if the element was resized + if ( ! $.isEmptyObject(props) ) { + this._trigger("resize", event, this.ui()); + } + + return false; + }, + + _mouseStop: function(event) { + + this.resizing = false; + var pr, ista, soffseth, soffsetw, s, left, top, + o = this.options, that = this; + + if(this._helper) { + + pr = this._proportionallyResizeElements; + ista = pr.length && (/textarea/i).test(pr[0].nodeName); + soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height; + soffsetw = ista ? 0 : that.sizeDiff.width; + + s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) }; + left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null; + top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null; + + if (!o.animate) { + this.element.css($.extend(s, { top: top, left: left })); + } + + that.helper.height(that.size.height); + that.helper.width(that.size.width); + + if (this._helper && !o.animate) { + this._proportionallyResize(); + } + } + + $("body").css("cursor", "auto"); + + this.element.removeClass("ui-resizable-resizing"); + + this._propagate("stop", event); + + if (this._helper) { + this.helper.remove(); + } + + return false; + + }, + + _updateVirtualBoundaries: function(forceAspectRatio) { + var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, + o = this.options; + + b = { + minWidth: isNumber(o.minWidth) ? o.minWidth : 0, + maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity, + minHeight: isNumber(o.minHeight) ? o.minHeight : 0, + maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity + }; + + if(this._aspectRatio || forceAspectRatio) { + // We want to create an enclosing box whose aspect ration is the requested one + // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension + pMinWidth = b.minHeight * this.aspectRatio; + pMinHeight = b.minWidth / this.aspectRatio; + pMaxWidth = b.maxHeight * this.aspectRatio; + pMaxHeight = b.maxWidth / this.aspectRatio; + + if(pMinWidth > b.minWidth) { + b.minWidth = pMinWidth; + } + if(pMinHeight > b.minHeight) { + b.minHeight = pMinHeight; + } + if(pMaxWidth < b.maxWidth) { + b.maxWidth = pMaxWidth; + } + if(pMaxHeight < b.maxHeight) { + b.maxHeight = pMaxHeight; + } + } + this._vBoundaries = b; + }, + + _updateCache: function(data) { + this.offset = this.helper.offset(); + if (isNumber(data.left)) { + this.position.left = data.left; + } + if (isNumber(data.top)) { + this.position.top = data.top; + } + if (isNumber(data.height)) { + this.size.height = data.height; + } + if (isNumber(data.width)) { + this.size.width = data.width; + } + }, + + _updateRatio: function( data ) { + + var cpos = this.position, + csize = this.size, + a = this.axis; + + if (isNumber(data.height)) { + data.width = (data.height * this.aspectRatio); + } else if (isNumber(data.width)) { + data.height = (data.width / this.aspectRatio); + } + + if (a === "sw") { + data.left = cpos.left + (csize.width - data.width); + data.top = null; + } + if (a === "nw") { + data.top = cpos.top + (csize.height - data.height); + data.left = cpos.left + (csize.width - data.width); + } + + return data; + }, + + _respectSize: function( data ) { + + var o = this._vBoundaries, + a = this.axis, + ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), + isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height), + dw = this.originalPosition.left + this.originalSize.width, + dh = this.position.top + this.size.height, + cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a); + if (isminw) { + data.width = o.minWidth; + } + if (isminh) { + data.height = o.minHeight; + } + if (ismaxw) { + data.width = o.maxWidth; + } + if (ismaxh) { + data.height = o.maxHeight; + } + + if (isminw && cw) { + data.left = dw - o.minWidth; + } + if (ismaxw && cw) { + data.left = dw - o.maxWidth; + } + if (isminh && ch) { + data.top = dh - o.minHeight; + } + if (ismaxh && ch) { + data.top = dh - o.maxHeight; + } + + // fixing jump error on top/left - bug #2330 + if (!data.width && !data.height && !data.left && data.top) { + data.top = null; + } else if (!data.width && !data.height && !data.top && data.left) { + data.left = null; + } + + return data; + }, + + _proportionallyResize: function() { + + if (!this._proportionallyResizeElements.length) { + return; + } + + var i, j, borders, paddings, prel, + element = this.helper || this.element; + + for ( i=0; i < this._proportionallyResizeElements.length; i++) { + + prel = this._proportionallyResizeElements[i]; + + if (!this.borderDif) { + this.borderDif = []; + borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")]; + paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")]; + + for ( j = 0; j < borders.length; j++ ) { + this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 ); + } + } + + prel.css({ + height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0, + width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0 + }); + + } + + }, + + _renderProxy: function() { + + var el = this.element, o = this.options; + this.elementOffset = el.offset(); + + if(this._helper) { + + this.helper = this.helper || $("
"); + + this.helper.addClass(this._helper).css({ + width: this.element.outerWidth() - 1, + height: this.element.outerHeight() - 1, + position: "absolute", + left: this.elementOffset.left +"px", + top: this.elementOffset.top +"px", + zIndex: ++o.zIndex //TODO: Don't modify option + }); + + this.helper + .appendTo("body") + .disableSelection(); + + } else { + this.helper = this.element; + } + + }, + + _change: { + e: function(event, dx) { + return { width: this.originalSize.width + dx }; + }, + w: function(event, dx) { + var cs = this.originalSize, sp = this.originalPosition; + return { left: sp.left + dx, width: cs.width - dx }; + }, + n: function(event, dx, dy) { + var cs = this.originalSize, sp = this.originalPosition; + return { top: sp.top + dy, height: cs.height - dy }; + }, + s: function(event, dx, dy) { + return { height: this.originalSize.height + dy }; + }, + se: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + sw: function(event, dx, dy) { + return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + }, + ne: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy])); + }, + nw: function(event, dx, dy) { + return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy])); + } + }, + + _propagate: function(n, event) { + $.ui.plugin.call(this, n, [event, this.ui()]); + (n !== "resize" && this._trigger(n, event, this.ui())); + }, + + plugins: {}, + + ui: function() { + return { + originalElement: this.originalElement, + element: this.element, + helper: this.helper, + position: this.position, + size: this.size, + originalSize: this.originalSize, + originalPosition: this.originalPosition + }; + } + +}); + +/* + * Resizable Extensions + */ + +$.ui.plugin.add("resizable", "animate", { + + stop: function( event ) { + var that = $(this).data("ui-resizable"), + o = that.options, + pr = that._proportionallyResizeElements, + ista = pr.length && (/textarea/i).test(pr[0].nodeName), + soffseth = ista && $.ui.hasScroll(pr[0], "left") /* TODO - jump height */ ? 0 : that.sizeDiff.height, + soffsetw = ista ? 0 : that.sizeDiff.width, + style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) }, + left = (parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left)) || null, + top = (parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top)) || null; + + that.element.animate( + $.extend(style, top && left ? { top: top, left: left } : {}), { + duration: o.animateDuration, + easing: o.animateEasing, + step: function() { + + var data = { + width: parseInt(that.element.css("width"), 10), + height: parseInt(that.element.css("height"), 10), + top: parseInt(that.element.css("top"), 10), + left: parseInt(that.element.css("left"), 10) + }; + + if (pr && pr.length) { + $(pr[0]).css({ width: data.width, height: data.height }); + } + + // propagating resize, and updating values for each animation step + that._updateCache(data); + that._propagate("resize", event); + + } + } + ); + } + +}); + +$.ui.plugin.add("resizable", "containment", { + + start: function() { + var element, p, co, ch, cw, width, height, + that = $(this).data("ui-resizable"), + o = that.options, + el = that.element, + oc = o.containment, + ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc; + + if (!ce) { + return; + } + + that.containerElement = $(ce); + + if (/document/.test(oc) || oc === document) { + that.containerOffset = { left: 0, top: 0 }; + that.containerPosition = { left: 0, top: 0 }; + + that.parentData = { + element: $(document), left: 0, top: 0, + width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight + }; + } + + // i'm a node, so compute top, left, right, bottom + else { + element = $(ce); + p = []; + $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); }); + + that.containerOffset = element.offset(); + that.containerPosition = element.position(); + that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; + + co = that.containerOffset; + ch = that.containerSize.height; + cw = that.containerSize.width; + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ); + height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + + that.parentData = { + element: ce, left: co.left, top: co.top, width: width, height: height + }; + } + }, + + resize: function( event ) { + var woset, hoset, isParent, isOffsetRelative, + that = $(this).data("ui-resizable"), + o = that.options, + co = that.containerOffset, cp = that.position, + pRatio = that._aspectRatio || event.shiftKey, + cop = { top:0, left:0 }, ce = that.containerElement; + + if (ce[0] !== document && (/static/).test(ce.css("position"))) { + cop = co; + } + + if (cp.left < (that._helper ? co.left : 0)) { + that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left)); + if (pRatio) { + that.size.height = that.size.width / that.aspectRatio; + } + that.position.left = o.helper ? co.left : 0; + } + + if (cp.top < (that._helper ? co.top : 0)) { + that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top); + if (pRatio) { + that.size.width = that.size.height * that.aspectRatio; + } + that.position.top = that._helper ? co.top : 0; + } + + that.offset.left = that.parentData.left+that.position.left; + that.offset.top = that.parentData.top+that.position.top; + + woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ); + hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height ); + + isParent = that.containerElement.get(0) === that.element.parent().get(0); + isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position")); + + if ( isParent && isOffsetRelative ) { + woset -= Math.abs( that.parentData.left ); + } + + if (woset + that.size.width >= that.parentData.width) { + that.size.width = that.parentData.width - woset; + if (pRatio) { + that.size.height = that.size.width / that.aspectRatio; + } + } + + if (hoset + that.size.height >= that.parentData.height) { + that.size.height = that.parentData.height - hoset; + if (pRatio) { + that.size.width = that.size.height * that.aspectRatio; + } + } + }, + + stop: function(){ + var that = $(this).data("ui-resizable"), + o = that.options, + co = that.containerOffset, + cop = that.containerPosition, + ce = that.containerElement, + helper = $(that.helper), + ho = helper.offset(), + w = helper.outerWidth() - that.sizeDiff.width, + h = helper.outerHeight() - that.sizeDiff.height; + + if (that._helper && !o.animate && (/relative/).test(ce.css("position"))) { + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + } + + if (that._helper && !o.animate && (/static/).test(ce.css("position"))) { + $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h }); + } + + } +}); + +$.ui.plugin.add("resizable", "alsoResize", { + + start: function () { + var that = $(this).data("ui-resizable"), + o = that.options, + _store = function (exp) { + $(exp).each(function() { + var el = $(this); + el.data("ui-resizable-alsoresize", { + width: parseInt(el.width(), 10), height: parseInt(el.height(), 10), + left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10) + }); + }); + }; + + if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) { + if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); } + else { $.each(o.alsoResize, function (exp) { _store(exp); }); } + }else{ + _store(o.alsoResize); + } + }, + + resize: function (event, ui) { + var that = $(this).data("ui-resizable"), + o = that.options, + os = that.originalSize, + op = that.originalPosition, + delta = { + height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0, + top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0 + }, + + _alsoResize = function (exp, c) { + $(exp).each(function() { + var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {}, + css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; + + $.each(css, function (i, prop) { + var sum = (start[prop]||0) + (delta[prop]||0); + if (sum && sum >= 0) { + style[prop] = sum || null; + } + }); + + el.css(style); + }); + }; + + if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) { + $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); }); + }else{ + _alsoResize(o.alsoResize); + } + }, + + stop: function () { + $(this).removeData("resizable-alsoresize"); + } +}); + +$.ui.plugin.add("resizable", "ghost", { + + start: function() { + + var that = $(this).data("ui-resizable"), o = that.options, cs = that.size; + + that.ghost = that.originalElement.clone(); + that.ghost + .css({ opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 }) + .addClass("ui-resizable-ghost") + .addClass(typeof o.ghost === "string" ? o.ghost : ""); + + that.ghost.appendTo(that.helper); + + }, + + resize: function(){ + var that = $(this).data("ui-resizable"); + if (that.ghost) { + that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width }); + } + }, + + stop: function() { + var that = $(this).data("ui-resizable"); + if (that.ghost && that.helper) { + that.helper.get(0).removeChild(that.ghost.get(0)); + } + } + +}); + +$.ui.plugin.add("resizable", "grid", { + + resize: function() { + var that = $(this).data("ui-resizable"), + o = that.options, + cs = that.size, + os = that.originalSize, + op = that.originalPosition, + a = that.axis, + grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid, + gridX = (grid[0]||1), + gridY = (grid[1]||1), + ox = Math.round((cs.width - os.width) / gridX) * gridX, + oy = Math.round((cs.height - os.height) / gridY) * gridY, + newWidth = os.width + ox, + newHeight = os.height + oy, + isMaxWidth = o.maxWidth && (o.maxWidth < newWidth), + isMaxHeight = o.maxHeight && (o.maxHeight < newHeight), + isMinWidth = o.minWidth && (o.minWidth > newWidth), + isMinHeight = o.minHeight && (o.minHeight > newHeight); + + o.grid = grid; + + if (isMinWidth) { + newWidth = newWidth + gridX; + } + if (isMinHeight) { + newHeight = newHeight + gridY; + } + if (isMaxWidth) { + newWidth = newWidth - gridX; + } + if (isMaxHeight) { + newHeight = newHeight - gridY; + } + + if (/^(se|s|e)$/.test(a)) { + that.size.width = newWidth; + that.size.height = newHeight; + } else if (/^(ne)$/.test(a)) { + that.size.width = newWidth; + that.size.height = newHeight; + that.position.top = op.top - oy; + } else if (/^(sw)$/.test(a)) { + that.size.width = newWidth; + that.size.height = newHeight; + that.position.left = op.left - ox; + } else { + if ( newHeight - gridY > 0 ) { + that.size.height = newHeight; + that.position.top = op.top - oy; + } else { + that.size.height = gridY; + that.position.top = op.top + os.height - gridY; + } + if ( newWidth - gridX > 0 ) { + that.size.width = newWidth; + that.position.left = op.left - ox; + } else { + that.size.width = gridX; + that.position.left = op.left + os.width - gridX; + } + } + } + +}); + +})(jQuery); +(function( $, undefined ) { + +$.widget("ui.selectable", $.ui.mouse, { + version: "1.10.4", + options: { + appendTo: "body", + autoRefresh: true, + distance: 0, + filter: "*", + tolerance: "touch", + + // callbacks + selected: null, + selecting: null, + start: null, + stop: null, + unselected: null, + unselecting: null + }, + _create: function() { + var selectees, + that = this; + + this.element.addClass("ui-selectable"); + + this.dragged = false; + + // cache selectee children based on filter + this.refresh = function() { + selectees = $(that.options.filter, that.element[0]); + selectees.addClass("ui-selectee"); + selectees.each(function() { + var $this = $(this), + pos = $this.offset(); + $.data(this, "selectable-item", { + element: this, + $element: $this, + left: pos.left, + top: pos.top, + right: pos.left + $this.outerWidth(), + bottom: pos.top + $this.outerHeight(), + startselected: false, + selected: $this.hasClass("ui-selected"), + selecting: $this.hasClass("ui-selecting"), + unselecting: $this.hasClass("ui-unselecting") + }); + }); + }; + this.refresh(); + + this.selectees = selectees.addClass("ui-selectee"); + + this._mouseInit(); + + this.helper = $("
"); + }, + + _destroy: function() { + this.selectees + .removeClass("ui-selectee") + .removeData("selectable-item"); + this.element + .removeClass("ui-selectable ui-selectable-disabled"); + this._mouseDestroy(); + }, + + _mouseStart: function(event) { + var that = this, + options = this.options; + + this.opos = [event.pageX, event.pageY]; + + if (this.options.disabled) { + return; + } + + this.selectees = $(options.filter, this.element[0]); + + this._trigger("start", event); + + $(options.appendTo).append(this.helper); + // position helper (lasso) + this.helper.css({ + "left": event.pageX, + "top": event.pageY, + "width": 0, + "height": 0 + }); + + if (options.autoRefresh) { + this.refresh(); + } + + this.selectees.filter(".ui-selected").each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.startselected = true; + if (!event.metaKey && !event.ctrlKey) { + selectee.$element.removeClass("ui-selected"); + selectee.selected = false; + selectee.$element.addClass("ui-unselecting"); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + }); + + $(event.target).parents().addBack().each(function() { + var doSelect, + selectee = $.data(this, "selectable-item"); + if (selectee) { + doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected"); + selectee.$element + .removeClass(doSelect ? "ui-unselecting" : "ui-selected") + .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); + selectee.unselecting = !doSelect; + selectee.selecting = doSelect; + selectee.selected = doSelect; + // selectable (UN)SELECTING callback + if (doSelect) { + that._trigger("selecting", event, { + selecting: selectee.element + }); + } else { + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + return false; + } + }); + + }, + + _mouseDrag: function(event) { + + this.dragged = true; + + if (this.options.disabled) { + return; + } + + var tmp, + that = this, + options = this.options, + x1 = this.opos[0], + y1 = this.opos[1], + x2 = event.pageX, + y2 = event.pageY; + + if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; } + if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; } + this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1}); + + this.selectees.each(function() { + var selectee = $.data(this, "selectable-item"), + hit = false; + + //prevent helper from being selected if appendTo: selectable + if (!selectee || selectee.element === that.element[0]) { + return; + } + + if (options.tolerance === "touch") { + hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) ); + } else if (options.tolerance === "fit") { + hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2); + } + + if (hit) { + // SELECT + if (selectee.selected) { + selectee.$element.removeClass("ui-selected"); + selectee.selected = false; + } + if (selectee.unselecting) { + selectee.$element.removeClass("ui-unselecting"); + selectee.unselecting = false; + } + if (!selectee.selecting) { + selectee.$element.addClass("ui-selecting"); + selectee.selecting = true; + // selectable SELECTING callback + that._trigger("selecting", event, { + selecting: selectee.element + }); + } + } else { + // UNSELECT + if (selectee.selecting) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { + selectee.$element.removeClass("ui-selecting"); + selectee.selecting = false; + selectee.$element.addClass("ui-selected"); + selectee.selected = true; + } else { + selectee.$element.removeClass("ui-selecting"); + selectee.selecting = false; + if (selectee.startselected) { + selectee.$element.addClass("ui-unselecting"); + selectee.unselecting = true; + } + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + if (selectee.selected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { + selectee.$element.removeClass("ui-selected"); + selectee.selected = false; + + selectee.$element.addClass("ui-unselecting"); + selectee.unselecting = true; + // selectable UNSELECTING callback + that._trigger("unselecting", event, { + unselecting: selectee.element + }); + } + } + } + }); + + return false; + }, + + _mouseStop: function(event) { + var that = this; + + this.dragged = false; + + $(".ui-unselecting", this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass("ui-unselecting"); + selectee.unselecting = false; + selectee.startselected = false; + that._trigger("unselected", event, { + unselected: selectee.element + }); + }); + $(".ui-selecting", this.element[0]).each(function() { + var selectee = $.data(this, "selectable-item"); + selectee.$element.removeClass("ui-selecting").addClass("ui-selected"); + selectee.selecting = false; + selectee.selected = true; + selectee.startselected = true; + that._trigger("selected", event, { + selected: selectee.element + }); + }); + this._trigger("stop", event); + + this.helper.remove(); + + return false; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +function isOverAxis( x, reference, size ) { + return ( x > reference ) && ( x < ( reference + size ) ); +} + +function isFloating(item) { + return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display")); +} + +$.widget("ui.sortable", $.ui.mouse, { + version: "1.10.4", + widgetEventPrefix: "sort", + ready: false, + options: { + appendTo: "parent", + axis: false, + connectWith: false, + containment: false, + cursor: "auto", + cursorAt: false, + dropOnEmpty: true, + forcePlaceholderSize: false, + forceHelperSize: false, + grid: false, + handle: false, + helper: "original", + items: "> *", + opacity: false, + placeholder: false, + revert: false, + scroll: true, + scrollSensitivity: 20, + scrollSpeed: 20, + scope: "default", + tolerance: "intersect", + zIndex: 1000, + + // callbacks + activate: null, + beforeStop: null, + change: null, + deactivate: null, + out: null, + over: null, + receive: null, + remove: null, + sort: null, + start: null, + stop: null, + update: null + }, + _create: function() { + + var o = this.options; + this.containerCache = {}; + this.element.addClass("ui-sortable"); + + //Get the items + this.refresh(); + + //Let's determine if the items are being displayed horizontally + this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false; + + //Let's determine the parent's offset + this.offset = this.element.offset(); + + //Initialize mouse events for interaction + this._mouseInit(); + + //We're ready to go + this.ready = true; + + }, + + _destroy: function() { + this.element + .removeClass("ui-sortable ui-sortable-disabled"); + this._mouseDestroy(); + + for ( var i = this.items.length - 1; i >= 0; i-- ) { + this.items[i].item.removeData(this.widgetName + "-item"); + } + + return this; + }, + + _setOption: function(key, value){ + if ( key === "disabled" ) { + this.options[ key ] = value; + + this.widget().toggleClass( "ui-sortable-disabled", !!value ); + } else { + // Don't call widget base _setOption for disable as it adds ui-state-disabled class + $.Widget.prototype._setOption.apply(this, arguments); + } + }, + + _mouseCapture: function(event, overrideHandle) { + var currentItem = null, + validHandle = false, + that = this; + + if (this.reverting) { + return false; + } + + if(this.options.disabled || this.options.type === "static") { + return false; + } + + //We have to refresh the items data once first + this._refreshItems(event); + + //Find out if the clicked node (or one of its parents) is a actual item in this.items + $(event.target).parents().each(function() { + if($.data(this, that.widgetName + "-item") === that) { + currentItem = $(this); + return false; + } + }); + if($.data(event.target, that.widgetName + "-item") === that) { + currentItem = $(event.target); + } + + if(!currentItem) { + return false; + } + if(this.options.handle && !overrideHandle) { + $(this.options.handle, currentItem).find("*").addBack().each(function() { + if(this === event.target) { + validHandle = true; + } + }); + if(!validHandle) { + return false; + } + } + + this.currentItem = currentItem; + this._removeCurrentsFromItems(); + return true; + + }, + + _mouseStart: function(event, overrideHandle, noActivation) { + + var i, body, + o = this.options; + + this.currentContainer = this; + + //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture + this.refreshPositions(); + + //Create and append the visible helper + this.helper = this._createHelper(event); + + //Cache the helper size + this._cacheHelperProportions(); + + /* + * - Position generation - + * This block generates everything position related - it's the core of draggables. + */ + + //Cache the margins of the original element + this._cacheMargins(); + + //Get the next scrolling parent + this.scrollParent = this.helper.scrollParent(); + + //The element's absolute position on the page minus margins + this.offset = this.currentItem.offset(); + this.offset = { + top: this.offset.top - this.margins.top, + left: this.offset.left - this.margins.left + }; + + $.extend(this.offset, { + click: { //Where the click happened, relative to the element + left: event.pageX - this.offset.left, + top: event.pageY - this.offset.top + }, + parent: this._getParentOffset(), + relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper + }); + + // Only after we got the offset, we can change the helper's position to absolute + // TODO: Still need to figure out a way to make relative sorting possible + this.helper.css("position", "absolute"); + this.cssPosition = this.helper.css("position"); + + //Generate the original position + this.originalPosition = this._generatePosition(event); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + + //Adjust the mouse offset relative to the helper if "cursorAt" is supplied + (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt)); + + //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; + + //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way + if(this.helper[0] !== this.currentItem[0]) { + this.currentItem.hide(); + } + + //Create the placeholder + this._createPlaceholder(); + + //Set a containment if given in the options + if(o.containment) { + this._setContainment(); + } + + if( o.cursor && o.cursor !== "auto" ) { // cursor option + body = this.document.find( "body" ); + + // support: IE + this.storedCursor = body.css( "cursor" ); + body.css( "cursor", o.cursor ); + + this.storedStylesheet = $( "" ).appendTo( body ); + } + + if(o.opacity) { // opacity option + if (this.helper.css("opacity")) { + this._storedOpacity = this.helper.css("opacity"); + } + this.helper.css("opacity", o.opacity); + } + + if(o.zIndex) { // zIndex option + if (this.helper.css("zIndex")) { + this._storedZIndex = this.helper.css("zIndex"); + } + this.helper.css("zIndex", o.zIndex); + } + + //Prepare scrolling + if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { + this.overflowOffset = this.scrollParent.offset(); + } + + //Call callbacks + this._trigger("start", event, this._uiHash()); + + //Recache the helper size + if(!this._preserveHelperProportions) { + this._cacheHelperProportions(); + } + + + //Post "activate" events to possible containers + if( !noActivation ) { + for ( i = this.containers.length - 1; i >= 0; i-- ) { + this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); + } + } + + //Prepare possible droppables + if($.ui.ddmanager) { + $.ui.ddmanager.current = this; + } + + if ($.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(this, event); + } + + this.dragging = true; + + this.helper.addClass("ui-sortable-helper"); + this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position + return true; + + }, + + _mouseDrag: function(event) { + var i, item, itemElement, intersection, + o = this.options, + scrolled = false; + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if(this.options.scroll) { + if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { + + if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed; + } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) { + this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed; + } + + if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) { + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed; + } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) { + this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed; + } + + } else { + + if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) { + scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed); + } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) { + scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed); + } + + if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) { + scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed); + } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) { + scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed); + } + + } + + if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(this, event); + } + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + //Set the helper position + if(!this.options.axis || this.options.axis !== "y") { + this.helper[0].style.left = this.position.left+"px"; + } + if(!this.options.axis || this.options.axis !== "x") { + this.helper[0].style.top = this.position.top+"px"; + } + + //Rearrange + for (i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + item = this.items[i]; + itemElement = item.item[0]; + intersection = this._intersectsWithPointer(item); + if (!intersection) { + continue; + } + + // Only put the placeholder inside the current Container, skip all + // items from other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this, moving items in "sub-sortables" can cause + // the placeholder to jitter beetween the outer and inner container. + if (item.instance !== this.currentContainer) { + continue; + } + + // cannot intersect with itself + // no useless actions that have been done before + // no action if the item moved is the parent of the item checked + if (itemElement !== this.currentItem[0] && + this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement && + !$.contains(this.placeholder[0], itemElement) && + (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true) + ) { + + this.direction = intersection === 1 ? "down" : "up"; + + if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { + this._rearrange(event, item); + } else { + break; + } + + this._trigger("change", event, this._uiHash()); + break; + } + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if($.ui.ddmanager) { + $.ui.ddmanager.drag(this, event); + } + + //Call callbacks + this._trigger("sort", event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event, noPropagation) { + + if(!event) { + return; + } + + //If we are using droppables, inform the manager about the drop + if ($.ui.ddmanager && !this.options.dropBehaviour) { + $.ui.ddmanager.drop(this, event); + } + + if(this.options.revert) { + var that = this, + cur = this.placeholder.offset(), + axis = this.options.axis, + animation = {}; + + if ( !axis || axis === "x" ) { + animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft); + } + if ( !axis || axis === "y" ) { + animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop); + } + this.reverting = true; + $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() { + that._clear(event); + }); + } else { + this._clear(event, noPropagation); + } + + return false; + + }, + + cancel: function() { + + if(this.dragging) { + + this._mouseUp({ target: null }); + + if(this.options.helper === "original") { + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + //Post deactivating events to containers + for (var i = this.containers.length - 1; i >= 0; i--){ + this.containers[i]._trigger("deactivate", null, this._uiHash(this)); + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", null, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) { + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + } + if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) { + this.helper.remove(); + } + + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } + } + + return this; + + }, + + serialize: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected), + str = []; + o = o || {}; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/)); + if (res) { + str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2])); + } + }); + + if(!str.length && o.key) { + str.push(o.key + "="); + } + + return str.join("&"); + + }, + + toArray: function(o) { + + var items = this._getItemsAsjQuery(o && o.connected), + ret = []; + + o = o || {}; + + items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); }); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function(item) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height, + l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height, + dyClick = this.offset.click.top, + dxClick = this.offset.click.left, + isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ), + isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ), + isOverElement = isOverElementHeight && isOverElementWidth; + + if ( this.options.tolerance === "pointer" || + this.options.forcePointerForContainers || + (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"]) + ) { + return isOverElement; + } else { + + return (l < x1 + (this.helperProportions.width / 2) && // Right Half + x2 - (this.helperProportions.width / 2) < r && // Left Half + t < y1 + (this.helperProportions.height / 2) && // Bottom Half + y2 - (this.helperProportions.height / 2) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function(item) { + + var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height), + isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width), + isOverElement = isOverElementHeight && isOverElementWidth, + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (!isOverElement) { + return false; + } + + return this.floating ? + ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 ) + : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) ); + + }, + + _intersectsWithSides: function(item) { + + var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height), + isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf)); + } else { + return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf)); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta !== 0 && (delta > 0 ? "down" : "up"); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta !== 0 && (delta > 0 ? "right" : "left"); + }, + + refresh: function(event) { + this._refreshItems(event); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith; + }, + + _getItemsAsjQuery: function(connected) { + + var i, j, cur, inst, + items = [], + queries = [], + connectWith = this._connectWith(); + + if(connectWith && connected) { + for (i = connectWith.length - 1; i >= 0; i--){ + cur = $(connectWith[i]); + for ( j = cur.length - 1; j >= 0; j--){ + inst = $.data(cur[j], this.widgetFullName); + if(inst && inst !== this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]); + } + } + } + } + + queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]); + + function addItems() { + items.push( this ); + } + for (i = queries.length - 1; i >= 0; i--){ + queries[i][0].each( addItems ); + } + + return $(items); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); + + this.items = $.grep(this.items, function (item) { + for (var j=0; j < list.length; j++) { + if(list[j] === item.item[0]) { + return false; + } + } + return true; + }); + + }, + + _refreshItems: function(event) { + + this.items = []; + this.containers = [this]; + + var i, j, cur, inst, targetData, _queries, item, queriesLength, + items = this.items, + queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]], + connectWith = this._connectWith(); + + if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down + for (i = connectWith.length - 1; i >= 0; i--){ + cur = $(connectWith[i]); + for (j = cur.length - 1; j >= 0; j--){ + inst = $.data(cur[j], this.widgetFullName); + if(inst && inst !== this && !inst.options.disabled) { + queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]); + this.containers.push(inst); + } + } + } + } + + for (i = queries.length - 1; i >= 0; i--) { + targetData = queries[i][1]; + _queries = queries[i][0]; + + for (j=0, queriesLength = _queries.length; j < queriesLength; j++) { + item = $(_queries[j]); + + item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager) + + items.push({ + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + }); + } + } + + }, + + refreshPositions: function(fast) { + + //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change + if(this.offsetParent && this.helper) { + this.offset.parent = this._getParentOffset(); + } + + var i, item, t, p; + + for (i = this.items.length - 1; i >= 0; i--){ + item = this.items[i]; + + //We ignore calculating positions of all connected containers when we're not over them + if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) { + continue; + } + + t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item; + + if (!fast) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + p = t.offset(); + item.left = p.left; + item.top = p.top; + } + + if(this.options.custom && this.options.custom.refreshContainers) { + this.options.custom.refreshContainers.call(this); + } else { + for (i = this.containers.length - 1; i >= 0; i--){ + p = this.containers[i].element.offset(); + this.containers[i].containerCache.left = p.left; + this.containers[i].containerCache.top = p.top; + this.containers[i].containerCache.width = this.containers[i].element.outerWidth(); + this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); + } + } + + return this; + }, + + _createPlaceholder: function(that) { + that = that || this; + var className, + o = that.options; + + if(!o.placeholder || o.placeholder.constructor === String) { + className = o.placeholder; + o.placeholder = { + element: function() { + + var nodeName = that.currentItem[0].nodeName.toLowerCase(), + element = $( "<" + nodeName + ">", that.document[0] ) + .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder") + .removeClass("ui-sortable-helper"); + + if ( nodeName === "tr" ) { + that.currentItem.children().each(function() { + $( " ", that.document[0] ) + .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) + .appendTo( element ); + }); + } else if ( nodeName === "img" ) { + element.attr( "src", that.currentItem.attr( "src" ) ); + } + + if ( !className ) { + element.css( "visibility", "hidden" ); + } + + return element; + }, + update: function(container, p) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified + if(className && !o.forcePlaceholderSize) { + return; + } + + //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item + if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); } + if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); } + } + }; + } + + //Create the placeholder + that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); + + //Append it after the actual current item + that.currentItem.after(that.placeholder); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update(that, that.placeholder); + + }, + + _contactContainers: function(event) { + var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating, + innermostContainer = null, + innermostIndex = null; + + // get innermost container that intersects with item + for (i = this.containers.length - 1; i >= 0; i--) { + + // never consider a container that's located within the item itself + if($.contains(this.currentItem[0], this.containers[i].element[0])) { + continue; + } + + if(this._intersectsWith(this.containers[i].containerCache)) { + + // if we've already found a container and it's more "inner" than this, then continue + if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) { + continue; + } + + innermostContainer = this.containers[i]; + innermostIndex = i; + + } else { + // container doesn't intersect. trigger "out" event if necessary + if(this.containers[i].containerCache.over) { + this.containers[i]._trigger("out", event, this._uiHash(this)); + this.containers[i].containerCache.over = 0; + } + } + + } + + // if no intersecting containers found, return + if(!innermostContainer) { + return; + } + + // move the item into the container if it's not there already + if(this.containers.length === 1) { + if (!this.containers[innermostIndex].containerCache.over) { + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + } else { + + //When entering a new container, we will find the item with the least distance and append our item near it + dist = 10000; + itemWithLeastDistance = null; + floating = innermostContainer.floating || isFloating(this.currentItem); + posProperty = floating ? "left" : "top"; + sizeProperty = floating ? "width" : "height"; + base = this.positionAbs[posProperty] + this.offset.click[posProperty]; + for (j = this.items.length - 1; j >= 0; j--) { + if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) { + continue; + } + if(this.items[j].item[0] === this.currentItem[0]) { + continue; + } + if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) { + continue; + } + cur = this.items[j].item.offset()[posProperty]; + nearBottom = false; + if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ + nearBottom = true; + cur += this.items[j][sizeProperty]; + } + + if(Math.abs(cur - base) < dist) { + dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; + this.direction = nearBottom ? "up": "down"; + } + } + + //Check if dropOnEmpty is enabled + if(!itemWithLeastDistance && !this.options.dropOnEmpty) { + return; + } + + if(this.currentContainer === this.containers[innermostIndex]) { + return; + } + + itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true); + this._trigger("change", event, this._uiHash()); + this.containers[innermostIndex]._trigger("change", event, this._uiHash(this)); + this.currentContainer = this.containers[innermostIndex]; + + //Update the placeholder + this.options.placeholder.update(this.currentContainer, this.placeholder); + + this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); + this.containers[innermostIndex].containerCache.over = 1; + } + + + }, + + _createHelper: function(event) { + + var o = this.options, + helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem); + + //Add the helper to the DOM if that didn't happen already + if(!helper.parents("body").length) { + $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]); + } + + if(helper[0] === this.currentItem[0]) { + this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }; + } + + if(!helper[0].style.width || o.forceHelperSize) { + helper.width(this.currentItem.width()); + } + if(!helper[0].style.height || o.forceHelperSize) { + helper.height(this.currentItem.height()); + } + + return helper; + + }, + + _adjustOffsetFromHelper: function(obj) { + if (typeof obj === "string") { + obj = obj.split(" "); + } + if ($.isArray(obj)) { + obj = {left: +obj[0], top: +obj[1] || 0}; + } + if ("left" in obj) { + this.offset.click.left = obj.left + this.margins.left; + } + if ("right" in obj) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ("top" in obj) { + this.offset.click.top = obj.top + this.margins.top; + } + if ("bottom" in obj) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that + // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag + if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + // This needs to be actually done for all browsers, since pageX/pageY includes this information + // with an ugly IE fix + if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) { + po = { top: 0, left: 0 }; + } + + return { + top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0), + left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0) + }; + + }, + + _getRelativeOffset: function() { + + if(this.cssPosition === "relative") { + var p = this.currentItem.position(); + return { + top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(), + left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: (parseInt(this.currentItem.css("marginLeft"),10) || 0), + top: (parseInt(this.currentItem.css("marginTop"),10) || 0) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var ce, co, over, + o = this.options; + if(o.containment === "parent") { + o.containment = this.helper[0].parentNode; + } + if(o.containment === "document" || o.containment === "window") { + this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, + ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top + ]; + } + + if(!(/^(document|window|parent)$/).test(o.containment)) { + ce = $(o.containment)[0]; + co = $(o.containment).offset(); + over = ($(ce).css("overflow") !== "hidden"); + + this.containment = [ + co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, + co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, + co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, + co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function(d, pos) { + + if(!pos) { + pos = this.position; + } + var mod = d === "absolute" ? 1 : -1, + scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, + scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + return { + top: ( + pos.top + // The absolute mouse position + this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + ), + left: ( + pos.left + // The absolute mouse position + this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + ) + }; + + }, + + _generatePosition: function(event) { + + var top, left, + o = this.options, + pageX = event.pageX, + pageY = event.pageY, + scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) { + this.offset.relative = this._getRelativeOffset(); + } + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if(this.originalPosition) { //If we are not dragging yet, we won't check for options + + if(this.containment) { + if(event.pageX - this.offset.click.left < this.containment[0]) { + pageX = this.containment[0] + this.offset.click.left; + } + if(event.pageY - this.offset.click.top < this.containment[1]) { + pageY = this.containment[1] + this.offset.click.top; + } + if(event.pageX - this.offset.click.left > this.containment[2]) { + pageX = this.containment[2] + this.offset.click.left; + } + if(event.pageY - this.offset.click.top > this.containment[3]) { + pageY = this.containment[3] + this.offset.click.top; + } + } + + if(o.grid) { + top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1]; + pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top; + + left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0]; + pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left; + } + + } + + return { + top: ( + pageY - // The absolute mouse position + this.offset.click.top - // Click offset (relative to the element) + this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.top + // The offsetParent's offset without borders (offset + border) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + ), + left: ( + pageX - // The absolute mouse position + this.offset.click.left - // Click offset (relative to the element) + this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.left + // The offsetParent's offset without borders (offset + border) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + ) + }; + + }, + + _rearrange: function(event, i, a, hardRefresh) { + + a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling)); + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var counter = this.counter; + + this._delay(function() { + if(counter === this.counter) { + this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove + } + }); + + }, + + _clear: function(event, noPropagation) { + + this.reverting = false; + // We delay all events that have to be triggered to after the point where the placeholder has been removed and + // everything else normalized again + var i, + delayedTriggers = []; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088) + if(!this._noFinalSort && this.currentItem.parent().length) { + this.placeholder.before(this.currentItem); + } + this._noFinalSort = null; + + if(this.helper[0] === this.currentItem[0]) { + for(i in this._storedCSS) { + if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") { + this._storedCSS[i] = ""; + } + } + this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); + } else { + this.currentItem.show(); + } + + if(this.fromOutside && !noPropagation) { + delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); }); + } + if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) { + delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed + } + + // Check if the items Container has Changed and trigger appropriate + // events. + if (this !== this.currentContainer) { + if(!noPropagation) { + delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); }); + delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer)); + } + } + + + //Post events to containers + function delayEvent( type, instance, container ) { + return function( event ) { + container._trigger( type, event, instance._uiHash( instance ) ); + }; + } + for (i = this.containers.length - 1; i >= 0; i--){ + if (!noPropagation) { + delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); + } + if(this.containers[i].containerCache.over) { + delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); + this.containers[i].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if ( this.storedCursor ) { + this.document.find( "body" ).css( "cursor", this.storedCursor ); + this.storedStylesheet.remove(); + } + if(this._storedOpacity) { + this.helper.css("opacity", this._storedOpacity); + } + if(this._storedZIndex) { + this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex); + } + + this.dragging = false; + if(this.cancelHelperRemoval) { + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + for (i=0; i < delayedTriggers.length; i++) { + delayedTriggers[i].call(this, event); + } //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return false; + } + + if(!noPropagation) { + this._trigger("beforeStop", event, this._uiHash()); + } + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + + if(this.helper[0] !== this.currentItem[0]) { + this.helper.remove(); + } + this.helper = null; + + if(!noPropagation) { + for (i=0; i < delayedTriggers.length; i++) { + delayedTriggers[i].call(this, event); + } //Trigger all delayed events + this._trigger("stop", event, this._uiHash()); + } + + this.fromOutside = false; + return true; + + }, + + _trigger: function() { + if ($.Widget.prototype._trigger.apply(this, arguments) === false) { + this.cancel(); + } + }, + + _uiHash: function(_inst) { + var inst = _inst || this; + return { + helper: inst.helper, + placeholder: inst.placeholder || $([]), + position: inst.position, + originalPosition: inst.originalPosition, + offset: inst.positionAbs, + item: inst.currentItem, + sender: _inst ? _inst.element : null + }; + } + +}); + +})(jQuery); +(function( $, undefined ) { + +var uid = 0, + hideProps = {}, + showProps = {}; + +hideProps.height = hideProps.paddingTop = hideProps.paddingBottom = + hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide"; +showProps.height = showProps.paddingTop = showProps.paddingBottom = + showProps.borderTopWidth = showProps.borderBottomWidth = "show"; + +$.widget( "ui.accordion", { + version: "1.10.4", + options: { + active: 0, + animate: {}, + collapsible: false, + event: "click", + header: "> li > :first-child,> :not(li):even", + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // callbacks + activate: null, + beforeActivate: null + }, + + _create: function() { + var options = this.options; + this.prevShow = this.prevHide = $(); + this.element.addClass( "ui-accordion ui-widget ui-helper-reset" ) + // ARIA + .attr( "role", "tablist" ); + + // don't allow collapsible: false and active: false / null + if ( !options.collapsible && (options.active === false || options.active == null) ) { + options.active = 0; + } + + this._processPanels(); + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this._refresh(); + }, + + _getCreateEventData: function() { + return { + header: this.active, + panel: !this.active.length ? $() : this.active.next(), + content: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icons = this.options.icons; + if ( icons ) { + $( "" ) + .addClass( "ui-accordion-header-icon ui-icon " + icons.header ) + .prependTo( this.headers ); + this.active.children( ".ui-accordion-header-icon" ) + .removeClass( icons.header ) + .addClass( icons.activeHeader ); + this.headers.addClass( "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this.headers + .removeClass( "ui-accordion-icons" ) + .children( ".ui-accordion-header-icon" ) + .remove(); + }, + + _destroy: function() { + var contents; + + // clean up main element + this.element + .removeClass( "ui-accordion ui-widget ui-helper-reset" ) + .removeAttr( "role" ); + + // clean up headers + this.headers + .removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" ) + .removeAttr( "role" ) + .removeAttr( "aria-expanded" ) + .removeAttr( "aria-selected" ) + .removeAttr( "aria-controls" ) + .removeAttr( "tabIndex" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + this._destroyIcons(); + + // clean up content panels + contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role" ) + .removeAttr( "aria-hidden" ) + .removeAttr( "aria-labelledby" ) + .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" ) + .each(function() { + if ( /^ui-accordion/.test( this.id ) ) { + this.removeAttribute( "id" ); + } + }); + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + + // #5332 - opacity doesn't cascade to positioned elements in IE + // so we need to add the disabled class to the headers and panels + if ( key === "disabled" ) { + this.headers.add( this.headers.next() ) + .toggleClass( "ui-state-disabled", !!value ); + } + }, + + _keydown: function( event ) { + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + toFocus.focus(); + event.preventDefault(); + } + }, + + _panelKeyDown : function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().focus(); + } + }, + + refresh: function() { + var options = this.options; + this._processPanels(); + + // was collapsed or no panel + if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) { + options.active = false; + this.active = $(); + // active false only when collapsible is true + } else if ( options.active === false ) { + this._activate( 0 ); + // was active, but active panel is gone + } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + // all remaining panel are disabled + if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) { + options.active = false; + this.active = $(); + // activate previous panel + } else { + this._activate( Math.max( 0, options.active - 1 ) ); + } + // was active, active panel still exists + } else { + // make sure active index is correct + options.active = this.headers.index( this.active ); + } + + this._destroyIcons(); + + this._refresh(); + }, + + _processPanels: function() { + this.headers = this.element.find( this.options.header ) + .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" ); + + this.headers.next() + .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" ) + .filter(":not(.ui-accordion-content-active)") + .hide(); + }, + + _refresh: function() { + var maxHeight, + options = this.options, + heightStyle = options.heightStyle, + parent = this.element.parent(), + accordionId = this.accordionId = "ui-accordion-" + + (this.element.attr( "id" ) || ++uid); + + this.active = this._findActive( options.active ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) + .removeClass( "ui-corner-all" ); + this.active.next() + .addClass( "ui-accordion-content-active" ) + .show(); + + this.headers + .attr( "role", "tab" ) + .each(function( i ) { + var header = $( this ), + headerId = header.attr( "id" ), + panel = header.next(), + panelId = panel.attr( "id" ); + if ( !headerId ) { + headerId = accordionId + "-header-" + i; + header.attr( "id", headerId ); + } + if ( !panelId ) { + panelId = accordionId + "-panel-" + i; + panel.attr( "id", panelId ); + } + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + }) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr({ + "aria-selected": "false", + "aria-expanded": "false", + tabIndex: -1 + }) + .next() + .attr({ + "aria-hidden": "true" + }) + .hide(); + + // make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr({ + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: 0 + }) + .next() + .attr({ + "aria-hidden": "false" + }); + } + + this._createIcons(); + + this._setupEvents( options.event ); + + if ( heightStyle === "fill" ) { + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each(function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + }); + + this.headers.each(function() { + maxHeight -= $( this ).outerHeight( true ); + }); + + this.headers.next() + .each(function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + }) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each(function() { + maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); + }) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler({ + target: active, + currentTarget: active, + preventDefault: $.noop + }); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = { + keydown: "_keydown" + }; + if ( event ) { + $.each( event.split(" "), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + }); + } + + this._off( this.headers.add( this.headers.next() ) ); + this._on( this.headers, events ); + this._on( this.headers.next(), { keydown: "_panelKeyDown" }); + this._hoverable( this.headers ); + this._focusable( this.headers ); + }, + + _eventHandler: function( event ) { + var options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // switch classes + // corner classes on the previously active header stay after the animation + active.removeClass( "ui-accordion-header-active ui-state-active" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.activeHeader ) + .addClass( options.icons.header ); + } + + if ( !clickedIsActive ) { + clicked + .removeClass( "ui-corner-all" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) + .removeClass( options.icons.header ) + .addClass( options.icons.activeHeader ); + } + + clicked + .next() + .addClass( "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr({ + "aria-hidden": "true" + }); + toHide.prev().attr( "aria-selected", "false" ); + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr({ + "tabIndex": -1, + "aria-expanded": "false" + }); + } else if ( toShow.length ) { + this.headers.filter(function() { + return $( this ).attr( "tabIndex" ) === 0; + }) + .attr( "tabIndex", -1 ); + } + + toShow + .attr( "aria-hidden", "false" ) + .prev() + .attr({ + "aria-selected": "true", + tabIndex: 0, + "aria-expanded": "true" + }); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + }); + toShow + .hide() + .animate( showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + adjust += fx.now; + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + }); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel; + + toHide + .removeClass( "ui-accordion-content-active" ) + .prev() + .removeClass( "ui-corner-top" ) + .addClass( "ui-corner-all" ); + + // Work around for rendering bug in IE (#5421) + if ( toHide.length ) { + toHide.parent()[0].className = toHide.parent()[0].className; + } + this._trigger( "activate", null, data ); + } +}); + +})( jQuery ); +(function( $, undefined ) { + +$.widget( "ui.autocomplete", { + version: "1.10.4", + defaultElement: "", + options: { + appendTo: null, + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + requestIndex: 0, + pending: 0, + + _create: function() { + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput, + nodeName = this.element[0].nodeName.toLowerCase(), + isTextarea = nodeName === "textarea", + isInput = nodeName === "input"; + + this.isMultiLine = + // Textareas are always multi-line + isTextarea ? true : + // Inputs are always single-line, even if inside a contentEditable element + // IE also treats inputs as contentEditable + isInput ? false : + // All other element types are determined by whether or not they're contentEditable + this.element.prop( "isContentEditable" ); + + this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; + this.isNewMenu = true; + + this.element + .addClass( "ui-autocomplete-input" ) + .attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + case keyCode.NUMPAD_ENTER: + // when menu is open and has focus + if ( this.menu.active ) { + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + this._value( this.term ); + this.close( event ); + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + // Double press in IE means clear the whole form + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + event.preventDefault(); + } + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + if ( this.cancelBlur ) { + delete this.cancelBlur; + return; + } + + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + }); + + this._initSource(); + this.menu = $( "
    " ) + .addClass( "ui-autocomplete ui-front" ) + .appendTo( this._appendTo() ) + .menu({ + // disable ARIA support, the live region takes care of that + role: null + }) + .hide() + .data( "ui-menu" ); + + this._on( this.menu.element, { + mousedown: function( event ) { + // prevent moving focus out of the text field + event.preventDefault(); + + // IE doesn't prevent moving focus even with event.preventDefault() + // so we set a flag to know when we should ignore the blur event + this.cancelBlur = true; + this._delay(function() { + delete this.cancelBlur; + }); + + // clicking on the scrollbar causes focus to shift to the body + // but we can't detect a mouseup or a click immediately afterward + // so we have to track the next mousedown and close the menu if + // the user clicks somewhere outside of the autocomplete + var menuElement = this.menu.element[ 0 ]; + if ( !$( event.target ).closest( ".ui-menu-item" ).length ) { + this._delay(function() { + var that = this; + this.document.one( "mousedown", function( event ) { + if ( event.target !== that.element[ 0 ] && + event.target !== menuElement && + !$.contains( menuElement, event.target ) ) { + that.close(); + } + }); + }); + } + }, + menufocus: function( event, ui ) { + // support: Firefox + // Prevent accidental activation of menu items in Firefox (#7024 #9118) + if ( this.isNewMenu ) { + this.isNewMenu = false; + if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { + this.menu.blur(); + + this.document.one( "mousemove", function() { + $( event.target ).trigger( event.originalEvent ); + }); + + return; + } + } + + var item = ui.item.data( "ui-autocomplete-item" ); + if ( false !== this._trigger( "focus", event, { item: item } ) ) { + // use value to match what will end up in the input, if it was a key event + if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { + this._value( item.value ); + } + } else { + // Normally the input is populated with the item's value as the + // menu is navigated, causing screen readers to notice a change and + // announce the item. Since the focus event was canceled, this doesn't + // happen, so we update the live region so that screen readers can + // still notice the change and announce it. + this.liveRegion.text( item.value ); + } + }, + menuselect: function( event, ui ) { + var item = ui.item.data( "ui-autocomplete-item" ), + previous = this.previous; + + // only trigger when focus was lost (click on menu) + if ( this.element[0] !== this.document[0].activeElement ) { + this.element.focus(); + this.previous = previous; + // #6109 - IE triggers two focus events and the second + // is asynchronous, so we need to reset the previous + // term synchronously and asynchronously :-( + this._delay(function() { + this.previous = previous; + this.selectedItem = item; + }); + } + + if ( false !== this._trigger( "select", event, { item: item } ) ) { + this._value( item.value ); + } + // reset the term after the select event + // this allows custom select handling to work properly + this.term = this._value(); + + this.close( event ); + this.selectedItem = item; + } + }); + + this.liveRegion = $( "", { + role: "status", + "aria-live": "polite" + }) + .addClass( "ui-helper-hidden-accessible" ) + .insertBefore( this.element ); + + // turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + }); + }, + + _destroy: function() { + clearTimeout( this.searching ); + this.element + .removeClass( "ui-autocomplete-input" ) + .removeAttr( "autocomplete" ); + this.menu.element.remove(); + this.liveRegion.remove(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( this._appendTo() ); + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _appendTo: function() { + var element = this.options.appendTo; + + if ( element ) { + element = element.jquery || element.nodeType ? + $( element ) : + this.document.find( element ).eq( 0 ); + } + + if ( !element ) { + element = this.element.closest( ".ui-front" ); + } + + if ( !element.length ) { + element = this.document[0].body; + } + + return element; + }, + + _initSource: function() { + var array, url, + that = this; + if ( $.isArray(this.options.source) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter( array, request.term ) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( that.xhr ) { + that.xhr.abort(); + } + that.xhr = $.ajax({ + url: url, + data: request, + dataType: "json", + success: function( data ) { + response( data ); + }, + error: function() { + response( [] ); + } + }); + }; + } else { + this.source = this.options.source; + } + }, + + _searchTimeout: function( event ) { + clearTimeout( this.searching ); + this.searching = this._delay(function() { + // only search if the value has changed + if ( this.term !== this._value() ) { + this.selectedItem = null; + this.search( null, event ); + } + }, this.options.delay ); + }, + + search: function( value, event ) { + value = value != null ? value : this._value(); + + // always save the actual value, not the one passed as an argument + this.term = this._value(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this.element.addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var index = ++this.requestIndex; + + return $.proxy(function( content ) { + if ( index === this.requestIndex ) { + this.__response( content ); + } + + this.pending--; + if ( !this.pending ) { + this.element.removeClass( "ui-autocomplete-loading" ); + } + }, this ); + }, + + __response: function( content ) { + if ( content ) { + content = this._normalize( content ); + } + this._trigger( "response", null, { content: content } ); + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { + this._suggest( content ); + this._trigger( "open" ); + } else { + // use ._close() instead of .close() so we don't cancel future searches + this._close(); + } + }, + + close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { + if ( this.menu.element.is( ":visible" ) ) { + this.menu.element.hide(); + this.menu.blur(); + this.isNewMenu = true; + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this._value() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + // assume all items have the right format when the first item is complete + if ( items.length && items[0].label && items[0].value ) { + return items; + } + return $.map( items, function( item ) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend({ + label: item.label || item.value, + value: item.value || item.label + }, item ); + }); + }, + + _suggest: function( items ) { + var ul = this.menu.element.empty(); + this._renderMenu( ul, items ); + this.isNewMenu = true; + this.menu.refresh(); + + // size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend({ + of: this.element + }, this.options.position )); + + if ( this.options.autoFocus ) { + this.menu.next(); + } + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var that = this; + $.each( items, function( index, item ) { + that._renderItemData( ul, item ); + }); + }, + + _renderItemData: function( ul, item ) { + return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); + }, + + _renderItem: function( ul, item ) { + return $( "
  • " ) + .append( $( "" ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is( ":visible" ) ) { + this.search( null, event ); + return; + } + if ( this.menu.isFirstItem() && /^previous/.test( direction ) || + this.menu.isLastItem() && /^next/.test( direction ) ) { + this._value( this.term ); + this.menu.blur(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + + _value: function() { + return this.valueMethod.apply( this.element, arguments ); + }, + + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +}); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + }, + filter: function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + return $.grep( array, function(value) { + return matcher.test( value.label || value.value || value ); + }); + } +}); + + +// live region extension, adding a `messages` option +// NOTE: This is an experimental API. We are still investigating +// a full solution for string manipulation and internationalization. +$.widget( "ui.autocomplete", $.ui.autocomplete, { + options: { + messages: { + noResults: "No search results.", + results: function( amount ) { + return amount + ( amount > 1 ? " results are" : " result is" ) + + " available, use up and down arrow keys to navigate."; + } + } + }, + + __response: function( content ) { + var message; + this._superApply( arguments ); + if ( this.options.disabled || this.cancelSearch ) { + return; + } + if ( content && content.length ) { + message = this.options.messages.results( content.length ); + } else { + message = this.options.messages.noResults; + } + this.liveRegion.text( message ); + } +}); + +}( jQuery )); +(function( $, undefined ) { + +var lastActive, + baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", + typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", + formResetHandler = function() { + var form = $( this ); + setTimeout(function() { + form.find( ":ui-button" ).button( "refresh" ); + }, 1 ); + }, + radioGroup = function( radio ) { + var name = radio.name, + form = radio.form, + radios = $( [] ); + if ( name ) { + name = name.replace( /'/g, "\\'" ); + if ( form ) { + radios = $( form ).find( "[name='" + name + "']" ); + } else { + radios = $( "[name='" + name + "']", radio.ownerDocument ) + .filter(function() { + return !this.form; + }); + } + } + return radios; + }; + +$.widget( "ui.button", { + version: "1.10.4", + defaultElement: "").addClass(this._triggerClass). + html(!buttonImage ? buttonText : $("").attr( + { src:buttonImage, alt:buttonText, title:buttonText }))); + input[isRTL ? "before" : "after"](inst.trigger); + inst.trigger.click(function() { + if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) { + $.datepicker._hideDatepicker(); + } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) { + $.datepicker._hideDatepicker(); + $.datepicker._showDatepicker(input[0]); + } else { + $.datepicker._showDatepicker(input[0]); + } + return false; + }); + } + }, + + /* Apply the maximum length for the date format. */ + _autoSize: function(inst) { + if (this._get(inst, "autoSize") && !inst.inline) { + var findMax, max, maxI, i, + date = new Date(2009, 12 - 1, 20), // Ensure double digits + dateFormat = this._get(inst, "dateFormat"); + + if (dateFormat.match(/[DM]/)) { + findMax = function(names) { + max = 0; + maxI = 0; + for (i = 0; i < names.length; i++) { + if (names[i].length > max) { + max = names[i].length; + maxI = i; + } + } + return maxI; + }; + date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? + "monthNames" : "monthNamesShort")))); + date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? + "dayNames" : "dayNamesShort"))) + 20 - date.getDay()); + } + inst.input.attr("size", this._formatDate(inst, date).length); + } + }, + + /* Attach an inline date picker to a div. */ + _inlineDatepicker: function(target, inst) { + var divSpan = $(target); + if (divSpan.hasClass(this.markerClassName)) { + return; + } + divSpan.addClass(this.markerClassName).append(inst.dpDiv); + $.data(target, PROP_NAME, inst); + this._setDate(inst, this._getDefaultDate(inst), true); + this._updateDatepicker(inst); + this._updateAlternate(inst); + //If disabled option is true, disable the datepicker before showing it (see ticket #5665) + if( inst.settings.disabled ) { + this._disableDatepicker( target ); + } + // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements + // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height + inst.dpDiv.css( "display", "block" ); + }, + + /* Pop-up the date picker in a "dialog" box. + * @param input element - ignored + * @param date string or Date - the initial date to display + * @param onSelect function - the function to call when a date is selected + * @param settings object - update the dialog date picker instance's settings (anonymous object) + * @param pos int[2] - coordinates for the dialog's position within the screen or + * event - with x/y coordinates or + * leave empty for default (screen centre) + * @return the manager object + */ + _dialogDatepicker: function(input, date, onSelect, settings, pos) { + var id, browserWidth, browserHeight, scrollX, scrollY, + inst = this._dialogInst; // internal instance + + if (!inst) { + this.uuid += 1; + id = "dp" + this.uuid; + this._dialogInput = $(""); + this._dialogInput.keydown(this._doKeyDown); + $("body").append(this._dialogInput); + inst = this._dialogInst = this._newInst(this._dialogInput, false); + inst.settings = {}; + $.data(this._dialogInput[0], PROP_NAME, inst); + } + extendRemove(inst.settings, settings || {}); + date = (date && date.constructor === Date ? this._formatDate(inst, date) : date); + this._dialogInput.val(date); + + this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); + if (!this._pos) { + browserWidth = document.documentElement.clientWidth; + browserHeight = document.documentElement.clientHeight; + scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; + scrollY = document.documentElement.scrollTop || document.body.scrollTop; + this._pos = // should use actual width/height below + [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; + } + + // move input on screen for focus, but hidden behind dialog + this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px"); + inst.settings.onSelect = onSelect; + this._inDialog = true; + this.dpDiv.addClass(this._dialogClass); + this._showDatepicker(this._dialogInput[0]); + if ($.blockUI) { + $.blockUI(this.dpDiv); + } + $.data(this._dialogInput[0], PROP_NAME, inst); + return this; + }, + + /* Detach a datepicker from its control. + * @param target element - the target input field or division or span + */ + _destroyDatepicker: function(target) { + var nodeName, + $target = $(target), + inst = $.data(target, PROP_NAME); + + if (!$target.hasClass(this.markerClassName)) { + return; + } + + nodeName = target.nodeName.toLowerCase(); + $.removeData(target, PROP_NAME); + if (nodeName === "input") { + inst.append.remove(); + inst.trigger.remove(); + $target.removeClass(this.markerClassName). + unbind("focus", this._showDatepicker). + unbind("keydown", this._doKeyDown). + unbind("keypress", this._doKeyPress). + unbind("keyup", this._doKeyUp); + } else if (nodeName === "div" || nodeName === "span") { + $target.removeClass(this.markerClassName).empty(); + } + }, + + /* Enable the date picker to a jQuery selection. + * @param target element - the target input field or division or span + */ + _enableDatepicker: function(target) { + var nodeName, inline, + $target = $(target), + inst = $.data(target, PROP_NAME); + + if (!$target.hasClass(this.markerClassName)) { + return; + } + + nodeName = target.nodeName.toLowerCase(); + if (nodeName === "input") { + target.disabled = false; + inst.trigger.filter("button"). + each(function() { this.disabled = false; }).end(). + filter("img").css({opacity: "1.0", cursor: ""}); + } else if (nodeName === "div" || nodeName === "span") { + inline = $target.children("." + this._inlineClass); + inline.children().removeClass("ui-state-disabled"); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", false); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value === target ? null : value); }); // delete entry + }, + + /* Disable the date picker to a jQuery selection. + * @param target element - the target input field or division or span + */ + _disableDatepicker: function(target) { + var nodeName, inline, + $target = $(target), + inst = $.data(target, PROP_NAME); + + if (!$target.hasClass(this.markerClassName)) { + return; + } + + nodeName = target.nodeName.toLowerCase(); + if (nodeName === "input") { + target.disabled = true; + inst.trigger.filter("button"). + each(function() { this.disabled = true; }).end(). + filter("img").css({opacity: "0.5", cursor: "default"}); + } else if (nodeName === "div" || nodeName === "span") { + inline = $target.children("." + this._inlineClass); + inline.children().addClass("ui-state-disabled"); + inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). + prop("disabled", true); + } + this._disabledInputs = $.map(this._disabledInputs, + function(value) { return (value === target ? null : value); }); // delete entry + this._disabledInputs[this._disabledInputs.length] = target; + }, + + /* Is the first field in a jQuery collection disabled as a datepicker? + * @param target element - the target input field or division or span + * @return boolean - true if disabled, false if enabled + */ + _isDisabledDatepicker: function(target) { + if (!target) { + return false; + } + for (var i = 0; i < this._disabledInputs.length; i++) { + if (this._disabledInputs[i] === target) { + return true; + } + } + return false; + }, + + /* Retrieve the instance data for the target control. + * @param target element - the target input field or division or span + * @return object - the associated instance data + * @throws error if a jQuery problem getting data + */ + _getInst: function(target) { + try { + return $.data(target, PROP_NAME); + } + catch (err) { + throw "Missing instance data for this datepicker"; + } + }, + + /* Update or retrieve the settings for a date picker attached to an input field or division. + * @param target element - the target input field or division or span + * @param name object - the new settings to update or + * string - the name of the setting to change or retrieve, + * when retrieving also "all" for all instance settings or + * "defaults" for all global defaults + * @param value any - the new value for the setting + * (omit if above is an object or to retrieve a value) + */ + _optionDatepicker: function(target, name, value) { + var settings, date, minDate, maxDate, + inst = this._getInst(target); + + if (arguments.length === 2 && typeof name === "string") { + return (name === "defaults" ? $.extend({}, $.datepicker._defaults) : + (inst ? (name === "all" ? $.extend({}, inst.settings) : + this._get(inst, name)) : null)); + } + + settings = name || {}; + if (typeof name === "string") { + settings = {}; + settings[name] = value; + } + + if (inst) { + if (this._curInst === inst) { + this._hideDatepicker(); + } + + date = this._getDateDatepicker(target, true); + minDate = this._getMinMaxDate(inst, "min"); + maxDate = this._getMinMaxDate(inst, "max"); + extendRemove(inst.settings, settings); + // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided + if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) { + inst.settings.minDate = this._formatDate(inst, minDate); + } + if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) { + inst.settings.maxDate = this._formatDate(inst, maxDate); + } + if ( "disabled" in settings ) { + if ( settings.disabled ) { + this._disableDatepicker(target); + } else { + this._enableDatepicker(target); + } + } + this._attachments($(target), inst); + this._autoSize(inst); + this._setDate(inst, date); + this._updateAlternate(inst); + this._updateDatepicker(inst); + } + }, + + // change method deprecated + _changeDatepicker: function(target, name, value) { + this._optionDatepicker(target, name, value); + }, + + /* Redraw the date picker attached to an input field or division. + * @param target element - the target input field or division or span + */ + _refreshDatepicker: function(target) { + var inst = this._getInst(target); + if (inst) { + this._updateDatepicker(inst); + } + }, + + /* Set the dates for a jQuery selection. + * @param target element - the target input field or division or span + * @param date Date - the new date + */ + _setDateDatepicker: function(target, date) { + var inst = this._getInst(target); + if (inst) { + this._setDate(inst, date); + this._updateDatepicker(inst); + this._updateAlternate(inst); + } + }, + + /* Get the date(s) for the first entry in a jQuery selection. + * @param target element - the target input field or division or span + * @param noDefault boolean - true if no default date is to be used + * @return Date - the current date + */ + _getDateDatepicker: function(target, noDefault) { + var inst = this._getInst(target); + if (inst && !inst.inline) { + this._setDateFromField(inst, noDefault); + } + return (inst ? this._getDate(inst) : null); + }, + + /* Handle keystrokes. */ + _doKeyDown: function(event) { + var onSelect, dateStr, sel, + inst = $.datepicker._getInst(event.target), + handled = true, + isRTL = inst.dpDiv.is(".ui-datepicker-rtl"); + + inst._keyEvent = true; + if ($.datepicker._datepickerShowing) { + switch (event.keyCode) { + case 9: $.datepicker._hideDatepicker(); + handled = false; + break; // hide on tab out + case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." + + $.datepicker._currentClass + ")", inst.dpDiv); + if (sel[0]) { + $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); + } + + onSelect = $.datepicker._get(inst, "onSelect"); + if (onSelect) { + dateStr = $.datepicker._formatDate(inst); + + // trigger custom callback + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); + } else { + $.datepicker._hideDatepicker(); + } + + return false; // don't submit the form + case 27: $.datepicker._hideDatepicker(); + break; // hide on escape + case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, "stepBigMonths") : + -$.datepicker._get(inst, "stepMonths")), "M"); + break; // previous month/year on page up/+ ctrl + case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, "stepBigMonths") : + +$.datepicker._get(inst, "stepMonths")), "M"); + break; // next month/year on page down/+ ctrl + case 35: if (event.ctrlKey || event.metaKey) { + $.datepicker._clearDate(event.target); + } + handled = event.ctrlKey || event.metaKey; + break; // clear on ctrl or command +end + case 36: if (event.ctrlKey || event.metaKey) { + $.datepicker._gotoToday(event.target); + } + handled = event.ctrlKey || event.metaKey; + break; // current on ctrl or command +home + case 37: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D"); + } + handled = event.ctrlKey || event.metaKey; + // -1 day on ctrl or command +left + if (event.originalEvent.altKey) { + $.datepicker._adjustDate(event.target, (event.ctrlKey ? + -$.datepicker._get(inst, "stepBigMonths") : + -$.datepicker._get(inst, "stepMonths")), "M"); + } + // next month/year on alt +left on Mac + break; + case 38: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, -7, "D"); + } + handled = event.ctrlKey || event.metaKey; + break; // -1 week on ctrl or command +up + case 39: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D"); + } + handled = event.ctrlKey || event.metaKey; + // +1 day on ctrl or command +right + if (event.originalEvent.altKey) { + $.datepicker._adjustDate(event.target, (event.ctrlKey ? + +$.datepicker._get(inst, "stepBigMonths") : + +$.datepicker._get(inst, "stepMonths")), "M"); + } + // next month/year on alt +right + break; + case 40: if (event.ctrlKey || event.metaKey) { + $.datepicker._adjustDate(event.target, +7, "D"); + } + handled = event.ctrlKey || event.metaKey; + break; // +1 week on ctrl or command +down + default: handled = false; + } + } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home + $.datepicker._showDatepicker(this); + } else { + handled = false; + } + + if (handled) { + event.preventDefault(); + event.stopPropagation(); + } + }, + + /* Filter entered characters - based on date format. */ + _doKeyPress: function(event) { + var chars, chr, + inst = $.datepicker._getInst(event.target); + + if ($.datepicker._get(inst, "constrainInput")) { + chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); + chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode); + return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1); + } + }, + + /* Synchronise manual entry and field/alternate field. */ + _doKeyUp: function(event) { + var date, + inst = $.datepicker._getInst(event.target); + + if (inst.input.val() !== inst.lastVal) { + try { + date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), + (inst.input ? inst.input.val() : null), + $.datepicker._getFormatConfig(inst)); + + if (date) { // only if valid + $.datepicker._setDateFromField(inst); + $.datepicker._updateAlternate(inst); + $.datepicker._updateDatepicker(inst); + } + } + catch (err) { + } + } + return true; + }, + + /* Pop-up the date picker for a given input field. + * If false returned from beforeShow event handler do not show. + * @param input element - the input field attached to the date picker or + * event - if triggered by focus + */ + _showDatepicker: function(input) { + input = input.target || input; + if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger + input = $("input", input.parentNode)[0]; + } + + if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here + return; + } + + var inst, beforeShow, beforeShowSettings, isFixed, + offset, showAnim, duration; + + inst = $.datepicker._getInst(input); + if ($.datepicker._curInst && $.datepicker._curInst !== inst) { + $.datepicker._curInst.dpDiv.stop(true, true); + if ( inst && $.datepicker._datepickerShowing ) { + $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); + } + } + + beforeShow = $.datepicker._get(inst, "beforeShow"); + beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; + if(beforeShowSettings === false){ + return; + } + extendRemove(inst.settings, beforeShowSettings); + + inst.lastVal = null; + $.datepicker._lastInput = input; + $.datepicker._setDateFromField(inst); + + if ($.datepicker._inDialog) { // hide cursor + input.value = ""; + } + if (!$.datepicker._pos) { // position below input + $.datepicker._pos = $.datepicker._findPos(input); + $.datepicker._pos[1] += input.offsetHeight; // add the height + } + + isFixed = false; + $(input).parents().each(function() { + isFixed |= $(this).css("position") === "fixed"; + return !isFixed; + }); + + offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; + $.datepicker._pos = null; + //to avoid flashes on Firefox + inst.dpDiv.empty(); + // determine sizing offscreen + inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"}); + $.datepicker._updateDatepicker(inst); + // fix width for dynamic number of date pickers + // and adjust position before showing + offset = $.datepicker._checkOffset(inst, offset, isFixed); + inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? + "static" : (isFixed ? "fixed" : "absolute")), display: "none", + left: offset.left + "px", top: offset.top + "px"}); + + if (!inst.inline) { + showAnim = $.datepicker._get(inst, "showAnim"); + duration = $.datepicker._get(inst, "duration"); + inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; + + if ( $.effects && $.effects.effect[ showAnim ] ) { + inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration); + } else { + inst.dpDiv[showAnim || "show"](showAnim ? duration : null); + } + + if ( $.datepicker._shouldFocusInput( inst ) ) { + inst.input.focus(); + } + + $.datepicker._curInst = inst; + } + }, + + /* Generate the date picker content. */ + _updateDatepicker: function(inst) { + this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + instActive = inst; // for delegate hover events + inst.dpDiv.empty().append(this._generateHTML(inst)); + this._attachHandlers(inst); + inst.dpDiv.find("." + this._dayOverClass + " a").mouseover(); + + var origyearshtml, + numMonths = this._getNumberOfMonths(inst), + cols = numMonths[1], + width = 17; + + inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); + if (cols > 1) { + inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em"); + } + inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + + "Class"]("ui-datepicker-multi"); + inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + + "Class"]("ui-datepicker-rtl"); + + if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { + inst.input.focus(); + } + + // deffered render of the years select (to avoid flashes on Firefox) + if( inst.yearshtml ){ + origyearshtml = inst.yearshtml; + setTimeout(function(){ + //assure that inst.yearshtml didn't change. + if( origyearshtml === inst.yearshtml && inst.yearshtml ){ + inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml); + } + origyearshtml = inst.yearshtml = null; + }, 0); + } + }, + + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + // Support: IE and jQuery <1.9 + _shouldFocusInput: function( inst ) { + return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); + }, + + /* Check positioning to remain on screen. */ + _checkOffset: function(inst, offset, isFixed) { + var dpWidth = inst.dpDiv.outerWidth(), + dpHeight = inst.dpDiv.outerHeight(), + inputWidth = inst.input ? inst.input.outerWidth() : 0, + inputHeight = inst.input ? inst.input.outerHeight() : 0, + viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()), + viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); + + offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0); + offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0; + offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; + + // now check if datepicker is showing outside window viewport - move to a better place if so. + offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight) : 0); + + return offset; + }, + + /* Find an object's position on the screen. */ + _findPos: function(obj) { + var position, + inst = this._getInst(obj), + isRTL = this._get(inst, "isRTL"); + + while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? "previousSibling" : "nextSibling"]; + } + + position = $(obj).offset(); + return [position.left, position.top]; + }, + + /* Hide the date picker from view. + * @param input element - the input field attached to the date picker + */ + _hideDatepicker: function(input) { + var showAnim, duration, postProcess, onClose, + inst = this._curInst; + + if (!inst || (input && inst !== $.data(input, PROP_NAME))) { + return; + } + + if (this._datepickerShowing) { + showAnim = this._get(inst, "showAnim"); + duration = this._get(inst, "duration"); + postProcess = function() { + $.datepicker._tidyDialog(inst); + }; + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess); + } else { + inst.dpDiv[(showAnim === "slideDown" ? "slideUp" : + (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess); + } + + if (!showAnim) { + postProcess(); + } + this._datepickerShowing = false; + + onClose = this._get(inst, "onClose"); + if (onClose) { + onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]); + } + + this._lastInput = null; + if (this._inDialog) { + this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); + if ($.blockUI) { + $.unblockUI(); + $("body").append(this.dpDiv); + } + } + this._inDialog = false; + } + }, + + /* Tidy up after a dialog display. */ + _tidyDialog: function(inst) { + inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar"); + }, + + /* Close date picker if clicked elsewhere. */ + _checkExternalClick: function(event) { + if (!$.datepicker._curInst) { + return; + } + + var $target = $(event.target), + inst = $.datepicker._getInst($target[0]); + + if ( ( ( $target[0].id !== $.datepicker._mainDivId && + $target.parents("#" + $.datepicker._mainDivId).length === 0 && + !$target.hasClass($.datepicker.markerClassName) && + !$target.closest("." + $.datepicker._triggerClass).length && + $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || + ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) { + $.datepicker._hideDatepicker(); + } + }, + + /* Adjust one of the date sub-fields. */ + _adjustDate: function(id, offset, period) { + var target = $(id), + inst = this._getInst(target[0]); + + if (this._isDisabledDatepicker(target[0])) { + return; + } + this._adjustInstDate(inst, offset + + (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning + period); + this._updateDatepicker(inst); + }, + + /* Action for current link. */ + _gotoToday: function(id) { + var date, + target = $(id), + inst = this._getInst(target[0]); + + if (this._get(inst, "gotoCurrent") && inst.currentDay) { + inst.selectedDay = inst.currentDay; + inst.drawMonth = inst.selectedMonth = inst.currentMonth; + inst.drawYear = inst.selectedYear = inst.currentYear; + } else { + date = new Date(); + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + } + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a new month/year. */ + _selectMonthYear: function(id, select, period) { + var target = $(id), + inst = this._getInst(target[0]); + + inst["selected" + (period === "M" ? "Month" : "Year")] = + inst["draw" + (period === "M" ? "Month" : "Year")] = + parseInt(select.options[select.selectedIndex].value,10); + + this._notifyChange(inst); + this._adjustDate(target); + }, + + /* Action for selecting a day. */ + _selectDay: function(id, month, year, td) { + var inst, + target = $(id); + + if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { + return; + } + + inst = this._getInst(target[0]); + inst.selectedDay = inst.currentDay = $("a", td).html(); + inst.selectedMonth = inst.currentMonth = month; + inst.selectedYear = inst.currentYear = year; + this._selectDate(id, this._formatDate(inst, + inst.currentDay, inst.currentMonth, inst.currentYear)); + }, + + /* Erase the input field and hide the date picker. */ + _clearDate: function(id) { + var target = $(id); + this._selectDate(target, ""); + }, + + /* Update the input field with the selected date. */ + _selectDate: function(id, dateStr) { + var onSelect, + target = $(id), + inst = this._getInst(target[0]); + + dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); + if (inst.input) { + inst.input.val(dateStr); + } + this._updateAlternate(inst); + + onSelect = this._get(inst, "onSelect"); + if (onSelect) { + onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback + } else if (inst.input) { + inst.input.trigger("change"); // fire the change event + } + + if (inst.inline){ + this._updateDatepicker(inst); + } else { + this._hideDatepicker(); + this._lastInput = inst.input[0]; + if (typeof(inst.input[0]) !== "object") { + inst.input.focus(); // restore focus + } + this._lastInput = null; + } + }, + + /* Update any alternate field to synchronise with the main field. */ + _updateAlternate: function(inst) { + var altFormat, date, dateStr, + altField = this._get(inst, "altField"); + + if (altField) { // update alternate field too + altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat"); + date = this._getDate(inst); + dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); + $(altField).each(function() { $(this).val(dateStr); }); + } + }, + + /* Set as beforeShowDay function to prevent selection of weekends. + * @param date Date - the date to customise + * @return [boolean, string] - is this date selectable?, what is its CSS class? + */ + noWeekends: function(date) { + var day = date.getDay(); + return [(day > 0 && day < 6), ""]; + }, + + /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. + * @param date Date - the date to get the week for + * @return number - the number of the week within the year that contains this date + */ + iso8601Week: function(date) { + var time, + checkDate = new Date(date.getTime()); + + // Find Thursday of this week starting on Monday + checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); + + time = checkDate.getTime(); + checkDate.setMonth(0); // Compare with Jan 1 + checkDate.setDate(1); + return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; + }, + + /* Parse a string value into a date object. + * See formatDate below for the possible formats. + * + * @param format string - the expected format of the date + * @param value string - the date in the above format + * @param settings Object - attributes include: + * shortYearCutoff number - the cutoff year for determining the century (optional) + * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + * dayNames string[7] - names of the days from Sunday (optional) + * monthNamesShort string[12] - abbreviated names of the months (optional) + * monthNames string[12] - names of the months (optional) + * @return Date - the extracted date value or null if value is blank + */ + parseDate: function (format, value, settings) { + if (format == null || value == null) { + throw "Invalid arguments"; + } + + value = (typeof value === "object" ? value.toString() : value + ""); + if (value === "") { + return null; + } + + var iFormat, dim, extra, + iValue = 0, + shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff, + shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : + new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)), + dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, + dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, + monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, + monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, + year = -1, + month = -1, + day = -1, + doy = -1, + literal = false, + date, + // Check whether a format character is doubled + lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); + if (matches) { + iFormat++; + } + return matches; + }, + // Extract a number from the string value + getNumber = function(match) { + var isDoubled = lookAhead(match), + size = (match === "@" ? 14 : (match === "!" ? 20 : + (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))), + digits = new RegExp("^\\d{1," + size + "}"), + num = value.substring(iValue).match(digits); + if (!num) { + throw "Missing number at position " + iValue; + } + iValue += num[0].length; + return parseInt(num[0], 10); + }, + // Extract a name from the string value and convert to an index + getName = function(match, shortNames, longNames) { + var index = -1, + names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; + } + }); + if (index !== -1) { + return index + 1; + } else { + throw "Unknown name at position " + iValue; + } + }, + // Confirm that a literal character matches the string value + checkLiteral = function() { + if (value.charAt(iValue) !== format.charAt(iFormat)) { + throw "Unexpected literal at position " + iValue; + } + iValue++; + }; + + for (iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) { + if (format.charAt(iFormat) === "'" && !lookAhead("'")) { + literal = false; + } else { + checkLiteral(); + } + } else { + switch (format.charAt(iFormat)) { + case "d": + day = getNumber("d"); + break; + case "D": + getName("D", dayNamesShort, dayNames); + break; + case "o": + doy = getNumber("o"); + break; + case "m": + month = getNumber("m"); + break; + case "M": + month = getName("M", monthNamesShort, monthNames); + break; + case "y": + year = getNumber("y"); + break; + case "@": + date = new Date(getNumber("@")); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "!": + date = new Date((getNumber("!") - this._ticksTo1970) / 10000); + year = date.getFullYear(); + month = date.getMonth() + 1; + day = date.getDate(); + break; + case "'": + if (lookAhead("'")){ + checkLiteral(); + } else { + literal = true; + } + break; + default: + checkLiteral(); + } + } + } + + if (iValue < value.length){ + extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } + } + + if (year === -1) { + year = new Date().getFullYear(); + } else if (year < 100) { + year += new Date().getFullYear() - new Date().getFullYear() % 100 + + (year <= shortYearCutoff ? 0 : -100); + } + + if (doy > -1) { + month = 1; + day = doy; + do { + dim = this._getDaysInMonth(year, month - 1); + if (day <= dim) { + break; + } + month++; + day -= dim; + } while (true); + } + + date = this._daylightSavingAdjust(new Date(year, month - 1, day)); + if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) { + throw "Invalid date"; // E.g. 31/02/00 + } + return date; + }, + + /* Standard date formats. */ + ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) + COOKIE: "D, dd M yy", + ISO_8601: "yy-mm-dd", + RFC_822: "D, d M y", + RFC_850: "DD, dd-M-y", + RFC_1036: "D, d M y", + RFC_1123: "D, d M yy", + RFC_2822: "D, d M yy", + RSS: "D, d M y", // RFC 822 + TICKS: "!", + TIMESTAMP: "@", + W3C: "yy-mm-dd", // ISO 8601 + + _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), + + /* Format a date object into a string value. + * The format can be combinations of the following: + * d - day of month (no leading zero) + * dd - day of month (two digit) + * o - day of year (no leading zeros) + * oo - day of year (three digit) + * D - day name short + * DD - day name long + * m - month of year (no leading zero) + * mm - month of year (two digit) + * M - month name short + * MM - month name long + * y - year (two digit) + * yy - year (four digit) + * @ - Unix timestamp (ms since 01/01/1970) + * ! - Windows ticks (100ns since 01/01/0001) + * "..." - literal text + * '' - single quote + * + * @param format string - the desired format of the date + * @param date Date - the date value to format + * @param settings Object - attributes include: + * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) + * dayNames string[7] - names of the days from Sunday (optional) + * monthNamesShort string[12] - abbreviated names of the months (optional) + * monthNames string[12] - names of the months (optional) + * @return string - the date in the above format + */ + formatDate: function (format, date, settings) { + if (!date) { + return ""; + } + + var iFormat, + dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, + dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, + monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, + monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, + // Check whether a format character is doubled + lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); + if (matches) { + iFormat++; + } + return matches; + }, + // Format a number, with leading zero if necessary + formatNumber = function(match, value, len) { + var num = "" + value; + if (lookAhead(match)) { + while (num.length < len) { + num = "0" + num; + } + } + return num; + }, + // Format a name, short or long as requested + formatName = function(match, value, shortNames, longNames) { + return (lookAhead(match) ? longNames[value] : shortNames[value]); + }, + output = "", + literal = false; + + if (date) { + for (iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) { + if (format.charAt(iFormat) === "'" && !lookAhead("'")) { + literal = false; + } else { + output += format.charAt(iFormat); + } + } else { + switch (format.charAt(iFormat)) { + case "d": + output += formatNumber("d", date.getDate(), 2); + break; + case "D": + output += formatName("D", date.getDay(), dayNamesShort, dayNames); + break; + case "o": + output += formatNumber("o", + Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); + break; + case "m": + output += formatNumber("m", date.getMonth() + 1, 2); + break; + case "M": + output += formatName("M", date.getMonth(), monthNamesShort, monthNames); + break; + case "y": + output += (lookAhead("y") ? date.getFullYear() : + (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100); + break; + case "@": + output += date.getTime(); + break; + case "!": + output += date.getTime() * 10000 + this._ticksTo1970; + break; + case "'": + if (lookAhead("'")) { + output += "'"; + } else { + literal = true; + } + break; + default: + output += format.charAt(iFormat); + } + } + } + } + return output; + }, + + /* Extract all possible characters from the date format. */ + _possibleChars: function (format) { + var iFormat, + chars = "", + literal = false, + // Check whether a format character is doubled + lookAhead = function(match) { + var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); + if (matches) { + iFormat++; + } + return matches; + }; + + for (iFormat = 0; iFormat < format.length; iFormat++) { + if (literal) { + if (format.charAt(iFormat) === "'" && !lookAhead("'")) { + literal = false; + } else { + chars += format.charAt(iFormat); + } + } else { + switch (format.charAt(iFormat)) { + case "d": case "m": case "y": case "@": + chars += "0123456789"; + break; + case "D": case "M": + return null; // Accept anything + case "'": + if (lookAhead("'")) { + chars += "'"; + } else { + literal = true; + } + break; + default: + chars += format.charAt(iFormat); + } + } + } + return chars; + }, + + /* Get a setting value, defaulting if necessary. */ + _get: function(inst, name) { + return inst.settings[name] !== undefined ? + inst.settings[name] : this._defaults[name]; + }, + + /* Parse existing date and initialise date picker. */ + _setDateFromField: function(inst, noDefault) { + if (inst.input.val() === inst.lastVal) { + return; + } + + var dateFormat = this._get(inst, "dateFormat"), + dates = inst.lastVal = inst.input ? inst.input.val() : null, + defaultDate = this._getDefaultDate(inst), + date = defaultDate, + settings = this._getFormatConfig(inst); + + try { + date = this.parseDate(dateFormat, dates, settings) || defaultDate; + } catch (event) { + dates = (noDefault ? "" : dates); + } + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + inst.currentDay = (dates ? date.getDate() : 0); + inst.currentMonth = (dates ? date.getMonth() : 0); + inst.currentYear = (dates ? date.getFullYear() : 0); + this._adjustInstDate(inst); + }, + + /* Retrieve the default date shown on opening. */ + _getDefaultDate: function(inst) { + return this._restrictMinMax(inst, + this._determineDate(inst, this._get(inst, "defaultDate"), new Date())); + }, + + /* A date may be specified as an exact value or a relative one. */ + _determineDate: function(inst, date, defaultDate) { + var offsetNumeric = function(offset) { + var date = new Date(); + date.setDate(date.getDate() + offset); + return date; + }, + offsetString = function(offset) { + try { + return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), + offset, $.datepicker._getFormatConfig(inst)); + } + catch (e) { + // Ignore + } + + var date = (offset.toLowerCase().match(/^c/) ? + $.datepicker._getDate(inst) : null) || new Date(), + year = date.getFullYear(), + month = date.getMonth(), + day = date.getDate(), + pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, + matches = pattern.exec(offset); + + while (matches) { + switch (matches[2] || "d") { + case "d" : case "D" : + day += parseInt(matches[1],10); break; + case "w" : case "W" : + day += parseInt(matches[1],10) * 7; break; + case "m" : case "M" : + month += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + case "y": case "Y" : + year += parseInt(matches[1],10); + day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); + break; + } + matches = pattern.exec(offset); + } + return new Date(year, month, day); + }, + newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : + (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); + + newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate); + if (newDate) { + newDate.setHours(0); + newDate.setMinutes(0); + newDate.setSeconds(0); + newDate.setMilliseconds(0); + } + return this._daylightSavingAdjust(newDate); + }, + + /* Handle switch to/from daylight saving. + * Hours may be non-zero on daylight saving cut-over: + * > 12 when midnight changeover, but then cannot generate + * midnight datetime, so jump to 1AM, otherwise reset. + * @param date (Date) the date to check + * @return (Date) the corrected date + */ + _daylightSavingAdjust: function(date) { + if (!date) { + return null; + } + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); + return date; + }, + + /* Set the date(s) directly. */ + _setDate: function(inst, date, noChange) { + var clear = !date, + origMonth = inst.selectedMonth, + origYear = inst.selectedYear, + newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); + + inst.selectedDay = inst.currentDay = newDate.getDate(); + inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); + inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); + if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) { + this._notifyChange(inst); + } + this._adjustInstDate(inst); + if (inst.input) { + inst.input.val(clear ? "" : this._formatDate(inst)); + } + }, + + /* Retrieve the date(s) directly. */ + _getDate: function(inst) { + var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null : + this._daylightSavingAdjust(new Date( + inst.currentYear, inst.currentMonth, inst.currentDay))); + return startDate; + }, + + /* Attach the onxxx handlers. These are declared statically so + * they work with static code transformers like Caja. + */ + _attachHandlers: function(inst) { + var stepMonths = this._get(inst, "stepMonths"), + id = "#" + inst.id.replace( /\\\\/g, "\\" ); + inst.dpDiv.find("[data-handler]").map(function () { + var handler = { + prev: function () { + $.datepicker._adjustDate(id, -stepMonths, "M"); + }, + next: function () { + $.datepicker._adjustDate(id, +stepMonths, "M"); + }, + hide: function () { + $.datepicker._hideDatepicker(); + }, + today: function () { + $.datepicker._gotoToday(id); + }, + selectDay: function () { + $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); + return false; + }, + selectMonth: function () { + $.datepicker._selectMonthYear(id, this, "M"); + return false; + }, + selectYear: function () { + $.datepicker._selectMonthYear(id, this, "Y"); + return false; + } + }; + $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]); + }); + }, + + /* Generate the HTML for the current state of the date picker. */ + _generateHTML: function(inst) { + var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, + controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, + monthNames, monthNamesShort, beforeShowDay, showOtherMonths, + selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, + cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, + printDate, dRow, tbody, daySettings, otherMonth, unselectable, + tempDate = new Date(), + today = this._daylightSavingAdjust( + new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time + isRTL = this._get(inst, "isRTL"), + showButtonPanel = this._get(inst, "showButtonPanel"), + hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"), + navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"), + numMonths = this._getNumberOfMonths(inst), + showCurrentAtPos = this._get(inst, "showCurrentAtPos"), + stepMonths = this._get(inst, "stepMonths"), + isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1), + currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : + new Date(inst.currentYear, inst.currentMonth, inst.currentDay))), + minDate = this._getMinMaxDate(inst, "min"), + maxDate = this._getMinMaxDate(inst, "max"), + drawMonth = inst.drawMonth - showCurrentAtPos, + drawYear = inst.drawYear; + + if (drawMonth < 0) { + drawMonth += 12; + drawYear--; + } + if (maxDate) { + maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), + maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); + maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); + while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { + drawMonth--; + if (drawMonth < 0) { + drawMonth = 11; + drawYear--; + } + } + } + inst.drawMonth = drawMonth; + inst.drawYear = drawYear; + + prevText = this._get(inst, "prevText"); + prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), + this._getFormatConfig(inst))); + + prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? + "" + prevText + "" : + (hideIfNoPrevNext ? "" : "" + prevText + "")); + + nextText = this._get(inst, "nextText"); + nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, + this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), + this._getFormatConfig(inst))); + + next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? + "" + nextText + "" : + (hideIfNoPrevNext ? "" : "" + nextText + "")); + + currentText = this._get(inst, "currentText"); + gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today); + currentText = (!navigationAsDateFormat ? currentText : + this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); + + controls = (!inst.inline ? "" : ""); + + buttonPanel = (showButtonPanel) ? "
    " + (isRTL ? controls : "") + + (this._isInRange(inst, gotoDate) ? "" : "") + (isRTL ? "" : controls) + "
    " : ""; + + firstDay = parseInt(this._get(inst, "firstDay"),10); + firstDay = (isNaN(firstDay) ? 0 : firstDay); + + showWeek = this._get(inst, "showWeek"); + dayNames = this._get(inst, "dayNames"); + dayNamesMin = this._get(inst, "dayNamesMin"); + monthNames = this._get(inst, "monthNames"); + monthNamesShort = this._get(inst, "monthNamesShort"); + beforeShowDay = this._get(inst, "beforeShowDay"); + showOtherMonths = this._get(inst, "showOtherMonths"); + selectOtherMonths = this._get(inst, "selectOtherMonths"); + defaultDate = this._getDefaultDate(inst); + html = ""; + dow; + for (row = 0; row < numMonths[0]; row++) { + group = ""; + this.maxRows = 4; + for (col = 0; col < numMonths[1]; col++) { + selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); + cornerClass = " ui-corner-all"; + calender = ""; + if (isMultiMonth) { + calender += "
    "; + } + calender += "
    " + + (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") + + (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") + + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, + row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers + "
    " + + ""; + thead = (showWeek ? "" : ""); + for (dow = 0; dow < 7; dow++) { // days of the week + day = (dow + firstDay) % 7; + thead += "= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + + "" + dayNamesMin[day] + ""; + } + calender += thead + ""; + daysInMonth = this._getDaysInMonth(drawYear, drawMonth); + if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) { + inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); + } + leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; + curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate + numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); + for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows + calender += ""; + tbody = (!showWeek ? "" : ""); + for (dow = 0; dow < 7; dow++) { // create date picker days + daySettings = (beforeShowDay ? + beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]); + otherMonth = (printDate.getMonth() !== drawMonth); + unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || + (minDate && printDate < minDate) || (maxDate && printDate > maxDate); + tbody += ""; // display selectable date + printDate.setDate(printDate.getDate() + 1); + printDate = this._daylightSavingAdjust(printDate); + } + calender += tbody + ""; + } + drawMonth++; + if (drawMonth > 11) { + drawMonth = 0; + drawYear++; + } + calender += "
    " + this._get(inst, "weekHeader") + "
    " + + this._get(inst, "calculateWeek")(printDate) + "" + // actions + (otherMonth && !showOtherMonths ? " " : // display for other months + (unselectable ? "" + printDate.getDate() + "" : "" + printDate.getDate() + "")) + "
    " + (isMultiMonth ? "
    " + + ((numMonths[0] > 0 && col === numMonths[1]-1) ? "
    " : "") : ""); + group += calender; + } + html += group; + } + html += buttonPanel; + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort) { + + var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, + changeMonth = this._get(inst, "changeMonth"), + changeYear = this._get(inst, "changeYear"), + showMonthAfterYear = this._get(inst, "showMonthAfterYear"), + html = "
    ", + monthHtml = ""; + + // month selection + if (secondary || !changeMonth) { + monthHtml += "" + monthNames[drawMonth] + ""; + } else { + inMinYear = (minDate && minDate.getFullYear() === drawYear); + inMaxYear = (maxDate && maxDate.getFullYear() === drawYear); + monthHtml += ""; + } + + if (!showMonthAfterYear) { + html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : ""); + } + + // year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ""; + if (secondary || !changeYear) { + html += "" + drawYear + ""; + } else { + // determine range of years to display + years = this._get(inst, "yearRange").split(":"); + thisYear = new Date().getFullYear(); + determineYear = function(value) { + var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : + (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : + parseInt(value, 10))); + return (isNaN(year) ? thisYear : year); + }; + year = determineYear(years[0]); + endYear = Math.max(year, determineYear(years[1] || "")); + year = (minDate ? Math.max(year, minDate.getFullYear()) : year); + endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); + inst.yearshtml += ""; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + + html += this._get(inst, "yearSuffix"); + if (showMonthAfterYear) { + html += (secondary || !(changeMonth && changeYear) ? " " : "") + monthHtml; + } + html += "
    "; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function(inst, offset, period) { + var year = inst.drawYear + (period === "Y" ? offset : 0), + month = inst.drawMonth + (period === "M" ? offset : 0), + day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0), + date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); + + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if (period === "M" || period === "Y") { + this._notifyChange(inst); + } + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function(inst, date) { + var minDate = this._getMinMaxDate(inst, "min"), + maxDate = this._getMinMaxDate(inst, "max"), + newDate = (minDate && date < minDate ? minDate : date); + return (maxDate && newDate > maxDate ? maxDate : newDate); + }, + + /* Notify change of month/year. */ + _notifyChange: function(inst) { + var onChange = this._get(inst, "onChangeMonthYear"); + if (onChange) { + onChange.apply((inst.input ? inst.input[0] : null), + [inst.selectedYear, inst.selectedMonth + 1, inst]); + } + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function(inst) { + var numMonths = this._get(inst, "numberOfMonths"); + return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths)); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function(inst, minMax) { + return this._determineDate(inst, this._get(inst, minMax + "Date"), null); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function(year, month) { + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function(year, month) { + return new Date(year, month, 1).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function(inst, offset, curYear, curMonth) { + var numMonths = this._getNumberOfMonths(inst), + date = this._daylightSavingAdjust(new Date(curYear, + curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); + + if (offset < 0) { + date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); + } + return this._isInRange(inst, date); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function(inst, date) { + var yearSplit, currentYear, + minDate = this._getMinMaxDate(inst, "min"), + maxDate = this._getMinMaxDate(inst, "max"), + minYear = null, + maxYear = null, + years = this._get(inst, "yearRange"); + if (years){ + yearSplit = years.split(":"); + currentYear = new Date().getFullYear(); + minYear = parseInt(yearSplit[0], 10); + maxYear = parseInt(yearSplit[1], 10); + if ( yearSplit[0].match(/[+\-].*/) ) { + minYear += currentYear; + } + if ( yearSplit[1].match(/[+\-].*/) ) { + maxYear += currentYear; + } + } + + return ((!minDate || date.getTime() >= minDate.getTime()) && + (!maxDate || date.getTime() <= maxDate.getTime()) && + (!minYear || date.getFullYear() >= minYear) && + (!maxYear || date.getFullYear() <= maxYear)); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function(inst) { + var shortYearCutoff = this._get(inst, "shortYearCutoff"); + shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); + return {shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), + monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")}; + }, + + /* Format the given date for display. */ + _formatDate: function(inst, day, month, year) { + if (!day) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = (day ? (typeof day === "object" ? day : + this._daylightSavingAdjust(new Date(year, month, day))) : + this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); + return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)); + } +}); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function bindHover(dpDiv) { + var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; + return dpDiv.delegate(selector, "mouseout", function() { + $(this).removeClass("ui-state-hover"); + if (this.className.indexOf("ui-datepicker-prev") !== -1) { + $(this).removeClass("ui-datepicker-prev-hover"); + } + if (this.className.indexOf("ui-datepicker-next") !== -1) { + $(this).removeClass("ui-datepicker-next-hover"); + } + }) + .delegate(selector, "mouseover", function(){ + if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { + $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); + $(this).addClass("ui-state-hover"); + if (this.className.indexOf("ui-datepicker-prev") !== -1) { + $(this).addClass("ui-datepicker-prev-hover"); + } + if (this.className.indexOf("ui-datepicker-next") !== -1) { + $(this).addClass("ui-datepicker-next-hover"); + } + } + }); +} + +/* jQuery extend now ignores nulls! */ +function extendRemove(target, props) { + $.extend(target, props); + for (var name in props) { + if (props[name] == null) { + target[name] = props[name]; + } + } + return target; +} + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function(options){ + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if (!$.datepicker.initialized) { + $(document).mousedown($.datepicker._checkExternalClick); + $.datepicker.initialized = true; + } + + /* Append datepicker main container to body if not exist. */ + if ($("#"+$.datepicker._mainDivId).length === 0) { + $("body").append($.datepicker.dpDiv); + } + + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) { + return $.datepicker["_" + options + "Datepicker"]. + apply($.datepicker, [this[0]].concat(otherArgs)); + } + if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") { + return $.datepicker["_" + options + "Datepicker"]. + apply($.datepicker, [this[0]].concat(otherArgs)); + } + return this.each(function() { + typeof options === "string" ? + $.datepicker["_" + options + "Datepicker"]. + apply($.datepicker, [this].concat(otherArgs)) : + $.datepicker._attachDatepicker(this, options); + }); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.10.4"; + +})(jQuery); +(function( $, undefined ) { + +var sizeRelatedOptions = { + buttons: true, + height: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + width: true + }, + resizableRelatedOptions = { + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true + }; + +$.widget( "ui.dialog", { + version: "1.10.4", + options: { + appendTo: "body", + autoOpen: true, + buttons: [], + closeOnEscape: true, + closeText: "close", + dialogClass: "", + draggable: true, + hide: null, + height: "auto", + maxHeight: null, + maxWidth: null, + minHeight: 150, + minWidth: 150, + modal: false, + position: { + my: "center", + at: "center", + of: window, + collision: "fit", + // Ensure the titlebar is always visible + using: function( pos ) { + var topOffset = $( this ).css( pos ).offset().top; + if ( topOffset < 0 ) { + $( this ).css( "top", pos.top - topOffset ); + } + } + }, + resizable: true, + show: null, + title: null, + width: 300, + + // callbacks + beforeClose: null, + close: null, + drag: null, + dragStart: null, + dragStop: null, + focus: null, + open: null, + resize: null, + resizeStart: null, + resizeStop: null + }, + + _create: function() { + this.originalCss = { + display: this.element[0].style.display, + width: this.element[0].style.width, + minHeight: this.element[0].style.minHeight, + maxHeight: this.element[0].style.maxHeight, + height: this.element[0].style.height + }; + this.originalPosition = { + parent: this.element.parent(), + index: this.element.parent().children().index( this.element ) + }; + this.originalTitle = this.element.attr("title"); + this.options.title = this.options.title || this.originalTitle; + + this._createWrapper(); + + this.element + .show() + .removeAttr("title") + .addClass("ui-dialog-content ui-widget-content") + .appendTo( this.uiDialog ); + + this._createTitlebar(); + this._createButtonPane(); + + if ( this.options.draggable && $.fn.draggable ) { + this._makeDraggable(); + } + if ( this.options.resizable && $.fn.resizable ) { + this._makeResizable(); + } + + this._isOpen = false; + }, + + _init: function() { + if ( this.options.autoOpen ) { + this.open(); + } + }, + + _appendTo: function() { + var element = this.options.appendTo; + if ( element && (element.jquery || element.nodeType) ) { + return $( element ); + } + return this.document.find( element || "body" ).eq( 0 ); + }, + + _destroy: function() { + var next, + originalPosition = this.originalPosition; + + this._destroyOverlay(); + + this.element + .removeUniqueId() + .removeClass("ui-dialog-content ui-widget-content") + .css( this.originalCss ) + // Without detaching first, the following becomes really slow + .detach(); + + this.uiDialog.stop( true, true ).remove(); + + if ( this.originalTitle ) { + this.element.attr( "title", this.originalTitle ); + } + + next = originalPosition.parent.children().eq( originalPosition.index ); + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[0] !== this.element[0] ) { + next.before( this.element ); + } else { + originalPosition.parent.append( this.element ); + } + }, + + widget: function() { + return this.uiDialog; + }, + + disable: $.noop, + enable: $.noop, + + close: function( event ) { + var activeElement, + that = this; + + if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) { + return; + } + + this._isOpen = false; + this._destroyOverlay(); + + if ( !this.opener.filter(":focusable").focus().length ) { + + // support: IE9 + // IE9 throws an "Unspecified error" accessing document.activeElement from an ': - ""; b("
    ").append(t).insertBefore(q); b("
    " + this.p.loadtext + "
    ").insertBefore(q); b(this).attr({cellSpacing:"0", cellPadding:"0", border:"0", role:"grid", "aria-multiselectable":!!this.p.multiselect, "aria-labelledby":"gbox_" + this.id}); var J = function(c, d){c = parseInt(c, 10); return isNaN(c)?d?d:0:c}, F = function(c, d, e){var l = a.p.colModel[c], n = l.align, o = 'style="', - p = l.classes, w = l.name; if (n)o += "text-align:" + n + ";"; if (l.hidden === true)o += "display:none;"; if (d === 0)o += "width: " + g.headers[c].width + "px;"; o += '"' + (p !== undefined?' class="' + p + '"':"") + (l.title && e?' title="' + b.jgrid.stripHtml(e) + '"':""); o += ' aria-describedby="' + a.p.id + "_" + w + '"'; return o}, Q = function(c){return c === undefined || c === null || c === ""?" ":a.p.autoencode?b.jgrid.htmlEncode(c):c + ""}, M = function(c, d, e, l, n){e = a.p.colModel[e]; if (typeof e.formatter !== "undefined"){c = {rowId:c, colModel:e, gid:a.p.id}; d = b.isFunction(e.formatter)? - e.formatter.call(a, d, c, l, n):b.fmatter?b.fn.fmatter(e.formatter, d, c, l, n):Q(d)} else d = Q(d); return d}, R = function(c, d, e, l, n){c = M(c, d, e, n, "add"); return'" + c + ""}, u = function(c, d, e){c = ''; d = F(d, e, ""); return'" + c + ""}, la = function(c, d, e, l){e = (parseInt(e, 10) - 1) * parseInt(l, 10) + 1 + d; c = F(c, d, ""); return'" + e + ""}, ca = function(c){var d, e = [], l = 0, n; for (n = 0; n < a.p.colModel.length; n++){d = a.p.colModel[n]; if (d.name !== "cb" && d.name !== "subgrid" && d.name !== "rn"){e[l] = c == "xml"?d.xmlmap || d.name:d.jsonmap || d.name; l++}}return e}, fa = function(c){var d = a.p.remapColumns; if (!d || !d.length)d = b.map(a.p.colModel, function(e, l){return l}); if (c)d = b.map(d, function(e){return e < c?null:e - c}); return d}, aa = function(c, d){a.p.deepempty?b("tbody:first tr", c).remove():b("tbody:first", - c).empty(); if (d && a.p.scroll){b(">div:first", c).css({height:"auto"}).children("div:first").css({height:0, display:"none"}); c.scrollTop = 0}}, U = function(c, d){var e, l, n, o; if (typeof d === "function")return d(c); e = c[d]; if (e === undefined){if (typeof d === "string")n = d.split("."); try{if (o = n.length)for (e = c; e && o--; ){l = n.shift(); e = e[l]}} catch (p){}}return e}, ia = function(c, d, e, l, n){var o = new Date; a.p.reccount = 0; if (b.isXMLDoc(c)){if (a.p.treeANode === - 1 && !a.p.scroll){aa(d, false); e = 0} else e = e > 0?e:0; var p, w = 0, y, s, r = 0, v = 0, - z = 0, D, N, L = [], P, G = {}, da = a.rows.length, E, W, B = [], S = 0, ga = a.p.altRows === true?" " + a.p.altclass:""; a.p.xmlReader.repeatitems || (L = ca("xml")); D = a.p.keyIndex === false?a.p.xmlReader.id:a.p.keyIndex; if (L.length > 0 && !isNaN(D)){if (a.p.remapColumns && a.p.remapColumns.length)D = b.inArray(D, a.p.remapColumns); D = L[D]}N = (D + "").indexOf("[") === - 1?L.length?function(X, V){return b(D, X).text() || V}:function(X, V){return b(a.p.xmlReader.cell, X).eq(D).text() || V}:function(X, V){return X.getAttribute(D.replace(/[\[\]]/g, "")) || V}; a.p.userData = - {}; b(a.p.xmlReader.page, c).each(function(){a.p.page = this.textContent || this.text || 0}); b(a.p.xmlReader.total, c).each(function(){a.p.lastpage = this.textContent || this.text; if (a.p.lastpage === undefined)a.p.lastpage = 1}); b(a.p.xmlReader.records, c).each(function(){a.p.records = this.textContent || this.text || 0}); b(a.p.xmlReader.userdata, c).each(function(){a.p.userData[this.getAttribute("name")] = this.textContent || this.text}); c = b(a.p.xmlReader.root + " " + a.p.xmlReader.row, c); var ha = c.length, O = 0; if (c && ha){var ma = parseInt(a.p.rowNum, - 10), wa = a.p.scroll?(parseInt(a.p.page, 10) - 1) * ma + 1:1; if (n)ma *= n + 1; for (n = b.isFunction(a.p.afterInsertRow); O < ha; ){E = c[O]; W = N(E, wa + O); p = e === 0?0:e + 1; p = (p + O) % 2 == 1?ga:""; B[S++] = ''; if (a.p.rownumbers === true){B[S++] = la(0, O, a.p.page, a.p.rowNum); z = 1}if (a.p.multiselect === true){B[S++] = u(W, z, O); r = 1}if (a.p.subGrid === true){B[S++] = b(a).jqGrid("addSubGridCell", r + z, O + e); v = 1}if (a.p.xmlReader.repeatitems){P || (P = fa(r + v + z)); var za = b(a.p.xmlReader.cell, - E); b.each(P, function(X){var V = za[this]; if (!V)return false; y = V.textContent || V.text; G[a.p.colModel[X + r + v + z].name] = y; B[S++] = R(W, y, X + r + v + z, O + e, E)})} else for (p = 0; p < L.length; p++){y = b(L[p], E).text(); G[a.p.colModel[p + r + v + z].name] = y; B[S++] = R(W, y, p + r + v + z, O + e, E)}B[S++] = ""; if (a.p.gridview === false){if (a.p.treeGrid === true){p = a.p.treeANode >= - 1?a.p.treeANode:0; s = b(B.join(""))[0]; try{b(a).jqGrid("setTreeNode", G, s)} catch (Fa){}da === 0?b("tbody:first", d).append(s):b(a.rows[O + p + e]).after(s)} else b("tbody:first", d).append(B.join("")); - if (a.p.subGrid === true)try{b(a).jqGrid("addSubGrid", a.rows[a.rows.length - 1], r + z)} catch (Ga){}n && a.p.afterInsertRow.call(a, W, G, E); B = []; S = 0}G = {}; w++; O++; if (w == ma)break}}a.p.gridview === true && b("tbody:first", d).append(B.join("")); a.p.totaltime = new Date - o; if (w > 0){a.grid.cols = a.rows[0].cells; if (a.p.records === 0)a.p.records = ha}B = null; if (!a.p.treeGrid && !a.p.scroll)a.grid.bDiv.scrollTop = 0; a.p.reccount = w; a.p.treeANode = - 1; a.p.userDataOnFooter && b(a).jqGrid("footerData", "set", a.p.userData, true); l || na(false, true)}}, - ra = function(c, d, e, l, n){var o = new Date; a.p.reccount = 0; if (c){if (a.p.treeANode === - 1 && !a.p.scroll){aa(d, false); e = 0} else e = e > 0?e:0; var p = 0, w, y, s, r = [], v, z = 0, D = 0, N = 0, L, P, G, da = {}, E, W = a.rows.length, B; s = []; E = 0; var S = a.p.altRows === true?" " + a.p.altclass:""; a.p.page = U(c, a.p.jsonReader.page) || 0; G = U(c, a.p.jsonReader.total); a.p.lastpage = G === undefined?1:G; a.p.records = U(c, a.p.jsonReader.records) || 0; a.p.userData = U(c, a.p.jsonReader.userdata) || {}; a.p.jsonReader.repeatitems || (v = r = ca("json")); G = a.p.keyIndex === false?a.p.jsonReader.id: - a.p.keyIndex; if (r.length > 0 && !isNaN(G)){if (a.p.remapColumns && a.p.remapColumns.length)G = b.inArray(G, a.p.remapColumns); G = r[G]}if (P = U(c, a.p.jsonReader.root)){L = P.length; c = 0; var ga = parseInt(a.p.rowNum, 10), ha = a.p.scroll?(parseInt(a.p.page, 10) - 1) * ga + 1:1; if (n)ga *= n + 1; for (var O = b.isFunction(a.p.afterInsertRow); c < L; ){n = P[c]; B = U(n, G); if (B === undefined){B = ha + c; if (r.length === 0)if (a.p.jsonReader.cell)B = n[a.p.jsonReader.cell][G] || B}w = e === 0?0:e + 1; w = (w + c) % 2 == 1?S:""; s[E++] = ''; if (a.p.rownumbers === true){s[E++] = la(0, c, a.p.page, a.p.rowNum); N = 1}if (a.p.multiselect){s[E++] = u(B, N, c); z = 1}if (a.p.subGrid){s[E++] = b(a).jqGrid("addSubGridCell", z + N, c + e); D = 1}if (a.p.jsonReader.repeatitems){if (a.p.jsonReader.cell)n = U(n, a.p.jsonReader.cell); v || (v = fa(z + D + N))}for (y = 0; y < v.length; y++){w = U(n, v[y]); s[E++] = R(B, w, y + z + D + N, c + e, n); da[a.p.colModel[y + z + D + N].name] = w}s[E++] = ""; if (a.p.gridview === false){if (a.p.treeGrid === true){E = a.p.treeANode >= - 1?a.p.treeANode:0; s = b(s.join(""))[0]; - try{b(a).jqGrid("setTreeNode", da, s)} catch (ma){}W === 0?b("tbody:first", d).append(s):b(a.rows[c + E + e]).after(s)} else b("tbody:first", d).append(s.join("")); if (a.p.subGrid === true)try{b(a).jqGrid("addSubGrid", a.rows[a.rows.length - 1], z + N)} catch (wa){}O && a.p.afterInsertRow.call(a, B, da, n); s = []; E = 0}da = {}; p++; c++; if (p == ga)break}a.p.gridview === true && b("tbody:first", d).append(s.join("")); a.p.totaltime = new Date - o; if (p > 0){a.grid.cols = a.rows[0].cells; if (a.p.records === 0)a.p.records = L}}if (!a.p.treeGrid && !a.p.scroll)a.grid.bDiv.scrollTop = - 0; a.p.reccount = p; a.p.treeANode = - 1; a.p.userDataOnFooter && b(a).jqGrid("footerData", "set", a.p.userData, true); l || na(false, true)}}, na = function(c, d){var e, l, n, o, p, w, y, s = ""; n = parseInt(a.p.page, 10) - 1; if (n < 0)n = 0; n *= parseInt(a.p.rowNum, 10); p = n + a.p.reccount; if (a.p.scroll){e = b("tbody:first > tr", a.grid.bDiv); n = p - e.length; if (l = e.outerHeight()){e = n * l; l = parseInt(a.p.records, 10) * l; b(">div:first", a.grid.bDiv).css({height:l}).children("div:first").css({height:e, display:e?"":"none"})}}s = a.p.pager?a.p.pager:""; s += a.p.toppager? - s?"," + a.p.toppager:a.p.toppager:""; if (s){y = b.jgrid.formatter.integer || {}; if (a.p.loadonce){e = l = 1; a.p.lastpage = a.page = 1; b(".selbox", s).attr("disabled", true)} else{e = J(a.p.page); l = J(a.p.lastpage); b(".selbox", s).attr("disabled", false)}if (a.p.pginput === true){b(".ui-pg-input", s).val(a.p.page); b("#sp_1", s).html(b.fmatter?b.fmatter.util.NumberFormat(a.p.lastpage, y):a.p.lastpage)}if (a.p.viewrecords)if (a.p.reccount === 0)b(".ui-paging-info", s).html(a.p.emptyrecords); else{o = n + 1; w = a.p.records; if (b.fmatter){o = b.fmatter.util.NumberFormat(o, - y); p = b.fmatter.util.NumberFormat(p, y); w = b.fmatter.util.NumberFormat(w, y)}b(".ui-paging-info", s).html(b.jgrid.format(a.p.recordtext, o, p, w))}if (a.p.pgbuttons === true){if (e <= 0)e = l = 0; if (e == 1 || e === 0){b("#first, #prev", a.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover"); a.p.toppager && b("#first_t, #prev_t", a.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")} else{b("#first, #prev", a.p.pager).removeClass("ui-state-disabled"); a.p.toppager && b("#first_t, #prev_t", a.p.toppager).removeClass("ui-state-disabled")}if (e == - l || e === 0){b("#next, #last", a.p.pager).addClass("ui-state-disabled").removeClass("ui-state-hover"); a.p.toppager && b("#next_t, #last_t", a.p.toppager).addClass("ui-state-disabled").removeClass("ui-state-hover")} else{b("#next, #last", a.p.pager).removeClass("ui-state-disabled"); a.p.toppager && b("#next_t, #last_t", a.p.toppager).removeClass("ui-state-disabled")}}}c === true && a.p.rownumbers === true && b("td.jqgrid-rownum", a.rows).each(function(r){b(this).html(n + 1 + r)}); d && a.p.jqgdnd && b(a).jqGrid("gridDnD", "updateDnD"); - b.isFunction(a.p.gridComplete) && a.p.gridComplete.call(a)}, Y = function(c){if (!a.grid.hDiv.loading){var d = a.p.scroll && c === false, e = {}, l, n = a.p.prmNames; if (a.p.page <= 0)a.p.page = 1; if (n.search !== null)e[n.search] = a.p.search; if (n.nd !== null)e[n.nd] = (new Date).getTime(); if (n.rows !== null)e[n.rows] = a.p.rowNum; if (n.page !== null)e[n.page] = a.p.page; if (n.sort !== null)e[n.sort] = a.p.sortname; if (n.order !== null)e[n.order] = a.p.sortorder; var o = a.p.loadComplete, p = b.isFunction(o); p || (o = null); var w = 0; c = c || 1; if (c > 1)if (n.npage !== - null){e[n.npage] = c; w = c - 1; c = 1} else o = function(s){p && a.p.loadComplete.call(a, s); a.grid.hDiv.loading = false; a.p.page++; Y(c - 1)}; else n.npage !== null && delete a.p.postData[n.npage]; b.extend(a.p.postData, e); var y = !a.p.scroll?0:a.rows.length - 1; if (b.isFunction(a.p.datatype))a.p.datatype.call(a, a.p.postData, "load_" + a.p.id); else{b.isFunction(a.p.beforeRequest) && a.p.beforeRequest.call(a); l = a.p.datatype.toLowerCase(); switch (l){case "json":case "jsonp":case "xml":case "script":b.ajax(b.extend({url:a.p.url, type:a.p.mtype, - dataType:l, data:b.isFunction(a.p.serializeGridData)?a.p.serializeGridData.call(a, a.p.postData):a.p.postData, success:function(s){l === "xml"?ia(s, a.grid.bDiv, y, c > 1, w):ra(s, a.grid.bDiv, y, c > 1, w); o && o.call(a, s); d && a.grid.populateVisible(); if (a.p.loadonce || a.p.treeGrid)a.p.datatype = "local"; ja()}, error:function(s, r, v){b.isFunction(a.p.loadError) && a.p.loadError.call(a, s, r, v); ja()}, beforeSend:function(s){oa(); b.isFunction(a.p.loadBeforeSend) && a.p.loadBeforeSend.call(a, s)}}, b.jgrid.ajaxOptions, a.p.ajaxGridOptions)); - break; case "xmlstring":oa(); e = b.jgrid.stringToDoc(a.p.datastr); p && a.p.loadComplete.call(a, e); ia(e, a.grid.bDiv); a.p.datatype = "local"; a.p.datastr = null; ja(); break; case "jsonstring":oa(); e = typeof a.p.datastr == "string"?b.jgrid.parse(a.p.datastr):a.p.datastr; p && a.p.loadComplete.call(a, e); ra(e, a.grid.bDiv); a.p.datatype = "local"; a.p.datastr = null; ja(); break; case "local":case "clientside":oa(); a.p.datatype = "local"; p && a.p.loadComplete.call(a, ""); Aa(); na(true, true); ja(); break}}}}, oa = function(){a.grid.hDiv.loading = - true; if (!a.p.hiddengrid)switch (a.p.loadui){case "disable":break; case "enable":b("#load_" + a.p.id).show(); break; case "block":b("#lui_" + a.p.id).show(); b("#load_" + a.p.id).show(); break}}, ja = function(){a.grid.hDiv.loading = false; switch (a.p.loadui){case "disable":break; case "enable":b("#load_" + a.p.id).hide(); break; case "block":b("#lui_" + a.p.id).hide(); b("#load_" + a.p.id).hide(); break}}, Aa = function(){var c = /[\$,%]/g, d = [], e = 0, l, n, o, p = a.p.sortorder == "asc"?1: - 1, w = false, y; b.each(a.p.colModel, function(r){if (this.index == - a.p.sortname || this.name == a.p.sortname){if (a.p.lastsort == r)w = true; e = r; l = this.sorttype; return false}}); o = l == "float" || l == "number" || l == "currency"?function(r){r = parseFloat(r.replace(c, "")); return isNaN(r)?0:r}:l == "int" || l == "integer"?function(r){return J(r.replace(c, ""), 0)}:l == "date" || l == "datetime"?function(r){return Ba(a.p.colModel[e].datefmt || "Y-m-d", r).getTime()}:b.isFunction(l)?l:function(r){return b.trim(r.toUpperCase())}; y = a.p.colModel[e]; b.each(a.rows, function(r, v){try{n = b.unformat(b(v).children("td").eq(e), - {rowId:v.id, colModel:y}, e, true)} catch (z){n = b(v).children("td").eq(e).text()}v.sortKey = o(n); d[r] = this}); if (a.p.treeGrid)b(a).jqGrid("SortTree", p); else{w?d.reverse():d.sort(function(r, v){if (r.sortKey < v.sortKey)return - p; if (r.sortKey > v.sortKey)return p; return 0}); if (d[0]){b("td", d[0]).each(function(r){b(this).css("width", g.headers[r].width + "px")}); a.grid.cols = d[0].cells}var s = ""; if (a.p.altRows)s = a.p.altclass; b.each(d, function(r, v){if (s)r % 2 == 1?b(v).addClass(s):b(v).removeClass(s); b("tbody", a.grid.bDiv).append(v); - v.sortKey = null})}a.grid.bDiv.scrollTop = 0}, Ba = function(c, d){var e = {m:1, d:1, y:1970, h:0, i:0, s:0}, l, n, o; if (d = b.trim(d)){d = d.split(/[\\\/:_;.\t\T\s-]/); c = c.split(/[\\\/:_;.\t\T\s-]/); var p = b.jgrid.formatter.date.monthNames, w = b.jgrid.formatter.date.AmPm, y = function(s, r){if (s === 0){if (r == 12)r = 0} else if (r != 12)r += 12; return r}; l = 0; for (n = c.length; l < n; l++){if (c[l] == "M"){o = b.inArray(d[l], p); if (o !== - 1 && o < 12)d[l] = o + 1}if (c[l] == "F"){o = b.inArray(d[l], p); if (o !== - 1 && o > 11)d[l] = o + 1 - 12}if (c[l] == "a"){o = b.inArray(d[l], w); if (o !== - - 1 && o < 2 && d[l] == w[o]){d[l] = o; e.h = y(d[l], e.h)}}if (c[l] == "A"){o = b.inArray(d[l], w); if (o !== - 1 && o > 1 && d[l] == w[o]){d[l] = o - 2; e.h = y(d[l], e.h)}}e[c[l].toLowerCase()] = parseInt(d[l], 10)}e.m = parseInt(e.m, 10) - 1; c = e.y; if (c >= 70 && c <= 99)e.y = 1900 + e.y; else if (c >= 0 && c <= 69)e.y = 2E3 + e.y}return new Date(e.y, e.m, e.d, e.h, e.i, e.s, 0)}; t = function(c, d){var e = "", l = "", n = "", o, p, w, y, s = function(r){var v; if (b.isFunction(a.p.onPaging))v = - a.p.onPaging.call(a, r); a.p.selrow = null; if (a.p.multiselect){a.p.selarrrow = []; b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false)}a.p.savedRow = []; if (v == "stop")return false; return true}; c = c.substr(1); o = "pg_" + c; p = c + "_left"; w = c + "_center"; y = c + "_right"; b("#" + c).append("
").attr("dir", "ltr"); if (a.p.rowList.length > 0){n = ""; n += ""}if (m == "rtl")l += n; if (a.p.pginput === true)e = "" + b.jgrid.format(a.p.pgtext || "", "", - "") + ""; if (a.p.pgbuttons === true){p = ["first" + d, "prev" + d, "next" + d, "last" + d]; m == "rtl" && p.reverse(); l += ""; l += ""; l += e != ""?"" + e + "": - ""; l += ""; l += ""} else if (e != "")l += e; if (m == "ltr")l += n; l += ""; a.p.viewrecords === true && b("td#" + c + "_" + a.p.recordpos, "#" + o).append("
"); b("td#" + c + "_" + a.p.pagerpos, "#" + o).append(l); n = b(".ui-jqgrid").css("font-size") || - "11px"; b("body").append(""); l = b(l).clone().appendTo("#testpg").width(); b("#testpg").remove(); if (l > 0){if (e != "")l += 50; b("td#" + c + "_" + a.p.pagerpos, "#" + o).width(l)}a.p._nvtd = []; a.p._nvtd[0] = l?Math.floor((a.p.width - l) / 2):Math.floor(a.p.width / 3); a.p._nvtd[1] = 0; l = null; b(".ui-pg-selbox", "#" + o).bind("change", function(){a.p.page = Math.round(a.p.rowNum * (a.p.page - 1) / this.value - 0.5) + 1; a.p.rowNum = this.value; - if (d)b(".ui-pg-selbox", a.p.pager).val(this.value); else a.p.toppager && b(".ui-pg-selbox", a.p.toppager).val(this.value); if (!s("records"))return false; Y(); return false}); if (a.p.pgbuttons === true){b(".ui-pg-button", "#" + o).hover(function(){if (b(this).hasClass("ui-state-disabled"))this.style.cursor = "default"; else{b(this).addClass("ui-state-hover"); this.style.cursor = "pointer"}}, function(){if (!b(this).hasClass("ui-state-disabled")){b(this).removeClass("ui-state-hover"); this.style.cursor = "default"}}); b("#first" + - d + ", #prev" + d + ", #next" + d + ", #last" + d, "#" + c).click(function(){var r = J(a.p.page, 1), v = J(a.p.lastpage, 1), z = false, D = true, N = true, L = true, P = true; if (v === 0 || v === 1)P = L = N = D = false; else if (v > 1 && r >= 1)if (r === 1)N = D = false; else{if (!(r > 1 && r < v))if (r === v)P = L = false} else if (v > 1 && r === 0){P = L = false; r = v - 1}if (this.id === "first" + d && D){a.p.page = 1; z = true}if (this.id === "prev" + d && N){a.p.page = r - 1; z = true}if (this.id === "next" + d && L){a.p.page = r + 1; z = true}if (this.id === "last" + d && P){a.p.page = v; z = true}if (z){if (!s(this.id))return false; Y()}return false})}a.p.pginput === - true && b("input.ui-pg-input", "#" + o).keypress(function(r){if ((r.charCode?r.charCode:r.keyCode?r.keyCode:0) == 13){a.p.page = b(this).val() > 0?b(this).val():a.p.page; if (!s("user"))return false; Y(); return false}return this})}; var xa = function(c, d, e, l){if (a.p.colModel[d].sortable)if (!(a.p.savedRow.length > 0)){if (!e){if (a.p.lastsort == d)if (a.p.sortorder == "asc")a.p.sortorder = "desc"; else{if (a.p.sortorder == "desc")a.p.sortorder = "asc"} else a.p.sortorder = a.p.colModel[d].firstsortorder || "asc"; a.p.page = 1}if (l)if (a.p.lastsort == - d && a.p.sortorder == l && !e)return; else a.p.sortorder = l; e = b("thead:first", a.grid.hDiv).get(0); b("tr th:eq(" + a.p.lastsort + ") span.ui-grid-ico-sort", e).addClass("ui-state-disabled"); b("tr th:eq(" + a.p.lastsort + ")", e).attr("aria-selected", "false"); b("tr th:eq(" + d + ") span.ui-icon-" + a.p.sortorder, e).removeClass("ui-state-disabled"); b("tr th:eq(" + d + ")", e).attr("aria-selected", "true"); if (!a.p.viewsortcols[0])if (a.p.lastsort != d){b("tr th:eq(" + a.p.lastsort + ") span.s-ico", e).hide(); b("tr th:eq(" + d + ") span.s-ico", - e).show()}c = c.substring(5); a.p.sortname = a.p.colModel[d].index || c; e = a.p.sortorder; if (b.isFunction(a.p.onSortCol))if (a.p.onSortCol.call(a, c, d, e) == "stop"){a.p.lastsort = d; return}if (a.p.datatype == "local")a.p.deselectAfterSort && b(a).jqGrid("resetSelection"); else{a.p.selrow = null; a.p.multiselect && b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false); a.p.selarrrow = []; a.p.savedRow = []; a.p.scroll && aa(a.grid.bDiv, true)}a.p.subGrid && a.p.datatype == "local" && b("td.sgexpanded", "#" + a.p.id).each(function(){b(this).trigger("click")}); - Y(); a.p.lastsort = d; if (a.p.sortname != c && d)a.p.lastsort = d}}, Ca = function(c){var d = c, e; for (e = c + 1; e < a.p.colModel.length; e++)if (a.p.colModel[e].hidden !== true){d = e; break}return d - c}, Da = function(c){var d, e = {}, l = C?0:a.p.cellLayout; for (d = e[0] = e[1] = e[2] = 0; d <= c; d++)if (a.p.colModel[d].hidden === false)e[0] += a.p.colModel[d].width + l; if (a.p.direction == "rtl")e[0] = a.p.width - e[0]; e[0] -= a.grid.bDiv.scrollLeft; if (b(a.grid.cDiv).is(":visible"))e[1] += b(a.grid.cDiv).height() + parseInt(b(a.grid.cDiv).css("padding-top"), 10) + - parseInt(b(a.grid.cDiv).css("padding-bottom"), 10); if (a.p.toolbar[0] === true && (a.p.toolbar[1] == "top" || a.p.toolbar[1] == "both"))e[1] += b(a.grid.uDiv).height() + parseInt(b(a.grid.uDiv).css("border-top-width"), 10) + parseInt(b(a.grid.uDiv).css("border-bottom-width"), 10); if (a.p.toppager)e[1] += b(a.grid.topDiv).height() + parseInt(b(a.grid.topDiv).css("border-bottom-width"), 10); e[2] += b(a.grid.bDiv).height() + b(a.grid.hDiv).height(); return e}; this.p.id = this.id; if (b.inArray(a.p.multikey, ["shiftKey", "altKey", "ctrlKey"]) == - - 1)a.p.multikey = false; a.p.keyIndex = false; for (j = 0; j < a.p.colModel.length; j++)if (a.p.colModel[j].key === true){a.p.keyIndex = j; break}a.p.sortorder = a.p.sortorder.toLowerCase(); if (this.p.treeGrid === true)try{b(this).jqGrid("setTreeGrid")} catch (Ha){}if (this.p.subGrid)try{b(a).jqGrid("setSubGrid")} catch (Ia){}if (this.p.multiselect){this.p.colNames.unshift(""); this.p.colModel.unshift({name:"cb", width:C?a.p.multiselectWidth + a.p.cellLayout: - a.p.multiselectWidth, sortable:false, resizable:false, hidedlg:true, search:false, align:"center", fixed:true})}if (this.p.rownumbers){this.p.colNames.unshift(""); this.p.colModel.unshift({name:"rn", width:a.p.rownumWidth, sortable:false, resizable:false, hidedlg:true, search:false, align:"center", fixed:true})}a.p.xmlReader = b.extend(true, {root:"rows", row:"row", page:"rows>page", total:"rows>total", records:"rows>records", repeatitems:true, cell:"cell", id:"[id]", userdata:"userdata", subgrid:{root:"rows", row:"row", repeatitems:true, - cell:"cell"}}, a.p.xmlReader); a.p.jsonReader = b.extend(true, {root:"rows", page:"page", total:"total", records:"records", repeatitems:true, cell:"cell", id:"id", userdata:"userdata", subgrid:{root:"rows", repeatitems:true, cell:"cell"}}, a.p.jsonReader); if (a.p.scroll){a.p.pgbuttons = false; a.p.pginput = false; a.p.rowList = []}var H = "", ya, ba, sa, ka, pa, I, A, ea; ba = ea = ""; if (a.p.shrinkToFit === true && a.p.forceFit === true)for (j = a.p.colModel.length - 1; j >= 0; j--)if (!a.p.colModel[j].hidden){a.p.colModel[j].resizable = - false; break}if (a.p.viewsortcols[1] == "horizontal"){ea = " ui-i-asc"; ba = " ui-i-desc"}ya = x?"class='ui-th-div-ie'":""; ea = ""; for (j = 0; j < this.p.colNames.length; j++){ba = a.p.headertitles?' title="' + b.jgrid.stripHtml(a.p.colNames[j]) + - '"':""; H += ""; ba = a.p.colModel[j].index || a.p.colModel[j].name; H += "
" + a.p.colNames[j]; a.p.colModel[j].width = a.p.colModel[j].width?parseInt(a.p.colModel[j].width, 10):150; if (typeof a.p.colModel[j].title !== "boolean")a.p.colModel[j].title = true; if (ba == a.p.sortname)a.p.lastsort = j; H += ea + "
"}H += ""; b(this).append(H); b("thead tr:first th", - this).hover(function(){b(this).addClass("ui-state-hover")}, function(){b(this).removeClass("ui-state-hover")}); if (this.p.multiselect){var ta = [], qa; b("#cb_" + b.jgrid.jqID(a.p.id), this).bind("click", function(){if (this.checked){b("[id^=jqg_]", a.rows).attr("checked", true); b(a.rows).each(function(c){if (!b(this).hasClass("subgrid")){b(this).addClass("ui-state-highlight").attr("aria-selected", "true"); a.p.selarrrow[c] = a.p.selrow = this.id}}); qa = true; ta = []} else{b("[id^=jqg_]", a.rows).attr("checked", false); b(a.rows).each(function(c){if (!b(this).hasClass("subgrid")){b(this).removeClass("ui-state-highlight").attr("aria-selected", - "false"); ta[c] = this.id}}); a.p.selarrrow = []; a.p.selrow = null; qa = false}if (b.isFunction(a.p.onSelectAll))a.p.onSelectAll.call(a, qa?a.p.selarrrow:ta, qa)})}if (a.p.autowidth === true){H = b(K).innerWidth(); a.p.width = H > 0?H:"nw"}(function(){var c = 0, d = a.p.cellLayout, e = 0, l, n = a.p.scrollOffset, o, p = false, w, y = 0, s = 0, r = 0, v; if (C)d = 0; b.each(a.p.colModel, function(){if (typeof this.hidden === "undefined")this.hidden = false; if (this.hidden === false){c += J(this.width, 0); if (this.fixed){y += this.width; s += this.width + d} else e++; r++}}); - if (isNaN(a.p.width))a.p.width = g.width = c; else g.width = a.p.width; a.p.tblwidth = c; if (a.p.shrinkToFit === false && a.p.forceFit === true)a.p.forceFit = false; if (a.p.shrinkToFit === true && e > 0){w = g.width - d * e - s; if (!isNaN(a.p.height)){w -= n; p = true}c = 0; b.each(a.p.colModel, function(z){if (this.hidden === false && !this.fixed){this.width = o = Math.round(w * this.width / (a.p.tblwidth - y)); c += o; l = z}}); v = 0; if (p){if (g.width - s - (c + d * e) !== n)v = g.width - s - (c + d * e) - n} else if (!p && Math.abs(g.width - s - (c + d * e)) !== 1)v = g.width - s - (c + d * e); a.p.colModel[l].width += - v; a.p.tblwidth = c + v + y + r * d; if (a.p.tblwidth > a.p.width){a.p.colModel[l].width -= a.p.tblwidth - parseInt(a.p.width, 10); a.p.tblwidth = a.p.width}}})(); b(K).css("width", g.width + "px").append("
 
"); b(q).css("width", g.width + "px"); H = b("thead:first", a).get(0); var ua = ""; q = b("tr:first", H); a.p.disableClick = false; b("th", q).each(function(c){sa = a.p.colModel[c].width; if (typeof a.p.colModel[c].resizable === "undefined")a.p.colModel[c].resizable = true; if (a.p.colModel[c].resizable){ka = document.createElement("span"); b(ka).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-" + m); b.browser.opera || b(ka).css("cursor", "col-resize"); b(this).addClass(a.p.resizeclass)} else ka = ""; b(this).css("width", sa + "px").prepend(ka); a.p.colModel[c].hidden && b(this).css("display", "none"); - g.headers[c] = {width:sa, el:this}; pa = a.p.colModel[c].sortable; if (typeof pa !== "boolean")pa = a.p.colModel[c].sortable = true; var d = a.p.colModel[c].name; d == "cb" || d == "subgrid" || d == "rn" || a.p.viewsortcols[2] && b("div", this).addClass("ui-jqgrid-sortable"); if (pa)if (a.p.viewsortcols[0]){b("div span.s-ico", this).show(); c == a.p.lastsort && b("div span.ui-icon-" + a.p.sortorder, this).removeClass("ui-state-disabled")} else if (c == a.p.lastsort){b("div span.s-ico", this).show(); b("div span.ui-icon-" + a.p.sortorder, this).removeClass("ui-state-disabled")}ua += - ""}).mousedown(function(c){if (b(c.target).closest("th>span.ui-jqgrid-resize").length == 1){var d = b.jgrid.getCellIndex(this); if (a.p.forceFit === true)a.p.nv = Ca(d); g.dragStart(d, c, Da(d)); return false}}).click(function(c){if (a.p.disableClick)return a.p.disableClick = false; var d = "th>div.ui-jqgrid-sortable", e, l; a.p.viewsortcols[2] || (d = "th>div>span>span.ui-grid-ico-sort"); c = b(c.target).closest(d); if (c.length == 1){d = b.jgrid.getCellIndex(this); if (!a.p.viewsortcols[2]){e = - true; l = c.attr("sort")}xa(b("div", this)[0].id, d, e, l); return false}}); if (a.p.sortable && b.fn.sortable)try{b(a).jqGrid("sortableColumns", q)} catch (Ja){}ua += "
 
"; this.appendChild(document.createElement("tbody")); b(this).addClass("ui-jqgrid-btable"); q = b("
").append(H); var T = a.p.caption && a.p.hiddengrid === true?true:false; H = b("
"); g.hDiv = document.createElement("div"); b(g.hDiv).css({width:g.width + "px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(H); b(H).append(q); T && b(g.hDiv).hide(); if (a.p.pager){if (typeof a.p.pager == "string"){if (a.p.pager.substr(0, 1) != "#")a.p.pager = "#" + a.p.pager} else a.p.pager = "#" + b(a.p.pager).attr("id"); b(a.p.pager).css({width:g.width + "px"}).appendTo(K).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom"); T && b(a.p.pager).hide(); t(a.p.pager, "")}a.p.cellEdit === - false && a.p.hoverrows === true && b(a).bind("mouseover", function(c){A = b(c.target).closest("tr.jqgrow"); b(A).attr("class") !== "subgrid" && b(A).addClass("ui-state-hover"); return false}).bind("mouseout", function(c){A = b(c.target).closest("tr.jqgrow"); b(A).removeClass("ui-state-hover"); return false}); var Z, $; b(a).before(g.hDiv).click(function(c){I = c.target; var d = b(I).hasClass("cbox"); A = b(I, a.rows).closest("tr.jqgrow"); if (b(A).length === 0)return this; var e = true; if (b.isFunction(a.p.beforeSelectRow))e = a.p.beforeSelectRow.call(a, - A[0].id, c); if (I.tagName == "A" || (I.tagName == "INPUT" || I.tagName == "TEXTAREA" || I.tagName == "OPTION" || I.tagName == "SELECT") && !d)return this; if (e === true){if (a.p.cellEdit === true)if (a.p.multiselect && d)b(a).jqGrid("setSelection", A[0].id, true); else{Z = A[0].rowIndex; $ = b.jgrid.getCellIndex(I); try{b(a).jqGrid("editCell", Z, $, true)} catch (l){}} else if (a.p.multikey)if (c[a.p.multikey])b(a).jqGrid("setSelection", A[0].id, true); else{if (a.p.multiselect && d){d = b("[id^=jqg_]", A).attr("checked"); b("[id^=jqg_]", A).attr("checked", - !d)}} else{if (a.p.multiselect && a.p.multiboxonly)if (!d){b(a.p.selarrrow).each(function(n, o){n = a.rows.namedItem(o); b(n).removeClass("ui-state-highlight"); b("#jqg_" + b.jgrid.jqID(o), n).attr("checked", false)}); a.p.selarrrow = []; b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false)}b(a).jqGrid("setSelection", A[0].id, true)}if (b.isFunction(a.p.onCellSelect)){Z = A[0].id; $ = b.jgrid.getCellIndex(I); a.p.onCellSelect.call(a, Z, $, b(I).html(), c)}c.stopPropagation()} else return this}).bind("reloadGrid", function(c, - d){if (a.p.treeGrid === true)a.p.datatype = a.p.treedatatype; d && d.current && a.grid.selectionPreserver(a); if (a.p.datatype == "local")b(a).jqGrid("resetSelection"); else if (!a.p.treeGrid){a.p.selrow = null; if (a.p.multiselect){a.p.selarrrow = []; b("#cb_" + b.jgrid.jqID(a.p.id), a.grid.hDiv).attr("checked", false)}a.p.savedRow = []; a.p.scroll && aa(a.grid.bDiv, true)}if (d && d.page){c = d.page; if (c > a.p.lastpage)c = a.p.lastpage; if (c < 1)c = 1; a.p.page = c; a.grid.bDiv.scrollTop = a.grid.prevRowHeight?(c - 1) * a.grid.prevRowHeight * a.p.rowNum: - 0}if (a.grid.prevRowHeight && a.p.scroll){delete a.p.lastpage; a.grid.populateVisible()} else a.grid.populate(); return false}); b.isFunction(this.p.ondblClickRow) && b(this).dblclick(function(c){I = c.target; A = b(I, a.rows).closest("tr.jqgrow"); if (b(A).length === 0)return false; Z = A[0].rowIndex; $ = b.jgrid.getCellIndex(I); a.p.ondblClickRow.call(a, b(A).attr("id"), Z, $, c); return false}); b.isFunction(this.p.onRightClickRow) && b(this).bind("contextmenu", function(c){I = c.target; A = b(I, a.rows).closest("tr.jqgrow"); if (b(A).length === - 0)return false; a.p.multiselect || b(a).jqGrid("setSelection", A[0].id, true); Z = A[0].rowIndex; $ = b.jgrid.getCellIndex(I); a.p.onRightClickRow.call(a, b(A).attr("id"), Z, $, c); return false}); g.bDiv = document.createElement("div"); b(g.bDiv).append(b('
').append("
").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height + (isNaN(a.p.height)?"":"px"), width:g.width + "px"}).scroll(g.scrollGrid); b("table:first", g.bDiv).css({width:a.p.tblwidth + - "px"}); if (x){b("tbody", this).size() == 2 && b("tbody:first", this).remove(); a.p.multikey && b(g.bDiv).bind("selectstart", function(){return false})} else a.p.multikey && b(g.bDiv).bind("mousedown", function(){return false}); T && b(g.bDiv).hide(); g.cDiv = document.createElement("div"); var va = a.p.hidegrid === true?b("").addClass("ui-jqgrid-titlebar-close HeaderButton").hover(function(){va.addClass("ui-state-hover")}, function(){va.removeClass("ui-state-hover")}).append("").css(m == - "rtl"?"left":"right", "0px"):""; b(g.cDiv).append(va).append("" + a.p.caption + "").addClass("ui-jqgrid-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"); b(g.cDiv).insertBefore(g.hDiv); if (a.p.toolbar[0]){g.uDiv = document.createElement("div"); if (a.p.toolbar[1] == "top")b(g.uDiv).insertBefore(g.hDiv); else a.p.toolbar[1] == "bottom" && b(g.uDiv).insertAfter(g.hDiv); if (a.p.toolbar[1] == "both"){g.ubDiv = document.createElement("div"); b(g.uDiv).insertBefore(g.hDiv).addClass("ui-userdata ui-state-default").attr("id", - "t_" + this.id); b(g.ubDiv).insertAfter(g.hDiv).addClass("ui-userdata ui-state-default").attr("id", "tb_" + this.id); T && b(g.ubDiv).hide()} else b(g.uDiv).width(g.width).addClass("ui-userdata ui-state-default").attr("id", "t_" + this.id); T && b(g.uDiv).hide()}if (a.p.toppager){a.p.toppager = a.p.id + "_toppager"; g.topDiv = b("
")[0]; a.p.toppager = "#" + a.p.toppager; b(g.topDiv).insertBefore(g.hDiv).addClass("ui-state-default ui-jqgrid-toppager").width(g.width); t(a.p.toppager, "_t")}if (a.p.footerrow){g.sDiv = - b("
")[0]; H = b("
"); b(g.sDiv).append(H).insertAfter(g.hDiv).width(g.width); b(H).append(ua); g.footers = b(".ui-jqgrid-ftable", g.sDiv)[0].rows[0].cells; if (a.p.rownumbers)g.footers[0].className = "ui-state-default jqgrid-rownum"; T && b(g.sDiv).hide()}if (a.p.caption){var Ea = a.p.datatype; if (a.p.hidegrid === true){b(".ui-jqgrid-titlebar-close", g.cDiv).click(function(c){var d = b.isFunction(a.p.onHeaderClick); if (a.p.gridstate == - "visible"){b(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv", "#gview_" + a.p.id).slideUp("fast"); a.p.pager && b(a.p.pager).slideUp("fast"); a.p.toppager && b(a.p.toppager).slideUp("fast"); if (a.p.toolbar[0] === true){a.p.toolbar[1] == "both" && b(g.ubDiv).slideUp("fast"); b(g.uDiv).slideUp("fast")}a.p.footerrow && b(".ui-jqgrid-sdiv", "#gbox_" + a.p.id).slideUp("fast"); b("span", this).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s"); a.p.gridstate = "hidden"; b("#gbox_" + a.p.id).hasClass("ui-resizable") && - b(".ui-resizable-handle", "#gbox_" + a.p.id).hide(); if (d)T || a.p.onHeaderClick.call(a, a.p.gridstate, c)} else if (a.p.gridstate == "hidden"){b(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv", "#gview_" + a.p.id).slideDown("fast"); a.p.pager && b(a.p.pager).slideDown("fast"); a.p.toppager && b(a.p.toppager).slideDown("fast"); if (a.p.toolbar[0] === true){a.p.toolbar[1] == "both" && b(g.ubDiv).slideDown("fast"); b(g.uDiv).slideDown("fast")}a.p.footerrow && b(".ui-jqgrid-sdiv", "#gbox_" + a.p.id).slideDown("fast"); b("span", this).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n"); - if (T){a.p.datatype = Ea; Y(); T = false}a.p.gridstate = "visible"; b("#gbox_" + a.p.id).hasClass("ui-resizable") && b(".ui-resizable-handle", "#gbox_" + a.p.id).show(); d && a.p.onHeaderClick.call(a, a.p.gridstate, c)}return false}); if (T){a.p.datatype = "local"; b(".ui-jqgrid-titlebar-close", g.cDiv).trigger("click")}}} else b(g.cDiv).hide(); b(g.hDiv).after(g.bDiv).mousemove(function(c){if (g.resizing){g.dragMove(c); return false}}); b(".ui-jqgrid-labels", g.hDiv).bind("selectstart", function(){return false}); b(document).mouseup(function(){if (g.resizing){g.dragEnd(); - return false}return true}); this.updateColumns = function(){var c = this.rows[0], d = this; if (c){b("td", c).each(function(e){b(this).css("width", d.grid.headers[e].width + "px")}); this.grid.cols = c.cells}return this}; a.formatCol = F; a.sortData = xa; a.updatepager = na; a.formatter = function(c, d, e, l, n){return M(c, d, e, l, n)}; b.extend(g, {populate:Y, emptyRows:aa}); this.grid = g; a.addXmlData = function(c){ia(c, a.grid.bDiv)}; a.addJSONData = function(c){ra(c, a.grid.bDiv)}; Y(); a.p.hiddengrid = false; b(window).unload(function(){a = null})}}})}; - b.jgrid.extend({getGridParam:function(f){var k = this[0]; if (k.grid)return f?typeof k.p[f] != "undefined"?k.p[f]:null:k.p}, setGridParam:function(f){return this.each(function(){this.grid && typeof f === "object" && b.extend(true, this.p, f)})}, getDataIDs:function(){var f = [], k = 0, i; this.each(function(){if ((i = this.rows.length) && i > 0)for (; k < i; ){f[k] = this.rows[k].id; k++}}); return f}, setSelection:function(f, k){return this.each(function(){function i(a){var q = b(h.grid.bDiv)[0].clientHeight, t = b(h.grid.bDiv)[0].scrollTop, - x = h.rows[a].offsetTop; a = h.rows[a].clientHeight; if (x + a >= q + t)b(h.grid.bDiv)[0].scrollTop = x - (q + t) + a + t; else if (x < q + t)if (x < t)b(h.grid.bDiv)[0].scrollTop = x}var h = this, g, j, m; if (f !== undefined){k = k === false?false:true; if (j = h.rows.namedItem(f + "")){if (h.p.scrollrows === true){g = h.rows.namedItem(f).rowIndex; g >= 0 && i(g)}if (h.p.multiselect){h.p.selrow = j.id; m = b.inArray(h.p.selrow, h.p.selarrrow); if (m === - 1){j.className !== "ui-subgrid" && b(j).addClass("ui-state-highlight").attr("aria-selected", "true"); g = true; b("#jqg_" + b.jgrid.jqID(h.p.selrow), - h.rows[j.rowIndex]).attr("checked", g); h.p.selarrrow.push(h.p.selrow); h.p.onSelectRow && k && h.p.onSelectRow.call(h, h.p.selrow, g)} else{j.className !== "ui-subgrid" && b(j).removeClass("ui-state-highlight").attr("aria-selected", "false"); g = false; b("#jqg_" + b.jgrid.jqID(h.p.selrow), h.rows[j.rowIndex]).attr("checked", g); h.p.selarrrow.splice(m, 1); h.p.onSelectRow && k && h.p.onSelectRow.call(h, h.p.selrow, g); j = h.p.selarrrow[0]; h.p.selrow = j === undefined?null:j}} else if (j.className !== "ui-subgrid"){h.p.selrow && b(h.rows.namedItem(h.p.selrow)).removeClass("ui-state-highlight").attr("aria-selected", - "false"); h.p.selrow = j.id; b(j).addClass("ui-state-highlight").attr("aria-selected", "true"); h.p.onSelectRow && k && h.p.onSelectRow.call(h, h.p.selrow, true)}}}})}, resetSelection:function(){return this.each(function(){var f = this, k; if (f.p.multiselect){b(f.p.selarrrow).each(function(i, h){k = f.rows.namedItem(h); b(k).removeClass("ui-state-highlight").attr("aria-selected", "false"); b("#jqg_" + b.jgrid.jqID(h), k).attr("checked", false)}); b("#cb_" + b.jgrid.jqID(f.p.id), f.grid.hDiv).attr("checked", false); f.p.selarrrow = - []} else if (f.p.selrow){b("tr#" + b.jgrid.jqID(f.p.selrow), f.grid.bDiv).removeClass("ui-state-highlight").attr("aria-selected", "false"); f.p.selrow = null}f.p.savedRow = []})}, getRowData:function(f){var k = {}, i, h = false, g, j = 0; this.each(function(){var m = this, a, q; if (typeof f == "undefined"){h = true; i = []; g = m.rows.length} else{q = m.rows.namedItem(f); if (!q)return k; g = 1}for (; j < g; ){if (h)q = m.rows[j]; b("td", q).each(function(t){a = m.p.colModel[t].name; if (a !== "cb" && a !== "subgrid")if (m.p.treeGrid === true && a == m.p.ExpandColumn)k[a] = - b.jgrid.htmlDecode(b("span:first", this).html()); else try{k[a] = b.unformat(this, {rowId:q.id, colModel:m.p.colModel[t]}, t)} catch (x){k[a] = b.jgrid.htmlDecode(b(this).html())}}); j++; if (h){i.push(k); k = {}}}}); return i?i:k}, delRowData:function(f){var k = false, i, h, g; this.each(function(){var j = this; if (i = j.rows.namedItem(f)){g = i.rowIndex; b(i).remove(); j.p.records--; j.p.reccount--; j.updatepager(true, false); k = true; if (j.p.multiselect){h = b.inArray(f, j.p.selarrrow); h != - 1 && j.p.selarrrow.splice(h, 1)}if (f == j.p.selrow)j.p.selrow = - null} else return false; g === 0 && k && j.updateColumns(); if (j.p.altRows === true && k){var m = j.p.altclass; b(j.rows).each(function(a){a % 2 == 1?b(this).addClass(m):b(this).removeClass(m)})}}); return k}, setRowData:function(f, k, i){var h, g = false, j; this.each(function(){var m = this, a, q, t = typeof i; if (!m.grid)return false; q = m.rows.namedItem(f); if (!q)return false; k && b(this.p.colModel).each(function(x){h = this.name; if (k[h] !== undefined){a = m.formatter(f, k[h], x, k, "edit"); j = this.title?{title:b.jgrid.stripHtml(a)}:{}; m.p.treeGrid === - true && h == m.p.ExpandColumn?b("td:eq(" + x + ") > span:first", q).html(a).attr(j):b("td:eq(" + x + ")", q).html(a).attr(j); g = true}}); if (t === "string")b(q).addClass(i); else t === "object" && b(q).css(i)}); return g}, addRowData:function(f, k, i, h){i || (i = "last"); var g = false, j, m, a, q, t, x, C, K, J = "", F, Q, M, R; if (k){if (b.isArray(k)){F = true; i = "last"; Q = f} else{k = [k]; F = false}this.each(function(){var u = this, la = k.length; t = u.p.rownumbers === true?1:0; a = u.p.multiselect === true?1:0; q = u.p.subGrid === true?1:0; if (!F)if (typeof f != "undefined")f += - ""; else{f = u.p.records + 1 + ""; if (u.p.keyIndex !== false){Q = u.p.colModel[u.p.keyIndex + a + q + t].name; if (typeof k[0][Q] != "undefined")f = k[0][Q]}}M = u.p.altclass; for (var ca = 0, fa = "", aa = b.isFunction(u.p.afterInsertRow)?true:false; ca < la; ){R = k[ca]; m = ""; if (F){try{f = R[Q]} catch (U){f = u.p.records + 1}fa = u.p.altRows === true?(u.rows.length - 1) % 2 === 0?M:"":""}if (t){J = u.formatCol(t, 1, ""); m += '0"}if (a){K = ''; J = u.formatCol(t, 1, ""); m += '" + K + ""}if (q)m += b(u).jqGrid("addSubGridCell", a + t, 1); for (C = a + q + t; C < this.p.colModel.length; C++){j = this.p.colModel[C].name; K = u.formatter(f, R[j], C, R, "add"); J = u.formatCol(C, 1, K); m += '" + K + ""}m = '' + m + ""; if (u.p.subGrid === true){m = b(m)[0]; b(u).jqGrid("addSubGrid", - m, a + t)}if (u.rows.length === 0)b("table:first", u.grid.bDiv).append(m); else switch (i){case "last":b(u.rows[u.rows.length - 1]).after(m); break; case "first":b(u.rows[0]).before(m); break; case "after":if (x = u.rows.namedItem(h))b(u.rows[x.rowIndex + 1]).hasClass("ui-subgrid")?b(u.rows[x.rowIndex + 1]).after(m):b(x).after(m); break; case "before":if (x = u.rows.namedItem(h)){b(x).before(m); x = x.rowIndex}break}u.p.records++; u.p.reccount++; if (!u.grid.cols || !u.grid.cols.length)u.grid.cols = u.rows[0].cells; if (i === "first" || i === - "before" && x <= 1 || u.rows.length === 1)u.updateColumns(); aa && u.p.afterInsertRow.call(u, f, R, R); ca++}if (u.p.altRows === true && !F)if (i == "last")(u.rows.length - 1) % 2 == 1 && b(u.rows[u.rows.length - 1]).addClass(M); else b(u.rows).each(function(ia){ia % 2 == 1?b(this).addClass(M):b(this).removeClass(M)}); u.updatepager(true, true); g = true})}return g}, footerData:function(f, k, i){function h(q){for (var t in q)if (q.hasOwnProperty(t))return false; return true}var g, j = false, m = {}, a; if (typeof f == "undefined")f = "get"; if (typeof i != "boolean")i = - true; f = f.toLowerCase(); this.each(function(){var q = this, t; if (!q.grid || !q.p.footerrow)return false; if (f == "set")if (h(k))return false; j = true; b(this.p.colModel).each(function(x){g = this.name; if (f == "set"){if (k[g] !== undefined){t = i?q.formatter("", k[g], x, k, "edit"):k[g]; a = this.title?{title:b.jgrid.stripHtml(t)}:{}; b("tr.footrow td:eq(" + x + ")", q.grid.sDiv).html(t).attr(a); j = true}} else if (f == "get")m[g] = b("tr.footrow td:eq(" + x + ")", q.grid.sDiv).html()})}); return f == "get"?m:j}, ShowHideCol:function(f, k){return this.each(function(){var i = - this, h = false; if (i.grid){if (typeof f === "string")f = [f]; k = k != "none"?"":"none"; var g = k == ""?true:false; b(this.p.colModel).each(function(j){if (b.inArray(this.name, f) !== - 1 && this.hidden === g){b("tr", i.grid.hDiv).each(function(){b("th:eq(" + j + ")", this).css("display", k)}); b(i.rows).each(function(m){b("td:eq(" + j + ")", i.rows[m]).css("display", k)}); i.p.footerrow && b("td:eq(" + j + ")", i.grid.sDiv).css("display", k); if (k == "none")i.p.tblwidth -= this.width; else i.p.tblwidth += this.width; this.hidden = !g; h = true}}); if (h === true){b("table:first", - i.grid.hDiv).width(i.p.tblwidth); b("table:first", i.grid.bDiv).width(i.p.tblwidth); i.grid.hDiv.scrollLeft = i.grid.bDiv.scrollLeft; if (i.p.footerrow){b("table:first", i.grid.sDiv).width(i.p.tblwidth); i.grid.sDiv.scrollLeft = i.grid.bDiv.scrollLeft}}}})}, hideCol:function(f){return this.each(function(){b(this).jqGrid("ShowHideCol", f, "none")})}, showCol:function(f){return this.each(function(){b(this).jqGrid("ShowHideCol", f, "")})}, remapColumns:function(f, k, i){function h(m){var a; a = m.length?b.makeArray(m):b.extend({}, - m); b.each(f, function(q){m[q] = a[this]})}function g(m, a){b(">tr" + (a || ""), m).each(function(){var q = this, t = b.makeArray(q.cells); b.each(f, function(){var x = t[this]; x && q.appendChild(x)})})}var j = this.get(0); h(j.p.colModel); h(j.p.colNames); h(j.grid.headers); g(b("thead:first", j.grid.hDiv), i && ":not(.ui-jqgrid-labels)"); k && g(b("tbody:first", j.grid.bDiv), ".jqgrow"); j.p.footerrow && g(b("tbody:first", j.grid.sDiv)); if (j.p.remapColumns)if (j.p.remapColumns.length)h(j.p.remapColumns); else j.p.remapColumns = b.makeArray(f); - j.p.lastsort = b.inArray(j.p.lastsort, f); if (j.p.treeGrid)j.p.expColInd = b.inArray(j.p.expColInd, f)}, setGridWidth:function(f, k){return this.each(function(){var i = this, h, g = 0, j = i.p.cellLayout, m, a = 0, q = false, t = i.p.scrollOffset, x, C = 0, K = 0, J = 0, F; if (i.grid){if (typeof k != "boolean")k = i.p.shrinkToFit; if (!isNaN(f)){f = parseInt(f, 10); i.grid.width = i.p.width = f; b("#gbox_" + i.p.id).css("width", f + "px"); b("#gview_" + i.p.id).css("width", f + "px"); b(i.grid.bDiv).css("width", f + "px"); b(i.grid.hDiv).css("width", f + "px"); i.p.pager && - b(i.p.pager).css("width", f + "px"); i.p.toppager && b(i.p.toppager).css("width", f + "px"); if (i.p.toolbar[0] === true){b(i.grid.uDiv).css("width", f + "px"); i.p.toolbar[1] == "both" && b(i.grid.ubDiv).css("width", f + "px")}i.p.footerrow && b(i.grid.sDiv).css("width", f + "px"); if (k === false && i.p.forceFit === true)i.p.forceFit = false; if (k === true){if (b.browser.safari)j = 0; b.each(i.p.colModel, function(){if (this.hidden === false){g += parseInt(this.width, 10); if (this.fixed){K += this.width; C += this.width + j} else a++; J++}}); if (a !== 0){i.p.tblwidth = - g; x = f - j * a - C; if (!isNaN(i.p.height))q = true; x -= t; g = 0; var Q = i.grid.cols.length > 0; b.each(i.p.colModel, function(M){if (this.hidden === false && !this.fixed){h = Math.round(x * this.width / (i.p.tblwidth - K)); if (!(h < 0)){this.width = h; g += h; i.grid.headers[M].width = h; i.grid.headers[M].el.style.width = h + "px"; if (i.p.footerrow)i.grid.footers[M].style.width = h + "px"; if (Q)i.grid.cols[M].style.width = h + "px"; m = M}}}); F = 0; if (q){if (f - C - (g + j * a) !== t)F = f - C - (g + j * a) - t} else if (Math.abs(f - - C - (g + j * a)) !== 1)F = f - C - (g + j * a); i.p.colModel[m].width += F; i.p.tblwidth = g + F + K + j * J; if (i.p.tblwidth > f){q = i.p.tblwidth - parseInt(f, 10); i.p.tblwidth = f; h = i.p.colModel[m].width -= q} else h = i.p.colModel[m].width; i.grid.headers[m].width = h; i.grid.headers[m].el.style.width = h + "px"; if (Q)i.grid.cols[m].style.width = h + "px"; b("table:first", i.grid.bDiv).css("width", i.p.tblwidth + "px"); b("table:first", i.grid.hDiv).css("width", i.p.tblwidth + "px"); i.grid.hDiv.scrollLeft = i.grid.bDiv.scrollLeft; if (i.p.footerrow){i.grid.footers[m].style.width = - h + "px"; b("table:first", i.grid.sDiv).css("width", i.p.tblwidth + "px")}}}}}})}, setGridHeight:function(f){return this.each(function(){var k = this; if (k.grid){b(k.grid.bDiv).css({height:f + (isNaN(f)?"":"px")}); k.p.height = f; k.p.scroll && k.grid.populateVisible()}})}, setCaption:function(f){return this.each(function(){this.p.caption = f; b("span.ui-jqgrid-title", this.grid.cDiv).html(f); b(this.grid.cDiv).show()})}, setLabel:function(f, k, i, h){return this.each(function(){var g = this, j = - 1; if (g.grid){if (isNaN(f))b(g.p.colModel).each(function(q){if (this.name == - f){j = q; return false}}); else j = parseInt(f, 10); if (j >= 0){var m = b("tr.ui-jqgrid-labels th:eq(" + j + ")", g.grid.hDiv); if (k){var a = b(".s-ico", m); b("[id^=jqgh_]", m).empty().html(k).append(a); g.p.colNames[j] = k}if (i)typeof i === "string"?b(m).addClass(i):b(m).css(i); typeof h === "object" && b(m).attr(h)}}})}, setCell:function(f, k, i, h, g, j){return this.each(function(){var m = this, a = - 1, q, t; if (m.grid){if (isNaN(k))b(m.p.colModel).each(function(C){if (this.name == k){a = C; return false}}); else a = parseInt(k, 10); if (a >= 0)if (q = m.rows.namedItem(f)){var x = - b("td:eq(" + a + ")", q); if (i !== "" || j === true){q = m.formatter(f, i, a, q, "edit"); t = m.p.colModel[a].title?{title:b.jgrid.stripHtml(q)}:{}; m.p.treeGrid && b(".tree-wrap", b(x)).length > 0?b("span", b(x)).html(q).attr(t):b(x).html(q).attr(t)}if (typeof h === "string")b(x).addClass(h); else h && b(x).css(h); typeof g === "object" && b(x).attr(g)}}})}, getCell:function(f, k){var i = false; this.each(function(){var h = this, g = - 1; if (h.grid){if (isNaN(k))b(h.p.colModel).each(function(a){if (this.name === k){g = a; return false}}); else g = parseInt(k, - 10); if (g >= 0){var j = h.rows.namedItem(f); if (j)try{i = b.unformat(b("td:eq(" + g + ")", j), {rowId:j.id, colModel:h.p.colModel[g]}, g)} catch (m){i = b.jgrid.htmlDecode(b("td:eq(" + g + ")", j).html())}}}}); return i}, getCol:function(f, k, i){var h = [], g, j = 0; k = typeof k != "boolean"?false:k; if (typeof i == "undefined")i = false; this.each(function(){var m = this, a = - 1; if (m.grid){if (isNaN(f))b(m.p.colModel).each(function(C){if (this.name === f){a = C; return false}}); else a = parseInt(f, 10); if (a >= 0){var q = m.rows.length, t = 0; if (q && q > 0){for (; t < q; ){try{g = - b.unformat(b(m.rows[t].cells[a]), {rowId:m.rows[t].id, colModel:m.p.colModel[a]}, a)} catch (x){g = b.jgrid.htmlDecode(m.rows[t].cells[a].innerHTML)}if (i)j += parseFloat(g); else if (k)h.push({id:m.rows[t].id, value:g}); else h[t] = g; t++}if (i)switch (i.toLowerCase()){case "sum":h = j; break; case "avg":h = j / q; break; case "count":h = q; break}}}}}); return h}, clearGridData:function(f){return this.each(function(){var k = this; if (k.grid){if (typeof f != "boolean")f = false; b("tbody:first tr", k.grid.bDiv).remove(); k.p.footerrow && f && - b(".ui-jqgrid-ftable td", k.grid.sDiv).html(" "); k.p.selrow = null; k.p.selarrrow = []; k.p.savedRow = []; k.p.records = 0; k.p.page = "0"; k.p.lastpage = "0"; k.p.reccount = 0; k.updatepager(true, false)}})}, getInd:function(f, k){var i = false, h; this.each(function(){if (h = this.rows.namedItem(f))i = k === true?h:h.rowIndex}); return i}})})(jQuery); - (function(c){function u(a, b, d, e, g){var h = b; if (c.fn.fmatter[a])h = c.fn.fmatter[a](b, d, e, g); return h}c.fmatter = {}; c.fn.fmatter = function(a, b, d, e, g){d = c.extend({}, c.jgrid.formatter, d); return u(a, b, d, e, g)}; c.fmatter.util = {NumberFormat:function(a, b){isNumber(a) || (a *= 1); if (isNumber(a)){var d = a < 0, e = a + "", g = b.decimalSeparator?b.decimalSeparator:"."; if (isNumber(b.decimalPlaces)){var h = b.decimalPlaces; e = Math.pow(10, h); e = Math.round(a * e) / e + ""; a = e.lastIndexOf("."); if (h > 0){if (a < 0){e += g; a = e.length - 1} else if (g !== ".")e = - e.replace(".", g); for (; e.length - 1 - a < h; )e += "0"}}if (b.thousandsSeparator){h = b.thousandsSeparator; a = e.lastIndexOf(g); a = a > - 1?a:e.length; g = e.substring(a); for (var f = - 1, i = a; i > 0; i--){f++; if (f % 3 === 0 && i !== a && (!d || i > 1))g = h + g; g = e.charAt(i - 1) + g}e = g}e = b.prefix?b.prefix + e:e; return e = b.suffix?e + b.suffix:e} else return a}, DateFormat:function(a, b, d, e){var g = function(m, r){m = String(m); for (r = parseInt(r, 10) || 2; m.length < r; )m = "0" + m; return m}, h = {m:1, d:1, y:1970, h:0, i:0, s:0, u:0}, f = 0, i, k, j = ["i18n"]; j.i18n = {dayNames:e.dayNames, - monthNames:e.monthNames}; if (a in e.masks)a = e.masks[a]; if (b.constructor === Date)f = b; else{b = b.split(/[\\\/:_;.\t\T\s-]/); a = a.split(/[\\\/:_;.\t\T\s-]/); i = 0; for (k = a.length; i < k; i++){if (a[i] == "M"){f = c.inArray(b[i], j.i18n.monthNames); if (f !== - 1 && f < 12)b[i] = f + 1}if (a[i] == "F"){f = c.inArray(b[i], j.i18n.monthNames); if (f !== - 1 && f > 11)b[i] = f + 1 - 12}h[a[i].toLowerCase()] = parseInt(b[i], 10)}h.m = parseInt(h.m, 10) - 1; f = h.y; if (f >= 70 && f <= 99)h.y = 1900 + h.y; else if (f >= 0 && f <= 69)h.y = 2E3 + h.y; f = new Date(h.y, h.m, h.d, h.h, h.i, h.s, h.u)}if (d in - e.masks)d = e.masks[d]; else d || (d = "Y-m-d"); h = f.getHours(); a = f.getMinutes(); b = f.getDate(); i = f.getMonth() + 1; k = f.getTimezoneOffset(); var l = f.getSeconds(), o = f.getMilliseconds(), n = f.getDay(), p = f.getFullYear(), q = (n + 6) % 7 + 1, s = (new Date(p, i - 1, b) - new Date(p, 0, 1)) / 864E5, t = {d:g(b), D:j.i18n.dayNames[n], j:b, l:j.i18n.dayNames[n + 7], N:q, S:e.S(b), w:n, z:s, W:q < 5?Math.floor((s + q - 1) / 7) + 1:Math.floor((s + q - 1) / 7) || (((new Date(p - 1, 0, 1)).getDay() + 6) % 7 < 4?53:52), F:j.i18n.monthNames[i - 1 + 12], m:g(i), M:j.i18n.monthNames[i - 1], n:i, t:"?", - L:"?", o:"?", Y:p, y:String(p).substring(2), a:h < 12?e.AmPm[0]:e.AmPm[1], A:h < 12?e.AmPm[2]:e.AmPm[3], B:"?", g:h % 12 || 12, G:h, h:g(h % 12 || 12), H:g(h), i:g(a), s:g(l), u:o, e:"?", I:"?", O:(k > 0?"-":"+") + g(Math.floor(Math.abs(k) / 60) * 100 + Math.abs(k) % 60, 4), P:"?", T:(String(f).match(/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g) || [""]).pop().replace(/[^-+\dA-Z]/g, ""), Z:"?", c:"?", r:"?", U:Math.floor(f / 1E3)}; return d.replace(/\\.|[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g, - function(m){return m in t?t[m]:m.substring(1)})}}; c.fn.fmatter.defaultFormat = function(a, b){return isValue(a) && a !== ""?a:b.defaultValue?b.defaultValue:" "}; c.fn.fmatter.email = function(a, b){return isEmpty(a)?c.fn.fmatter.defaultFormat(a, b):'
' + a + ""}; c.fn.fmatter.checkbox = function(a, b){var d = c.extend({}, b.checkbox); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); b = d.disabled === true?"disabled":""; if (isEmpty(a) || isUndefined(a))a = c.fn.fmatter.defaultFormat(a, - d); a += ""; a = a.toLowerCase(); return'"}; c.fn.fmatter.link = function(a, b){var d = {target:b.target}, e = ""; isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (d.target)e = "target=" + d.target; return isEmpty(a)?c.fn.fmatter.defaultFormat(a, b):"' + a + ""}; c.fn.fmatter.showlink = function(a, b){var d = {baseLinkUrl:b.baseLinkUrl, showAction:b.showAction, - addParam:b.addParam || "", target:b.target, idName:b.idName}, e = ""; isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (d.target)e = "target=" + d.target; d = d.baseLinkUrl + d.showAction + "?" + d.idName + "=" + b.rowId + d.addParam; return isString(a)?"' + a + "":c.fn.fmatter.defaultFormat(a, b)}; c.fn.fmatter.integer = function(a, b){var d = c.extend({}, b.integer); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (isEmpty(a))return d.defaultValue; - return c.fmatter.util.NumberFormat(a, d)}; c.fn.fmatter.number = function(a, b){var d = c.extend({}, b.number); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (isEmpty(a))return d.defaultValue; return c.fmatter.util.NumberFormat(a, d)}; c.fn.fmatter.currency = function(a, b){var d = c.extend({}, b.currency); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); if (isEmpty(a))return d.defaultValue; return c.fmatter.util.NumberFormat(a, d)}; c.fn.fmatter.date = - function(a, b, d, e){d = c.extend({}, b.date); isUndefined(b.colModel.formatoptions) || (d = c.extend({}, d, b.colModel.formatoptions)); return!d.reformatAfterEdit && e == "edit"?c.fn.fmatter.defaultFormat(a, b):isEmpty(a)?c.fn.fmatter.defaultFormat(a, b):c.fmatter.util.DateFormat(d.srcformat, a, d.newformat, d)}; c.fn.fmatter.select = function(a, b){a += ""; var d = false, e = []; if (!isUndefined(b.colModel.editoptions))d = b.colModel.editoptions.value; if (d){var g = b.colModel.editoptions.multiple === true?true:false, h = [], f; if (g){h = a.split(","); - h = c.map(h, function(l){return c.trim(l)})}if (isString(d))for (var i = d.split(";"), k = 0, j = 0; j < i.length; j++){f = i[j].split(":"); if (f.length > 2)f[1] = jQuery.map(f, function(l, o){if (o > 0)return l}).join(":"); if (g){if (jQuery.inArray(f[0], h) > - 1){e[k] = f[1]; k++}} else if (c.trim(f[0]) == c.trim(a)){e[0] = f[1]; break}} else if (isObject(d))if (g)e = jQuery.map(h, function(l){return d[l]}); else e[0] = d[a] || ""}a = e.join(", "); return a == ""?c.fn.fmatter.defaultFormat(a, b):a}; c.fn.fmatter.rowactions = function(a, b, d, e){switch (d){case "edit":d = - function(){c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + b).show(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).hide()}; c("#" + b).jqGrid("editRow", a, e, null, null, null, {oper:"edit"}, d, null, d); c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + b).hide(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).show(); break; case "save":c("#" + b).jqGrid("saveRow", a, null, null); c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + - b).show(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).hide(); break; case "cancel":c("#" + b).jqGrid("restoreRow", a); c("tr#" + a + " div.ui-inline-edit, tr#" + a + " div.ui-inline-del", "#" + b).show(); c("tr#" + a + " div.ui-inline-save, tr#" + a + " div.ui-inline-cancel", "#" + b).hide(); break}}; c.fn.fmatter.actions = function(a, b){a = {keys:false, editbutton:true, delbutton:true}; isUndefined(b.colModel.formatoptions) || (a = c.extend(a, b.colModel.formatoptions)); var d = b.rowId, e = "", g; if (typeof d == "undefined" || - isEmpty(d))return""; if (a.editbutton){g = "onclick=$.fn.fmatter.rowactions('" + d + "','" + b.gid + "','edit'," + a.keys + ");"; e = e + "
"}if (a.delbutton){g = "onclick=jQuery('#" + b.gid + "').jqGrid('delGridRow','" + d + "');"; e = e + "
"}g = "onclick=$.fn.fmatter.rowactions('" + d + "','" + b.gid + "','save',false);"; e = e + ""; g = "onclick=$.fn.fmatter.rowactions('" + d + "','" + b.gid + "','cancel',false);"; return e = e + "
"}; c.unformat = function(a, b, d, e){var g, h = b.colModel.formatter, f = b.colModel.formatoptions || {}, i = /([\.\*\_\'\(\)\{\}\+\?\\])/g; unformatFunc = b.colModel.unformat || c.fn.fmatter[h] && c.fn.fmatter[h].unformat; if (typeof unformatFunc !== "undefined" && isFunction(unformatFunc))g = unformatFunc(c(a).text(), b, a); else if (typeof h !== "undefined" && isString(h)){g = c.jgrid.formatter || {}; switch (h){case "integer":f = c.extend({}, g.integer, f); b = f.thousandsSeparator.replace(i, "\\$1"); b = new RegExp(b, "g"); g = - c(a).text().replace(b, ""); break; case "number":f = c.extend({}, g.number, f); b = f.thousandsSeparator.replace(i, "\\$1"); b = new RegExp(b, "g"); g = c(a).text().replace(b, "").replace(f.decimalSeparator, "."); break; case "currency":f = c.extend({}, g.currency, f); b = f.thousandsSeparator.replace(i, "\\$1"); b = new RegExp(b, "g"); g = c(a).text().replace(b, "").replace(f.decimalSeparator, ".").replace(f.prefix, "").replace(f.suffix, ""); break; case "checkbox":f = b.colModel.editoptions?b.colModel.editoptions.value.split(":"):["Yes", "No"]; - g = c("input", a).attr("checked")?f[0]:f[1]; break; case "select":g = c.unformat.select(a, b, d, e); break; case "actions":return""; default:g = c(a).text()}}return g?g:e === true?c(a).text():c.jgrid.htmlDecode(c(a).html())}; c.unformat.select = function(a, b, d, e){d = []; a = c(a).text(); if (e === true)return a; b = c.extend({}, b.colModel.editoptions); if (b.value){var g = b.value; b = b.multiple === true?true:false; e = []; var h; if (b){e = a.split(","); e = c.map(e, function(j){return c.trim(j)})}if (isString(g))for (var f = g.split(";"), i = 0, k = 0; k < f.length; k++){h = - f[k].split(":"); if (b){if (jQuery.inArray(h[1], e) > - 1){d[i] = h[0]; i++}} else if (c.trim(h[1]) == c.trim(a)){d[0] = h[0]; break}} else if (isObject(g)){b || (e[0] = a); d = jQuery.map(e, function(j){var l; c.each(g, function(o, n){if (n == j){l = o; return false}}); if (l)return l})}return d.join(", ")} else return a || ""}; isValue = function(a){return isObject(a) || isString(a) || isNumber(a) || isBoolean(a)}; isBoolean = function(a){return typeof a === "boolean"}; isNull = function(a){return a === null}; isNumber = function(a){return typeof a === "number" && - isFinite(a)}; isString = function(a){return typeof a === "string"}; isEmpty = function(a){if (!isString(a) && isValue(a))return false; else if (!isValue(a))return true; a = c.trim(a).replace(/\ \;/ig, "").replace(/\ \;/ig, ""); return a === ""}; isUndefined = function(a){return typeof a === "undefined"}; isObject = function(a){return a && (typeof a === "object" || isFunction(a)) || false}; isFunction = function(a){return typeof a === "function"}})(jQuery); - (function(a){a.jgrid.extend({getColProp:function(g){var d = {}, b = this[0]; if (b.grid){b = b.p.colModel; for (var n = 0; n < b.length; n++)if (b[n].name == g){d = b[n]; break}return d}}, setColProp:function(g, d){return this.each(function(){if (this.grid)if (d)for (var b = this.p.colModel, n = 0; n < b.length; n++)if (b[n].name == g){a.extend(this.p.colModel[n], d); break}})}, sortGrid:function(g, d, b){return this.each(function(){var n = this, s = - 1; if (n.grid){if (!g)g = n.p.sortname; for (var q = 0; q < n.p.colModel.length; q++)if (n.p.colModel[q].index == - g || n.p.colModel[q].name == g){s = q; break}if (s != - 1){q = n.p.colModel[s].sortable; if (typeof q !== "boolean")q = true; if (typeof d !== "boolean")d = false; q && n.sortData("jqgh_" + g, s, d, b)}}})}, GridDestroy:function(){return this.each(function(){if (this.grid){this.p.pager && a(this.p.pager).remove(); var g = this.id; try{a("#gbox_" + g).remove()} catch (d){}}})}, GridUnload:function(){return this.each(function(){if (this.grid){var g = {id:a(this).attr("id"), cl:a(this).attr("class")}; this.p.pager && a(this.p.pager).empty().removeClass("ui-state-default ui-jqgrid-pager corner-bottom"); - var d = document.createElement("table"); a(d).attr({id:g.id}); d.className = g.cl; g = this.id; a(d).removeClass("ui-jqgrid-btable"); if (a(this.p.pager).parents("#gbox_" + g).length === 1){a(d).insertBefore("#gbox_" + g).show(); a(this.p.pager).insertBefore("#gbox_" + g)} else a(d).insertBefore("#gbox_" + g).show(); a("#gbox_" + g).remove()}})}, setGridState:function(g){return this.each(function(){if (this.grid){var d = this; if (g == "hidden"){a(".ui-jqgrid-bdiv, .ui-jqgrid-hdiv", "#gview_" + d.p.id).slideUp("fast"); d.p.pager && a(d.p.pager).slideUp("fast"); - d.p.toppager && a(d.p.toppager).slideUp("fast"); if (d.p.toolbar[0] === true){d.p.toolbar[1] == "both" && a(d.grid.ubDiv).slideUp("fast"); a(d.grid.uDiv).slideUp("fast")}d.p.footerrow && a(".ui-jqgrid-sdiv", "#gbox_" + d.p.id).slideUp("fast"); a(".ui-jqgrid-titlebar-close span", d.grid.cDiv).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s"); d.p.gridstate = "hidden"} else if (g == "visible"){a(".ui-jqgrid-hdiv, .ui-jqgrid-bdiv", "#gview_" + d.p.id).slideDown("fast"); d.p.pager && a(d.p.pager).slideDown("fast"); - d.p.toppager && a(d.p.toppager).slideDown("fast"); if (d.p.toolbar[0] === true){d.p.toolbar[1] == "both" && a(d.grid.ubDiv).slideDown("fast"); a(d.grid.uDiv).slideDown("fast")}d.p.footerrow && a(".ui-jqgrid-sdiv", "#gbox_" + d.p.id).slideDown("fast"); a(".ui-jqgrid-titlebar-close span", d.grid.cDiv).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n"); d.p.gridstate = "visible"}}})}, updateGridRows:function(g, d, b){var n, s = false, q; this.each(function(){var h = this, l, o, c, f; if (!h.grid)return false; - d || (d = "id"); g && g.length > 0 && a(g).each(function(){c = this; if (o = h.rows.namedItem(c[d])){f = c[d]; if (b === true)if (h.p.jsonReader.repeatitems === true){if (h.p.jsonReader.cell)c = c[h.p.jsonReader.cell]; for (var e = 0; e < c.length; e++){l = h.formatter(f, c[e], e, c, "edit"); q = h.p.colModel[e].title?{title:a.jgrid.stripHtml(l)}:{}; h.p.treeGrid === true && n == h.p.ExpandColumn?a("td:eq(" + e + ") > span:first", o).html(l).attr(q):a("td:eq(" + e + ")", o).html(l).attr(q)}return s = true}a(h.p.colModel).each(function(m){n = b === true?this.jsonmap || - this.name:this.name; if (c[n] !== undefined){l = h.formatter(f, c[n], m, c, "edit"); q = this.title?{title:a.jgrid.stripHtml(l)}:{}; h.p.treeGrid === true && n == h.p.ExpandColumn?a("td:eq(" + m + ") > span:first", o).html(l).attr(q):a("td:eq(" + m + ")", o).html(l).attr(q); s = true}})}})}); return s}, filterGrid:function(g, d){d = a.extend({gridModel:false, gridNames:false, gridToolbar:false, filterModel:[], formtype:"horizontal", autosearch:true, formclass:"filterform", tableclass:"filtertable", buttonclass:"filterbutton", searchButton:"Search", - clearButton:"Clear", enableSearch:false, enableClear:false, beforeSearch:null, afterSearch:null, beforeClear:null, afterClear:null, url:"", marksearched:true}, d || {}); return this.each(function(){var b = this; this.p = d; if (this.p.filterModel.length === 0 && this.p.gridModel === false)alert("No filter is set"); else if (g){this.p.gridid = g.indexOf("#") != - 1?g:"#" + g; var n = a(this.p.gridid).jqGrid("getGridParam", "colModel"); if (n){if (this.p.gridModel === true){var s = a(this.p.gridid)[0], q; a.each(n, function(f){var e = []; this.search = - this.search === false?false:true; q = this.editrules && this.editrules.searchhidden === true?true:this.hidden === true?false:true; if (this.search === true && q === true){e.label = b.p.gridNames === true?s.p.colNames[f]:""; e.name = this.name; e.index = this.index || this.name; e.stype = this.edittype || "text"; if (e.stype != "select")e.stype = "text"; e.defval = this.defval || ""; e.surl = this.surl || ""; e.sopt = this.editoptions || {}; e.width = this.width; b.p.filterModel.push(e)}})} else a.each(b.p.filterModel, function(){for (var f = 0; f < n.length; f++)if (this.name == - n[f].name){this.index = n[f].index || this.name; break}if (!this.index)this.index = this.name}); var h = function(){var f = {}, e = 0, m, i = a(b.p.gridid)[0], k; i.p.searchdata = {}; a.isFunction(b.p.beforeSearch) && b.p.beforeSearch(); a.each(b.p.filterModel, function(){k = this.index; switch (this.stype){case "select":if (m = a("select[name=" + k + "]", b).val()){f[k] = m; b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).addClass("dirty-cell"); e++} else{b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).removeClass("dirty-cell"); try{delete i.p.postData[this.index]} catch (r){}}break; - default:if (m = a("input[name=" + k + "]", b).val()){f[k] = m; b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).addClass("dirty-cell"); e++} else{b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).removeClass("dirty-cell"); try{delete i.p.postData[this.index]} catch (u){}}}}); var p = e > 0?true:false; a.extend(i.p.postData, f); var j; if (b.p.url){j = a(i).jqGrid("getGridParam", "url"); a(i).jqGrid("setGridParam", {url:b.p.url})}a(i).jqGrid("setGridParam", {search:p}).trigger("reloadGrid", [{page:1}]); j && a(i).jqGrid("setGridParam", - {url:j}); a.isFunction(b.p.afterSearch) && b.p.afterSearch()}, l = function(){var f = {}, e, m = 0, i = a(b.p.gridid)[0], k; a.isFunction(b.p.beforeClear) && b.p.beforeClear(); a.each(b.p.filterModel, function(){k = this.index; e = this.defval?this.defval:""; if (!this.stype)this.stype = "text"; switch (this.stype){case "select":var r; a("select[name=" + k + "] option", b).each(function(v){if (v === 0)this.selected = true; if (a(this).text() == e){this.selected = true; r = a(this).val(); return false}}); if (r){f[k] = r; b.p.marksearched && a("#jqgh_" + this.name, - i.grid.hDiv).addClass("dirty-cell"); m++} else{b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).removeClass("dirty-cell"); try{delete i.p.postData[this.index]} catch (u){}}break; case "text":a("input[name=" + k + "]", b).val(e); if (e){f[k] = e; b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).addClass("dirty-cell"); m++} else{b.p.marksearched && a("#jqgh_" + this.name, i.grid.hDiv).removeClass("dirty-cell"); try{delete i.p.postData[this.index]} catch (t){}}break}}); var p = m > 0?true:false; a.extend(i.p.postData, f); var j; - if (b.p.url){j = a(i).jqGrid("getGridParam", "url"); a(i).jqGrid("setGridParam", {url:b.p.url})}a(i).jqGrid("setGridParam", {search:p}).trigger("reloadGrid", [{page:1}]); j && a(i).jqGrid("setGridParam", {url:j}); a.isFunction(b.p.afterClear) && b.p.afterClear()}, o = a("
"), c = a("
"); a(o).append(c); (function(){var f = document.createElement("tr"), - e, m, i, k; b.p.formtype == "horizontal" && a(c).append(f); a.each(b.p.filterModel, function(p){i = document.createElement("td"); a(i).append(""); k = document.createElement("td"); var j = this; if (!this.stype)this.stype = "text"; switch (this.stype){case "select":if (this.surl)a(k).load(this.surl, function(){j.defval && a("select", this).val(j.defval); a("select", this).attr({name:j.index || j.name, id:"sg_" + j.name}); j.sopt && a("select", this).attr(j.sopt); b.p.gridToolbar === true && j.width && - a("select", this).width(j.width); b.p.autosearch === true && a("select", this).change(function(){h(); return false})}); else if (j.sopt.value){var r = j.sopt.value, u = document.createElement("select"); a(u).attr({name:j.index || j.name, id:"sg_" + j.name}).attr(j.sopt); var t; if (typeof r === "string"){p = r.split(";"); for (var v = 0; v < p.length; v++){r = p[v].split(":"); t = document.createElement("option"); t.value = r[0]; t.innerHTML = r[1]; if (r[1] == j.defval)t.selected = "selected"; u.appendChild(t)}} else if (typeof r === "object")for (v in r)if (r.hasOwnProperty(v)){p++; - t = document.createElement("option"); t.value = v; t.innerHTML = r[v]; if (r[v] == j.defval)t.selected = "selected"; u.appendChild(t)}b.p.gridToolbar === true && j.width && a(u).width(j.width); a(k).append(u); b.p.autosearch === true && a(u).change(function(){h(); return false})}break; case "text":u = this.defval?this.defval:""; a(k).append(""); j.sopt && a("input", k).attr(j.sopt); if (b.p.gridToolbar === true && j.width)a.browser.msie?a("input", k).width(j.width - - 4):a("input", k).width(j.width - 2); b.p.autosearch === true && a("input", k).keypress(function(w){if ((w.charCode?w.charCode:w.keyCode?w.keyCode:0) == 13){h(); return false}return this}); break}if (b.p.formtype == "horizontal"){b.p.gridToolbar === true && b.p.gridNames === false?a(f).append(k):a(f).append(i).append(k); a(f).append(k)} else{e = document.createElement("tr"); a(e).append(i).append(k); a(c).append(e)}}); k = document.createElement("td"); if (b.p.enableSearch === true){m = ""; a(k).append(m); a("input#sButton", k).click(function(){h(); return false})}if (b.p.enableClear === true){m = ""; a(k).append(m); a("input#cButton", k).click(function(){l(); return false})}if (b.p.enableClear === true || b.p.enableSearch === true)if (b.p.formtype == "horizontal")a(f).append(k); else{e = document.createElement("tr"); a(e).append(" ").append(k); a(c).append(e)}})(); a(this).append(o); - this.triggerSearch = h; this.clearSearch = l} else alert("Could not get grid colModel")} else alert("No target grid is set!")})}, filterToolbar:function(g){g = a.extend({autosearch:true, searchOnEnter:true, beforeSearch:null, afterSearch:null, beforeClear:null, afterClear:null, searchurl:"", stringResult:false, groupOp:"AND"}, g || {}); return this.each(function(){function d(h, l){var o = a(h); o[0] && jQuery.each(l, function(){this.data !== undefined?o.bind(this.type, this.data, this.fn):o.bind(this.type, this.fn)})}var b = this, n = - function(){var h = {}, l = 0, o, c, f = {}; a.each(b.p.colModel, function(){c = this.index || this.name; var j = this.searchoptions && this.searchoptions.sopt?this.searchoptions.sopt[0]:"bw"; switch (this.stype){case "select":if (o = a("select[name=" + c + "]", b.grid.hDiv).val()){h[c] = o; f[c] = j; l++} else try{delete b.p.postData[c]} catch (r){}break; case "text":if (o = a("input[name=" + c + "]", b.grid.hDiv).val()){h[c] = o; f[c] = j; l++} else try{delete b.p.postData[c]} catch (u){}break}}); var e = l > 0?true:false; if (g.stringResult){var m = '{"groupOp":"' + - g.groupOp + '","rules":[', i = 0; a.each(h, function(j, r){if (i > 0)m += ","; m += '{"field":"' + j + '",'; m += '"op":"' + f[j] + '",'; m += '"data":"' + r + '"}'; i++}); m += "]}"; a.extend(b.p.postData, {filters:m})} else a.extend(b.p.postData, h); var k; if (b.p.searchurl){k = b.p.url; a(b).jqGrid("setGridParam", {url:b.p.searchurl})}var p = false; if (a.isFunction(g.beforeSearch))p = g.beforeSearch.call(b); p || a(b).jqGrid("setGridParam", {search:e}).trigger("reloadGrid", [{page:1}]); k && a(b).jqGrid("setGridParam", {url:k}); a.isFunction(g.afterSearch) && - g.afterSearch()}, s = a(""), q; a.each(b.p.colModel, function(){var h = this, l, o, c, f; o = a(""); l = a("
"); this.hidden === true && a(o).css("display", "none"); this.search = this.search === false?false:true; if (typeof this.stype == "undefined")this.stype = "text"; c = a.extend({}, this.searchoptions || {}); if (this.search)switch (this.stype){case "select":if (f = - this.surl || c.dataUrl)a.ajax(a.extend({url:f, dataType:"html", complete:function(p){if (c.buildSelect !== undefined)(p = c.buildSelect(p)) && a(l).append(p); else a(l).append(p.responseText); c.defaultValue && a("select", l).val(c.defaultValue); a("select", l).attr({name:h.index || h.name, id:"gs_" + h.name}); c.attr && a("select", l).attr(c.attr); a("select", l).css({width:"100%"}); c.dataInit !== undefined && c.dataInit(a("select", l)[0]); c.dataEvents !== undefined && d(a("select", l)[0], c.dataEvents); g.autosearch === true && a("select", - l).change(function(){n(); return false}); p = null}}, a.jgrid.ajaxOptions, b.p.ajaxSelectOptions || {})); else{var e; if (h.searchoptions && h.searchoptions.value)e = h.searchoptions.value; else if (h.editoptions && h.editoptions.value)e = h.editoptions.value; if (e){f = document.createElement("select"); f.style.width = "100%"; a(f).attr({name:h.index || h.name, id:"gs_" + h.name}); var m, i; if (typeof e === "string"){e = e.split(";"); for (var k = 0; k < e.length; k++){m = e[k].split(":"); i = document.createElement("option"); i.value = m[0]; i.innerHTML = - m[1]; f.appendChild(i)}} else if (typeof e === "object")for (m in e)if (e.hasOwnProperty(m)){i = document.createElement("option"); i.value = m; i.innerHTML = e[m]; f.appendChild(i)}c.defaultValue && a(f).val(c.defaultValue); c.attr && a(f).attr(c.attr); c.dataInit !== undefined && c.dataInit(f); c.dataEvents !== undefined && d(f, c.dataEvents); a(l).append(f); g.autosearch === true && a(f).change(function(){n(); return false})}}break; case "text":f = c.defaultValue?c.defaultValue:""; a(l).append(""); c.attr && a("input", l).attr(c.attr); c.dataInit !== undefined && c.dataInit(a("input", l)[0]); c.dataEvents !== undefined && d(a("input", l)[0], c.dataEvents); if (g.autosearch === true)g.searchOnEnter?a("input", l).keypress(function(p){if ((p.charCode?p.charCode:p.keyCode?p.keyCode:0) == 13){n(); return false}return this}):a("input", l).keydown(function(p){switch (p.which){case 9:case 16:case 37:case 38:case 39:case 40:case 27:break; default:q && clearTimeout(q); q = setTimeout(function(){n()}, - 500)}}); break}a(o).append(l); a(s).append(o)}); a("table thead", b.grid.hDiv).append(s); this.triggerToolbar = n; this.clearToolbar = function(h){var l = {}, o, c = 0, f; h = typeof h != "boolean"?true:h; a.each(b.p.colModel, function(){o = this.searchoptions && this.searchoptions.defaultValue?this.searchoptions.defaultValue:""; f = this.index || this.name; switch (this.stype){case "select":var j; a("select[name=" + f + "] option", b.grid.hDiv).each(function(t){if (t === 0)this.selected = true; if (a(this).text() == o){this.selected = true; j = a(this).val(); - return false}}); if (j){l[f] = j; c++} else try{delete b.p.postData[f]} catch (r){}break; case "text":a("input[name=" + f + "]", b.grid.hDiv).val(o); if (o){l[f] = o; c++} else try{delete b.p.postData[f]} catch (u){}break}}); var e = c > 0?true:false; if (g.stringResult){var m = '{"groupOp":"' + g.groupOp + '","rules":[', i = 0; a.each(l, function(j, r){if (i > 0)m += ","; m += '{"field":"' + j + '",'; m += '"op":"eq",'; m += '"data":"' + r + '"}'; i++}); m += "]}"; a.extend(b.p.postData, {filters:m})} else a.extend(b.p.postData, l); var k; if (b.p.searchurl){k = b.p.url; - a(b).jqGrid("setGridParam", {url:b.p.searchurl})}var p = false; if (a.isFunction(g.beforeClear))p = g.beforeClear.call(b); p || h && a(b).jqGrid("setGridParam", {search:e}).trigger("reloadGrid", [{page:1}]); k && a(b).jqGrid("setGridParam", {url:k}); a.isFunction(g.afterClear) && g.afterClear()}; this.toggleToolbar = function(){var h = a("tr.ui-search-toolbar", b.grid.hDiv); h.css("display") == "none"?h.show():h.hide()}})}})})(jQuery); - var showModal = function(a){a.w.show()}, closeModal = function(a){a.w.hide().attr("aria-hidden", "true"); a.o && a.o.remove()}, hideModal = function(a, b){b = jQuery.extend({jqm:true, gb:""}, b || {}); if (b.onClose){var c = b.onClose(a); if (typeof c == "boolean" && !c)return}if (jQuery.fn.jqm && b.jqm === true)jQuery(a).attr("aria-hidden", "true").jqmHide(); else{if (b.gb != "")try{jQuery(".jqgrid-overlay:first", b.gb).hide()} catch (e){}jQuery(a).hide().attr("aria-hidden", "true")}}; - function findPos(a){var b = 0, c = 0; if (a.offsetParent){do{b += a.offsetLeft; c += a.offsetTop}while (a = a.offsetParent)}return[b, c]} -var createModal = function(a, b, c, e, f, h){var d = document.createElement("div"), g; g = jQuery(c.gbox).attr("dir") == "rtl"?true:false; d.className = "ui-widget ui-widget-content ui-corner-all ui-jqdialog"; d.id = a.themodal; var i = document.createElement("div"); i.className = "ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"; i.id = a.modalhead; jQuery(i).append("" + c.caption + ""); var j = jQuery("").hover(function(){j.addClass("ui-state-hover")}, - function(){j.removeClass("ui-state-hover")}).append(""); jQuery(i).append(j); if (g){d.dir = "rtl"; jQuery(".ui-jqdialog-title", i).css("float", "right"); jQuery(".ui-jqdialog-titlebar-close", i).css("left", "0.3em")} else{d.dir = "ltr"; jQuery(".ui-jqdialog-title", i).css("float", "left"); jQuery(".ui-jqdialog-titlebar-close", i).css("right", "0.3em")}var l = document.createElement("div"); jQuery(l).addClass("ui-jqdialog-content ui-widget-content").attr("id", a.modalcontent); - jQuery(l).append(b); d.appendChild(l); jQuery(d).prepend(i); h === true?jQuery("body").append(d):jQuery(d).insertBefore(e); if (typeof c.jqModal === "undefined")c.jqModal = true; b = {}; if (jQuery.fn.jqm && c.jqModal === true){if (c.left === 0 && c.top === 0){e = []; e = findPos(f); c.left = e[0] + 4; c.top = e[1] + 4}b.top = c.top + "px"; b.left = c.left} else if (c.left !== 0 || c.top !== 0){b.left = c.left; b.top = c.top + "px"}jQuery("a.ui-jqdialog-titlebar-close", i).click(function(){var n = jQuery("#" + a.themodal).data("onClose") || c.onClose, k = jQuery("#" + a.themodal).data("gbox") || - c.gbox; hideModal("#" + a.themodal, {gb:k, jqm:c.jqModal, onClose:n}); return false}); if (c.width === 0 || !c.width)c.width = 300; if (c.height === 0 || !c.height)c.height = 200; if (!c.zIndex)c.zIndex = 950; f = 0; if (g && b.left && !h){f = jQuery(c.gbox).width() - (!isNaN(c.width)?parseInt(c.width, 10):0) - 8; b.left = parseInt(b.left, 10) + parseInt(f, 10)}if (b.left)b.left += "px"; jQuery(d).css(jQuery.extend({width:isNaN(c.width)?"auto":c.width + "px", height:isNaN(c.height)?"auto":c.height + "px", zIndex:c.zIndex, overflow:"hidden"}, b)).attr({tabIndex:"-1", - role:"dialog", "aria-labelledby":a.modalhead, "aria-hidden":"true"}); if (typeof c.drag == "undefined")c.drag = true; if (typeof c.resize == "undefined")c.resize = true; if (c.drag){jQuery(i).css("cursor", "move"); if (jQuery.fn.jqDrag)jQuery(d).jqDrag(i); else try{jQuery(d).draggable({handle:jQuery("#" + i.id)})} catch (q){}}if (c.resize)if (jQuery.fn.jqResize){jQuery(d).append("
"); jQuery("#" + a.themodal).jqResize(".jqResize", - a.scrollelm?"#" + a.scrollelm:false)} else try{jQuery(d).resizable({handles:"se, sw", alsoResize:a.scrollelm?"#" + a.scrollelm:false})} catch (o){}c.closeOnEscape === true && jQuery(d).keydown(function(n){if (n.which == 27){n = jQuery("#" + a.themodal).data("onClose") || c.onClose; hideModal(this, {gb:c.gbox, jqm:c.jqModal, onClose:n})}})}, viewModal = function(a, b){b = jQuery.extend({toTop:true, overlay:10, modal:false, onShow:showModal, onHide:closeModal, gbox:"", jqm:true, jqM:true}, b || {}); if (jQuery.fn.jqm && b.jqm === true)b.jqM?jQuery(a).attr("aria-hidden", - "false").jqm(b).jqmShow():jQuery(a).attr("aria-hidden", "false").jqmShow(); else{if (b.gbox != ""){jQuery(".jqgrid-overlay:first", b.gbox).show(); jQuery(a).data("gbox", b.gbox)}jQuery(a).show().attr("aria-hidden", "false"); try{jQuery(":input:visible", a)[0].focus()} catch (c){}}}; - function info_dialog(a, b, c, e){var f = {width:290, height:"auto", dataheight:"auto", drag:true, resize:false, caption:"" + a + "", left:250, top:170, zIndex:1E3, jqModal:true, modal:false, closeOnEscape:true, align:"center", buttonalign:"center", buttons:[]}; jQuery.extend(f, e || {}); var h = f.jqModal; if (jQuery.fn.jqm && !h)h = false; a = ""; if (f.buttons.length > 0)for (e = 0; e < f.buttons.length; e++){if (typeof f.buttons[e].id == "undefined")f.buttons[e].id = "info_button_" + e; a += "" + - f.buttons[e].text + ""}e = isNaN(f.dataheight)?f.dataheight:f.dataheight + "px"; var d = "
"; d += "
" + b + "
"; d += c?"
" + - c + "" + a + "
":a != ""?"
" + a + "
":""; d += "
"; try{jQuery("#info_dialog").attr("aria-hidden") == "false" && hideModal("#info_dialog", {jqm:h}); jQuery("#info_dialog").remove()} catch (g){}createModal({themodal:"info_dialog", modalhead:"info_head", modalcontent:"info_content", scrollelm:"infocnt"}, d, f, "", "", true); a && jQuery.each(f.buttons, - function(j){jQuery("#" + this.id, "#info_id").bind("click", function(){f.buttons[j].onClick.call(jQuery("#info_dialog")); return false})}); jQuery("#closedialog", "#info_id").click(function(j){hideModal("#info_dialog", {jqm:h}); return false}); jQuery(".fm-button", "#info_dialog").hover(function(){jQuery(this).addClass("ui-state-hover")}, function(){jQuery(this).removeClass("ui-state-hover")}); viewModal("#info_dialog", {onHide:function(j){j.w.hide().remove(); j.o && j.o.remove()}, modal:f.modal, jqm:h}); try{$("#info_dialog").focus()} catch (i){}} -function createEl(a, b, c, e, f){function h(k, m){if (jQuery.isFunction(m.dataInit)){k.id = m.id; m.dataInit(k); delete m.id; delete m.dataInit}if (m.dataEvents){jQuery.each(m.dataEvents, function(){this.data !== undefined?jQuery(k).bind(this.type, this.data, this.fn):jQuery(k).bind(this.type, this.fn)}); delete m.dataEvents}return m}var d = ""; b.defaultValue && delete b.defaultValue; switch (a){case "textarea":d = document.createElement("textarea"); if (e)b.cols || jQuery(d).css({width:"98%"}); else if (!b.cols)b.cols = 20; if (!b.rows)b.rows = - 2; if (c == " " || c == " " || c.length == 1 && c.charCodeAt(0) == 160)c = ""; d.value = c; b = h(d, b); jQuery(d).attr(b).attr({role:"textbox", multiline:"true"}); break; case "checkbox":d = document.createElement("input"); d.type = "checkbox"; if (b.value){var g = b.value.split(":"); if (c === g[0]){d.checked = true; d.defaultChecked = true}d.value = g[0]; jQuery(d).attr("offval", g[1]); try{delete b.value} catch (i){}} else{g = c.toLowerCase(); if (g.search(/(false|0|no|off|undefined)/i) < 0 && g !== ""){d.checked = true; d.defaultChecked = true; d.value = -c} else d.value = "on"; jQuery(d).attr("offval", "off")}b = h(d, b); jQuery(d).attr(b).attr("role", "checkbox"); break; case "select":d = document.createElement("select"); d.setAttribute("role", "select"); var j, l = []; if (b.multiple === true){j = true; d.multiple = "multiple"; $(d).attr("aria-multiselectable", "true")} else j = false; if (typeof b.dataUrl != "undefined")jQuery.ajax(jQuery.extend({url:b.dataUrl, type:"GET", complete:function(k, m){try{delete b.dataUrl; delete b.value} catch (r){}if (typeof b.buildSelect != "undefined"){k = b.buildSelect(k); - k = jQuery(k).html(); delete b.buildSelect} else k = jQuery(k.responseText).html(); if (k){jQuery(d).append(k); b = h(d, b); if (typeof b.size === "undefined")b.size = j?3:1; if (j){l = c.split(","); l = jQuery.map(l, function(p){return jQuery.trim(p)})} else l[0] = jQuery.trim(c); jQuery(d).attr(b); setTimeout(function(){jQuery("option", d).each(function(p){if (p === 0)this.selected = ""; $(this).attr("role", "option"); if (jQuery.inArray(jQuery.trim(jQuery(this).text()), l) > - 1 || jQuery.inArray(jQuery.trim(jQuery(this).val()), l) > - 1){this.selected = - "selected"; if (!j)return false}})}, 0)}}}, f || {})); else if (b.value){if (j){l = c.split(","); l = jQuery.map(l, function(k){return jQuery.trim(k)}); if (typeof b.size === "undefined")b.size = 3} else b.size = 1; if (typeof b.value === "function")b.value = b.value(); if (typeof b.value === "string"){e = b.value.split(";"); for (g = 0; g < e.length; g++){f = e[g].split(":"); if (f.length > 2)f[1] = jQuery.map(f, function(k, m){if (m > 0)return k}).join(":"); a = document.createElement("option"); a.setAttribute("role", "option"); a.value = f[0]; a.innerHTML = f[1]; - if (!j && (jQuery.trim(f[0]) == jQuery.trim(c) || jQuery.trim(f[1]) == jQuery.trim(c)))a.selected = "selected"; if (j && (jQuery.inArray(jQuery.trim(f[1]), l) > - 1 || jQuery.inArray(jQuery.trim(f[0]), l) > - 1))a.selected = "selected"; d.appendChild(a)}} else if (typeof b.value === "object"){e = b.value; for (g in e)if (e.hasOwnProperty(g)){a = document.createElement("option"); a.setAttribute("role", "option"); a.value = g; a.innerHTML = e[g]; if (!j && (jQuery.trim(g) == jQuery.trim(c) || jQuery.trim(e[g]) == jQuery.trim(c)))a.selected = "selected"; if (j && - (jQuery.inArray(jQuery.trim(e[g]), l) > - 1 || jQuery.inArray(jQuery.trim(g), l) > - 1))a.selected = "selected"; d.appendChild(a)}}b = h(d, b); try{delete b.value} catch (q){}jQuery(d).attr(b)}break; case "text":case "password":case "button":g = a == "button"?"button":"textbox"; d = document.createElement("input"); d.type = a; d.value = c; b = h(d, b); if (a != "button")if (e)b.size || jQuery(d).css({width:"98%"}); else if (!b.size)b.size = 20; jQuery(d).attr(b).attr("role", g); break; case "image":case "file":d = document.createElement("input"); d.type = - a; b = h(d, b); jQuery(d).attr(b); break; case "custom":d = document.createElement("span"); try{if (jQuery.isFunction(b.custom_element)){var o = b.custom_element.call(this, c, b); if (o){o = jQuery(o).addClass("customelement").attr({id:b.id, name:b.name}); jQuery(d).empty().append(o)} else throw"e2"; } else throw"e1"; } catch (n){n == "e1" && info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_element' " + jQuery.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose); n == "e2"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_element' " + - jQuery.jgrid.edit.msg.novalue, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, n.message, jQuery.jgrid.edit.bClose)}break}return d}function daysInFebruary(a){return a % 4 === 0 && (a % 100 !== 0 || a % 400 === 0)?29:28}function DaysArray(a){for (var b = 1; b <= a; b++){this[b] = 31; if (b == 4 || b == 6 || b == 9 || b == 11)this[b] = 30; if (b == 2)this[b] = 29}return this} -function checkDate(a, b){var c = {}, e; a = a.toLowerCase(); e = a.indexOf("/") != - 1?"/":a.indexOf("-") != - 1?"-":a.indexOf(".") != - 1?".":"/"; a = a.split(e); b = b.split(e); if (b.length != 3)return false; e = - 1; for (var f, h = - 1, d = - 1, g = 0; g < a.length; g++){f = isNaN(b[g])?0:parseInt(b[g], 10); c[a[g]] = f; f = a[g]; if (f.indexOf("y") != - 1)e = g; if (f.indexOf("m") != - 1)d = g; if (f.indexOf("d") != - 1)h = g}f = a[e] == "y" || a[e] == "yyyy"?4:a[e] == "yy"?2: - 1; g = DaysArray(12); var i; if (e === - 1)return false; else{i = c[a[e]].toString(); if (f == 2 && i.length == 1)f = 1; if (i.length != - f || c[a[e]] === 0 && b[e] != "00")return false}if (d === - 1)return false; else{i = c[a[d]].toString(); if (i.length < 1 || c[a[d]] < 1 || c[a[d]] > 12)return false}if (h === - 1)return false; else{i = c[a[h]].toString(); if (i.length < 1 || c[a[h]] < 1 || c[a[h]] > 31 || c[a[d]] == 2 && c[a[h]] > daysInFebruary(c[a[e]]) || c[a[h]] > g[c[a[d]]])return false}return true}function isEmpty(a){return a.match(/^s+$/) || a == ""?true:false} -function checkTime(a){var b = /^(\d{1,2}):(\d{2})([ap]m)?$/; if (!isEmpty(a))if (a = a.match(b)){if (a[3]){if (a[1] < 1 || a[1] > 12)return false} else if (a[1] > 23)return false; if (a[2] > 59)return false} else return false; return true} -function checkValues(a, b, c){var e, f, h; if (typeof b == "string"){f = 0; for (len = c.p.colModel.length; f < len; f++)if (c.p.colModel[f].name == b){e = c.p.colModel[f].editrules; b = f; try{h = c.p.colModel[f].formoptions.label} catch (d){}break}} else if (b >= 0)e = c.p.colModel[b].editrules; if (e){h || (h = c.p.colNames[b]); if (e.required === true)if (a.match(/^s+$/) || a == "")return[false, h + ": " + jQuery.jgrid.edit.msg.required, ""]; f = e.required === false?false:true; if (e.number === true)if (!(f === false && isEmpty(a)))if (isNaN(a))return[false, h + ": " + - jQuery.jgrid.edit.msg.number, ""]; if (typeof e.minValue != "undefined" && !isNaN(e.minValue))if (parseFloat(a) < parseFloat(e.minValue))return[false, h + ": " + jQuery.jgrid.edit.msg.minValue + " " + e.minValue, ""]; if (typeof e.maxValue != "undefined" && !isNaN(e.maxValue))if (parseFloat(a) > parseFloat(e.maxValue))return[false, h + ": " + jQuery.jgrid.edit.msg.maxValue + " " + e.maxValue, ""]; var g; if (e.email === true)if (!(f === false && isEmpty(a))){g = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i; - if (!g.test(a))return[false, h + ": " + jQuery.jgrid.edit.msg.email, ""]}if (e.integer === true)if (!(f === false && isEmpty(a))){if (isNaN(a))return[false, h + ": " + jQuery.jgrid.edit.msg.integer, ""]; if (a % 1 !== 0 || a.indexOf(".") != - 1)return[false, h + ": " + jQuery.jgrid.edit.msg.integer, ""]}if (e.date === true)if (!(f === false && isEmpty(a))){b = c.p.colModel[b].datefmt || "Y-m-d"; if (!checkDate(b, a))return[false, h + ": " + jQuery.jgrid.edit.msg.date + " - " + b, ""]}if (e.time === true)if (!(f === false && isEmpty(a)))if (!checkTime(a))return[false, h + - ": " + jQuery.jgrid.edit.msg.date + " - hh:mm (am/pm)", ""]; if (e.url === true)if (!(f === false && isEmpty(a))){g = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i; if (!g.test(a))return[false, h + ": " + jQuery.jgrid.edit.msg.url, ""]}if (e.custom === true)if (!(f === false && isEmpty(a)))if (jQuery.isFunction(e.custom_func)){a = e.custom_func.call(c, a, h); return jQuery.isArray(a)?a:[false, jQuery.jgrid.edit.msg.customarray, ""]} else return[false, jQuery.jgrid.edit.msg.customfcheck, - ""]}return[true, "", ""]}; - (function(a){var c = null; a.jgrid.extend({searchGrid:function(d){d = a.extend({recreateFilter:false, drag:true, sField:"searchField", sValue:"searchString", sOper:"searchOper", sFilter:"filters", loadDefaults:true, beforeShowSearch:null, afterShowSearch:null, onInitializeSearch:null, closeAfterSearch:false, closeAfterReset:false, closeOnEscape:false, multipleSearch:false, cloneSearchRowOnAdd:true, sopt:null, stringResult:undefined, onClose:null, useDataProxy:false, overlay:true}, a.jgrid.search, d || {}); return this.each(function(){function b(o, - s){s = o.p.postData[s.sFilter]; if (typeof s == "string")s = a.jgrid.parse(s); if (s){s.groupOp && o.SearchFilter.setGroupOp(s.groupOp); if (s.rules){var y, J = 0, k = s.rules.length; for (y = false; J < k; J++){y = s.rules[J]; if (y.field !== undefined && y.op !== undefined && y.data !== undefined)(y = o.SearchFilter.setFilter({sfref:o.SearchFilter.$.find(".sf:last"), filter:a.extend({}, y)})) && o.SearchFilter.add()}}}}function q(o){var s = o !== undefined, y = a("#" + z.p.id), J = {}; if (d.multipleSearch === false){J[d.sField] = o.rules[0].field; J[d.sValue] = - o.rules[0].data; J[d.sOper] = o.rules[0].op} else J[d.sFilter] = o; y[0].p.search = s; a.extend(y[0].p.postData, J); y.trigger("reloadGrid", [{page:1}]); d.closeAfterSearch && t(a("#" + h))}function D(o){o = o !== undefined; var s = a("#" + z.p.id), y = []; s[0].p.search = o; if (d.multipleSearch === false)y[d.sField] = y[d.sValue] = y[d.sOper] = ""; else y[d.sFilter] = ""; a.extend(s[0].p.postData, y); s.trigger("reloadGrid", [{page:1}]); d.closeAfterReset && t(a("#" + h))}function t(o){if (d.onClose){var s = d.onClose(o); if (typeof s == "boolean" && !s)return}o.hide(); - d.overlay === true && a(".jqgrid-overlay:first", "#gbox_" + z.p.id).hide()}function F(){var o = a(".ui-searchFilter").length; if (o > 1){var s = a("#" + h).css("zIndex"); a("#" + h).css({zIndex:parseInt(s, 10) + o})}a("#" + h).show(); d.overlay === true && a(".jqgrid-overlay:first", "#gbox_" + z.p.id).show(); try{a(":input:visible", "#" + h)[0].focus()} catch (y){}}var z = this; if (z.grid)if (a.fn.searchFilter){var h = "fbox_" + z.p.id; d.recreateFilter === true && a("#" + h).remove(); if (a("#" + h).html() != null){a.isFunction(d.beforeShowSearch) && d.beforeShowSearch(a("#" + - h)); F(); a.isFunction(d.afterShowSearch) && d.afterShowSearch(a("#" + h))} else{var p = [], H = a("#" + z.p.id).jqGrid("getGridParam", "colNames"), f = a("#" + z.p.id).jqGrid("getGridParam", "colModel"), l = ["eq", "ne", "lt", "le", "gt", "ge", "bw", "bn", "in", "ni", "ew", "en", "cn", "nc"], e, j, m, u = []; if (d.sopt !== null)for (e = m = 0; e < d.sopt.length; e++){if ((j = a.inArray(d.sopt[e], l)) != - 1){u[m] = {op:d.sopt[e], text:d.odata[j]}; m++}} else for (e = 0; e < l.length; e++)u[e] = {op:l[e], text:d.odata[e]}; a.each(f, function(o, s){var y = typeof s.search === "undefined"? - true:s.search, J = s.hidden === true; o = a.extend({}, {text:H[o], itemval:s.index || s.name}, this.searchoptions); s = o.searchhidden === true; if (typeof o.sopt !== "undefined"){m = 0; o.ops = []; if (o.sopt.length > 0)for (e = 0; e < o.sopt.length; e++)if ((j = a.inArray(o.sopt[e], l)) != - 1){o.ops[m] = {op:o.sopt[e], text:d.odata[j]}; m++}}if (typeof this.stype === "undefined")this.stype = "text"; if (this.stype == "select")if (o.dataUrl === undefined){var k; if (o.value)k = o.value; else if (this.editoptions)k = this.editoptions.value; if (k){o.dataValues = []; if (typeof k === - "string"){k = k.split(";"); var i; for (e = 0; e < k.length; e++){i = k[e].split(":"); o.dataValues[e] = {value:i[0], text:i[1]}}} else if (typeof k === "object"){e = 0; for (i in k)if (k.hasOwnProperty(i)){o.dataValues[e] = {value:i, text:k[i]}; e++}}}}if (s && y || y && !J)p.push(o)}); if (p.length > 0){a("").insertBefore("#gview_" + z.p.id); if (d.stringResult === undefined)d.stringResult = d.multipleSearch; z.SearchFilter = a("#" + h).searchFilter(p, {groupOps:d.groupOps, operators:u, onClose:t, resetText:d.Reset, - searchText:d.Find, windowTitle:d.caption, rulesText:d.rulesText, matchText:d.matchText, onSearch:q, onReset:D, stringResult:d.stringResult, ajaxSelectOptions:a.extend({}, a.jgrid.ajaxOptions, z.p.ajaxSelectOptions || {}), clone:d.cloneSearchRowOnAdd}); a(".ui-widget-overlay", "#" + h).remove(); z.p.direction == "rtl" && a(".ui-closer", "#" + h).css("float", "left"); if (d.drag === true){a("#" + h + " table thead tr:first td:first").css("cursor", "move"); if (jQuery.fn.jqDrag)a("#" + h).jqDrag(a("#" + h + " table thead tr:first td:first")); - else try{a("#" + h).draggable({handle:a("#" + h + " table thead tr:first td:first")})} catch (Q){}}if (d.multipleSearch === false){a(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText", "#" + h).hide(); a("select[name='groupOp']", "#" + h).hide()}d.multipleSearch === true && d.loadDefaults === true && b(z, d); a.isFunction(d.onInitializeSearch) && d.onInitializeSearch(a("#" + h)); a.isFunction(d.beforeShowSearch) && d.beforeShowSearch(a("#" + h)); F(); a.isFunction(d.afterShowSearch) && d.afterShowSearch(a("#" + h)); d.closeOnEscape === - true && a("#" + h).keydown(function(o){o.which == 27 && t(a("#" + h))})}}}})}, editGridRow:function(d, b){c = b = a.extend({top:0, left:0, width:300, height:"auto", dataheight:"auto", modal:false, drag:true, resize:true, url:null, mtype:"POST", clearAfterAdd:true, closeAfterEdit:false, reloadAfterSubmit:true, onInitializeForm:null, beforeInitData:null, beforeShowForm:null, afterShowForm:null, beforeSubmit:null, afterSubmit:null, onclickSubmit:null, afterComplete:null, onclickPgButtons:null, afterclickPgButtons:null, editData:{}, recreateForm:false, - jqModal:true, closeOnEscape:false, addedrow:"first", topinfo:"", bottominfo:"", saveicon:[], closeicon:[], savekey:[false, 13], navkeys:[false, 38, 40], checkOnSubmit:false, checkOnUpdate:false, _savedData:{}, processing:false, onClose:null, ajaxEditOptions:{}, serializeEditData:null, viewPagerButtons:true}, a.jgrid.edit, b || {}); return this.each(function(){function q(g, n){g === 0?a("#pData", "#" + j + "_2").addClass("ui-state-disabled"):a("#pData", "#" + j + "_2").removeClass("ui-state-disabled"); g == n?a("#nData", "#" + j + "_2").addClass("ui-state-disabled"): - a("#nData", "#" + j + "_2").removeClass("ui-state-disabled")}function D(){var g = a(f).jqGrid("getDataIDs"), n = a("#id_g", "#" + j).val(); return[a.inArray(n, g), g]}function t(){var g = true; a("#FormError", "#" + j).hide(); if (c.checkOnUpdate){k = {}; i = {}; F(); w = a.extend({}, k, i); if (O = H(w, c._savedData)){a("#" + e).data("disabled", true); a(".confirm", "#" + m.themodal).show(); g = false}}return g}function F(){a(".FormElement", "#" + j).each(function(){var g = a(".customelement", this); if (g.length){var n = g[0].name; a.each(f.p.colModel, function(){if (this.name == - n && this.editoptions && a.isFunction(this.editoptions.custom_value)){try{k[n] = this.editoptions.custom_value(a("#" + n, "#" + j), "get"); if (k[n] === undefined)throw"e1"; } catch (r){r == "e1"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.novalue, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, r.message, jQuery.jgrid.edit.bClose)}return true}})} else{switch (a(this).get(0).type){case "checkbox":if (a(this).attr("checked"))k[this.name] = a(this).val(); else{g = a(this).attr("offval"); - k[this.name] = g}break; case "select-one":k[this.name] = a("option:selected", this).val(); i[this.name] = a("option:selected", this).text(); break; case "select-multiple":k[this.name] = a(this).val(); k[this.name] = k[this.name]?k[this.name].join(","):""; var v = []; a("option:selected", this).each(function(r, E){v[r] = a(E).text()}); i[this.name] = v.join(","); break; case "password":case "text":case "textarea":case "button":k[this.name] = a(this).val(); break}if (f.p.autoencode)k[this.name] = a.jgrid.htmlEncode(k[this.name])}}); return true} - function z(g, n, v, r){for (var E, A, B, M = 0, x, P, C, T = [], G = false, V = "", R = 1; R <= r; R++)V += "  "; if (g != "_empty")G = a(n).jqGrid("getInd", g); a(n.p.colModel).each(function(U){E = this.name; P = (A = this.editrules && this.editrules.edithidden === true?false:this.hidden === true?true:false)?"style='display:none'":""; if (E !== "cb" && E !== "subgrid" && this.editable === true && E !== "rn"){if (G === false)x = ""; else if (E == n.p.ExpandColumn && - n.p.treeGrid === true)x = a("td:eq(" + U + ")", n.rows[G]).text(); else try{x = a.unformat(a("td:eq(" + U + ")", n.rows[G]), {rowId:g, colModel:this}, U)} catch (ca){x = a("td:eq(" + U + ")", n.rows[G]).html()}var W = a.extend({}, this.editoptions || {}, {id:E, name:E}), X = a.extend({}, {elmprefix:"", elmsuffix:"", rowabove:false, rowcontent:""}, this.formoptions || {}), ba = parseInt(X.rowpos, 10) || M + 1, da = parseInt((parseInt(X.colpos, 10) || 1) * 2, 10); if (g == "_empty" && W.defaultValue)x = a.isFunction(W.defaultValue)?W.defaultValue():W.defaultValue; if (!this.edittype)this.edittype = - "text"; if (f.p.autoencode)x = a.jgrid.htmlDecode(x); C = createEl(this.edittype, W, x, false, a.extend({}, a.jgrid.ajaxOptions, n.p.ajaxSelectOptions || {})); if (x == "" && this.edittype == "checkbox")x = a(C).attr("offval"); if (x == "" && this.edittype == "select")x = a("option:eq(0)", C).text(); if (c.checkOnSubmit || c.checkOnUpdate)c._savedData[E] = x; a(C).addClass("FormElement"); B = a(v).find("tr[rowpos=" + ba + "]"); if (X.rowabove){W = a("" + X.rowcontent + ""); a(v).append(W); W[0].rp = ba}if (B.length === - 0){B = a("").addClass("FormData").attr("id", "tr_" + E); a(B).append(V); a(v).append(B); B[0].rp = ba}a("td:eq(" + (da - 2) + ")", B[0]).html(typeof X.label === "undefined"?n.p.colNames[U]:X.label); a("td:eq(" + (da - 1) + ")", B[0]).append(X.elmprefix).append(C).append(X.elmsuffix); T[M] = U; M++}}); if (M > 0){R = a(""); R[0].rp = M + 999; a(v).append(R); if (c.checkOnSubmit || c.checkOnUpdate)c._savedData[n.p.id + "_id"] = g}return T}function h(g, n, v){var r, E = 0, A, B, M, x, P; if (c.checkOnSubmit || c.checkOnUpdate){c._savedData = {}; c._savedData[n.p.id + "_id"] = g}var C = n.p.colModel; if (g == "_empty"){a(C).each(function(){r = this.name; M = a.extend({}, this.editoptions || {}); B = a("#" + a.jgrid.jqID(r), "#" + v); if (B[0] != null){x = ""; if (M.defaultValue){x = a.isFunction(M.defaultValue)?M.defaultValue():M.defaultValue; if (B[0].type == "checkbox"){P = - x.toLowerCase(); if (P.search(/(false|0|no|off|undefined)/i) < 0 && P !== ""){B[0].checked = true; B[0].defaultChecked = true; B[0].value = x} else B.attr({checked:"", defaultChecked:""})} else B.val(x)} else if (B[0].type == "checkbox"){B[0].checked = false; B[0].defaultChecked = false; x = a(B).attr("offval")} else if (B[0].type.substr(0, 6) == "select")B[0].selectedIndex = 0; else B.val(x); if (c.checkOnSubmit === true || c.checkOnUpdate)c._savedData[r] = x}}); a("#id_g", "#" + v).val(g)} else{var T = a(n).jqGrid("getInd", g, true); if (T){a("td", T).each(function(G){r = - C[G].name; if (r !== "cb" && r !== "subgrid" && r !== "rn" && C[G].editable === true){if (r == n.p.ExpandColumn && n.p.treeGrid === true)A = a(this).text(); else try{A = a.unformat(this, {rowId:g, colModel:C[G]}, G)} catch (V){A = a(this).html()}if (f.p.autoencode)A = a.jgrid.htmlDecode(A); if (c.checkOnSubmit === true || c.checkOnUpdate)c._savedData[r] = A; r = a.jgrid.jqID(r); switch (C[G].edittype){case "password":case "text":case "button":case "image":a("#" + r, "#" + v).val(A); break; case "textarea":if (A == " " || A == " " || A.length == 1 && A.charCodeAt(0) == - 160)A = ""; a("#" + r, "#" + v).val(A); break; case "select":var R = A.split(","); R = a.map(R, function(ca){return a.trim(ca)}); a("#" + r + " option", "#" + v).each(function(){this.selected = !C[G].editoptions.multiple && (R[0] == a.trim(a(this).text()) || R[0] == a.trim(a(this).val()))?true:C[G].editoptions.multiple?a.inArray(a.trim(a(this).text()), R) > - 1 || a.inArray(a.trim(a(this).val()), R) > - 1?true:false:false}); break; case "checkbox":A += ""; if (C[G].editoptions && C[G].editoptions.value)if (C[G].editoptions.value.split(":")[0] == A){a("#" + - r, "#" + v).attr("checked", true); a("#" + r, "#" + v).attr("defaultChecked", true)} else{a("#" + r, "#" + v).attr("checked", false); a("#" + r, "#" + v).attr("defaultChecked", "")} else{A = A.toLowerCase(); if (A.search(/(false|0|no|off|undefined)/i) < 0 && A !== ""){a("#" + r, "#" + v).attr("checked", true); a("#" + r, "#" + v).attr("defaultChecked", true)} else{a("#" + r, "#" + v).attr("checked", false); a("#" + r, "#" + v).attr("defaultChecked", "")}}break; case "custom":try{if (C[G].editoptions && a.isFunction(C[G].editoptions.custom_value))C[G].editoptions.custom_value(a("#" + - r, "#" + v), "set", A); else throw"e1"; } catch (U){U == "e1"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, U.message, jQuery.jgrid.edit.bClose)}break}E++}}); E > 0 && a("#id_g", "#" + j).val(g)}}}function p(){var g, n = [true, "", ""], v = {}, r = f.p.prmNames, E, A; if (a.isFunction(c.beforeCheckValues)){var B = c.beforeCheckValues(k, a("#" + e), k[f.p.id + "_id"] == "_empty"?r.addoper:r.editoper); if (B && typeof B === "object")k = B}for (var M in k)if (k.hasOwnProperty(M)){n = - checkValues(k[M], M, f); if (n[0] === false)break}if (n[0]){if (a.isFunction(c.onclickSubmit))v = c.onclickSubmit(c, k) || {}; if (a.isFunction(c.beforeSubmit))n = c.beforeSubmit(k, a("#" + e))}if (n[0] && !c.processing){c.processing = true; a("#sData", "#" + j + "_2").addClass("ui-state-active"); A = r.oper; E = r.id; k[A] = a.trim(k[f.p.id + "_id"]) == "_empty"?r.addoper:r.editoper; if (k[A] != r.addoper)k[E] = k[f.p.id + "_id"]; else if (k[E] === undefined)k[E] = k[f.p.id + "_id"]; delete k[f.p.id + "_id"]; k = a.extend(k, c.editData, v); v = a.extend({url:c.url? - c.url:a(f).jqGrid("getGridParam", "editurl"), type:c.mtype, data:a.isFunction(c.serializeEditData)?c.serializeEditData(k):k, complete:function(x, P){if (P != "success"){n[0] = false; n[1] = a.isFunction(c.errorTextFormat)?c.errorTextFormat(x):P + " Status: '" + x.statusText + "'. Error code: " + x.status} else if (a.isFunction(c.afterSubmit))n = c.afterSubmit(x, k); if (n[0] === false){a("#FormError>td", "#" + j).html(n[1]); a("#FormError", "#" + j).show()} else{a.each(f.p.colModel, function(){if (i[this.name] && this.formatter && this.formatter == - "select")try{delete i[this.name]} catch (G){}}); k = a.extend(k, i); f.p.autoencode && a.each(k, function(G, V){k[G] = a.jgrid.htmlDecode(V)}); if (k[A] == r.addoper){n[2] || (n[2] = parseInt(f.p.records, 10) + 1); k[E] = n[2]; if (c.closeAfterAdd){if (c.reloadAfterSubmit)a(f).trigger("reloadGrid"); else{a(f).jqGrid("addRowData", n[2], k, b.addedrow); a(f).jqGrid("setSelection", n[2])}hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose})} else if (c.clearAfterAdd){c.reloadAfterSubmit?a(f).trigger("reloadGrid"):a(f).jqGrid("addRowData", - n[2], k, b.addedrow); h("_empty", f, e)} else c.reloadAfterSubmit?a(f).trigger("reloadGrid"):a(f).jqGrid("addRowData", n[2], k, b.addedrow)} else{if (c.reloadAfterSubmit){a(f).trigger("reloadGrid"); c.closeAfterEdit || setTimeout(function(){a(f).jqGrid("setSelection", k[E])}, 1E3)} else f.p.treeGrid === true?a(f).jqGrid("setTreeRow", k[E], k):a(f).jqGrid("setRowData", k[E], k); c.closeAfterEdit && hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose})}if (a.isFunction(c.afterComplete)){g = x; setTimeout(function(){c.afterComplete(g, - k, a("#" + e)); g = null}, 500)}}c.processing = false; if (c.checkOnSubmit || c.checkOnUpdate){a("#" + e).data("disabled", false); if (c._savedData[f.p.id + "_id"] != "_empty")for (var C in c._savedData)if (k[C])c._savedData[C] = k[C]}a("#sData", "#" + j + "_2").removeClass("ui-state-active"); try{a(":input:visible", "#" + e)[0].focus()} catch (T){}}, error:function(x, P, C){a("#FormError>td", "#" + j).html(P + " : " + C); a("#FormError", "#" + j).show(); c.processing = false; a("#" + e).data("disabled", false); a("#sData", "#" + j + "_2").removeClass("ui-state-active")}}, - a.jgrid.ajaxOptions, c.ajaxEditOptions); if (!v.url && !c.useDataProxy)if (a.isFunction(f.p.dataProxy))c.useDataProxy = true; else{n[0] = false; n[1] += " " + a.jgrid.errors.nourl}if (n[0])c.useDataProxy?f.p.dataProxy.call(f, v, "set_" + f.p.id):a.ajax(v)}if (n[0] === false){a("#FormError>td", "#" + j).html(n[1]); a("#FormError", "#" + j).show()}}function H(g, n){var v = false, r; for (r in g)if (g[r] != n[r]){v = true; break}return v}var f = this; if (f.grid && d){var l = f.p.id, e = "FrmGrid_" + l, j = "TblGrid_" + l, m = {themodal:"editmod" + l, modalhead:"edithd" + - l, modalcontent:"editcnt" + l, scrollelm:e}, u = a.isFunction(c.beforeShowForm)?c.beforeShowForm:false, Q = a.isFunction(c.afterShowForm)?c.afterShowForm:false, o = a.isFunction(c.beforeInitData)?c.beforeInitData:false, s = a.isFunction(c.onInitializeForm)?c.onInitializeForm:false, y = 1, J = 0, k, i, w, O; if (d == "new"){d = "_empty"; b.caption = b.addCaption} else b.caption = b.editCaption; b.recreateForm === true && a("#" + m.themodal).html() != null && a("#" + m.themodal).remove(); var S = true; if (b.checkOnUpdate && b.jqModal && !b.modal)S = false; if (a("#" + - m.themodal).html() != null){a(".ui-jqdialog-title", "#" + m.modalhead).html(b.caption); a("#FormError", "#" + j).hide(); if (c.topinfo){a(".topinfo", "#" + j + "_2").html(c.topinfo); a(".tinfo", "#" + j + "_2").show()} else a(".tinfo", "#" + j + "_2").hide(); if (c.bottominfo){a(".bottominfo", "#" + j + "_2").html(c.bottominfo); a(".binfo", "#" + j + "_2").show()} else a(".binfo", "#" + j + "_2").hide(); o && o(a("#" + e)); h(d, f, e); d == "_empty" || !c.viewPagerButtons?a("#pData, #nData", "#" + j + "_2").hide():a("#pData, #nData", "#" + j + "_2").show(); if (c.processing === - true){c.processing = false; a("#sData", "#" + j + "_2").removeClass("ui-state-active")}if (a("#" + e).data("disabled") === true){a(".confirm", "#" + m.themodal).hide(); a("#" + e).data("disabled", false)}u && u(a("#" + e)); a("#" + m.themodal).data("onClose", c.onClose); viewModal("#" + m.themodal, {gbox:"#gbox_" + l, jqm:b.jqModal, jqM:false, closeoverlay:S, modal:b.modal}); S || a(".jqmOverlay").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false}); Q && Q(a("#" + e))} else{a(f.p.colModel).each(function(){var g = - this.formoptions; y = Math.max(y, g?g.colpos || 0:0); J = Math.max(J, g?g.rowpos || 0:0)}); var I = isNaN(b.dataheight)?b.dataheight:b.dataheight + "px", K; I = a("
").data("disabled", false); var L = a("
"); a(I).append(L); K = a(""); K[0].rp = 0; a(L).append(K); K = a("" + c.topinfo + ""); K[0].rp = 0; a(L).append(K); o && o(a("#" + e)); K = (o = f.p.direction == "rtl"?true:false)?"nData":"pData"; var N = o?"pData":"nData"; z(d, f, L, y); K = "
"; N = "
"; - var Z = "" + b.bSubmit + "", $ = "" + b.bCancel + ""; K = ""; K += ""; K += "
" + Z + $ + "
"; if (J > 0){var aa = []; a.each(a(L)[0].rows, function(g, n){aa[g] = n}); aa.sort(function(g, n){if (g.rp > n.rp)return 1; if (g.rp < n.rp)return - 1; return 0}); a.each(aa, function(g, n){a("tbody", L).append(n)})}b.gbox = "#gbox_" + l; var Y = false; if (b.closeOnEscape === true){b.closeOnEscape = false; Y = true}I = a("").append(I).append(K); createModal(m, I, b, "#gview_" + f.p.id, a("#gview_" + f.p.id)[0]); if (o){a("#pData, #nData", "#" + j + "_2").css("float", "right"); a(".EditButton", "#" + j + - "_2").css("text-align", "left")}c.topinfo && a(".tinfo", "#" + j + "_2").show(); c.bottominfo && a(".binfo", "#" + j + "_2").show(); K = I = null; a("#" + m.themodal).keydown(function(g){var n = g.target; if (a("#" + e).data("disabled") === true)return false; if (c.savekey[0] === true && g.which == c.savekey[1])if (n.tagName != "TEXTAREA"){a("#sData", "#" + j + "_2").trigger("click"); return false}if (g.which === 27){if (!t())return false; Y && hideModal(this, {gb:b.gbox, jqm:b.jqModal, onClose:c.onClose}); return false}if (c.navkeys[0] === true){if (a("#id_g", - "#" + j).val() == "_empty")return true; if (g.which == c.navkeys[1]){a("#pData", "#" + j + "_2").trigger("click"); return false}if (g.which == c.navkeys[2]){a("#nData", "#" + j + "_2").trigger("click"); return false}}}); if (b.checkOnUpdate){a("a.ui-jqdialog-titlebar-close span", "#" + m.themodal).removeClass("jqmClose"); a("a.ui-jqdialog-titlebar-close", "#" + m.themodal).unbind("click").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false})}b.saveicon = a.extend([true, - "left", "ui-icon-disk"], b.saveicon); b.closeicon = a.extend([true, "left", "ui-icon-close"], b.closeicon); if (b.saveicon[0] === true)a("#sData", "#" + j + "_2").addClass(b.saveicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (b.closeicon[0] === true)a("#cData", "#" + j + "_2").addClass(b.closeicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (c.checkOnSubmit || c.checkOnUpdate){Z = - "" + b.bYes + ""; N = "" + b.bNo + ""; $ = "" + b.bExit + ""; I = b.zIndex || 999; I++; a("
" + b.saveData + "

" + Z + N + $ + "
").insertAfter("#" + e); a("#sNew", "#" + m.themodal).click(function(){p(); a("#" + e).data("disabled", false); a(".confirm", "#" + m.themodal).hide(); return false}); a("#nNew", "#" + m.themodal).click(function(){a(".confirm", "#" + - m.themodal).hide(); a("#" + e).data("disabled", false); setTimeout(function(){a(":input", "#" + e)[0].focus()}, 0); return false}); a("#cNew", "#" + m.themodal).click(function(){a(".confirm", "#" + m.themodal).hide(); a("#" + e).data("disabled", false); hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false})}s && s(a("#" + e)); d == "_empty" || !c.viewPagerButtons?a("#pData,#nData", "#" + j + "_2").hide():a("#pData,#nData", "#" + j + "_2").show(); u && u(a("#" + e)); a("#" + m.themodal).data("onClose", c.onClose); - viewModal("#" + m.themodal, {gbox:"#gbox_" + l, jqm:b.jqModal, closeoverlay:S, modal:b.modal}); S || a(".jqmOverlay").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false}); Q && Q(a("#" + e)); a(".fm-button", "#" + m.themodal).hover(function(){a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); a("#sData", "#" + j + "_2").click(function(){k = {}; i = {}; a("#FormError", "#" + j).hide(); F(); if (k[f.p.id + "_id"] == "_empty")p(); else if (b.checkOnSubmit === - true){w = a.extend({}, k, i); if (O = H(w, c._savedData)){a("#" + e).data("disabled", true); a(".confirm", "#" + m.themodal).show()} else p()} else p(); return false}); a("#cData", "#" + j + "_2").click(function(){if (!t())return false; hideModal("#" + m.themodal, {gb:"#gbox_" + l, jqm:b.jqModal, onClose:c.onClose}); return false}); a("#nData", "#" + j + "_2").click(function(){if (!t())return false; a("#FormError", "#" + j).hide(); var g = D(); g[0] = parseInt(g[0], 10); if (g[0] != - 1 && g[1][g[0] + 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("next", - a("#" + e), g[1][g[0]]); h(g[1][g[0] + 1], f, e); a(f).jqGrid("setSelection", g[1][g[0] + 1]); a.isFunction(b.afterclickPgButtons) && b.afterclickPgButtons("next", a("#" + e), g[1][g[0] + 1]); q(g[0] + 1, g[1].length - 1)}return false}); a("#pData", "#" + j + "_2").click(function(){if (!t())return false; a("#FormError", "#" + j).hide(); var g = D(); if (g[0] != - 1 && g[1][g[0] - 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("prev", a("#" + e), g[1][g[0]]); h(g[1][g[0] - 1], f, e); a(f).jqGrid("setSelection", g[1][g[0] - 1]); a.isFunction(b.afterclickPgButtons) && - b.afterclickPgButtons("prev", a("#" + e), g[1][g[0] - 1]); q(g[0] - 1, g[1].length - 1)}return false})}u = D(); q(u[0], u[1].length - 1)}})}, viewGridRow:function(d, b){b = a.extend({top:0, left:0, width:0, height:"auto", dataheight:"auto", modal:false, drag:true, resize:true, jqModal:true, closeOnEscape:false, labelswidth:"30%", closeicon:[], navkeys:[false, 38, 40], onClose:null, beforeShowForm:null, viewPagerButtons:true}, a.jgrid.view, b || {}); return this.each(function(){function q(){if (b.closeOnEscape === true || b.navkeys[0] === true)setTimeout(function(){a(".ui-jqdialog-titlebar-close", - "#" + l.modalhead).focus()}, 0)}function D(i, w){i === 0?a("#pData", "#" + f + "_2").addClass("ui-state-disabled"):a("#pData", "#" + f + "_2").removeClass("ui-state-disabled"); i == w?a("#nData", "#" + f + "_2").addClass("ui-state-disabled"):a("#nData", "#" + f + "_2").removeClass("ui-state-disabled")}function t(){var i = a(h).jqGrid("getDataIDs"), w = a("#id_g", "#" + f).val(); return[a.inArray(w, i), i]}function F(i, w, O, S){for (var I, K, L, N = 0, Z, $, aa = [], Y = false, g = "  ", n = "", v = ["integer", "number", "currency"], r = 0, E = 0, A, B, M, x = 1; x <= S; x++)n += x == 1?g:"  "; a(w.p.colModel).each(function(){K = this.editrules && this.editrules.edithidden === true?false:this.hidden === true?true:false; if (!K && this.align === "right")if (this.formatter && a.inArray(this.formatter, v) !== - 1)r = - Math.max(r, parseInt(this.width, 10)); else E = Math.max(E, parseInt(this.width, 10))}); A = r !== 0?r:E !== 0?E:0; Y = a(w).jqGrid("getInd", i); a(w.p.colModel).each(function(P){I = this.name; B = false; $ = (K = this.editrules && this.editrules.edithidden === true?false:this.hidden === true?true:false)?"style='display:none'":""; M = typeof this.viewable != "boolean"?true:this.viewable; if (I !== "cb" && I !== "subgrid" && I !== "rn" && M){Z = Y === false?"":I == w.p.ExpandColumn && w.p.treeGrid === true?a("td:eq(" + P + ")", w.rows[Y]).text():a("td:eq(" + P + ")", w.rows[Y]).html(); - B = this.align === "right" && A !== 0?true:false; a.extend({}, this.editoptions || {}, {id:I, name:I}); var C = a.extend({}, {rowabove:false, rowcontent:""}, this.formoptions || {}), T = parseInt(C.rowpos, 10) || N + 1, G = parseInt((parseInt(C.colpos, 10) || 1) * 2, 10); if (C.rowabove){var V = a("" + C.rowcontent + ""); a(O).append(V); V[0].rp = T}L = a(O).find("tr[rowpos=" + T + "]"); if (L.length === 0){L = a("").addClass("FormData").attr("id", "trv_" + I); a(L).append(n); a(O).append(L); - L[0].rp = T}a("td:eq(" + (G - 2) + ")", L[0]).html("" + (typeof C.label === "undefined"?w.p.colNames[P]:C.label) + ""); a("td:eq(" + (G - 1) + ")", L[0]).append("" + Z + "").attr("id", "v_" + I); B && a("td:eq(" + (G - 1) + ") span", L[0]).css({"text-align":"right", width:A + "px"}); aa[N] = P; N++}}); if (N > 0){i = a(""); i[0].rp = N + 99; a(O).append(i)}return aa} - function z(i, w){var O, S, I = 0, K, L; if (L = a(w).jqGrid("getInd", i, true)){a("td", L).each(function(N){O = w.p.colModel[N].name; S = w.p.colModel[N].editrules && w.p.colModel[N].editrules.edithidden === true?false:w.p.colModel[N].hidden === true?true:false; if (O !== "cb" && O !== "subgrid" && O !== "rn"){K = O == w.p.ExpandColumn && w.p.treeGrid === true?a(this).text():a(this).html(); a.extend({}, w.p.colModel[N].editoptions || {}); O = a.jgrid.jqID("v_" + O); a("#" + O + " span", "#" + f).html(K); S && a("#" + O, "#" + f).parents("tr:first").hide(); I++}}); I > - 0 && a("#id_g", "#" + f).val(i)}}var h = this; if (h.grid && d){if (!b.imgpath)b.imgpath = h.p.imgpath; var p = h.p.id, H = "ViewGrid_" + p, f = "ViewTbl_" + p, l = {themodal:"viewmod" + p, modalhead:"viewhd" + p, modalcontent:"viewcnt" + p, scrollelm:H}, e = 1, j = 0; if (a("#" + l.themodal).html() != null){a(".ui-jqdialog-title", "#" + l.modalhead).html(b.caption); a("#FormError", "#" + f).hide(); z(d, h); a.isFunction(b.beforeShowForm) && b.beforeShowForm(a("#" + H)); viewModal("#" + l.themodal, {gbox:"#gbox_" + p, jqm:b.jqModal, jqM:false, modal:b.modal}); q()} else{a(h.p.colModel).each(function(){var i = - this.formoptions; e = Math.max(e, i?i.colpos || 0:0); j = Math.max(j, i?i.rowpos || 0:0)}); var m = isNaN(b.dataheight)?b.dataheight:b.dataheight + "px", u = a("
"), Q = a("
"); a(u).append(Q); F(d, h, Q, e); m = h.p.direction == "rtl"?true:false; var o = "
", s = "
", y = "" + b.bClose + ""; if (j > 0){var J = []; a.each(a(Q)[0].rows, function(i, w){J[i] = w}); J.sort(function(i, w){if (i.rp > w.rp)return 1; - if (i.rp < w.rp)return - 1; return 0}); a.each(J, function(i, w){a("tbody", Q).append(w)})}b.gbox = "#gbox_" + p; var k = false; if (b.closeOnEscape === true){b.closeOnEscape = false; k = true}u = a("").append(u).append("
" + y + "
"); createModal(l, u, b, "#gview_" + h.p.id, a("#gview_" + h.p.id)[0]); - if (m){a("#pData, #nData", "#" + f + "_2").css("float", "right"); a(".EditButton", "#" + f + "_2").css("text-align", "left")}b.viewPagerButtons || a("#pData, #nData", "#" + f + "_2").hide(); u = null; a("#" + l.themodal).keydown(function(i){if (i.which === 27){k && hideModal(this, {gb:b.gbox, jqm:b.jqModal, onClose:b.onClose}); return false}if (b.navkeys[0] === true){if (i.which === b.navkeys[1]){a("#pData", "#" + f + "_2").trigger("click"); return false}if (i.which === b.navkeys[2]){a("#nData", "#" + f + "_2").trigger("click"); return false}}}); b.closeicon = - a.extend([true, "left", "ui-icon-close"], b.closeicon); if (b.closeicon[0] === true)a("#cData", "#" + f + "_2").addClass(b.closeicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); a.isFunction(b.beforeShowForm) && b.beforeShowForm(a("#" + H)); viewModal("#" + l.themodal, {gbox:"#gbox_" + p, jqm:b.jqModal, modal:b.modal}); a(".fm-button:not(.ui-state-disabled)", "#" + f + "_2").hover(function(){a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); - q(); a("#cData", "#" + f + "_2").click(function(){hideModal("#" + l.themodal, {gb:"#gbox_" + p, jqm:b.jqModal, onClose:b.onClose}); return false}); a("#nData", "#" + f + "_2").click(function(){a("#FormError", "#" + f).hide(); var i = t(); i[0] = parseInt(i[0], 10); if (i[0] != - 1 && i[1][i[0] + 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("next", a("#" + H), i[1][i[0]]); z(i[1][i[0] + 1], h); a(h).jqGrid("setSelection", i[1][i[0] + 1]); a.isFunction(b.afterclickPgButtons) && b.afterclickPgButtons("next", a("#" + H), i[1][i[0] + 1]); D(i[0] + 1, i[1].length - - 1)}q(); return false}); a("#pData", "#" + f + "_2").click(function(){a("#FormError", "#" + f).hide(); var i = t(); if (i[0] != - 1 && i[1][i[0] - 1]){a.isFunction(b.onclickPgButtons) && b.onclickPgButtons("prev", a("#" + H), i[1][i[0]]); z(i[1][i[0] - 1], h); a(h).jqGrid("setSelection", i[1][i[0] - 1]); a.isFunction(b.afterclickPgButtons) && b.afterclickPgButtons("prev", a("#" + H), i[1][i[0] - 1]); D(i[0] - 1, i[1].length - 1)}q(); return false})}m = t(); D(m[0], m[1].length - 1)}})}, delGridRow:function(d, b){c = b = a.extend({top:0, left:0, width:240, height:"auto", - dataheight:"auto", modal:false, drag:true, resize:true, url:"", mtype:"POST", reloadAfterSubmit:true, beforeShowForm:null, afterShowForm:null, beforeSubmit:null, onclickSubmit:null, afterSubmit:null, jqModal:true, closeOnEscape:false, delData:{}, delicon:[], cancelicon:[], onClose:null, ajaxDelOptions:{}, processing:false, serializeDelData:null, useDataProxy:false}, a.jgrid.del, b || {}); return this.each(function(){var q = this; if (q.grid)if (d){var D = typeof b.beforeShowForm === "function"?true:false, t = typeof b.afterShowForm === - "function"?true:false, F = q.p.id, z = {}, h = "DelTbl_" + F, p, H, f, l, e = {themodal:"delmod" + F, modalhead:"delhd" + F, modalcontent:"delcnt" + F, scrollelm:h}; if (jQuery.isArray(d))d = d.join(); if (a("#" + e.themodal).html() != null){a("#DelData>td", "#" + h).text(d); a("#DelError", "#" + h).hide(); if (c.processing === true){c.processing = false; a("#dData", "#" + h).removeClass("ui-state-active")}D && b.beforeShowForm(a("#" + h)); viewModal("#" + e.themodal, {gbox:"#gbox_" + F, jqm:b.jqModal, jqM:false, modal:b.modal})} else{var j = isNaN(b.dataheight)?b.dataheight: - b.dataheight + "px"; j = "
"; j += ""; j += ""; j += ""; j += '"; j += "
' + b.msg + "
 
"; j += "
" + ("" + b.bSubmit + "") + " " + ("" + b.bCancel + "") + "
"; b.gbox = "#gbox_" + F; createModal(e, j, b, "#gview_" + q.p.id, a("#gview_" + q.p.id)[0]); a(".fm-button", - "#" + h + "_2").hover(function(){a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); b.delicon = a.extend([true, "left", "ui-icon-scissors"], b.delicon); b.cancelicon = a.extend([true, "left", "ui-icon-cancel"], b.cancelicon); if (b.delicon[0] === true)a("#dData", "#" + h + "_2").addClass(b.delicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (b.cancelicon[0] === true)a("#eData", "#" + h + "_2").addClass(b.cancelicon[1] == - "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); a("#dData", "#" + h + "_2").click(function(){var m = [true, ""]; z = {}; var u = a("#DelData>td", "#" + h).text(); if (typeof b.onclickSubmit === "function")z = b.onclickSubmit(c, u) || {}; if (typeof b.beforeSubmit === "function")m = b.beforeSubmit(u); if (m[0] && !c.processing){c.processing = true; a(this).addClass("ui-state-active"); f = q.p.prmNames; p = a.extend({}, c.delData, z); l = f.oper; p[l] = f.deloper; H = f.id; p[H] = u; var Q = a.extend({url:c.url? - c.url:a(q).jqGrid("getGridParam", "editurl"), type:b.mtype, data:a.isFunction(b.serializeDelData)?b.serializeDelData(p):p, complete:function(o, s){if (s != "success"){m[0] = false; m[1] = a.isFunction(c.errorTextFormat)?c.errorTextFormat(o):s + " Status: '" + o.statusText + "'. Error code: " + o.status} else if (typeof c.afterSubmit === "function")m = c.afterSubmit(o, p); if (m[0] === false){a("#DelError>td", "#" + h).html(m[1]); a("#DelError", "#" + h).show()} else{if (c.reloadAfterSubmit)a(q).trigger("reloadGrid"); else{s = []; s = u.split(","); - if (q.p.treeGrid === true)try{a(q).jqGrid("delTreeNode", s[0])} catch (y){} else for (var J = 0; J < s.length; J++)a(q).jqGrid("delRowData", s[J]); q.p.selrow = null; q.p.selarrrow = []}a.isFunction(c.afterComplete) && setTimeout(function(){c.afterComplete(o, u)}, 500)}c.processing = false; a("#dData", "#" + h + "_2").removeClass("ui-state-active"); m[0] && hideModal("#" + e.themodal, {gb:"#gbox_" + F, jqm:b.jqModal, onClose:c.onClose})}, error:function(o, s, y){a("#DelError>td", "#" + h).html(s + " : " + y); a("#DelError", "#" + h).show(); c.processing = - false; a("#dData", "#" + h + "_2").removeClass("ui-state-active")}}, a.jgrid.ajaxOptions, b.ajaxDelOptions); if (!Q.url && !c.useDataProxy)if (a.isFunction(q.p.dataProxy))c.useDataProxy = true; else{m[0] = false; m[1] += " " + a.jgrid.errors.nourl}if (m[0])c.useDataProxy?q.p.dataProxy.call(q, Q, "del_" + q.p.id):a.ajax(Q)}if (m[0] === false){a("#DelError>td", "#" + h).html(m[1]); a("#DelError", "#" + h).show()}return false}); a("#eData", "#" + h + "_2").click(function(){hideModal("#" + e.themodal, {gb:"#gbox_" + F, jqm:b.jqModal, onClose:c.onClose}); - return false}); D && b.beforeShowForm(a("#" + h)); viewModal("#" + e.themodal, {gbox:"#gbox_" + F, jqm:b.jqModal, modal:b.modal})}t && b.afterShowForm(a("#" + h)); b.closeOnEscape === true && setTimeout(function(){a(".ui-jqdialog-titlebar-close", "#" + e.modalhead).focus()}, 0)}})}, navGrid:function(d, b, q, D, t, F, z){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", closeOnEscape:true, beforeRefresh:null, afterRefresh:null, cloneToTop:false}, a.jgrid.nav, b || {}); return this.each(function(){var h = {themodal:"alertmod", modalhead:"alerthd", modalcontent:"alertcnt"}, p = this, H, f, l; if (!(!p.grid || typeof d != "string")){if (a("#" + h.themodal).html() === null){if (typeof window.innerWidth != "undefined"){H = window.innerWidth; f = window.innerHeight} else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != - "undefined" && document.documentElement.clientWidth !== 0){H = document.documentElement.clientWidth; f = document.documentElement.clientHeight} else{H = 1024; f = 768}createModal(h, "
" + b.alerttext + "
", {gbox:"#gbox_" + p.p.id, jqModal:true, drag:true, resize:true, caption:b.alertcap, top:f / 2 - 25, left:H / 2 - 100, width:200, height:"auto", closeOnEscape:b.closeOnEscape}, "", "", true)}H = 1; if (b.cloneToTop && p.p.toppager)H = 2; for (f = 0; f < H; f++){var e = a(""), - j, m; if (f === 0){j = d; m = p.p.id; if (j == p.p.toppager){m += "_top"; H = 1}} else{j = p.p.toppager; m = p.p.id + "_top"}p.p.direction == "rtl" && a(e).attr("dir", "rtl").css("float", "right"); if (b.add){D = D || {}; l = a(""); a(l).append("
" + b.addtext + "
"); a("tr", e).append(l); a(l, e).attr({title:b.addtitle || "", id:D.id || "add_" + m}).click(function(){a(this).hasClass("ui-state-disabled") || (typeof b.addfunc == "function"?b.addfunc(): - a(p).jqGrid("editGridRow", "new", D)); return false}).hover(function(){a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); l = null}if (b.edit){l = a(""); q = q || {}; a(l).append("
" + b.edittext + "
"); a("tr", e).append(l); a(l, e).attr({title:b.edittitle || "", id:q.id || "edit_" + m}).click(function(){if (!a(this).hasClass("ui-state-disabled")){var u = - p.p.selrow; if (u)typeof b.editfunc == "function"?b.editfunc(u):a(p).jqGrid("editGridRow", u, q); else{viewModal("#" + h.themodal, {gbox:"#gbox_" + p.p.id, jqm:true}); a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); l = null}if (b.view){l = a(""); z = z || {}; a(l).append("
" + b.viewtext + - "
"); a("tr", e).append(l); a(l, e).attr({title:b.viewtitle || "", id:z.id || "view_" + m}).click(function(){if (!a(this).hasClass("ui-state-disabled")){var u = p.p.selrow; if (u)a(p).jqGrid("viewGridRow", u, z); else{viewModal("#" + h.themodal, {gbox:"#gbox_" + p.p.id, jqm:true}); a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); l = null}if (b.del){l = a(""); - t = t || {}; a(l).append("
" + b.deltext + "
"); a("tr", e).append(l); a(l, e).attr({title:b.deltitle || "", id:t.id || "del_" + m}).click(function(){if (!a(this).hasClass("ui-state-disabled")){var u; if (p.p.multiselect){u = p.p.selarrrow; if (u.length === 0)u = null} else u = p.p.selrow; if (u)"function" == typeof b.delfunc?b.delfunc(u):a(p).jqGrid("delGridRow", u, t); else{viewModal("#" + h.themodal, {gbox:"#gbox_" + p.p.id, jqm:true}); a("#jqg_alrt").focus()}}return false}).hover(function(){a(this).hasClass("ui-state-disabled") || - a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); l = null}if (b.add || b.edit || b.del || b.view)a("tr", e).append(""); if (b.search){l = a(""); F = F || {}; a(l).append("
" + b.searchtext + "
"); a("tr", e).append(l); a(l, e).attr({title:b.searchtitle || "", id:F.id || "search_" + - m}).click(function(){a(this).hasClass("ui-state-disabled") || a(p).jqGrid("searchGrid", F); return false}).hover(function(){a(this).hasClass("ui-state-disabled") || a(this).addClass("ui-state-hover")}, function(){a(this).removeClass("ui-state-hover")}); l = null}if (b.refresh){l = a(""); a(l).append("
" + b.refreshtext + "
"); a("tr", e).append(l); a(l, e).attr({title:b.refreshtitle || "", id:"refresh_" + m}).click(function(){if (!a(this).hasClass("ui-state-disabled")){a.isFunction(b.beforeRefresh) && - b.beforeRefresh(); p.p.search = false; try{a("#fbox_" + p.p.id).searchFilter().reset(); a.isFunction(p.clearToolbar) && p.clearToolbar(false)} catch (u){}switch (b.refreshstate){case "firstpage":a(p).trigger("reloadGrid", [{page:1}]); break; case "current":a(p).trigger("reloadGrid", [{current:true}]); break}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")}); l = null}l = - a(".ui-jqgrid").css("font-size") || "11px"; a("body").append(""); l = a(e).clone().appendTo("#testpg2").width(); a("#testpg2").remove(); a(j + "_" + b.position, j).append(e); if (p.p._nvtd){if (l > p.p._nvtd[0]){a(j + "_" + b.position, j).width(l); p.p._nvtd[0] = l}p.p._nvtd[1] = l}e = l = l = null}}})}, navButtonAdd:function(d, b){b = a.extend({caption:"newButton", title:"", buttonicon:"ui-icon-newwin", onClickButton:null, position:"last", - cursor:"pointer"}, b || {}); return this.each(function(){if (this.grid){if (d.indexOf("#") !== 0)d = "#" + d; var q = a(".navtable", d)[0], D = this; if (q){var t = a(""); b.buttonicon.toString().toUpperCase() == "NONE"?a(t).addClass("ui-pg-button ui-corner-all").append("
" + b.caption + "
"):a(t).addClass("ui-pg-button ui-corner-all").append("
" + b.caption + "
"); b.id && a(t).attr("id", b.id); if (b.position == "first")q.rows[0].cells.length === - 0?a("tr", q).append(t):a("tr td:eq(0)", q).before(t); else a("tr", q).append(t); a(t, q).attr("title", b.title || "").click(function(F){a(this).hasClass("ui-state-disabled") || a.isFunction(b.onClickButton) && b.onClickButton.call(D, F); 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(d, b){b = a.extend({sepclass:"ui-separator", sepcontent:""}, b || {}); return this.each(function(){if (this.grid){if (d.indexOf("#") !== - 0)d = "#" + d; var q = a(".navtable", d)[0]; if (q){var D = "" + b.sepcontent + ""; a("tr", q).append(D)}}})}, GridToForm:function(d, b){return this.each(function(){var q = this; if (q.grid){var D = a(q).jqGrid("getRowData", d); if (D)for (var t in D)a("[name=" + t + "]", b).is("input:radio") || a("[name=" + t + "]", b).is("input:checkbox")?a("[name=" + t + "]", b).each(function(){a(this).val() == D[t]?a(this).attr("checked", "checked"):a(this).attr("checked", - "")}):a("[name=" + t + "]", b).val(D[t])}})}, FormToGrid:function(d, b, q, D){return this.each(function(){var t = this; if (t.grid){q || (q = "set"); D || (D = "first"); var F = a(b).serializeArray(), z = {}; a.each(F, function(h, p){z[p.name] = p.value}); if (q == "add")a(t).jqGrid("addRowData", d, z, D); else q == "set" && a(t).jqGrid("setRowData", d, z)}})}})})(jQuery); - jQuery.fn.searchFilter = function(k, H){function I(e, l, v){this.$ = e; this.add = function(a){a == null?e.find(".ui-add-last").click():e.find(".sf:eq(" + a + ") .ui-add").click(); return this}; this.del = function(a){a == null?e.find(".sf:last .ui-del").click():e.find(".sf:eq(" + a + ") .ui-del").click(); return this}; this.search = function(){e.find(".ui-search").click(); return this}; this.reset = function(){e.find(".ui-reset").click(); return this}; this.close = function(){e.find(".ui-closer").click(); return this}; if (l != null){function C(){jQuery(this).toggleClass("ui-state-hover"); - return false}function D(a){jQuery(this).toggleClass("ui-state-active", a.type == "mousedown"); return false}function m(a, b){return""}function w(a, b, d){return""}function E(a, b){a = e.find("tr.sf td.data " + a); a[0] != null && b(a)}function F(a, b){var d = e.find("tr.sf td.data " + a); d[0] != null && jQuery.each(b, function(){this.data != null?d.bind(this.type, this.data, this.fn):d.bind(this.type, this.fn)})}var f = jQuery.extend({}, - jQuery.fn.searchFilter.defaults, v), n = - 1, r = ""; jQuery.each(f.groupOps, function(){r += m(this.op, this.text)}); r = ""; e.html("").addClass("ui-searchFilter").append("
 
" + - f.windowTitle + "
 
" + - f.resetText + "" + f.searchText + "" + f.matchText + " " + r + " " + f.rulesText + " 
"); - var x = e.find("tr.sf"), G = x.find("td.fields"), y = x.find("td.ops"), o = x.find("td.data"), s = ""; jQuery.each(f.operators, function(){s += m(this.op, this.text)}); s = w("default", s, true); y.append(s); o.append(""); var t = "", z = false, p = false; jQuery.each(l, function(a){t += m(this.itemval, this.text); if (this.ops != null){z = true; var b = ""; jQuery.each(this.ops, function(){b += m(this.op, this.text)}); b = w("field" + a, b, true); y.append(b)}if (this.dataUrl != null){if (a > n)n = a; p = true; - var d = this.dataEvents, c = this.dataInit, g = this.buildSelect; jQuery.ajax(jQuery.extend({url:this.dataUrl, complete:function(h){h = g != null?jQuery("
").append(g(h)):jQuery("
").append(h.responseText); h.find("select").addClass("field" + a).hide(); o.append(h.html()); c && E(".field" + a, c); d && F(".field" + a, d); a == n && e.find("tr.sf td.fields select[name='field']").change()}}, f.ajaxSelectOptions))} else if (this.dataValues != null){p = true; var i = ""; jQuery.each(this.dataValues, function(){i += m(this.value, this.text)}); - i = w("field" + a, i, true); o.append(i)} else if (this.dataEvents != null || this.dataInit != null){p = true; i = ""; o.append(i)}this.dataInit != null && a != n && E(".field" + a, this.dataInit); this.dataEvents != null && a != n && F(".field" + a, this.dataEvents)}); t = ""; G.append(t); l = G.find("select[name='field']"); z?l.change(function(a){var b = a.target.selectedIndex; a = jQuery(a.target).parents("tr.sf").find("td.ops"); a.find("select").removeAttr("name").hide(); b = a.find(".field" + - b); if (b[0] == null)b = a.find(".default"); b.attr("name", "op").show()}):y.find(".default").attr("name", "op").show(); p?l.change(function(a){var b = a.target.selectedIndex; a = jQuery(a.target).parents("tr.sf").find("td.data"); a.find("select,input").removeClass("vdata").hide(); b = a.find(".field" + b); if (b[0] == null)b = a.find(".default"); b.show().addClass("vdata")}):o.find(".default").show().addClass("vdata"); if (z || p)l.change(); e.find(".ui-state-default").hover(C, C).mousedown(D).mouseup(D); e.find(".ui-closer").click(function(){f.onClose(jQuery(e.selector)); - return false}); e.find(".ui-del").click(function(a){a = jQuery(a.target).parents(".sf"); if (a.siblings(".sf").length > 0){f.datepickerFix === true && jQuery.fn.datepicker !== undefined && a.find(".hasDatepicker").datepicker("destroy"); a.remove()} else{a.find("select[name='field']")[0].selectedIndex = 0; a.find("select[name='op']")[0].selectedIndex = 0; a.find(".data input").val(""); a.find(".data select").each(function(){this.selectedIndex = 0}); a.find("select[name='field']").change()}return false}); e.find(".ui-add").click(function(a){a = - jQuery(a.target).parents(".sf"); var b = a.clone(true).insertAfter(a); b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active"); if (f.clone){b.find("select[name='field']")[0].selectedIndex = a.find("select[name='field']")[0].selectedIndex; if (b.find("select[name='op']")[0] != null)b.find("select[name='op']").focus()[0].selectedIndex = a.find("select[name='op']")[0].selectedIndex; var d = b.find("select.vdata"); if (d[0] != null)d[0].selectedIndex = a.find("select.vdata")[0].selectedIndex} else{b.find(".data input").val(""); - b.find("select[name='field']").focus()}f.datepickerFix === true && jQuery.fn.datepicker !== undefined && a.find(".hasDatepicker").each(function(){var c = jQuery.data(this, "datepicker").settings; b.find("#" + this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(c)}); b.find("select[name='field']").change(); return false}); e.find(".ui-search").click(function(){var a = jQuery(e.selector), b, d = a.find("select[name='groupOp'] :selected").val(); b = f.stringResult?'{"groupOp":"' + d + '","rules":[':{groupOp:d, - rules:[]}; a.find(".sf").each(function(c){var g = jQuery(this).find("select[name='field'] :selected").val(), i = jQuery(this).find("select[name='op'] :selected").val(), h = jQuery(this).find("input.vdata,select.vdata :selected").val(); h += ""; h = h.replace(/\\/g, "\\\\").replace(/\"/g, '\\"'); if (f.stringResult){if (c > 0)b += ","; b += '{"field":"' + g + '",'; b += '"op":"' + i + '",'; b += '"data":"' + h + '"}'} else b.rules.push({field:g, op:i, data:h})}); if (f.stringResult)b += "]}"; f.onSearch(b); return false}); e.find(".ui-reset").click(function(){var a = - jQuery(e.selector); a.find(".ui-del").click(); a.find("select[name='groupOp']")[0].selectedIndex = 0; f.onReset(); return false}); e.find(".ui-add-last").click(function(){var a = jQuery(e.selector + " .sf:last"), b = a.clone(true).insertAfter(a); b.find(".ui-state-default").removeClass("ui-state-hover ui-state-active"); b.find(".data input").val(""); b.find("select[name='field']").focus(); f.datepickerFix === true && jQuery.fn.datepicker !== undefined && a.find(".hasDatepicker").each(function(){var d = jQuery.data(this, "datepicker").settings; - b.find("#" + this.id).unbind().removeAttr("id").removeClass("hasDatepicker").datepicker(d)}); b.find("select[name='field']").change(); return false}); this.setGroupOp = function(a){selDOMobj = this.$.find("select[name='groupOp']")[0]; var b = {}, d = selDOMobj.options.length, c; for (c = 0; c < d; c++)b[selDOMobj.options[c].value] = c; selDOMobj.selectedIndex = b[a]; $(selDOMobj).change()}; this.setFilter = function(a){var b = a.sfref; a = a.filter; var d = [], c, g, i, h, j = {}; selDOMobj = b.find("select[name='field']")[0]; c = 0; for (i = selDOMobj.options.length; c < - i; c++){j[selDOMobj.options[c].value] = {index:c, ops:{}}; d.push(selDOMobj.options[c].value)}c = 0; for (i = d.length; c < i; c++){if (selDOMobj = b.find(".ops > select[class='field" + c + "']")[0]){g = 0; for (h = selDOMobj.options.length; g < h; g++)j[d[c]].ops[selDOMobj.options[g].value] = g}if (selDOMobj = b.find(".data > select[class='field" + c + "']")[0]){j[d[c]].data = {}; g = 0; for (h = selDOMobj.options.length; g < h; g++)j[d[c]].data[selDOMobj.options[g].value] = g}}var u, q, A, B; d = a.field; if (j[d])u = j[d].index; if (u != null){q = j[d].ops[a.op]; if (q === - undefined){c = 0; for (i = v.operators.length; c < i; c++)if (v.operators[c].op == a.op){q = c; break}}A = a.data; B = j[d].data == null? - 1:j[d].data[A]}if (u != null && q != null && B != null){b.find("select[name='field']")[0].selectedIndex = u; b.find("select[name='field']").change(); b.find("select[name='op']")[0].selectedIndex = q; b.find("input.vdata").val(A); if (b = b.find("select.vdata")[0])b.selectedIndex = B; return true} else return false}}}return new I(this, k, H)}; jQuery.fn.searchFilter.version = "1.2.9"; - jQuery.fn.searchFilter.defaults = {clone:true, datepickerFix:true, onReset:function(k){alert("Reset Clicked. Data Returned: " + k)}, onSearch:function(k){alert("Search Clicked. Data Returned: " + k)}, onClose:function(k){k.hide()}, groupOps:[{op:"AND", text:"all"}, {op:"OR", text:"any"}], operators:[{op:"eq", text:"is equal to"}, {op:"ne", text:"is not equal to"}, {op:"lt", text:"is less than"}, {op:"le", text:"is less or equal to"}, {op:"gt", text:"is greater than"}, {op:"ge", text:"is greater or equal to"}, {op:"in", text:"is in"}, - {op:"ni", text:"is not in"}, {op:"bw", text:"begins with"}, {op:"bn", text:"does not begin with"}, {op:"ew", text:"ends with"}, {op:"en", text:"does not end with"}, {op:"cn", text:"contains"}, {op:"nc", text:"does not contain"}], matchText:"match", rulesText:"rules", resetText:"Reset", searchText:"Search", stringResult:true, windowTitle:"Search Rules", ajaxSelectOptions:{}}; - (function(a){a.jgrid.extend({editRow:function(d, t, i, n, o, u, s, c, f){return this.each(function(){var b = this, k, l, r = 0, p = null, q = {}, h, g; if (b.grid){h = a(b).jqGrid("getInd", d, true); if (h !== false)if ((a(h).attr("editable") || "0") == "0" && !a(h).hasClass("not-editable-row")){g = b.p.colModel; a("td", h).each(function(j){k = g[j].name; var v = b.p.treeGrid === true && k == b.p.ExpandColumn; if (v)l = a("span:first", this).html(); else try{l = a.unformat(this, {rowId:d, colModel:g[j]}, j)} catch (m){l = a(this).html()}if (k != "cb" && k != "subgrid" && k != - "rn"){if (b.p.autoencode)l = a.jgrid.htmlDecode(l); q[k] = l; if (g[j].editable === true){if (p === null)p = j; v?a("span:first", this).html(""):a(this).html(""); var e = a.extend({}, g[j].editoptions || {}, {id:d + "_" + k, name:k}); if (!g[j].edittype)g[j].edittype = "text"; e = createEl(g[j].edittype, e, l, true, a.extend({}, a.jgrid.ajaxOptions, b.p.ajaxSelectOptions || {})); a(e).addClass("editable"); v?a("span:first", this).append(e):a(this).append(e); g[j].edittype == "select" && g[j].editoptions.multiple === true && a.browser.msie && a(e).width(a(e).width()); - r++}}}); if (r > 0){q.id = d; b.p.savedRow.push(q); a(h).attr("editable", "1"); a("td:eq(" + p + ") input", h).focus(); t === true && a(h).bind("keydown", function(j){j.keyCode === 27 && a(b).jqGrid("restoreRow", d, f); if (j.keyCode === 13){if (j.target.tagName == "TEXTAREA")return true; a(b).jqGrid("saveRow", d, n, o, u, s, c, f); return false}j.stopPropagation()}); a.isFunction(i) && i(d)}}}})}, saveRow:function(d, t, i, n, o, u, s){return this.each(function(){var c = this, f, b = {}, k = {}, l, r, p, q; if (c.grid){q = a(c).jqGrid("getInd", d, true); if (q !== false){l = - a(q).attr("editable"); i = i?i:c.p.editurl; if (l === "1"){var h; a("td", q).each(function(m){h = c.p.colModel[m]; f = h.name; if (f != "cb" && f != "subgrid" && h.editable === true && f != "rn"){switch (h.edittype){case "checkbox":var e = ["Yes", "No"]; if (h.editoptions)e = h.editoptions.value.split(":"); b[f] = a("input", this).attr("checked")?e[0]:e[1]; break; case "text":case "password":case "textarea":case "button":b[f] = a("input, textarea", this).val(); break; case "select":if (h.editoptions.multiple){e = a("select", this); var x = []; b[f] = a(e).val(); - b[f] = b[f]?b[f].join(","):""; a("select > option:selected", this).each(function(y, z){x[y] = a(z).text()}); k[f] = x.join(",")} else{b[f] = a("select>option:selected", this).val(); k[f] = a("select>option:selected", this).text()}if (h.formatter && h.formatter == "select")k = {}; break; case "custom":try{if (h.editoptions && a.isFunction(h.editoptions.custom_value)){b[f] = h.editoptions.custom_value(a(".customelement", this), "get"); if (b[f] === undefined)throw"e2"; } else throw"e1"; } catch (w){w == "e1" && info_dialog(jQuery.jgrid.errors.errcap, - "function 'custom_value' " + a.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose); w == "e2"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + a.jgrid.edit.msg.novalue, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, w.message, jQuery.jgrid.edit.bClose)}break}p = checkValues(b[f], m, c); if (p[0] === false){p[1] = b[f] + " " + p[1]; return false}if (c.p.autoencode)b[f] = a.jgrid.htmlEncode(b[f])}}); if (p[0] === false)try{var g = findPos(a("#" + d)[0]); info_dialog(a.jgrid.errors.errcap, p[1], a.jgrid.edit.bClose, - {left:g[0], top:g[1]})} catch (j){alert(p[1])} else{if (b){var v; g = c.p.prmNames; v = g.oper; l = g.id; b[v] = g.editoper; b[l] = d; if (typeof c.p.inlineData == "undefined")c.p.inlineData = {}; if (typeof n == "undefined")n = {}; b = a.extend({}, b, c.p.inlineData, n)}if (i == "clientArray"){b = a.extend({}, b, k); c.p.autoencode && a.each(b, function(m, e){b[m] = a.jgrid.htmlDecode(e)}); l = a(c).jqGrid("setRowData", d, b); a(q).attr("editable", "0"); for (g = 0; g < c.p.savedRow.length; g++)if (c.p.savedRow[g].id == d){r = g; break}r >= 0 && c.p.savedRow.splice(r, 1); - a.isFunction(o) && o(d, l)} else{a("#lui_" + c.p.id).show(); a.ajax(a.extend({url:i, data:a.isFunction(c.p.serializeRowData)?c.p.serializeRowData(b):b, type:"POST", complete:function(m, e){a("#lui_" + c.p.id).hide(); if (e === "success")if ((a.isFunction(t)?t(m):true) === true){c.p.autoencode && a.each(b, function(x, w){b[x] = a.jgrid.htmlDecode(w)}); b = a.extend({}, b, k); a(c).jqGrid("setRowData", d, b); a(q).attr("editable", "0"); for (e = 0; e < c.p.savedRow.length; e++)if (c.p.savedRow[e].id == d){r = e; break}r >= 0 && c.p.savedRow.splice(r, 1); - a.isFunction(o) && o(d, m)} else a(c).jqGrid("restoreRow", d, s)}, error:function(m, e){a("#lui_" + c.p.id).hide(); a.isFunction(u)?u(d, m, e):alert("Error Row: " + d + " Result: " + m.status + ":" + m.statusText + " Status: " + e)}}, a.jgrid.ajaxOptions, c.p.ajaxRowOptions || {}))}a(q).unbind("keydown")}}}}})}, restoreRow:function(d, t){return this.each(function(){var i = this, n, o, u = {}; if (i.grid){o = a(i).jqGrid("getInd", d, true); if (o !== false){for (var s = 0; s < i.p.savedRow.length; s++)if (i.p.savedRow[s].id == d){n = s; break}if (n >= 0){if (a.isFunction(a.fn.datepicker))try{a("input.hasDatepicker", - "#" + o.id).datepicker("hide")} catch (c){}a.each(i.p.colModel, function(){if (this.editable === true && this.name in i.p.savedRow[n])u[this.name] = i.p.savedRow[n][this.name]}); a(i).jqGrid("setRowData", d, u); a(o).attr("editable", "0").unbind("keydown"); i.p.savedRow.splice(n, 1)}a.isFunction(t) && t(d)}}})}})})(jQuery); - (function(b){b.jgrid.extend({editCell:function(d, e, a){return this.each(function(){var c = this, h, f, g; if (!(!c.grid || c.p.cellEdit !== true)){e = parseInt(e, 10); c.p.selrow = c.rows[d].id; c.p.knv || b(c).jqGrid("GridNav"); if (c.p.savedRow.length > 0){if (a === true)if (d == c.p.iRow && e == c.p.iCol)return; b(c).jqGrid("saveCell", c.p.savedRow[0].id, c.p.savedRow[0].ic)} else window.setTimeout(function(){b("#" + c.p.knv).attr("tabindex", "-1").focus()}, 0); h = c.p.colModel[e].name; if (!(h == "subgrid" || h == "cb" || h == "rn")){g = b("td:eq(" + e + - ")", c.rows[d]); if (c.p.colModel[e].editable === true && a === true && !g.hasClass("not-editable-cell")){if (parseInt(c.p.iCol, 10) >= 0 && parseInt(c.p.iRow, 10) >= 0){b("td:eq(" + c.p.iCol + ")", c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight"); b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}b(g).addClass("edit-cell ui-state-highlight"); b(c.rows[d]).addClass("selected-row ui-state-hover"); try{f = b.unformat(g, {rowId:c.rows[d].id, colModel:c.p.colModel[e]}, e)} catch (k){f = b(g).html()}if (c.p.autoencode)f = - b.jgrid.htmlDecode(f); if (!c.p.colModel[e].edittype)c.p.colModel[e].edittype = "text"; c.p.savedRow.push({id:d, ic:e, name:h, v:f}); if (b.isFunction(c.p.formatCell)){var j = c.p.formatCell(c.rows[d].id, h, f, d, e); if (j !== undefined)f = j}j = b.extend({}, c.p.colModel[e].editoptions || {}, {id:d + "_" + h, name:h}); var i = createEl(c.p.colModel[e].edittype, j, f, true, b.extend({}, b.jgrid.ajaxOptions, c.p.ajaxSelectOptions || {})); b.isFunction(c.p.beforeEditCell) && c.p.beforeEditCell(c.rows[d].id, h, f, d, e); b(g).html("").append(i).attr("tabindex", - "0"); window.setTimeout(function(){b(i).focus()}, 0); b("input, select, textarea", g).bind("keydown", function(l){if (l.keyCode === 27)if (b("input.hasDatepicker", g).length > 0)b(".ui-datepicker").is(":hidden")?b(c).jqGrid("restoreCell", d, e):b("input.hasDatepicker", g).datepicker("hide"); else b(c).jqGrid("restoreCell", d, e); l.keyCode === 13 && b(c).jqGrid("saveCell", d, e); if (l.keyCode == 9)if (c.grid.hDiv.loading)return false; else l.shiftKey?b(c).jqGrid("prevCell", d, e):b(c).jqGrid("nextCell", d, e); l.stopPropagation()}); - b.isFunction(c.p.afterEditCell) && c.p.afterEditCell(c.rows[d].id, h, f, d, e)} else{if (parseInt(c.p.iCol, 10) >= 0 && parseInt(c.p.iRow, 10) >= 0){b("td:eq(" + c.p.iCol + ")", c.rows[c.p.iRow]).removeClass("edit-cell ui-state-highlight"); b(c.rows[c.p.iRow]).removeClass("selected-row ui-state-hover")}g.addClass("edit-cell ui-state-highlight"); b(c.rows[d]).addClass("selected-row ui-state-hover"); if (b.isFunction(c.p.onSelectCell)){f = g.html().replace(/\ \;/ig, ""); c.p.onSelectCell(c.rows[d].id, h, f, d, e)}}c.p.iCol = e; c.p.iRow = - d}}})}, saveCell:function(d, e){return this.each(function(){var a = this, c; if (!(!a.grid || a.p.cellEdit !== true)){c = a.p.savedRow.length >= 1?0:null; if (c !== null){var h = b("td:eq(" + e + ")", a.rows[d]), f, g, k = a.p.colModel[e], j = k.name, i = b.jgrid.jqID(j); switch (k.edittype){case "select":if (k.editoptions.multiple){i = b("#" + d + "_" + i, a.rows[d]); var l = []; if (f = b(i).val())f.join(","); else f = ""; b("option:selected", i).each(function(m, p){l[m] = b(p).text()}); g = l.join(",")} else{f = b("#" + d + "_" + i + ">option:selected", a.rows[d]).val(); - g = b("#" + d + "_" + i + ">option:selected", a.rows[d]).text()}if (k.formatter)g = f; break; case "checkbox":var n = ["Yes", "No"]; if (k.editoptions)n = k.editoptions.value.split(":"); g = f = b("#" + d + "_" + i, a.rows[d]).attr("checked")?n[0]:n[1]; break; case "password":case "text":case "textarea":case "button":g = f = b("#" + d + "_" + i, a.rows[d]).val(); break; case "custom":try{if (k.editoptions && b.isFunction(k.editoptions.custom_value)){f = k.editoptions.custom_value(b(".customelement", h), "get"); if (f === undefined)throw"e2"; else g = f} else throw"e1"; - } catch (q){q == "e1" && info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + b.jgrid.edit.msg.nodefined, jQuery.jgrid.edit.bClose); q == "e2"?info_dialog(jQuery.jgrid.errors.errcap, "function 'custom_value' " + b.jgrid.edit.msg.novalue, jQuery.jgrid.edit.bClose):info_dialog(jQuery.jgrid.errors.errcap, q.message, jQuery.jgrid.edit.bClose)}break}if (g != a.p.savedRow[c].v){if (b.isFunction(a.p.beforeSaveCell))if (c = a.p.beforeSaveCell(a.rows[d].id, j, f, d, e))f = c; var r = checkValues(f, e, a); if (r[0] === true){c = {}; - if (b.isFunction(a.p.beforeSubmitCell))(c = a.p.beforeSubmitCell(a.rows[d].id, j, f, d, e)) || (c = {}); b("input.hasDatepicker", h).length > 0 && b("input.hasDatepicker", h).datepicker("hide"); if (a.p.cellsubmit == "remote")if (a.p.cellurl){var o = {}; if (a.p.autoencode)f = b.jgrid.htmlEncode(f); o[j] = f; n = a.p.prmNames; k = n.id; i = n.oper; o[k] = a.rows[d].id; o[i] = n.editoper; o = b.extend(c, o); b("#lui_" + a.p.id).show(); a.grid.hDiv.loading = true; b.ajax(b.extend({url:a.p.cellurl, data:b.isFunction(a.p.serializeCellData)?a.p.serializeCellData(o): - o, type:"POST", complete:function(m, p){b("#lui_" + a.p.id).hide(); a.grid.hDiv.loading = false; if (p == "success")if (b.isFunction(a.p.afterSubmitCell)){m = a.p.afterSubmitCell(m, o.id, j, f, d, e); if (m[0] === true){b(h).empty(); b(a).jqGrid("setCell", a.rows[d].id, e, g, false, false, true); b(h).addClass("dirty-cell"); b(a.rows[d]).addClass("edited"); b.isFunction(a.p.afterSaveCell) && a.p.afterSaveCell(a.rows[d].id, j, f, d, e); a.p.savedRow.splice(0, 1)} else{info_dialog(b.jgrid.errors.errcap, m[1], b.jgrid.edit.bClose); b(a).jqGrid("restoreCell", - d, e)}} else{b(h).empty(); b(a).jqGrid("setCell", a.rows[d].id, e, g, false, false, true); b(h).addClass("dirty-cell"); b(a.rows[d]).addClass("edited"); b.isFunction(a.p.afterSaveCell) && a.p.afterSaveCell(a.rows[d].id, j, f, d, e); a.p.savedRow.splice(0, 1)}}, error:function(m, p){b("#lui_" + a.p.id).hide(); a.grid.hDiv.loading = false; b.isFunction(a.p.errorCell)?a.p.errorCell(m, p):info_dialog(b.jgrid.errors.errcap, m.status + " : " + m.statusText + "
" + p, b.jgrid.edit.bClose); b(a).jqGrid("restoreCell", d, e)}}, b.jgrid.ajaxOptions, - a.p.ajaxCellOptions || {}))} else try{info_dialog(b.jgrid.errors.errcap, b.jgrid.errors.nourl, b.jgrid.edit.bClose); b(a).jqGrid("restoreCell", d, e)} catch (s){}if (a.p.cellsubmit == "clientArray"){b(h).empty(); b(a).jqGrid("setCell", a.rows[d].id, e, g, false, false, true); b(h).addClass("dirty-cell"); b(a.rows[d]).addClass("edited"); b.isFunction(a.p.afterSaveCell) && a.p.afterSaveCell(a.rows[d].id, j, f, d, e); a.p.savedRow.splice(0, 1)}} else try{window.setTimeout(function(){info_dialog(b.jgrid.errors.errcap, f + " " + r[1], b.jgrid.edit.bClose)}, - 100); b(a).jqGrid("restoreCell", d, e)} catch (t){}} else b(a).jqGrid("restoreCell", d, e)}b.browser.opera?b("#" + a.p.knv).attr("tabindex", "-1").focus():window.setTimeout(function(){b("#" + a.p.knv).attr("tabindex", "-1").focus()}, 0)}})}, restoreCell:function(d, e){return this.each(function(){var a = this, c; if (!(!a.grid || a.p.cellEdit !== true)){c = a.p.savedRow.length >= 1?0:null; if (c !== null){var h = b("td:eq(" + e + ")", a.rows[d]); if (b.isFunction(b.fn.datepicker))try{b("input.hasDatepicker", h).datepicker("hide")} catch (f){}b(h).empty().attr("tabindex", - "-1"); b(a).jqGrid("setCell", a.rows[d].id, e, a.p.savedRow[c].v, false, false, true); a.p.savedRow.splice(0, 1)}window.setTimeout(function(){b("#" + a.p.knv).attr("tabindex", "-1").focus()}, 0)}})}, nextCell:function(d, e){return this.each(function(){var a = this, c = false; if (!(!a.grid || a.p.cellEdit !== true)){for (var h = e + 1; h < a.p.colModel.length; h++)if (a.p.colModel[h].editable === true){c = h; break}if (c !== false)b(a).jqGrid("editCell", d, c, true); else a.p.savedRow.length > 0 && b(a).jqGrid("saveCell", d, e)}})}, prevCell:function(d, - e){return this.each(function(){var a = this, c = false; if (!(!a.grid || a.p.cellEdit !== true)){for (var h = e - 1; h >= 0; h--)if (a.p.colModel[h].editable === true){c = h; break}if (c !== false)b(a).jqGrid("editCell", d, c, true); else a.p.savedRow.length > 0 && b(a).jqGrid("saveCell", d, e)}})}, GridNav:function(){return this.each(function(){function d(g, k, j){if (j.substr(0, 1) == "v"){var i = b(a.grid.bDiv)[0].clientHeight, l = b(a.grid.bDiv)[0].scrollTop, n = a.rows[g].offsetTop + a.rows[g].clientHeight, q = a.rows[g].offsetTop; if (j == "vd")if (n >= i)b(a.grid.bDiv)[0].scrollTop = - b(a.grid.bDiv)[0].scrollTop + a.rows[g].clientHeight; if (j == "vu")if (q < l)b(a.grid.bDiv)[0].scrollTop = b(a.grid.bDiv)[0].scrollTop - a.rows[g].clientHeight}if (j == "h"){j = b(a.grid.bDiv)[0].clientWidth; i = b(a.grid.bDiv)[0].scrollLeft; l = a.rows[g].cells[k].offsetLeft; if (a.rows[g].cells[k].offsetLeft + a.rows[g].cells[k].clientWidth >= j + parseInt(i, 10))b(a.grid.bDiv)[0].scrollLeft = b(a.grid.bDiv)[0].scrollLeft + a.rows[g].cells[k].clientWidth; else if (l < i)b(a.grid.bDiv)[0].scrollLeft = b(a.grid.bDiv)[0].scrollLeft - a.rows[g].cells[k].clientWidth}} - function e(g, k){var j, i; if (k == "lft"){j = g + 1; for (i = g; i >= 0; i--)if (a.p.colModel[i].hidden !== true){j = i; break}}if (k == "rgt"){j = g - 1; for (i = g; i < a.p.colModel.length; i++)if (a.p.colModel[i].hidden !== true){j = i; break}}return j}var a = this; if (!(!a.grid || a.p.cellEdit !== true)){a.p.knv = a.p.id + "_kn"; var c = b(""), h, f; b(c).insertBefore(a.grid.cDiv); - b("#" + a.p.knv).focus().keydown(function(g){f = g.keyCode; if (a.p.direction == "rtl")if (f == 37)f = 39; else if (f == 39)f = 37; switch (f){case 38:if (a.p.iRow - 1 >= 0){d(a.p.iRow - 1, a.p.iCol, "vu"); b(a).jqGrid("editCell", a.p.iRow - 1, a.p.iCol, false)}break; case 40:if (a.p.iRow + 1 <= a.rows.length - 1){d(a.p.iRow + 1, a.p.iCol, "vd"); b(a).jqGrid("editCell", a.p.iRow + 1, a.p.iCol, false)}break; case 37:if (a.p.iCol - 1 >= 0){h = e(a.p.iCol - 1, "lft"); d(a.p.iRow, h, "h"); b(a).jqGrid("editCell", a.p.iRow, h, false)}break; case 39:if (a.p.iCol + 1 <= a.p.colModel.length - - 1){h = e(a.p.iCol + 1, "rgt"); d(a.p.iRow, h, "h"); b(a).jqGrid("editCell", a.p.iRow, h, false)}break; case 13:parseInt(a.p.iCol, 10) >= 0 && parseInt(a.p.iRow, 10) >= 0 && b(a).jqGrid("editCell", a.p.iRow, a.p.iCol, true); break}return false})}})}, getChangedCells:function(d){var e = []; d || (d = "all"); this.each(function(){var a = this, c; !a.grid || a.p.cellEdit !== true || b(a.rows).each(function(h){var f = {}; if (b(this).hasClass("edited")){b("td", this).each(function(g){c = a.p.colModel[g].name; if (c !== "cb" && c !== "subgrid")if (d == "dirty"){if (b(this).hasClass("dirty-cell"))try{f[c] = - b.unformat(this, {rowId:a.rows[h].id, colModel:a.p.colModel[g]}, g)} catch (k){f[c] = b.jgrid.htmlDecode(b(this).html())}} else try{f[c] = b.unformat(this, {rowId:a.rows[h].id, colModel:a.p.colModel[g]}, g)} catch (j){f[c] = b.jgrid.htmlDecode(b(this).html())}}); f.id = this.id; e.push(f)}})}); return e}})})(jQuery); - (function(b){b.fn.jqm = function(a){var f = {overlay:50, closeoverlay:true, overlayClass:"jqmOverlay", closeClass:"jqmClose", trigger:".jqModal", ajax:e, ajaxText:"", target:e, modal:e, toTop:e, onShow:e, onHide:e, onLoad:e}; return this.each(function(){if (this._jqm)return i[this._jqm].c = b.extend({}, i[this._jqm].c, a); l++; this._jqm = l; i[l] = {c:b.extend(f, b.jqm.params, a), a:e, w:b(this).addClass("jqmID" + l), s:l}; f.trigger && b(this).jqmAddTrigger(f.trigger)})}; b.fn.jqmAddClose = function(a){return o(this, a, "jqmHide")}; b.fn.jqmAddTrigger = - function(a){return o(this, a, "jqmShow")}; b.fn.jqmShow = function(a){return this.each(function(){b.jqm.open(this._jqm, a)})}; b.fn.jqmHide = function(a){return this.each(function(){b.jqm.close(this._jqm, a)})}; b.jqm = {hash:{}, open:function(a, f){var c = i[a], d = c.c, h = "." + d.closeClass, g = parseInt(c.w.css("z-index")); g = g > 0?g:3E3; var j = b("
").css({height:"100%", width:"100%", position:"fixed", left:0, top:0, "z-index":g - 1, opacity:d.overlay / 100}); if (c.a)return e; c.t = f; c.a = true; c.w.css("z-index", g); if (d.modal){k[0] || - setTimeout(function(){p("bind")}, 1); k.push(a)} else if (d.overlay > 0)d.closeoverlay && c.w.jqmAddClose(j); else j = e; c.o = j?j.addClass(d.overlayClass).prependTo("body"):e; if (q){b("html,body").css({height:"100%", width:"100%"}); if (j){j = j.css({position:"absolute"})[0]; for (var m in{Top:1, Left:1})j.style.setExpression(m.toLowerCase(), "(_=(document.documentElement.scroll" + m + " || document.body.scroll" + m + "))+'px'")}}if (d.ajax){a = d.target || c.w; g = d.ajax; a = typeof a == "string"?b(a, c.w):b(a); g = g.substr(0, 1) == "@"?b(f).attr(g.substring(1)): - g; a.html(d.ajaxText).load(g, function(){d.onLoad && d.onLoad.call(this, c); h && c.w.jqmAddClose(b(h, c.w)); r(c)})} else h && c.w.jqmAddClose(b(h, c.w)); d.toTop && c.o && c.w.before('').insertAfter(c.o); d.onShow?d.onShow(c):c.w.show(); r(c); return e}, close:function(a){a = i[a]; if (!a.a)return e; a.a = e; if (k[0]){k.pop(); k[0] || p("unbind")}a.c.toTop && a.o && b("#jqmP" + a.w[0]._jqm).after(a.w).remove(); if (a.c.onHide)a.c.onHide(a); else{a.w.hide(); a.o && a.o.remove()}return e}, params:{}}; var l = - 0, i = b.jqm.hash, k = [], q = b.browser.msie && b.browser.version == "6.0", e = false, r = function(a){var f = b('').css({opacity:0}); if (q)if (a.o)a.o.html('

').prepend(f); else b("iframe.jqm", a.w)[0] || a.w.prepend(f); s(a)}, s = function(a){try{b(":input:visible", a.w)[0].focus()} catch (f){}}, p = function(a){b(document)[a]("keypress", n)[a]("keydown", n)[a]("mousedown", n)}, n = function(a){var f = i[k[k.length - 1]]; (a = !b(a.target).parents(".jqmID" + - f.s)[0]) && s(f); return!a}, o = function(a, f, c){return a.each(function(){var d = this._jqm; b(f).each(function(){if (!this[c]){this[c] = []; b(this).click(function(){for (var h in{jqmShow:1, jqmHide:1})for (var g in this[h])i[this[h][g]] && i[this[h][g]].w[h](this); return e})}this[c].push(d)})})}})(jQuery); - (function(b){b.fn.jqDrag = function(a){return l(this, a, "d")}; b.fn.jqResize = function(a, e){return l(this, a, "r", e)}; b.jqDnR = {dnr:{}, e:0, drag:function(a){if (c.k == "d")d.css({left:c.X + a.pageX - c.pX, top:c.Y + a.pageY - c.pY}); else{d.css({width:Math.max(a.pageX - c.pX + c.W, 0), height:Math.max(a.pageY - c.pY + c.H, 0)}); M1 && f.css({width:Math.max(a.pageX - M1.pX + M1.W, 0), height:Math.max(a.pageY - M1.pY + M1.H, 0)})}return false}, stop:function(){b(document).unbind("mousemove", i.drag).unbind("mouseup", i.stop)}}; var i = b.jqDnR, c = i.dnr, - d = i.e, f, l = function(a, e, n, m){return a.each(function(){e = e?b(e, a):a; e.bind("mousedown", {e:a, k:n}, function(g){var j = g.data, h = {}; d = j.e; f = m?b(m):false; if (d.css("position") != "relative")try{d.position(h)} catch (o){}c = {X:h.left || k("left") || 0, Y:h.top || k("top") || 0, W:k("width") || d[0].scrollWidth || 0, H:k("height") || d[0].scrollHeight || 0, pX:g.pageX, pY:g.pageY, k:j.k}; M1 = f && j.k != "d"?{X:h.left || f1("left") || 0, Y:h.top || f1("top") || 0, W:f[0].offsetWidth || f1("width") || 0, H:f[0].offsetHeight || f1("height") || 0, pX:g.pageX, pY:g.pageY, - k:j.k}:false; b(document).mousemove(b.jqDnR.drag).mouseup(b.jqDnR.stop); return false})})}, k = function(a){return parseInt(d.css(a)) || false}; f1 = function(a){return parseInt(f.css(a)) || false}})(jQuery); - (function(a){a.jgrid.extend({setSubGrid:function(){return this.each(function(){var e = this; e.p.colNames.unshift(""); e.p.colModel.unshift({name:"subgrid", width:a.browser.safari?e.p.subGridWidth + e.p.cellLayout:e.p.subGridWidth, sortable:false, resizable:false, hidedlg:true, search:false, fixed:true}); e = e.p.subGridModel; if (e[0]){e[0].align = a.extend([], e[0].align || []); for (var c = 0; c < e[0].name.length; c++)e[0].align[c] = e[0].align[c] || "left"}})}, addSubGridCell:function(e, c){var b = "", n, k; this.each(function(){b = - this.formatCol(e, c); n = this.p.gridview; k = this.p.id}); return n === false?'":'"}, addSubGrid:function(e, c){return this.each(function(){var b = this; if (b.grid){var n, k, p, t, s, u, o; a("td:eq(" + c + ")", e).click(function(){if (a(this).hasClass("sgcollapsed")){p = b.p.id; n = a(this).parent(); - t = c >= 1?" ":""; k = a(n).attr("id"); o = true; if (a.isFunction(b.p.subGridBeforeExpand))o = b.p.subGridBeforeExpand(p + "_" + k, k); if (o === false)return false; s = 0; a.each(b.p.colModel, function(){if (this.hidden === true || this.name == "rn" || this.name == "cb")s++}); u = "" + t + "

"; a(this).parent().after(u + "
"); a.isFunction(b.p.subGridRowExpanded)?b.p.subGridRowExpanded(p + "_" + k, k):x(n); a(this).html("").removeClass("sgcollapsed").addClass("sgexpanded")} else if (a(this).hasClass("sgexpanded")){o = true; if (a.isFunction(b.p.subGridRowColapsed)){n = a(this).parent(); k = a(n).attr("id"); o = b.p.subGridRowColapsed(p + "_" + k, k)}if (o === false)return false; a(this).parent().next().remove(".ui-subgrid"); - a(this).html("").removeClass("sgexpanded").addClass("sgcollapsed")}return false}); var x = function(g){var j, f, d, h; j = a(g).attr("id"); f = {nd_:(new Date).getTime()}; f[b.p.prmNames.subgridid] = j; if (!b.p.subGridModel[0])return false; if (b.p.subGridModel[0].params)for (h = 0; h < b.p.subGridModel[0].params.length; h++)for (d = 0; d < b.p.colModel.length; d++)if (b.p.colModel[d].name == b.p.subGridModel[0].params[h])f[b.p.colModel[d].name] = a("td:eq(" + - d + ")", g).text().replace(/\ \;/ig, ""); if (!b.grid.hDiv.loading){b.grid.hDiv.loading = true; a("#load_" + b.p.id).show(); if (!b.p.subgridtype)b.p.subgridtype = b.p.datatype; if (a.isFunction(b.p.subgridtype))b.p.subgridtype(f); else b.p.subgridtype = b.p.subgridtype.toLowerCase(); switch (b.p.subgridtype){case "xml":case "json":a.ajax(a.extend({type:b.p.mtype, url:b.p.subGridUrl, dataType:b.p.subgridtype, data:a.isFunction(b.p.serializeSubGridData)?b.p.serializeSubGridData(f):f, complete:function(i){b.p.subgridtype == - "xml"?v(i.responseXML, j):w(a.jgrid.parse(i.responseText), j)}}, a.jgrid.ajaxOptions, b.p.ajaxSubgridOptions || {})); break}}return false}, r = function(g, j, f){j = a("").html(j); a(g).append(j)}, v = function(g, j){var f, d, h, i = a("
"), l = a(""); for (d = 0; d < b.p.subGridModel[0].name.length; d++){f = a(""); a(f).html(b.p.subGridModel[0].name[d]); - a(f).width(b.p.subGridModel[0].width[d]); a(l).append(f)}a(i).append(l); if (g){h = b.p.xmlReader.subgrid; a(h.root + " " + h.row, g).each(function(){l = a(""); if (h.repeatitems === true)a(h.cell, this).each(function(q){r(l, a(this).text() || " ", q)}); else{var m = b.p.subGridModel[0].mapping || b.p.subGridModel[0].name; if (m)for (d = 0; d < m.length; d++)r(l, a(m[d], this).text() || " ", d)}a(i).append(l)})}g = a("table:first", b.grid.bDiv).attr("id") + "_"; a("#" + g + j).append(i); b.grid.hDiv.loading = - false; a("#load_" + b.p.id).hide(); return false}, w = function(g, j){var f, d, h, i, l = a("
"), m = a(""); for (d = 0; d < b.p.subGridModel[0].name.length; d++){f = a(""); a(f).html(b.p.subGridModel[0].name[d]); a(f).width(b.p.subGridModel[0].width[d]); a(m).append(f)}a(l).append(m); if (g){f = b.p.jsonReader.subgrid; g = g[f.root]; if (typeof g !== "undefined")for (d = 0; d < - g.length; d++){h = g[d]; m = a(""); if (f.repeatitems === true){if (f.cell)h = h[f.cell]; for (i = 0; i < h.length; i++)r(m, h[i] || " ", i)} else{var q = b.p.subGridModel[0].mapping || b.p.subGridModel[0].name; if (q.length)for (i = 0; i < q.length; i++)r(m, h[q[i]] || " ", i)}a(l).append(m)}}d = a("table:first", b.grid.bDiv).attr("id") + "_"; a("#" + d + j).append(l); b.grid.hDiv.loading = false; a("#load_" + b.p.id).hide(); return false}; b.subGridXml = function(g, j){v(g, j)}; b.subGridJson = function(g, - j){w(g, j)}}})}, expandSubGridRow:function(e){return this.each(function(){var c = this; if (c.grid || e)if (c.p.subGrid === true)if (c = a(this).jqGrid("getInd", e, true))(c = a("td.sgcollapsed", c)[0]) && a(c).trigger("click")})}, collapseSubGridRow:function(e){return this.each(function(){var c = this; if (c.grid || e)if (c.p.subGrid === true)if (c = a(this).jqGrid("getInd", e, true))(c = a("td.sgexpanded", c)[0]) && a(c).trigger("click")})}, toggleSubGridRow:function(e){return this.each(function(){var c = this; if (c.grid || e)if (c.p.subGrid === - true)if (c = a(this).jqGrid("getInd", e, true)){var b = a("td.sgcollapsed", c)[0]; if (b)a(b).trigger("click"); else(b = a("td.sgexpanded", c)[0]) && a(b).trigger("click")}})}})})(jQuery); - (function(d){d.jgrid.extend({setTreeNode:function(a, c){return this.each(function(){var b = this; if (b.grid && b.p.treeGrid){var e = b.p.expColInd, f = b.p.treeReader.expanded_field, j = b.p.treeReader.leaf_field, k = b.p.treeReader.level_field; c.level = a[k]; if (b.p.treeGridModel == "nested"){c.lft = a[b.p.treeReader.left_field]; c.rgt = a[b.p.treeReader.right_field]; a[j] || (a[j] = parseInt(c.rgt, 10) === parseInt(c.lft, 10) + 1?"true":"false")} else c.parent_id = a[b.p.treeReader.parent_id_field]; var g = parseInt(c.level, 10), i; if (b.p.tree_root_level === - 0){i = g + 1; g = g} else{i = g; g = g - 1}i = "
"; i += "
").prepend(i); d(".treeclick", c).bind("click", function(h){h = d(h.target || h.srcElement, b.rows).parents("tr.jqgrow")[0].rowIndex; if (!b.rows[h].isLeaf)if (b.rows[h].expanded){d(b).jqGrid("collapseRow", b.rows[h]); d(b).jqGrid("collapseNode", b.rows[h])} else{d(b).jqGrid("expandRow", b.rows[h]); d(b).jqGrid("expandNode", b.rows[h])}return false}); b.p.ExpandColClick === true && d("span", c).css("cursor", "pointer").bind("click", - function(h){h = d(h.target || h.srcElement, b.rows).parents("tr.jqgrow")[0].rowIndex; if (!b.rows[h].isLeaf)if (b.rows[h].expanded){d(b).jqGrid("collapseRow", b.rows[h]); d(b).jqGrid("collapseNode", b.rows[h])} else{d(b).jqGrid("expandRow", b.rows[h]); d(b).jqGrid("expandNode", b.rows[h])}d(b).jqGrid("setSelection", b.rows[h].id); return false})}})}, setTreeGrid:function(){return this.each(function(){var a = this, c = 0; if (a.p.treeGrid){a.p.treedatatype || d.extend(a.p, {treedatatype:a.p.datatype}); a.p.subGrid = false; a.p.altRows = - false; a.p.pgbuttons = false; a.p.pginput = false; a.p.multiselect = false; a.p.rowList = []; a.p.treeIcons = d.extend({plus:"ui-icon-triangle-1-" + (a.p.direction == "rtl"?"w":"e"), minus:"ui-icon-triangle-1-s", leaf:"ui-icon-radio-off"}, a.p.treeIcons || {}); if (a.p.treeGridModel == "nested")a.p.treeReader = d.extend({level_field:"level", left_field:"lft", right_field:"rgt", leaf_field:"isLeaf", expanded_field:"expanded"}, a.p.treeReader); else if (a.p.treeGridModel == "adjacency")a.p.treeReader = d.extend({level_field:"level", parent_id_field:"parent", - leaf_field:"isLeaf", expanded_field:"expanded"}, a.p.treeReader); for (var b in a.p.colModel)if (a.p.colModel.hasOwnProperty(b)){if (a.p.colModel[b].name == a.p.ExpandColumn){a.p.expColInd = c; break}c++}if (!a.p.expColInd)a.p.expColInd = 0; d.each(a.p.treeReader, function(e, f){if (f){a.p.colNames.push(f); a.p.colModel.push({name:f, width:1, hidden:true, sortable:false, resizable:false, hidedlg:true, editable:true, search:false})}})}})}, expandRow:function(a){this.each(function(){var c = this; if (c.grid && c.p.treeGrid){var b = - d(c).jqGrid("getNodeChildren", a); d(b).each(function(){d(this).css("display", ""); this.expanded && d(c).jqGrid("expandRow", this)})}})}, collapseRow:function(a){this.each(function(){var c = this; if (c.grid && c.p.treeGrid){var b = d(c).jqGrid("getNodeChildren", a); d(b).each(function(){d(this).css("display", "none"); this.expanded && d(c).jqGrid("collapseRow", this)})}})}, getRootNodes:function(){var a = []; this.each(function(){var c = this; if (c.grid && c.p.treeGrid)switch (c.p.treeGridModel){case "nested":var b = c.p.treeReader.level_field; - d(c.rows).each(function(){parseInt(this[b], 10) === parseInt(c.p.tree_root_level, 10) && a.push(this)}); break; case "adjacency":d(c.rows).each(function(){if (this.parent_id === null || String(this.parent_id).toLowerCase() == "null")a.push(this)}); break}}); return a}, getNodeDepth:function(a){var c = null; this.each(function(){var b = this; if (this.grid && this.p.treeGrid)switch (b.p.treeGridModel){case "nested":c = parseInt(a.level, 10) - parseInt(this.p.tree_root_level, 10); break; case "adjacency":c = d(b).jqGrid("getNodeAncestors", - a).length; break}}); return c}, getNodeParent:function(a){var c = null; this.each(function(){var b = this; if (b.grid && b.p.treeGrid)switch (b.p.treeGridModel){case "nested":var e = parseInt(a.lft, 10), f = parseInt(a.rgt, 10), j = parseInt(a.level, 10); d(this.rows).each(function(){if (parseInt(this.level, 10) === j - 1 && parseInt(this.lft, 10) < e && parseInt(this.rgt, 10) > f){c = this; return false}}); break; case "adjacency":d(this.rows).each(function(){if (this.id == a.parent_id){c = this; return false}}); break}}); return c}, getNodeChildren:function(a){var c = - []; this.each(function(){var b = this; if (b.grid && b.p.treeGrid)switch (b.p.treeGridModel){case "nested":var e = parseInt(a.lft, 10), f = parseInt(a.rgt, 10), j = parseInt(a.level, 10); d(this.rows).each(function(){parseInt(this.level, 10) === j + 1 && parseInt(this.lft, 10) > e && parseInt(this.rgt, 10) < f && c.push(this)}); break; case "adjacency":d(this.rows).each(function(){this.parent_id == a.id && c.push(this)}); break}}); return c}, getFullTreeNode:function(a){var c = []; this.each(function(){var b = this, e; if (b.grid && b.p.treeGrid)switch (b.p.treeGridModel){case "nested":var f = - parseInt(a.lft, 10), j = parseInt(a.rgt, 10), k = parseInt(a.level, 10); d(this.rows).each(function(){parseInt(this.level, 10) >= k && parseInt(this.lft, 10) >= f && parseInt(this.lft, 10) <= j && c.push(this)}); break; case "adjacency":c.push(a); d(this.rows).each(function(g){e = c.length; for (g = 0; g < e; g++)if (c[g].id == this.parent_id){c.push(this); break}}); break}}); return c}, getNodeAncestors:function(a){var c = []; this.each(function(){if (this.grid && this.p.treeGrid)for (var b = d(this).jqGrid("getNodeParent", a); b; ){c.push(b); b = d(this).jqGrid("getNodeParent", - b)}}); return c}, isVisibleNode:function(a){var c = true; this.each(function(){var b = this; if (b.grid && b.p.treeGrid){b = d(b).jqGrid("getNodeAncestors", a); d(b).each(function(){c = c && this.expanded; if (!c)return false})}}); return c}, isNodeLoaded:function(a){var c; this.each(function(){var b = this; if (b.grid && b.p.treeGrid)c = a.loaded !== undefined?a.loaded:a.isLeaf || d(b).jqGrid("getNodeChildren", a).length > 0?true:false}); return c}, expandNode:function(a){return this.each(function(){if (this.grid && this.p.treeGrid)if (!a.expanded)if (d(this).jqGrid("isNodeLoaded", - a)){a.expanded = true; d("div.treeclick", a).removeClass(this.p.treeIcons.plus + " tree-plus").addClass(this.p.treeIcons.minus + " tree-minus")} else{a.expanded = true; d("div.treeclick", a).removeClass(this.p.treeIcons.plus + " tree-plus").addClass(this.p.treeIcons.minus + " tree-minus"); this.p.treeANode = a.rowIndex; this.p.datatype = this.p.treedatatype; this.p.treeGridModel == "nested"?d(this).jqGrid("setGridParam", {postData:{nodeid:a.id, n_left:a.lft, n_right:a.rgt, n_level:a.level}}):d(this).jqGrid("setGridParam", {postData:{nodeid:a.id, - parentid:a.parent_id, n_level:a.level}}); d(this).trigger("reloadGrid"); this.p.treeGridModel == "nested"?d(this).jqGrid("setGridParam", {postData:{nodeid:"", n_left:"", n_right:"", n_level:""}}):d(this).jqGrid("setGridParam", {postData:{nodeid:"", parentid:"", n_level:""}})}})}, collapseNode:function(a){return this.each(function(){if (this.grid && this.p.treeGrid)if (a.expanded){a.expanded = false; d("div.treeclick", a).removeClass(this.p.treeIcons.minus + " tree-minus").addClass(this.p.treeIcons.plus + " tree-plus")}})}, - SortTree:function(a){return this.each(function(){if (this.grid && this.p.treeGrid){var c, b, e, f = [], j = this, k = d(this).jqGrid("getRootNodes"); k.sort(function(g, i){if (g.sortKey < i.sortKey)return - a; if (g.sortKey > i.sortKey)return a; return 0}); if (k[0]){d("td", k[0]).each(function(g){d(this).css("width", j.grid.headers[g].width + "px")}); j.grid.cols = k[0].cells}c = 0; for (b = k.length; c < b; c++){e = k[c]; f.push(e); d(this).jqGrid("collectChildrenSortTree", f, e, a)}d.each(f, function(g, i){d("tbody", j.grid.bDiv).append(i); i.sortKey = - null})}})}, collectChildrenSortTree:function(a, c, b){return this.each(function(){if (this.grid && this.p.treeGrid){var e, f, j, k = d(this).jqGrid("getNodeChildren", c); k.sort(function(g, i){if (g.sortKey < i.sortKey)return - b; if (g.sortKey > i.sortKey)return b; return 0}); e = 0; for (f = k.length; e < f; e++){j = k[e]; a.push(j); d(this).jqGrid("collectChildrenSortTree", a, j, b)}}})}, setTreeRow:function(a, c){var b = false; this.each(function(){var e = this; if (e.grid && e.p.treeGrid)b = d(e).jqGrid("setRowData", a, c)}); return b}, delTreeNode:function(a){return this.each(function(){var c = - this; if (c.grid && c.p.treeGrid){var b = d(c).jqGrid("getInd", a, true); if (b){var e = d(c).jqGrid("getNodeChildren", b); if (e.length > 0)for (var f = 0; f < e.length; f++)d(c).jqGrid("delRowData", e[f].id); d(c).jqGrid("delRowData", b.id)}}})}})})(jQuery); - (function(b){b.jgrid.extend({jqGridImport:function(a){a = b.extend({imptype:"xml", impstring:"", impurl:"", mtype:"GET", impData:{}, xmlGrid:{config:"roots>grid", data:"roots>rows"}, jsonGrid:{config:"grid", data:"data"}, ajaxOptions:{}}, a || {}); return this.each(function(){var e = this, c = function(d, g){var f = b(g.xmlGrid.config, d)[0]; g = b(g.xmlGrid.data, d)[0]; var k; if (xmlJsonClass.xml2json && b.jgrid.parse){f = xmlJsonClass.xml2json(f, " "); f = b.jgrid.parse(f); for (var h in f)if (f.hasOwnProperty(h))k = f[h]; if (g){h = f.grid.datatype; - f.grid.datatype = "xmlstring"; f.grid.datastr = d; b(e).jqGrid(k).jqGrid("setGridParam", {datatype:h})} else b(e).jqGrid(k)} else alert("xml2json or parse are not present")}, i = function(d, g){if (d && typeof d == "string"){var f = b.jgrid.parse(d); d = f[g.jsonGrid.config]; if (g = f[g.jsonGrid.data]){f = d.datatype; d.datatype = "jsonstring"; d.datastr = g; b(e).jqGrid(d).jqGrid("setGridParam", {datatype:f})} else b(e).jqGrid(d)}}; switch (a.imptype){case "xml":b.ajax(b.extend({url:a.impurl, type:a.mtype, data:a.impData, dataType:"xml", - complete:function(d, g){if (g == "success"){c(d.responseXML, a); b.isFunction(a.importComplete) && a.importComplete(d)}}}, a.ajaxOptions)); break; case "xmlstring":if (a.impstring && typeof a.impstring == "string"){var j = b.jgrid.stringToDoc(a.impstring); if (j){c(j, a); b.isFunction(a.importComplete) && a.importComplete(j); a.impstring = null}j = null}break; case "json":b.ajax(b.extend({url:a.impurl, type:a.mtype, data:a.impData, dataType:"json", complete:function(d, g){if (g == "success"){i(d.responseText, a); b.isFunction(a.importComplete) && - a.importComplete(d)}}}, a.ajaxOptions)); break; case "jsonstring":if (a.impstring && typeof a.impstring == "string"){i(a.impstring, a); b.isFunction(a.importComplete) && a.importComplete(a.impstring); a.impstring = null}break}})}, jqGridExport:function(a){a = b.extend({exptype:"xmlstring", root:"grid", ident:"\t"}, a || {}); var e = null; this.each(function(){if (this.grid){var c = b.extend({}, b(this).jqGrid("getGridParam")); if (c.rownumbers){c.colNames.splice(0, 1); c.colModel.splice(0, 1)}if (c.multiselect){c.colNames.splice(0, 1); - c.colModel.splice(0, 1)}if (c.subGrid){c.colNames.splice(0, 1); c.colModel.splice(0, 1)}c.knv = null; if (c.treeGrid)for (var i in c.treeReader)if (c.treeReader.hasOwnProperty(i)){c.colNames.splice(c.colNames.length - 1); c.colModel.splice(c.colModel.length - 1)}switch (a.exptype){case "xmlstring":e = "<" + a.root + ">" + xmlJsonClass.json2xml(c, a.ident) + ""; break; case "jsonstring":e = "{" + xmlJsonClass.toJson(c, a.root, a.ident) + "}"; if (c.postData.filters !== undefined){e = e.replace(/filters":"/, 'filters":'); e = e.replace(/}]}"/, - "}]}")}break}}}); return e}, excelExport:function(a){a = b.extend({exptype:"remote", url:null, oper:"oper", tag:"excel", exportOptions:{}}, a || {}); return this.each(function(){$t = this; if (this.grid)if (a.exptype == "remote"){var e = b.extend({}, this.p.postData); e[a.oper] = a.tag; e = jQuery.param(e); window.location = a.url + "?" + e}})}})})(jQuery); - var xmlJsonClass = {xml2json:function(a, b){if (a.nodeType === 9)a = a.documentElement; a = this.toJson(this.toObj(this.removeWhite(a)), a.nodeName, "\t"); return"{\n" + b + (b?a.replace(/\t/g, b):a.replace(/\t|\n/g, "")) + "\n}"}, json2xml:function(a, b){var g = function(d, c, j){var i = "", k, h; if (d instanceof Array)if (d.length === 0)i += j + "<" + c + ">__EMPTY_ARRAY_\n"; else{k = 0; for (h = d.length; k < h; k += 1){var l = j + g(d[k], c, j + "\t") + "\n"; i += l}} else if (typeof d === "object"){k = false; i += j + "<" + c; for (h in d)if (d.hasOwnProperty(h))if (h.charAt(0) === - "@")i += " " + h.substr(1) + '="' + d[h].toString() + '"'; else k = true; i += k?">":"/>"; if (k){for (h in d)if (d.hasOwnProperty(h))if (h === "#text")i += d[h]; else if (h === "#cdata")i += ""; else if (h.charAt(0) !== "@")i += g(d[h], h, j + "\t"); i += (i.charAt(i.length - 1) === "\n"?j:"") + ""}} else i += typeof d === "function"?j + "<" + c + ">":d.toString() === '""' || d.toString().length === 0?j + "<" + c + ">__EMPTY_STRING_":j + "<" + c + ">" + d.toString() + ""; return i}, e = "", f; for (f in a)if (a.hasOwnProperty(f))e += - g(a[f], f, ""); return b?e.replace(/\t/g, b):e.replace(/\t|\n/g, "")}, toObj:function(a){var b = {}, g = /function/i; if (a.nodeType === 1){if (a.attributes.length){var e; for (e = 0; e < a.attributes.length; e += 1)b["@" + a.attributes[e].nodeName] = (a.attributes[e].nodeValue || "").toString()}if (a.firstChild){var f = e = 0, d = false, c; for (c = a.firstChild; c; c = c.nextSibling)if (c.nodeType === 1)d = true; else if (c.nodeType === 3 && c.nodeValue.match(/[^ \f\n\r\t\v]/))e += 1; else if (c.nodeType === 4)f += 1; if (d)if (e < 2 && f < 2){this.removeWhite(a); for (c = - a.firstChild; c; c = c.nextSibling)if (c.nodeType === 3)b["#text"] = this.escape(c.nodeValue); else if (c.nodeType === 4)if (g.test(c.nodeValue))b[c.nodeName] = [b[c.nodeName], c.nodeValue]; else b["#cdata"] = this.escape(c.nodeValue); else if (b[c.nodeName])if (b[c.nodeName]instanceof Array)b[c.nodeName][b[c.nodeName].length] = this.toObj(c); else b[c.nodeName] = [b[c.nodeName], this.toObj(c)]; else b[c.nodeName] = this.toObj(c)} else if (a.attributes.length)b["#text"] = this.escape(this.innerXml(a)); else b = this.escape(this.innerXml(a)); - else if (e)if (a.attributes.length)b["#text"] = this.escape(this.innerXml(a)); else{b = this.escape(this.innerXml(a)); if (b === "__EMPTY_ARRAY_")b = "[]"; else if (b === "__EMPTY_STRING_")b = ""} else if (f)if (f > 1)b = this.escape(this.innerXml(a)); else for (c = a.firstChild; c; c = c.nextSibling)if (g.test(a.firstChild.nodeValue)){b = a.firstChild.nodeValue; break} else b["#cdata"] = this.escape(c.nodeValue)}if (!a.attributes.length && !a.firstChild)b = null} else if (a.nodeType === 9)b = this.toObj(a.documentElement); else alert("unhandled node type: " + - a.nodeType); return b}, toJson:function(a, b, g){var e = b?'"' + b + '"':""; if (a === "[]")e += b?":[]":"[]"; else if (a instanceof Array){var f, d, c = []; d = 0; for (f = a.length; d < f; d += 1)c[d] = this.toJson(a[d], "", g + "\t"); e += (b?":[":"[") + (c.length > 1?"\n" + g + "\t" + c.join(",\n" + g + "\t") + "\n" + g:c.join("")) + "]"} else if (a === null)e += (b && ":") + "null"; else if (typeof a === "object"){f = []; for (d in a)if (a.hasOwnProperty(d))f[f.length] = this.toJson(a[d], d, g + "\t"); e += (b?":{":"{") + (f.length > 1?"\n" + g + "\t" + f.join(",\n" + g + "\t") + "\n" + g:f.join("")) + - "}"} else if (typeof a === "string"){g = /function/i; f = a.toString(); e += /(^-?\d+\.?\d*$)/.test(f) || g.test(f) || f === "false" || f === "true"?(b && ":") + f:(b && ":") + '"' + a + '"'} else e += (b && ":") + a.toString(); return e}, innerXml:function(a){var b = ""; if ("innerHTML"in a)b = a.innerHTML; else{var g = function(e){var f = "", d; if (e.nodeType === 1){f += "<" + e.nodeName; for (d = 0; d < e.attributes.length; d += 1)f += " " + e.attributes[d].nodeName + '="' + (e.attributes[d].nodeValue || "").toString() + '"'; if (e.firstChild){f += ">"; for (d = e.firstChild; d; d = d.nextSibling)f += - g(d); f += ""} else f += "/>"} else if (e.nodeType === 3)f += e.nodeValue; else if (e.nodeType === 4)f += ""; return f}; for (a = a.firstChild; a; a = a.nextSibling)b += g(a)}return b}, escape:function(a){return a.replace(/[\\]/g, "\\\\").replace(/[\"]/g, '\\"').replace(/[\n]/g, "\\n").replace(/[\r]/g, "\\r")}, removeWhite:function(a){a.normalize(); var b; for (b = a.firstChild; b; )if (b.nodeType === 3)if (b.nodeValue.match(/[^ \f\n\r\t\v]/))b = b.nextSibling; else{var g = b.nextSibling; a.removeChild(b); - b = g} else{b.nodeType === 1 && this.removeWhite(b); b = b.nextSibling}return a}}; - (function(b){b.jgrid.extend({setColumns:function(a){a = b.extend({top:0, left:0, width:200, height:"auto", dataheight:"auto", modal:false, drag:true, beforeShowForm:null, afterShowForm:null, afterSubmitForm:null, closeOnEscape:true, ShrinkToFit:false, jqModal:false, saveicon:[true, "left", "ui-icon-disk"], closeicon:[true, "left", "ui-icon-close"], onClose:null, colnameview:true, closeAfterSubmit:true, updateAfterCheck:false, recreateForm:false}, b.jgrid.col, a || {}); return this.each(function(){var c = this; if (c.grid){var j = typeof a.beforeShowForm === - "function"?true:false, k = typeof a.afterShowForm === "function"?true:false, l = typeof a.afterSubmitForm === "function"?true:false, e = c.p.id, d = "ColTbl_" + e, f = {themodal:"colmod" + e, modalhead:"colhd" + e, modalcontent:"colcnt" + e, scrollelm:d}; a.recreateForm === true && b("#" + f.themodal).html() != null && b("#" + f.themodal).remove(); if (b("#" + f.themodal).html() != null){j && a.beforeShowForm(b("#" + d)); viewModal("#" + f.themodal, {gbox:"#gbox_" + e, jqm:a.jqModal, jqM:false, modal:a.modal})} else{var g = isNaN(a.dataheight)?a.dataheight:a.dataheight + - "px"; g = "
"; g += ""; for (i = 0; i < this.p.colNames.length; i++)c.p.colModel[i].hidedlg || (g += ""); g += "
"; g += "
" + (!a.updateAfterCheck?"" + a.bSubmit + "":"") + " " + ("" + - a.bCancel + "") + "
"; a.gbox = "#gbox_" + e; createModal(f, g, a, "#gview_" + c.p.id, b("#gview_" + c.p.id)[0]); if (a.saveicon[0] == true)b("#dData", "#" + d + "_2").addClass(a.saveicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); if (a.closeicon[0] == true)b("#eData", "#" + d + "_2").addClass(a.closeicon[1] == "right"?"fm-button-icon-right":"fm-button-icon-left").append(""); a.updateAfterCheck? - b(":input", "#" + d).click(function(){var h = this.id.substr(4); if (h){this.checked?b(c).jqGrid("showCol", h):b(c).jqGrid("hideCol", h); a.ShrinkToFit === true && b(c).jqGrid("setGridWidth", c.grid.width - 0.0010, true)}return this}):b("#dData", "#" + d + "_2").click(function(){for (i = 0; i < c.p.colModel.length; i++)if (!c.p.colModel[i].hidedlg){var h = c.p.colModel[i].name.replace(".", "\\."); if (b("#col_" + h, "#" + d).attr("checked")){b(c).jqGrid("showCol", c.p.colModel[i].name); b("#col_" + h, "#" + d).attr("defaultChecked", true)} else{b(c).jqGrid("hideCol", - c.p.colModel[i].name); b("#col_" + h, "#" + d).attr("defaultChecked", "")}}a.ShrinkToFit === true && b(c).jqGrid("setGridWidth", c.grid.width - 0.0010, true); a.closeAfterSubmit && hideModal("#" + f.themodal, {gb:"#gbox_" + e, jqm:a.jqModal, onClose:a.onClose}); l && a.afterSubmitForm(b("#" + d)); return false}); b("#eData", "#" + d + "_2").click(function(){hideModal("#" + f.themodal, {gb:"#gbox_" + e, jqm:a.jqModal, onClose:a.onClose}); return false}); b("#dData, #eData", "#" + d + "_2").hover(function(){b(this).addClass("ui-state-hover")}, function(){b(this).removeClass("ui-state-hover")}); - j && a.beforeShowForm(b("#" + d)); viewModal("#" + f.themodal, {gbox:"#gbox_" + e, jqm:a.jqModal, jqM:true, modal:a.modal})}k && a.afterShowForm(b("#" + d))}})}})})(jQuery); - (function(c){c.jgrid.extend({getPostData:function(){var a = this[0]; if (a.grid)return a.p.postData}, setPostData:function(a){var b = this[0]; if (b.grid)if (typeof a === "object")b.p.postData = a; else alert("Error: cannot add a non-object postData value. postData unchanged.")}, appendPostData:function(a){var b = this[0]; if (b.grid)typeof a === "object"?c.extend(b.p.postData, a):alert("Error: cannot append a non-object postData value. postData unchanged.")}, setPostDataItem:function(a, b){var d = this[0]; if (d.grid)d.p.postData[a] = - b}, getPostDataItem:function(a){var b = this[0]; if (b.grid)return b.p.postData[a]}, removePostDataItem:function(a){var b = this[0]; b.grid && delete b.p.postData[a]}, getUserData:function(){var a = this[0]; if (a.grid)return a.p.userData}, getUserDataItem:function(a){var b = this[0]; if (b.grid)return b.p.userData[a]}})})(jQuery); - function tableToGrid(o, p){jQuery(o).each(function(){if (!this.grid){jQuery(this).width("99%"); var a = jQuery(this).width(), f = jQuery("input[type=checkbox]:first", jQuery(this)), l = jQuery("input[type=radio]:first", jQuery(this)), b = f.length > 0, q = !b && l.length > 0, m = b || q; f = f.attr("name") || l.attr("name"); var c = [], g = []; jQuery("th", jQuery(this)).each(function(){if (c.length === 0 && m){c.push({name:"__selection__", index:"__selection__", width:0, hidden:true}); g.push("__selection__")} else{c.push({name:jQuery(this).attr("id") || - jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"), index:jQuery(this).attr("id") || jQuery.trim(jQuery.jgrid.stripHtml(jQuery(this).html())).split(" ").join("_"), width:jQuery(this).width() || 150}); g.push(jQuery(this).html())}}); var e = [], h = [], i = []; jQuery("tbody > tr", jQuery(this)).each(function(){var j = {}, d = 0; jQuery("td", jQuery(this)).each(function(){if (d === 0 && m){var k = jQuery("input", jQuery(this)), n = k.attr("value"); h.push(n || e.length); k.attr("checked") && i.push(n); j[c[d].name] = - k.attr("value")} else j[c[d].name] = jQuery(this).html(); d++}); d > 0 && e.push(j)}); jQuery(this).empty(); jQuery(this).addClass("scroll"); jQuery(this).jqGrid($.extend({datatype:"local", width:a, colNames:g, colModel:c, multiselect:b}, p || {})); for (a = 0; a < e.length; a++){b = null; if (h.length > 0)if ((b = h[a]) && b.replace)b = encodeURIComponent(b).replace(/[.\-%]/g, "_"); if (b === null)b = a + 1; jQuery(this).jqGrid("addRowData", b, e[a])}for (a = 0; a < i.length; a++)jQuery(this).jqGrid("setSelection", i[a])}})}; - (function(a){if (a.browser.msie && a.browser.version == 8)a.expr[":"].hidden = function(b){return b.offsetWidth === 0 || b.offsetHeight === 0 || b.style.display == "none"}; a.jgrid._multiselect = false; if (a.ui)if (a.ui.multiselect){if (a.ui.multiselect.prototype._setSelected){var q = a.ui.multiselect.prototype._setSelected; a.ui.multiselect.prototype._setSelected = function(b, i){b = q.call(this, b, i); if (i && this.selectedList){var c = this.element; this.selectedList.find("li").each(function(){a(this).data("optionLink") && a(this).data("optionLink").remove().appendTo(c)})}return b}}if (a.ui.multiselect.prototype.destroy)a.ui.multiselect.prototype.destroy = - function(){this.element.show(); this.container.remove(); a.Widget === undefined?a.widget.prototype.destroy.apply(this, arguments):a.Widget.prototype.destroy.apply(this, arguments)}; a.jgrid._multiselect = true}a.jgrid.extend({sortableColumns:function(b){return this.each(function(){function i(){c.p.disableClick = true}var c = this, g = {tolerance:"pointer", axis:"x", scrollSensitivity:"1", items:">th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)", placeholder:{element:function(e){return a(document.createElement(e[0].nodeName)).addClass(e[0].className + - " ui-sortable-placeholder ui-state-highlight").removeClass("ui-sortable-helper")[0]}, update:function(e, h){h.height(e.currentItem.innerHeight() - parseInt(e.currentItem.css("paddingTop") || 0, 10) - parseInt(e.currentItem.css("paddingBottom") || 0, 10)); h.width(e.currentItem.innerWidth() - parseInt(e.currentItem.css("paddingLeft") || 0, 10) - parseInt(e.currentItem.css("paddingRight") || 0, 10))}}, update:function(e, h){e = a(h.item).parent(); e = a(">th", e); var j = {}; a.each(c.p.colModel, function(m){j[this.name] = m}); var l = []; - e.each(function(){var m = a(">div", this).get(0).id.replace(/^jqgh_/, ""); m in j && l.push(j[m])}); a(c).jqGrid("remapColumns", l, true, true); a.isFunction(c.p.sortable.update) && c.p.sortable.update(l); setTimeout(function(){c.p.disableClick = false}, 50)}}; if (c.p.sortable.options)a.extend(g, c.p.sortable.options); else if (a.isFunction(c.p.sortable))c.p.sortable = {update:c.p.sortable}; if (g.start){var d = g.start; g.start = function(e, h){i(); d.call(this, e, h)}} else g.start = i; if (c.p.sortable.exclude)g.items += ":not(" + c.p.sortable.exclude + - ")"; b.sortable(g).data("sortable").floating = true})}, columnChooser:function(b){function i(f, k, p){if (k >= 0){var o = f.slice(), r = o.splice(k, Math.max(f.length - k, k)); if (k > f.length)k = f.length; o[k] = p; return o.concat(r)}}function c(f, k){if (f)if (typeof f == "string")a.fn[f] && a.fn[f].apply(k, a.makeArray(arguments).slice(2)); else a.isFunction(f) && f.apply(k, a.makeArray(arguments).slice(2))}var g = this; if (!a("#colchooser_" + g[0].p.id).length){var d = a('
'), - e = a("select", d); b = a.extend({width:420, height:240, classname:null, done:function(f){f && g.jqGrid("remapColumns", f, true)}, msel:"multiselect", dlog:"dialog", dlog_opts:function(f){var k = {}; k[f.bSubmit] = function(){f.apply_perm(); f.cleanup(false)}; k[f.bCancel] = function(){f.cleanup(true)}; return{buttons:k, close:function(){f.cleanup(true)}, modal:false, resizable:false, width:f.width + 20}}, apply_perm:function(){a("option", e).each(function(){this.selected?g.jqGrid("showCol", h[this.value].name):g.jqGrid("hideCol", - h[this.value].name)}); var f = []; a("option[selected]", e).each(function(){f.push(parseInt(this.value, 10))}); a.each(f, function(){delete l[h[parseInt(this, 10)].name]}); a.each(l, function(){var k = parseInt(this, 10); f = i(f, k, k)}); b.done && b.done.call(g, f)}, cleanup:function(f){c(b.dlog, d, "destroy"); c(b.msel, e, "destroy"); d.remove(); f && b.done && b.done.call(g)}, msel_opts:{}}, a.jgrid.col, b || {}); if (a.ui)if (a.ui.multiselect)if (b.msel == "multiselect"){if (!a.jgrid._multiselect){alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!"); - return}b.msel_opts = a.extend(a.ui.multiselect.defaults, b.msel_opts)}b.caption && d.attr("title", b.caption); if (b.classname){d.addClass(b.classname); e.addClass(b.classname)}if (b.width){a(">div", d).css({width:b.width, margin:"0 auto"}); e.css("width", b.width)}if (b.height){a(">div", d).css("height", b.height); e.css("height", b.height - 10)}var h = g.jqGrid("getGridParam", "colModel"), j = g.jqGrid("getGridParam", "colNames"), l = {}, m = []; e.empty(); a.each(h, function(f){l[this.name] = f; if (this.hidedlg)this.hidden || m.push(f); - else e.append("")}); var n = a.isFunction(b.dlog_opts)?b.dlog_opts.call(g, b):b.dlog_opts; c(b.dlog, d, n); n = a.isFunction(b.msel_opts)?b.msel_opts.call(g, b):b.msel_opts; c(b.msel, e, n)}}, sortableRows:function(b){return this.each(function(){var i = this; if (i.grid)if (!i.p.treeGrid)if (a.fn.sortable){b = a.extend({cursor:"move", axis:"y", items:".jqgrow"}, b || {}); if (b.start && a.isFunction(b.start)){b._start_ = b.start; delete b.start} else b._start_ = - false; if (b.update && a.isFunction(b.update)){b._update_ = b.update; delete b.update} else b._update_ = false; b.start = function(c, g){a(g.item).css("border-width", "0px"); a("td", g.item).each(function(h){this.style.width = i.grid.cols[h].style.width}); if (i.p.subGrid){var d = a(g.item).attr("id"); try{a(i).jqGrid("collapseSubGridRow", d)} catch (e){}}b._start_ && b._start_.apply(this, [c, g])}; b.update = function(c, g){a(g.item).css("border-width", ""); i.updateColumns(); i.p.rownumbers === true && a("td.jqgrid-rownum", i.rows).each(function(d){a(this).html(d + - 1)}); b._update_ && b._update_.apply(this, [c, g])}; a("tbody:first", i).sortable(b); a("tbody:first", i).disableSelection()}})}, gridDnD:function(b){return this.each(function(){function i(){var d = a.data(c, "dnd"); a("tr.jqgrow:not(.ui-draggable)", c).draggable(a.isFunction(d.drag)?d.drag.call(a(c), d):d.drag)}var c = this; if (c.grid)if (!c.p.treeGrid)if (a.fn.draggable && a.fn.droppable){a("#jqgrid_dnd").html() === null && a("body").append("
"); if (typeof b == "string" && b == - "updateDnD" && c.p.jqgdnd === true)i(); else{b = a.extend({drag:function(d){return a.extend({start:function(e, h){if (c.p.subGrid){var j = a(h.helper).attr("id"); try{a(c).jqGrid("collapseSubGridRow", j)} catch (l){}}for (j = 0; j < a.data(c, "dnd").connectWith.length; j++)a(a.data(c, "dnd").connectWith[j]).jqGrid("getGridParam", "reccount") == "0" && a(a.data(c, "dnd").connectWith[j]).jqGrid("addRowData", "jqg_empty_row", {}); h.helper.addClass("ui-state-highlight"); a("td", h.helper).each(function(m){this.style.width = c.grid.headers[m].width + - "px"}); d.onstart && a.isFunction(d.onstart) && d.onstart.call(a(c), e, h)}, stop:function(e, h){if (h.helper.dropped){var j = a(h.helper).attr("id"); a(c).jqGrid("delRowData", j)}for (j = 0; j < a.data(c, "dnd").connectWith.length; j++)a(a.data(c, "dnd").connectWith[j]).jqGrid("delRowData", "jqg_empty_row"); d.onstop && a.isFunction(d.onstop) && d.onstop.call(a(c), e, h)}}, d.drag_opts || {})}, drop:function(d){return a.extend({accept:function(e){var h = a(e).closest("table.ui-jqgrid-btable"); if (a.data(h[0], "dnd") !== undefined){e = a.data(h[0], - "dnd").connectWith; return a.inArray("#" + this.id, e) != - 1?true:false}return e}, drop:function(e, h){var j = a(h.draggable).attr("id"); j = a("#" + c.id).jqGrid("getRowData", j); if (!d.dropbyname){var l = 0, m = {}, n, f = a("#" + this.id).jqGrid("getGridParam", "colModel"); try{for (var k in j){if (j.hasOwnProperty(k) && f[l]){n = f[l].name; m[n] = j[k]}l++}j = m} catch (p){}}h.helper.dropped = true; if (d.beforedrop && a.isFunction(d.beforedrop)){n = d.beforedrop.call(this, e, h, j, a("#" + c.id), a(this)); if (typeof n != "undefined" && n !== null && typeof n == - "object")j = n}if (h.helper.dropped){var o; if (d.autoid)if (a.isFunction(d.autoid))o = d.autoid.call(this, j); else{o = Math.ceil(Math.random() * 1E3); o = d.autoidprefix + o}a("#" + this.id).jqGrid("addRowData", o, j, d.droppos)}d.ondrop && a.isFunction(d.ondrop) && d.ondrop.call(this, e, h, j)}}, d.drop_opts || {})}, onstart:null, onstop:null, beforedrop:null, ondrop:null, drop_opts:{activeClass:"ui-state-active", 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_"}, b || {}); if (b.connectWith){b.connectWith = b.connectWith.split(","); b.connectWith = a.map(b.connectWith, function(d){return a.trim(d)}); a.data(c, "dnd", b); c.p.reccount != "0" && !c.p.jqgdnd && i(); c.p.jqgdnd = true; for (var g = 0; g < b.connectWith.length; g++)a(b.connectWith[g]).droppable(a.isFunction(b.drop)?b.drop.call(a(c), b):b.drop)}}}})}, gridResize:function(b){return this.each(function(){var i = this; if (i.grid && a.fn.resizable){b = a.extend({}, b || {}); if (b.alsoResize){b._alsoResize_ = - b.alsoResize; delete b.alsoResize} else b._alsoResize_ = false; if (b.stop && a.isFunction(b.stop)){b._stop_ = b.stop; delete b.stop} else b._stop_ = false; b.stop = function(c, g){a(i).jqGrid("setGridParam", {height:a("#gview_" + i.p.id + " .ui-jqgrid-bdiv").height()}); a(i).jqGrid("setGridWidth", g.size.width, b.shrinkToFit); b._stop_ && b._stop_.call(i, c, g)}; b.alsoResize = b._alsoResize_?eval("(" + ("{'#gview_" + i.p.id + " .ui-jqgrid-bdiv':true,'" + b._alsoResize_ + "':true}") + ")"):a(".ui-jqgrid-bdiv", "#gview_" + i.p.id); delete b._alsoResize_; - a("#gbox_" + i.p.id).resizable(b)}})}})})(jQuery); +* jqGrid 4.6.0 - jQuery Grid +* Copyright (c) 2008, Tony Tomov, tony@trirand.com +* Dual licensed under the MIT or GPL licenses +* http://www.opensource.org/licenses/mit-license.php +* http://www.gnu.org/licenses/gpl-2.0.html +* Date:2014-02-20 +* Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; grid.filter.js; grid.inlinedit.js; grid.celledit.js; jqModal.js; jqDnR.js; grid.subgrid.js; grid.grouping.js; grid.treegrid.js; grid.pivot.js; grid.import.js; JsonXml.js; grid.tbltogrid.js; grid.jqueryui.js; +*/ +(function(b){b.jgrid=b.jgrid||{};b.extend(b.jgrid,{version:"4.6.0",htmlDecode:function(b){return b&&(" "===b||" "===b||1===b.length&&160===b.charCodeAt(0))?"":b?String(b).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&"):b},htmlEncode:function(b){return b?String(b).replace(/&/g,"&").replace(/\"/g,""").replace(//g,">"):b},format:function(e){var f=b.makeArray(arguments).slice(1);null==e&&(e="");return e.replace(/\{(\d+)\}/g, +function(b,d){return f[d]})},msie:"Microsoft Internet Explorer"===navigator.appName,msiever:function(){var b=-1;null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(b=parseFloat(RegExp.$1));return b},getCellIndex:function(e){e=b(e);if(e.is("tr"))return-1;e=(e.is("td")||e.is("th")?e:e.closest("td,th"))[0];return b.jgrid.msie?b.inArray(e,e.parentNode.cells):e.cellIndex},stripHtml:function(b){b=String(b);var f=/<("[^"]*"|'[^']*'|[^'">])*>/gi;return b?(b=b.replace(f,""))&&" "!==b&&" "!== +b?b.replace(/\"/g,"'"):"":b},stripPref:function(e,f){var c=b.type(e);if("string"===c||"number"===c)e=String(e),f=""!==e?String(f).replace(String(e),""):f;return f},parse:function(e){"while(1);"===e.substr(0,9)&&(e=e.substr(9));"/*"===e.substr(0,2)&&(e=e.substr(2,e.length-4));e||(e="{}");return!0===b.jgrid.useJSON&&"object"===typeof JSON&&"function"===typeof JSON.parse?JSON.parse(e):eval("("+e+")")},parseDate:function(e,f,c,d){var a=/^\/Date\((([-+])?[0-9]+)(([-+])([0-9]{2})([0-9]{2}))?\)\/$/,l="string"=== +typeof f?f.match(a):null,a=function(a,b){a=String(a);for(b=parseInt(b,10)||2;a.lengthl&&(f[k]=l+1,g.m=f[k])),"F"===e[k]&&(l=b.inArray(f[k],d.monthNames,12),-1!==l&&11l&&f[k]===d.AmPm[l]&&(f[k]=l,g.h=h(f[k],g.h))),"A"===e[k]&&(l=b.inArray(f[k],d.AmPm),-1!==l&&1=h?g.y=1900+g.y:0<=h&&69>=h&&(g.y=2E3+g.y);h=new Date(g.y,g.m,g.d,g.h,g.i,g.s,g.u);0q?Math.floor((x+q-1)/7)+1:Math.floor((x+q-1)/7)|| +(4>((new Date(p-1,0,1)).getDay()+6)%7?53:52),F:d.monthNames[m-1+12],m:a(m),M:d.monthNames[m-1],n:m,t:"?",L:"?",o:"?",Y:p,y:String(p).substring(2),a:12>e?d.AmPm[0]:d.AmPm[1],A:12>e?d.AmPm[2]:d.AmPm[3],B:"?",g:e%12||12,G:e,h:a(e%12||12),H:a(e),i:a(f),s:a(k),u:n,e:"?",I:"?",O:(0?@\[\\\]\^`{|}~]/g,"\\$&")},guid:1,uidPref:"jqg",randId:function(e){return(e||b.jgrid.uidPref)+b.jgrid.guid++},getAccessor:function(b,f){var c,d,a=[],l;if("function"===typeof f)return f(b);c=b[f];if(void 0===c)try{if("string"===typeof f&& +(a=f.split(".")),l=a.length)for(c=b;c&&l--;)d=a.shift(),c=c[d]}catch(g){}return c},getXmlData:function(e,f,c){var d="string"===typeof f?f.match(/^(.*)\[(\w+)\]$/):null;if("function"===typeof f)return f(e);if(d&&d[2])return d[1]?b(d[1],e).attr(d[2]):b(e).attr(d[2]);e=b(f,e);return c?e:0
"), +f=e.appendTo("body").find("td").width();e.remove();return 0.1b?d:0;l||"number"===typeof a||"number"===typeof b||(a=String(a),b=String(b));return ab?d:0};this._performSort=function(){0!==x.length&&(a=d._doSort(a,0))};this._doSort=function(a,b){var l=x[b].by,e=x[b].dir,g=x[b].type,c=x[b].datefmt,f=x[b].sfunc;if(b===x.length-1)return d._getOrder(a,l,e,g,c,f);b++;l=d._getGroup(a,l,e,g,c);e=[];for(g=0;g",c)};this.less=function(a,b,c){return d._compareValues(d.less,a,b,"<",c)};this.greaterOrEquals=function(a,b,c){return d._compareValues(d.greaterOrEquals,a,b,">=",c)};this.lessOrEquals=function(a,b,c){return d._compareValues(d.lessOrEquals,a,b,"<=",c)};this.startsWith=function(a,c){var e=null==c?a:c,e=g?b.trim(e.toString()).length:e.toString().length;G?d._append(d._getStr("jQuery.jgrid.getAccessor(this,'"+ +a+"')")+".substr(0,"+e+") == "+d._getStr('"'+d._toStr(c)+'"')):(null!=c&&(e=g?b.trim(c.toString()).length:c.toString().length),d._append(d._getStr("this")+".substr(0,"+e+") == "+d._getStr('"'+d._toStr(a)+'"')));d._setCommand(d.startsWith,a);d._resetNegate();return d};this.endsWith=function(a,c){var e=null==c?a:c,e=g?b.trim(e.toString()).length:e.toString().length;G?d._append(d._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".substr("+d._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+".length-"+ +e+","+e+') == "'+d._toStr(c)+'"'):d._append(d._getStr("this")+".substr("+d._getStr("this")+'.length-"'+d._toStr(a)+'".length,"'+d._toStr(a)+'".length) == "'+d._toStr(a)+'"');d._setCommand(d.endsWith,a);d._resetNegate();return d};this.contains=function(a,b){G?d._append(d._getStr("jQuery.jgrid.getAccessor(this,'"+a+"')")+'.indexOf("'+d._toStr(b)+'",0) > -1'):d._append(d._getStr("this")+'.indexOf("'+d._toStr(a)+'",0) > -1');d._setCommand(d.contains,a);d._resetNegate();return d};this.groupBy=function(b, +c,e,l){return d._hasData()?d._getGroup(a,b,c,e,l):null};this.orderBy=function(a,c,e,l,g){c=null==c?"a":b.trim(c.toString().toLowerCase());null==e&&(e="text");null==l&&(l="Y-m-d");null==g&&(g=!1);if("desc"===c||"descending"===c)c="d";if("asc"===c||"ascending"===c)c="a";x.push({by:a,dir:c,type:e,datefmt:l,sfunc:g});return d};return d}(e,null)},getMethod:function(e){return this.getAccessor(b.fn.jqGrid,e)},extend:function(e){b.extend(b.fn.jqGrid,e);this.no_legacy_api||b.fn.extend(e)}});b.fn.jqGrid=function(e){if("string"=== +typeof e){var f=b.jgrid.getMethod(e);if(!f)throw"jqGrid - No such method: "+e;var c=b.makeArray(arguments).slice(1);return f.apply(this,c)}return this.each(function(){if(!this.grid){var d=b.extend(!0,{url:"",height:150,page:1,rowNum:20,rowTotal:null,records:0,pager:"",pgbuttons:!0,pginput:!0,colModel:[],rowList:[],colNames:[],sortorder:"asc",sortname:"",datatype:"xml",mtype:"GET",altRows:!1,selarrrow:[],savedRow:[],shrinkToFit:!0,xmlReader:{},jsonReader:{},subGrid:!1,subGridModel:[],reccount:0,lastpage:0, +lastsort:0,selrow:null,beforeSelectRow:null,onSelectRow:null,onSortCol:null,ondblClickRow:null,onRightClickRow:null,onPaging:null,onSelectAll:null,onInitGrid:null,loadComplete:null,gridComplete:null,loadError:null,loadBeforeSend:null,afterInsertRow:null,beforeRequest:null,beforeProcessing:null,onHeaderClick:null,viewrecords:!1,loadonce:!1,multiselect:!1,multikey:!1,editurl:null,search:!1,caption:"",hidegrid:!0,hiddengrid:!1,postData:{},userData:{},treeGrid:!1,treeGridModel:"nested",treeReader:{}, +treeANode:-1,ExpandColumn:null,tree_root_level:0,prmNames:{page:"page",rows:"rows",sort:"sidx",order:"sord",search:"_search",nd:"nd",id:"id",oper:"oper",editoper:"edit",addoper:"add",deloper:"del",subgridid:"id",npage:null,totalrows:"totalrows"},forceFit:!1,gridstate:"visible",cellEdit:!1,cellsubmit:"remote",nv:0,loadui:"enable",toolbar:[!1,""],scroll:!1,multiboxonly:!1,deselectAfterSort:!0,scrollrows:!1,autowidth:!1,scrollOffset:18,cellLayout:5,subGridWidth:20,multiselectWidth:20,gridview:!1,rownumWidth:25, +rownumbers:!1,pagerpos:"center",recordpos:"right",footerrow:!1,userDataOnFooter:!1,hoverrows:!0,altclass:"ui-priority-secondary",viewsortcols:[!1,"vertical",!0],resizeclass:"",autoencode:!1,remapColumns:[],ajaxGridOptions:{},direction:"ltr",toppager:!1,headertitles:!1,scrollTimeout:40,data:[],_index:{},grouping:!1,groupingView:{groupField:[],groupOrder:[],groupText:[],groupColumnShow:[],groupSummary:[],showSummaryOnHide:!1,sortitems:[],sortnames:[],summary:[],summaryval:[],plusicon:"ui-icon-circlesmall-plus", +minusicon:"ui-icon-circlesmall-minus",displayField:[],groupSummaryPos:[],formatDisplayField:[],_locgr:!1},ignoreCase:!1,cmTemplate:{},idPrefix:"",multiSort:!1},b.jgrid.defaults,e||{}),a=this,c={headers:[],cols:[],footers:[],dragStart:function(c,e,g){var f=b(this.bDiv).offset().left;this.resizing={idx:c,startX:e.clientX,sOL:e.clientX-f};this.hDiv.style.cursor="col-resize";this.curGbox=b("#rs_m"+b.jgrid.jqID(d.id),"#gbox_"+b.jgrid.jqID(d.id));this.curGbox.css({display:"block",left:e.clientX-f,top:g[1], +height:g[2]});b(a).triggerHandler("jqGridResizeStart",[e,c]);b.isFunction(d.resizeStart)&&d.resizeStart.call(a,e,c);document.onselectstart=function(){return!1}},dragMove:function(a){if(this.resizing){var b=a.clientX-this.resizing.startX;a=this.headers[this.resizing.idx];var c="ltr"===d.direction?a.width+b:a.width-b,e;33=k&&(void 0===d.lastpage||parseInt((m+g+f-1)/f,10)<=d.lastpage)&&(n=parseInt((a-m+f-1)/f,10),0<=m||2>n||!0===d.scroll?(E=Math.round((m+g)/f)+1,k=-1):k=1);0d.lastpage||1===d.lastpage||E===d.page&&E===d.lastpage)||(c.hDiv.loading?c.timer=setTimeout(c.populateVisible,d.scrollTimeout):(d.page=E,C&&(c.selectionPreserver(e[0]), +c.emptyRows.call(e[0],!1,!1)),c.populate(n)))}}},scrollGrid:function(a){if(d.scroll){var b=c.bDiv.scrollTop;void 0===c.scrollTop&&(c.scrollTop=0);b!==c.scrollTop&&(c.scrollTop=b,c.timer&&clearTimeout(c.timer),c.timer=setTimeout(c.populateVisible,d.scrollTimeout))}c.hDiv.scrollLeft=c.bDiv.scrollLeft;d.footerrow&&(c.sDiv.scrollLeft=c.bDiv.scrollLeft);a&&a.stopPropagation()},selectionPreserver:function(a){var c=a.p,d=c.selrow,e=c.selarrrow?b.makeArray(c.selarrrow):null,f=a.grid.bDiv.scrollLeft,g=function(){var h; +c.selrow=null;c.selarrrow=[];if(c.multiselect&&e&&0=document.documentMode)alert("Grid can not be used in this ('quirks') mode!");else{b(this).empty().attr("tabindex", +"0");this.p=d;this.p.useProp=!!b.fn.prop;var g,f;if(0===this.p.colNames.length)for(g=0;g
"),n=b.jgrid.msie;a.p.direction=b.trim(a.p.direction.toLowerCase());-1===b.inArray(a.p.direction,["ltr","rtl"])&&(a.p.direction="ltr");f=a.p.direction;b(k).insertBefore(this);b(this).removeClass("scroll").appendTo(k); +var m=b("
");b(m).attr({id:"gbox_"+this.id,dir:f}).insertBefore(k);b(k).attr("id","gview_"+this.id).appendTo(m);b("
").insertBefore(k);b("
"+this.p.loadtext+"
").insertBefore(k);b(this).attr({cellspacing:"0",cellpadding:"0",border:"0",role:"grid","aria-multiselectable":!!this.p.multiselect, +"aria-labelledby":"gbox_"+this.id});var r=function(a,b){a=parseInt(a,10);return isNaN(a)?b||0:a},p=function(d,e,f,g,pa,h){var k=a.p.colModel[d],m=k.align,E='style="',n=k.classes,C=k.name,A=[];m&&(E+="text-align:"+m+";");!0===k.hidden&&(E+="display:none;");if(0===e)E+="width: "+c.headers[d].width+"px;";else if(k.cellattr&&b.isFunction(k.cellattr)&&(d=k.cellattr.call(a,pa,f,g,k,h))&&"string"===typeof d)if(d=d.replace(/style/i,"style").replace(/title/i,"title"),-1"+b+""},U=function(b,c,d,e){e='";return'"+e+""},M=function(a,b,c,d){c=(parseInt(c,10)-1)*parseInt(d,10)+1+b;return'"+c+""},ea=function(b){var c,d=[],e=0,f;for(f=0;f"},K=function(c,d,e,f,g){var h=new Date,l="local"!==a.p.datatype&&a.p.loadonce||"xmlstring"===a.p.datatype,k=a.p.xmlReader,m="local"===a.p.datatype?"local":"xml";l&&(a.p.data=[],a.p._index={},a.p.localReader.id="_id_");a.p.reccount=0;if(b.isXMLDoc(c)){-1!==a.p.treeANode||a.p.scroll?e=1=a.p.page&&(a.p.page=1);if(c&&S){g&&(D*=g+1);g=b.isFunction(a.p.afterInsertRow); +var F=!1,J;a.p.grouping&&(F=!0===a.p.groupingView.groupCollapse,J=b.jgrid.getMethod("groupingPrepare"));for(;I");a.p.grouping&&(y.push(s),a.p.groupingView._locgr||J.call(n,v,I),s=[]);if(l||!0===a.p.treeGrid)v._id_=b.jgrid.stripPref(a.p.idPrefix,H),a.p.data.push(v),a.p._index[v._id_]=a.p.data.length-1;!1===a.p.gridview&&(b("tbody:first",d).append(s.join("")),n.triggerHandler("jqGridAfterInsertRow",[H,v,w]),g&&a.p.afterInsertRow.call(a,H,v,w), +s=[]);v={};R++;I++;if(R===D)break}}!0===a.p.gridview&&(A=-1=a.p.page&&(a.p.page=1);var I=parseInt(a.p.rowNum,10),F=a.p.scroll?b.jgrid.randId():1,J=!1,K;g&&(I*=g+1);"local"!==a.p.datatype||a.p.deselectAfterSort||(J=!0);var N=b.isFunction(a.p.afterInsertRow),P=[],Q=!1,O;a.p.grouping&&(Q=!0===a.p.groupingView.groupCollapse,O=b.jgrid.getMethod("groupingPrepare"));for(;A");a.p.grouping&&(P.push(L),a.p.groupingView._locgr||O.call(m,w,A),L=[]);if(l||!0===a.p.treeGrid)w._id_=b.jgrid.stripPref(a.p.idPrefix,s),a.p.data.push(w),a.p._index[w._id_]=a.p.data.length-1;!1===a.p.gridview&&(b("#"+b.jgrid.jqID(a.p.id)+" tbody:first").append(L.join("")),m.triggerHandler("jqGridAfterInsertRow", +[s,w,g]),N&&a.p.afterInsertRow.call(a,s,w,g),L=[]);w={};n++;A++;if(n===I)break}!0===a.p.gridview&&(H=-1=a.p.page&&(a.p.page=Math.min(1,a.p.lastpage));null!==f.search&&(e[f.search]=a.p.search);null!==f.nd&&(e[f.nd]=(new Date).getTime());null!==f.rows&&(e[f.rows]=a.p.rowNum);null!==f.page&&(e[f.page]=a.p.page);null!==f.sort&&(e[f.sort]=a.p.sortname);null!==f.order&&(e[f.order]=a.p.sortorder);null!==a.p.rowTotal&&null!==f.totalrows&&(e[f.totalrows]=a.p.rowTotal);var h=b.isFunction(a.p.loadComplete),k=h?a.p.loadComplete: +null,l=0;c=c||1;1
").attr("dir","ltr");if(0";k+=""}"rtl"===f&&(g+=k);!0===a.p.pginput&&(d=""+b.jgrid.format(a.p.pgtext||"","","")+"");!0===a.p.pgbuttons? +(m=["first"+e,"prev"+e,"next"+e,"last"+e],"rtl"===f&&m.reverse(),g+="",g+="",g=g+(""!==d?""+d+"": +"")+(""),g+=""):""!==d&&(g+=d);"ltr"===f&&(g+=k);g+="";!0===a.p.viewrecords&&b("td#"+c+"_"+a.p.recordpos,"#"+l).append("
");b("td#"+c+"_"+a.p.pagerpos,"#"+l).append(g);k=b(".ui-jqgrid").css("font-size")|| +"11px";b(document.body).append("");g=b(g).clone().appendTo("#testpg").width();b("#testpg").remove();0"),this.p.colModel.unshift({name:"cb",width:b.jgrid.cell_width?a.p.multiselectWidth+a.p.cellLayout:a.p.multiselectWidth,sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0}));this.p.rownumbers&&(this.p.colNames.unshift(""),this.p.colModel.unshift({name:"rn",width:a.p.rownumWidth, +sortable:!1,resizable:!1,hidedlg:!0,search:!1,align:"center",fixed:!0}));a.p.xmlReader=b.extend(!0,{root:"rows",row:"row",page:"rows>page",total:"rows>total",records:"rows>records",repeatitems:!0,cell:"cell",id:"[id]",userdata:"userdata",subgrid:{root:"rows",row:"row",repeatitems:!0,cell:"cell"}},a.p.xmlReader);a.p.jsonReader=b.extend(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!0,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}}, +a.p.jsonReader);a.p.localReader=b.extend(!0,{root:"rows",page:"page",total:"total",records:"records",repeatitems:!1,cell:"cell",id:"id",userdata:"userdata",subgrid:{root:"rows",repeatitems:!0,cell:"cell"}},a.p.localReader);a.p.scroll&&(a.p.pgbuttons=!1,a.p.pginput=!1,a.p.rowList=[]);a.p.data.length&&O();var D="",ta,F,ja,fa,ka,y,t,ba,ua=ba="",ga=[],va=[];F=[];if(!0===a.p.shrinkToFit&&!0===a.p.forceFit)for(g=a.p.colModel.length-1;0<=g;g--)if(!a.p.colModel[g].hidden){a.p.colModel[g].resizable= +!1;break}"horizontal"===a.p.viewsortcols[1]&&(ba=" ui-i-asc",ua=" ui-i-desc");ta=n?"class='ui-th-div-ie'":"";ba="");if(a.p.multiSort)for(ga=a.p.sortname.split(","),g=0;g",F=a.p.colModel[g].index||a.p.colModel[g].name,D+="
"+a.p.colNames[g],a.p.colModel[g].width=a.p.colModel[g].width?parseInt(a.p.colModel[g].width,10): +150,"boolean"!==typeof a.p.colModel[g].title&&(a.p.colModel[g].title=!0),a.p.colModel[g].lso="",F===a.p.sortname&&(a.p.lastsort=g),a.p.multiSort&&(F=b.inArray(F,ga),-1!==F&&(a.p.colModel[g].lso=va[F])),D+=ba+"
";D+="";ba=null;b(this).append(D);b("thead tr:first th",this).hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")});if(this.p.multiselect){var la=[],ca;b("#cb_"+b.jgrid.jqID(a.p.id),this).bind("click",function(){a.p.selarrrow= +[];var c=!0===a.p.frozenColumns?a.p.id+"_frozen":"";this.checked?(b(a.rows).each(function(d){0c&&(this.hidden=!a.p.groupingView.groupColumnShow[c])}this.widthOrg=k=r(this.width,0);!1===this.hidden&&(d+=k+e,this.fixed?p+=k+e:g++)});isNaN(a.p.width)&&(a.p.width=d+(!1!==a.p.shrinkToFit||isNaN(a.p.height)?0:h));c.width=a.p.width;a.p.tblwidth=d;!1===a.p.shrinkToFit&&!0===a.p.forceFit&&(a.p.forceFit=!1);!0===a.p.shrinkToFit&&0a.p.width&&(a.p.colModel[f].width-=a.p.tblwidth-parseInt(a.p.width,10),a.p.tblwidth=a.p.width))})();b(m).css("width",c.width+"px").append("
 
");b(k).css("width",c.width+"px");var D=b("thead:first",a).get(0),V="";a.p.footerrow&&(V+="");var k=b("tr:first",D),da="";a.p.disableClick=!1;b("th",k).each(function(d){ja=a.p.colModel[d].width;void 0===a.p.colModel[d].resizable&&(a.p.colModel[d].resizable= +!0);a.p.colModel[d].resizable?(fa=document.createElement("span"),b(fa).html(" ").addClass("ui-jqgrid-resize ui-jqgrid-resize-"+f).css("cursor","col-resize"),b(this).addClass(a.p.resizeclass)):fa="";b(this).css("width",ja+"px").prepend(fa);fa=null;var e="";a.p.colModel[d].hidden&&(b(this).css("display","none"),e="display:none;");da+="";c.headers[d]={width:ja,el:this};ka=a.p.colModel[d].sortable;"boolean"!==typeof ka&&(ka=a.p.colModel[d].sortable= +!0);e=a.p.colModel[d].name;"cb"!==e&&"subgrid"!==e&&"rn"!==e&&a.p.viewsortcols[2]&&b(">div",this).addClass("ui-jqgrid-sortable");ka&&(a.p.multiSort?a.p.viewsortcols[0]?(b("div span.s-ico",this).show(),a.p.colModel[d].lso&&b("div span.ui-icon-"+a.p.colModel[d].lso,this).removeClass("ui-state-disabled")):a.p.colModel[d].lso&&(b("div span.s-ico",this).show(),b("div span.ui-icon-"+a.p.colModel[d].lso,this).removeClass("ui-state-disabled")):a.p.viewsortcols[0]?(b("div span.s-ico",this).show(),d===a.p.lastsort&& +b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")):d===a.p.lastsort&&(b("div span.s-ico",this).show(),b("div span.ui-icon-"+a.p.sortorder,this).removeClass("ui-state-disabled")));a.p.footerrow&&(V+="")}).mousedown(function(d){if(1===b(d.target).closest("th>span.ui-jqgrid-resize").length){var e=sa(this);if(!0===a.p.forceFit){var g=a.p,f=e,h;for(h=e+1;h
 
").append(D),J=a.p.caption&&!0===a.p.hiddengrid?!0:!1;g=b("
");D=null;c.hDiv=document.createElement("div");b(c.hDiv).css({width:c.width+"px"}).addClass("ui-state-default ui-jqgrid-hdiv").append(g);b(g).append(k);k=null;J&&b(c.hDiv).hide();a.p.pager&&("string"===typeof a.p.pager?"#"!==a.p.pager.substr(0,1)&&(a.p.pager="#"+a.p.pager):a.p.pager="#"+b(a.p.pager).attr("id"),b(a.p.pager).css({width:c.width+"px"}).addClass("ui-state-default ui-jqgrid-pager ui-corner-bottom").appendTo(m),J&&b(a.p.pager).hide(),qa(a.p.pager,""));!1=== +a.p.cellEdit&&!0===a.p.hoverrows&&b(a).bind("mouseover",function(a){t=b(a.target).closest("tr.jqgrow");"ui-subgrid"!==b(t).attr("class")&&b(t).addClass("ui-state-hover")}).bind("mouseout",function(a){t=b(a.target).closest("tr.jqgrow");b(t).removeClass("ui-state-hover")});var B,N,ma;b(a).before(c.hDiv).click(function(c){y=c.target;t=b(y,a.rows).closest("tr.jqgrow");if(0===b(t).length||-1a.p.lastpage&&(e=a.p.lastpage);1>e&&(e=1);a.p.page=e;a.grid.bDiv.scrollTop=a.grid.prevRowHeight?(e-1)*a.grid.prevRowHeight*a.p.rowNum:0}a.grid.prevRowHeight&&a.p.scroll?(delete a.p.lastpage,a.grid.populateVisible()):a.grid.populate(); +!0===a.p._inlinenav&&b(a).jqGrid("showAddEditButtons");return!1}).dblclick(function(c){y=c.target;t=b(y,a.rows).closest("tr.jqgrow");0!==b(t).length&&(B=t[0].rowIndex,N=b.jgrid.getCellIndex(y),b(a).triggerHandler("jqGridDblClickRow",[b(t).attr("id"),B,N,c]),b.isFunction(a.p.ondblClickRow)&&a.p.ondblClickRow.call(a,b(t).attr("id"),B,N,c))}).bind("contextmenu",function(c){y=c.target;t=b(y,a.rows).closest("tr.jqgrow");0!==b(t).length&&(a.p.multiselect||b(a).jqGrid("setSelection",t[0].id,!0,c),B=t[0].rowIndex, +N=b.jgrid.getCellIndex(y),b(a).triggerHandler("jqGridRightClickRow",[b(t).attr("id"),B,N,c]),b.isFunction(a.p.onRightClickRow)&&a.p.onRightClickRow.call(a,b(t).attr("id"),B,N,c))});c.bDiv=document.createElement("div");n&&"auto"===String(a.p.height).toLowerCase()&&(a.p.height="100%");b(c.bDiv).append(b('
').append("
").append(this)).addClass("ui-jqgrid-bdiv").css({height:a.p.height+(isNaN(a.p.height)?"":"px"), +width:c.width+"px"}).scroll(c.scrollGrid);b("table:first",c.bDiv).css({width:a.p.tblwidth+"px"});b.support.tbody||2===b("tbody",this).length&&b("tbody:gt(0)",this).remove();a.p.multikey&&(b.jgrid.msie?b(c.bDiv).bind("selectstart",function(){return!1}):b(c.bDiv).bind("mousedown",function(){return!1}));J&&b(c.bDiv).hide();c.cDiv=document.createElement("div");var na=!0===a.p.hidegrid?b("").hover(function(){na.addClass("ui-state-hover")}, +function(){na.removeClass("ui-state-hover")}).append("").css("rtl"===f?"left":"right","0px"):"";b(c.cDiv).append(na).append(""+a.p.caption+"").addClass("ui-jqgrid-titlebar ui-jqgrid-caption"+("rtl"===f?"-rtl":"")+" ui-widget-header ui-corner-top ui-helper-clearfix");b(c.cDiv).insertBefore(c.hDiv);a.p.toolbar[0]&&(c.uDiv=document.createElement("div"),"top"===a.p.toolbar[1]?b(c.uDiv).insertBefore(c.hDiv):"bottom"=== +a.p.toolbar[1]&&b(c.uDiv).insertAfter(c.hDiv),"both"===a.p.toolbar[1]?(c.ubDiv=document.createElement("div"),b(c.uDiv).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id).insertBefore(c.hDiv),b(c.ubDiv).addClass("ui-userdata ui-state-default").attr("id","tb_"+this.id).insertAfter(c.hDiv),J&&b(c.ubDiv).hide()):b(c.uDiv).width(c.width).addClass("ui-userdata ui-state-default").attr("id","t_"+this.id),J&&b(c.uDiv).hide());a.p.toppager&&(a.p.toppager=b.jgrid.jqID(a.p.id)+"_toppager",c.topDiv= +b("
")[0],a.p.toppager="#"+a.p.toppager,b(c.topDiv).addClass("ui-state-default ui-jqgrid-toppager").width(c.width).insertBefore(c.hDiv),qa(a.p.toppager,"_t"));a.p.footerrow&&(c.sDiv=b("
")[0],g=b("
"),b(c.sDiv).append(g).width(c.width).insertAfter(c.hDiv),b(g).append(V),c.footers=b(".ui-jqgrid-ftable",c.sDiv)[0].rows[0].cells,a.p.rownumbers&&(c.footers[0].className="ui-state-default jqgrid-rownum"), +J&&b(c.sDiv).hide());g=null;if(a.p.caption){var ya=a.p.datatype;!0===a.p.hidegrid&&(b(".ui-jqgrid-titlebar-close",c.cDiv).click(function(d){var e=b.isFunction(a.p.onHeaderClick),g=".ui-jqgrid-bdiv, .ui-jqgrid-hdiv, .ui-jqgrid-pager, .ui-jqgrid-sdiv",f,h=this;!0===a.p.toolbar[0]&&("both"===a.p.toolbar[1]&&(g+=", #"+b(c.ubDiv).attr("id")),g+=", #"+b(c.uDiv).attr("id"));f=b(g,"#gview_"+b.jgrid.jqID(a.p.id)).length;"visible"===a.p.gridstate?b(g,"#gbox_"+b.jgrid.jqID(a.p.id)).slideUp("fast",function(){f--; +0===f&&(b("span",h).removeClass("ui-icon-circle-triangle-n").addClass("ui-icon-circle-triangle-s"),a.p.gridstate="hidden",b("#gbox_"+b.jgrid.jqID(a.p.id)).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+b.jgrid.jqID(a.p.id)).hide(),b(a).triggerHandler("jqGridHeaderClick",[a.p.gridstate,d]),e&&(J||a.p.onHeaderClick.call(a,a.p.gridstate,d)))}):"hidden"===a.p.gridstate&&b(g,"#gbox_"+b.jgrid.jqID(a.p.id)).slideDown("fast",function(){f--;0===f&&(b("span",h).removeClass("ui-icon-circle-triangle-s").addClass("ui-icon-circle-triangle-n"), +J&&(a.p.datatype=ya,Q(),J=!1),a.p.gridstate="visible",b("#gbox_"+b.jgrid.jqID(a.p.id)).hasClass("ui-resizable")&&b(".ui-resizable-handle","#gbox_"+b.jgrid.jqID(a.p.id)).show(),b(a).triggerHandler("jqGridHeaderClick",[a.p.gridstate,d]),e&&(J||a.p.onHeaderClick.call(a,a.p.gridstate,d)))});return!1}),J&&(a.p.datatype="local",b(".ui-jqgrid-titlebar-close",c.cDiv).trigger("click")))}else b(c.cDiv).hide();b(c.hDiv).after(c.bDiv).mousemove(function(a){if(c.resizing)return c.dragMove(a),!1});b(".ui-jqgrid-labels", +c.hDiv).bind("selectstart",function(){return!1});b(document).bind("mouseup.jqGrid"+a.p.id,function(){return c.resizing?(c.dragEnd(),!1):!0});a.formatCol=p;a.sortData=ra;a.updatepager=function(c,d){var e,g,f,h,k,l,m,n="",p=a.p.pager?"_"+b.jgrid.jqID(a.p.pager.substr(1)):"",q=a.p.toppager?"_"+a.p.toppager.substr(1):"";f=parseInt(a.p.page,10)-1;0>f&&(f=0);f*=parseInt(a.p.rowNum,10);k=f+a.p.reccount;if(a.p.scroll){e=b("tbody:first > tr:gt(0)",a.grid.bDiv);f=k-e.length;a.p.reccount=e.length;if(e=e.outerHeight()|| +a.grid.prevRowHeight)g=f*e,m=parseInt(a.p.records,10)*e,b(">div:first",a.grid.bDiv).css({height:m}).children("div:first").css({height:g,display:g?"":"none"}),0==a.grid.bDiv.scrollTop&&1=e&&(e=g=0),1===e||0===e?(b("#first"+ +p+", #prev"+p).addClass("ui-state-disabled").removeClass("ui-state-hover"),a.p.toppager&&b("#first_t"+q+", #prev_t"+q).addClass("ui-state-disabled").removeClass("ui-state-hover")):(b("#first"+p+", #prev"+p).removeClass("ui-state-disabled"),a.p.toppager&&b("#first_t"+q+", #prev_t"+q).removeClass("ui-state-disabled")),e===g||0===e?(b("#next"+p+", #last"+p).addClass("ui-state-disabled").removeClass("ui-state-hover"),a.p.toppager&&b("#next_t"+q+", #last_t"+q).addClass("ui-state-disabled").removeClass("ui-state-hover")): +(b("#next"+p+", #last"+p).removeClass("ui-state-disabled"),a.p.toppager&&b("#next_t"+q+", #last_t"+q).removeClass("ui-state-disabled")));!0===c&&!0===a.p.rownumbers&&b(">td.jqgrid-rownum",a.rows).each(function(a){b(this).html(f+1+a)});d&&a.p.jqgdnd&&b(a).jqGrid("gridDnD","updateDnD");b(a).triggerHandler("jqGridGridComplete");b.isFunction(a.p.gridComplete)&&a.p.gridComplete.call(a);b(a).triggerHandler("jqGridAfterGridComplete")};a.refreshIndex=O;a.setHeadCheckBox=ha;a.constructTr=$;a.formatter=function(a, +b,c,d,e){return x(a,b,c,d,e)};b.extend(c,{populate:Q,emptyRows:X,beginReq:P,endReq:T});this.grid=c;a.addXmlData=function(b){K(b,a.grid.bDiv)};a.addJSONData=function(b){Y(b,a.grid.bDiv)};this.grid.cols=this.rows[0].cells;b(a).triggerHandler("jqGridInitGrid");b.isFunction(a.p.onInitGrid)&&a.p.onInitGrid.call(a);Q();a.p.hiddengrid=!1}}}})};b.jgrid.extend({getGridParam:function(b){var f=this[0];if(f&&f.grid)return b?void 0!==f.p[b]?f.p[b]:null:f.p},setGridParam:function(e){return this.each(function(){this.grid&& +"object"===typeof e&&b.extend(!0,this.p,e)})},getGridRowById:function(e){var f;this.each(function(){try{for(var c=this.rows.length;c--;)if(e.toString()===this.rows[c].id){f=this.rows[c];break}}catch(d){f=b(this.grid.bDiv).find("#"+b.jgrid.jqID(e))}});return f},getDataIDs:function(){var e=[],f=0,c,d=0;this.each(function(){if((c=this.rows.length)&&0=d+g?b(this.grid.bDiv)[0].scrollTop=h-(d+g)+l+g:h span:first",k).html(h).attr(l):b("td[role='gridcell']:eq("+a+")",k).html(h).attr(l))}),"local"===g.p.datatype){var r=b.jgrid.stripPref(g.p.idPrefix,e),p=g.p._index[r],q;if(g.p.treeGrid)for(q in g.p.treeReader)g.p.treeReader.hasOwnProperty(q)&& +delete m[g.p.treeReader[q]];void 0!==p&&(g.p.data[p]=b.extend(!0,g.p.data[p],m));m=null}}catch(x){a=!1}a&&("string"===n?b(k).addClass(c):null!==c&&"object"===n&&b(k).css(c),b(g).triggerHandler("jqGridAfterGridComplete"))});return a},addRowData:function(e,f,c,d){c||(c="last");var a=!1,l,g,h,k,n,m,r,p,q="",x,G,U,M,ea,W;f&&(b.isArray(f)?(x=!0,c="last",G=e):(f=[f],x=!1),this.each(function(){var X=f.length;n=!0===this.p.rownumbers?1:0;h=!0===this.p.multiselect?1:0;k=!0===this.p.subGrid?1:0;x||(void 0!== +e?e=String(e):(e=b.jgrid.randId(),!1!==this.p.keyIndex&&(G=this.p.colModel[this.p.keyIndex+h+k+n].name,void 0!==f[0][G]&&(e=f[0][G]))));U=this.p.altclass;for(var O=0,$="",K={},Y=b.isFunction(this.p.afterInsertRow)?!0:!1;O0");h&&(p='',q=this.formatCol(n,1,"",null,e,!0),g[g.length]='"+p+"");k&&(g[g.length]=b(this).jqGrid("addSubGridCell",h+n,1));for(r=h+k+n;r"+p+"";g.unshift(this.constructTr(e,!1,$,K,M,!1)); +g[g.length]="";if(0===this.rows.length)b("table:first",this.grid.bDiv).append(g.join(""));else switch(c){case "last":b(this.rows[this.rows.length-1]).after(g.join(""));m=this.rows.length-1;break;case "first":b(this.rows[0]).after(g.join(""));m=1;break;case "after":if(m=b(this).jqGrid("getGridRowById",d))b(this.rows[m.rowIndex+1]).hasClass("ui-subgrid")?b(this.rows[m.rowIndex+1]).after(g):b(m).after(g.join("")),m=m.rowIndex+1;break;case "before":if(m=b(this).jqGrid("getGridRowById",d))b(m).before(g.join("")), +m=m.rowIndex-1}!0===this.p.subGrid&&b(this).jqGrid("addSubGrid",h+n,m);this.p.records++;this.p.reccount++;b(this).triggerHandler("jqGridAfterInsertRow",[e,M,M]);Y&&this.p.afterInsertRow.call(this,e,M,M);O++;"local"===this.p.datatype&&(K[this.p.localReader.id]=W,this.p._index[W]=this.p.data.length,this.p.data.push(K),K={})}!0!==this.p.altRows||x||("last"===c?1===(this.rows.length-1)%2&&b(this.rows[this.rows.length-1]).addClass(U):b(this.rows).each(function(a){1===a%2?b(this).addClass(U):b(this).removeClass(U)})); +this.updatepager(!0,!0);a=!0}));return a},footerData:function(e,f,c){function d(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var a,l=!1,g={},h;void 0==e&&(e="get");"boolean"!==typeof c&&(c=!0);e=e.toLowerCase();this.each(function(){var k=this,n;if(!k.grid||!k.p.footerrow||"set"===e&&d(f))return!1;l=!0;b(this.p.colModel).each(function(d){a=this.name;"set"===e?void 0!==f[a]&&(n=c?k.formatter("",f[a],d,f,"edit"):f[a],h=this.title?{title:b.jgrid.stripHtml(n)}:{},b("tr.footrow td:eq("+d+ +")",k.grid.sDiv).html(n).attr(h),l=!0):"get"===e&&(g[a]=b("tr.footrow td:eq("+d+")",k.grid.sDiv).html())})});return"get"===e?g:l},showHideCol:function(e,f){return this.each(function(){var c=this,d=!1,a=b.jgrid.cell_width?0:c.p.cellLayout,l;if(c.grid){"string"===typeof e&&(e=[e]);f="none"!==f?"":"none";var g=""===f?!0:!1,h=c.p.groupHeader&&("object"===typeof c.p.groupHeader||b.isFunction(c.p.groupHeader));h&&b(c).jqGrid("destroyGroupHeader",!1);b(this.p.colModel).each(function(h){if(-1!==b.inArray(this.name, +e)&&this.hidden===g){if(!0===c.p.frozenColumns&&!0===this.frozen)return!0;b("tr[role=rowheader]",c.grid.hDiv).each(function(){b(this.cells[h]).css("display",f)});b(c.rows).each(function(){b(this).hasClass("jqgroup")||b(this.cells[h]).css("display",f)});c.p.footerrow&&b("tr.footrow td:eq("+h+")",c.grid.sDiv).css("display",f);l=parseInt(this.width,10);c.p.tblwidth="none"===f?c.p.tblwidth-(l+a):c.p.tblwidth+(l+a);this.hidden=!g;d=!0;b(c).triggerHandler("jqGridShowHideCol",[g,this.name,h])}});!0===d&& +(!0!==c.p.shrinkToFit||isNaN(c.p.height)||(c.p.tblwidth+=parseInt(c.p.scrollOffset,10)),b(c).jqGrid("setGridWidth",!0===c.p.shrinkToFit?c.p.tblwidth:c.p.width));h&&b(c).jqGrid("setGroupHeaders",c.p.groupHeader)}})},hideCol:function(e){return this.each(function(){b(this).jqGrid("showHideCol",e,"none")})},showCol:function(e){return this.each(function(){b(this).jqGrid("showHideCol",e,"")})},remapColumns:function(e,f,c){function d(a){var c;c=a.length?b.makeArray(a):b.extend({},a);b.each(e,function(b){a[b]= +c[this]})}function a(a,c){b(">tr"+(c||""),a).each(function(){var a=this,c=b.makeArray(a.cells);b.each(e,function(){var b=c[this];b&&a.appendChild(b)})})}var l=this.get(0);d(l.p.colModel);d(l.p.colNames);d(l.grid.headers);a(b("thead:first",l.grid.hDiv),c&&":not(.ui-jqgrid-labels)");f&&a(b("#"+b.jgrid.jqID(l.p.id)+" tbody:first"),".jqgfirstrow, tr.jqgrow, tr.jqfoot");l.p.footerrow&&a(b("tbody:first",l.grid.sDiv));l.p.remapColumns&&(l.p.remapColumns.length?d(l.p.remapColumns):l.p.remapColumns=b.makeArray(e)); +l.p.lastsort=b.inArray(l.p.lastsort,e);l.p.treeGrid&&(l.p.expColInd=b.inArray(l.p.expColInd,e));b(l).triggerHandler("jqGridRemapColumns",[e,f,c])},setGridWidth:function(e,f){return this.each(function(){if(this.grid){var c=this,d,a=0,l=b.jgrid.cell_width?0:c.p.cellLayout,g,h=0,k=!1,n=c.p.scrollOffset,m,r=0,p;"boolean"!==typeof f&&(f=c.p.shrinkToFit);if(!isNaN(e)){e=parseInt(e,10);c.grid.width=c.p.width=e;b("#gbox_"+b.jgrid.jqID(c.p.id)).css("width",e+"px");b("#gview_"+b.jgrid.jqID(c.p.id)).css("width", +e+"px");b(c.grid.bDiv).css("width",e+"px");b(c.grid.hDiv).css("width",e+"px");c.p.pager&&b(c.p.pager).css("width",e+"px");c.p.toppager&&b(c.p.toppager).css("width",e+"px");!0===c.p.toolbar[0]&&(b(c.grid.uDiv).css("width",e+"px"),"both"===c.p.toolbar[1]&&b(c.grid.ubDiv).css("width",e+"px"));c.p.footerrow&&b(c.grid.sDiv).css("width",e+"px");!1===f&&!0===c.p.forceFit&&(c.p.forceFit=!1);if(!0===f){b.each(c.p.colModel,function(){!1===this.hidden&&(d=this.widthOrg,a+=d+l,this.fixed?r+=d+l:h++)});if(0=== +h)return;c.p.tblwidth=a;m=e-l*h-r;!isNaN(c.p.height)&&(b(c.grid.bDiv)[0].clientHeightd||(this.width=d,a+=d,c.grid.headers[b].width=d,c.grid.headers[b].el.style.width=d+"px",c.p.footerrow&&(c.grid.footers[b].style.width=d+"px"),q&&(c.grid.cols[b].style.width=d+"px"),g=b))});if(!g)return; +p=0;k?e-r-(a+l*h)!==n&&(p=e-r-(a+l*h)-n):1!==Math.abs(e-r-(a+l*h))&&(p=e-r-(a+l*h));c.p.colModel[g].width+=p;c.p.tblwidth=a+p+l*h+r;c.p.tblwidth>e?(k=c.p.tblwidth-parseInt(e,10),c.p.tblwidth=e,d=c.p.colModel[g].width-=k):d=c.p.colModel[g].width;c.grid.headers[g].width=d;c.grid.headers[g].el.style.width=d+"px";q&&(c.grid.cols[g].style.width=d+"px");c.p.footerrow&&(c.grid.footers[g].style.width=d+"px")}c.p.tblwidth&&(b("table:first",c.grid.bDiv).css("width",c.p.tblwidth+"px"),b("table:first",c.grid.hDiv).css("width", +c.p.tblwidth+"px"),c.grid.hDiv.scrollLeft=c.grid.bDiv.scrollLeft,c.p.footerrow&&b("table:first",c.grid.sDiv).css("width",c.p.tblwidth+"px"))}}})},setGridHeight:function(e){return this.each(function(){if(this.grid){var f=b(this.grid.bDiv);f.css({height:e+(isNaN(e)?"":"px")});!0===this.p.frozenColumns&&b("#"+b.jgrid.jqID(this.p.id)+"_frozen").parent().height(f.height()-16);this.p.height=e;this.p.scroll&&this.grid.populateVisible()}})},setCaption:function(e){return this.each(function(){this.p.caption= +e;b("span.ui-jqgrid-title, span.ui-jqgrid-title-rtl",this.grid.cDiv).html(e);b(this.grid.cDiv).show()})},setLabel:function(e,f,c,d){return this.each(function(){var a=-1;if(this.grid&&void 0!==e&&(b(this.p.colModel).each(function(b){if(this.name===e)return a=b,!1}),0<=a)){var l=b("tr.ui-jqgrid-labels th:eq("+a+")",this.grid.hDiv);if(f){var g=b(".s-ico",l);b("[id^=jqgh_]",l).empty().html(f).append(g);this.p.colNames[a]=f}c&&("string"===typeof c?b(l).addClass(c):b(l).css(c));"object"===typeof d&&b(l).attr(d)}})}, +setCell:function(e,f,c,d,a,l){return this.each(function(){var g=-1,h,k;if(this.grid&&(isNaN(f)?b(this.p.colModel).each(function(a){if(this.name===f)return g=a,!1}):g=parseInt(f,10),0<=g&&(h=b(this).jqGrid("getGridRowById",e)))){var n=b("td:eq("+g+")",h);if(""!==c||!0===l)h=this.formatter(e,c,g,h,"edit"),k=this.p.colModel[g].title?{title:b.jgrid.stripHtml(h)}:{},this.p.treeGrid&&0c,e=String(c),f=b.decimalSeparator||".",g;if(a.fmatter.isNumber(b.decimalPlaces)){var h=b.decimalPlaces,e=Math.pow(10,h),e=String(Math.round(c*e)/e);g=e.lastIndexOf(".");if(0g?(e+=f,g=e.length-1):"."!==f&& +(e=e.replace(".",f));e.length-1-g'+c+"
"};a.fn.fmatter.checkbox=function(c,b){var d=a.extend({},b.checkbox),e;void 0!==b.colModel&&void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions));e=!0===d.disabled?'disabled="disabled"':"";if(a.fmatter.isEmpty(c)||void 0===c)c=a.fn.fmatter.defaultFormat(c,d);c=String(c);c=(c+"").toLowerCase();return'c.search(/(false|f|0|no|n|off|undefined)/i)?" checked='checked' ":"")+' value="'+c+'" offval="no" '+e+"/>"};a.fn.fmatter.link=function(c, +b){var d={target:b.target},e="";void 0!==b.colModel&&void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions));d.target&&(e="target="+d.target);return a.fmatter.isEmpty(c)?a.fn.fmatter.defaultFormat(c,b):"'+c+""};a.fn.fmatter.showlink=function(c,b){var d={baseLinkUrl:b.baseLinkUrl,showAction:b.showAction,addParam:b.addParam||"",target:b.target,idName:b.idName},e="";void 0!==b.colModel&&void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions)); +d.target&&(e="target="+d.target);d=d.baseLinkUrl+d.showAction+"?"+d.idName+"="+b.rowId+d.addParam;return a.fmatter.isString(c)||a.fmatter.isNumber(c)?"'+c+"":a.fn.fmatter.defaultFormat(c,b)};a.fn.fmatter.integer=function(c,b){var d=a.extend({},b.integer);void 0!==b.colModel&&void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions));return a.fmatter.isEmpty(c)?d.defaultValue:a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.number=function(c,b){var d=a.extend({}, +b.number);void 0!==b.colModel&&void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions));return a.fmatter.isEmpty(c)?d.defaultValue:a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.currency=function(c,b){var d=a.extend({},b.currency);void 0!==b.colModel&&void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions));return a.fmatter.isEmpty(c)?d.defaultValue:a.fmatter.util.NumberFormat(c,d)};a.fn.fmatter.date=function(c,b,d,e){d=a.extend({},b.date);void 0!==b.colModel&& +void 0!==b.colModel.formatoptions&&(d=a.extend({},d,b.colModel.formatoptions));return d.reformatAfterEdit||"edit"!==e?a.fmatter.isEmpty(c)?a.fn.fmatter.defaultFormat(c,b):a.jgrid.parseDate(d.srcformat,c,d.newformat,d):a.fn.fmatter.defaultFormat(c,b)};a.fn.fmatter.select=function(c,b){c=String(c);var d=!1,e=[],f,g;void 0!==b.colModel.formatoptions?(d=b.colModel.formatoptions.value,f=void 0===b.colModel.formatoptions.separator?":":b.colModel.formatoptions.separator,g=void 0===b.colModel.formatoptions.delimiter? +";":b.colModel.formatoptions.delimiter):void 0!==b.colModel.editoptions&&(d=b.colModel.editoptions.value,f=void 0===b.colModel.editoptions.separator?":":b.colModel.editoptions.separator,g=void 0===b.colModel.editoptions.delimiter?";":b.colModel.editoptions.delimiter);if(d){var h=!0===b.colModel.editoptions.multiple?!0:!1,l=[];h&&(l=c.split(","),l=a.map(l,function(b){return a.trim(b)}));if(a.fmatter.isString(d)){var k=d.split(g),m=0,n;for(n=0;n div",e):a(this).parent(),k={extraparam:{}},m=function(b){a.isFunction(k.afterRestore)&&k.afterRestore.call(f,b);l.find("div.ui-inline-edit,div.ui-inline-del").show();l.find("div.ui-inline-save,div.ui-inline-cancel").hide()};void 0!==h.formatoptions&&(k=a.extend(k,h.formatoptions));void 0!==g.editOptions&&(k.editOptions=g.editOptions);void 0!==g.delOptions&&(k.delOptions=g.delOptions);b.hasClass("jqgrid-new-row")&&(k.extraparam[g.prmNames.oper]= +g.prmNames.addoper);b={keys:k.keys,oneditfunc:k.onEdit,successfunc:k.onSuccess,url:k.url,extraparam:k.extraparam,aftersavefunc:function(b,c){a.isFunction(k.afterSave)&&k.afterSave.call(f,b,c);l.find("div.ui-inline-edit,div.ui-inline-del").show();l.find("div.ui-inline-save,div.ui-inline-cancel").hide()},errorfunc:k.onError,afterrestorefunc:m,restoreAfterError:k.restoreAfterError,mtype:k.mtype};switch(c){case "edit":e.jqGrid("editRow",d,b);l.find("div.ui-inline-edit,div.ui-inline-del").hide();l.find("div.ui-inline-save,div.ui-inline-cancel").show(); +e.triggerHandler("jqGridAfterGridComplete");break;case "save":e.jqGrid("saveRow",d,b)&&(l.find("div.ui-inline-edit,div.ui-inline-del").show(),l.find("div.ui-inline-save,div.ui-inline-cancel").hide(),e.triggerHandler("jqGridAfterGridComplete"));break;case "cancel":e.jqGrid("restoreRow",d,m);l.find("div.ui-inline-edit,div.ui-inline-del").show();l.find("div.ui-inline-save,div.ui-inline-cancel").hide();e.triggerHandler("jqGridAfterGridComplete");break;case "del":e.jqGrid("delGridRow",d,k.delOptions); +break;case "formedit":e.jqGrid("setSelection",d),e.jqGrid("editGridRow",d,k.editOptions)}};a.fn.fmatter.actions=function(c,b){var d={keys:!1,editbutton:!0,delbutton:!0,editformbutton:!1},e=b.rowId,f="";void 0!==b.colModel.formatoptions&&(d=a.extend(d,b.colModel.formatoptions));if(void 0===e||a.fmatter.isEmpty(e))return"";d.editformbutton?f+="
":d.editbutton&&(f+="
");d.delbutton&&(f+="
");f+="";f+="";return"
"+f+"
"};a.unformat=function(c, +b,d,e){var f,g=b.colModel.formatter,h=b.colModel.formatoptions||{},l=/([\.\*\_\'\(\)\{\}\+\?\\])/g,k=b.colModel.unformat||a.fn.fmatter[g]&&a.fn.fmatter[g].unformat;if(void 0!==k&&a.isFunction(k))f=k.call(this,a(c).text(),b,c);else if(void 0!==g&&a.fmatter.isString(g))switch(f=a.jgrid.formatter||{},g){case "integer":h=a.extend({},f.integer,h);b=h.thousandsSeparator.replace(l,"\\$1");b=RegExp(b,"g");f=a(c).text().replace(b,"");break;case "number":h=a.extend({},f.number,h);b=h.thousandsSeparator.replace(l, +"\\$1");b=RegExp(b,"g");f=a(c).text().replace(b,"").replace(h.decimalSeparator,".");break;case "currency":h=a.extend({},f.currency,h);b=h.thousandsSeparator.replace(l,"\\$1");b=RegExp(b,"g");f=a(c).text();h.prefix&&h.prefix.length&&(f=f.substr(h.prefix.length));h.suffix&&h.suffix.length&&(f=f.substr(0,f.length-h.suffix.length));f=f.replace(b,"").replace(h.decimalSeparator,".");break;case "checkbox":h=b.colModel.editoptions?b.colModel.editoptions.value.split(":"):["Yes","No"];f=a("input",c).is(":checked")? +h[0]:h[1];break;case "select":f=a.unformat.select(c,b,d,e);break;case "actions":return"";default:f=a(c).text()}return void 0!==f?f:!0===e?a(c).text():a.jgrid.htmlDecode(a(c).html())};a.unformat.select=function(c,b,d,e){d=[];c=a(c).text();if(!0===e)return c;e=a.extend({},void 0!==b.colModel.formatoptions?b.colModel.formatoptions:b.colModel.editoptions);b=void 0===e.separator?":":e.separator;var f=void 0===e.delimiter?";":e.delimiter;if(e.value){var g=e.value;e=!0===e.multiple?!0:!1;var h=[];e&&(h= +c.split(","),h=a.map(h,function(b){return a.trim(b)}));if(a.fmatter.isString(g)){var l=g.split(f),k=0,m;for(m=0;m",ge:">=",bw:"^",bn:"!^","in":"=",ni:"!=",ew:"|",en:"!@",cn:"~",nc:"!~",nu:"#",nn:"!#"}},a.jgrid.search,b||{});return this.each(function(){var c=this;if(!this.ftoolbar){var d=function(){var d={},f=0,g,m,e={},q;a.each(c.p.colModel,function(){var l=a("#gs_"+a.jgrid.jqID(this.name),!0===this.frozen&&!0===c.p.frozenColumns?c.grid.fhDiv:c.grid.hDiv);m=this.index|| +this.name;q=b.searchOperators?l.parent().prev().children("a").attr("soper")||b.defaultSearch:this.searchoptions&&this.searchoptions.sopt?this.searchoptions.sopt[0]:"select"===this.stype?"eq":b.defaultSearch;if((g="custom"===this.stype&&a.isFunction(this.searchoptions.custom_value)&&0';g=a(e).attr("soper");var k,h=[],q,p=0,l=a(e).attr("colname");for(k=c.p.colModel.length;p
'+b.operands[b.odata[q].oper]+""+b.odata[q].text+"
");f+="";a("body").append(f);a("#sopt_menu").addClass("ui-menu ui-widget ui-widget-content ui-corner-all");a("#sopt_menu > li > a").hover(function(){a(this).addClass("ui-state-hover")}, +function(){a(this).removeClass("ui-state-hover")}).click(function(f){f=a(this).attr("value");var g=a(this).attr("oper");a(c).triggerHandler("jqGridToolbarSelectOper",[f,g,e]);a("#sopt_menu").hide();a(e).text(g).attr("soper",f);!0===b.autosearch&&(g=a(e).parent().next().children()[0],(a(g).val()||"nu"===f||"nn"===f)&&d())})},k=a(""),e;a.each(c.p.colModel,function(h){var f=this,g,m;m="";var x="=",q,p=a(""),l=a("
"),n=a("
");!0===this.hidden&&a(p).css("display","none");this.search=!1===this.search?!1:!0;void 0===this.stype&&(this.stype="text");g=a.extend({},this.searchoptions||{});if(this.search){if(b.searchOperators){m=g.sopt?g.sopt[0]: +"select"===f.stype?"eq":b.defaultSearch;for(q=0;q"+x+""}a("td:eq(0)",n).attr("colindex",h).append(m);void 0===g.clearSearch&&(g.clearSearch=!0);g.clearSearch?(m=b.resetTitle||"Clear Search Value",a("td:eq(2)",n).append(""+ +b.resetIcon+"")):a("td:eq(2)",n).hide();switch(this.stype){case "select":if(m=this.surl||g.dataUrl)a(l).append(n),a.ajax(a.extend({url:m,dataType:"html",success:function(e){void 0!==g.buildSelect?(e=g.buildSelect(e))&&a("td:eq(1)",n).append(e):a("td:eq(1)",n).append(e);void 0!==g.defaultValue&&a("select",l).val(g.defaultValue);a("select",l).attr({name:f.index||f.name,id:"gs_"+f.name});g.attr&&a("select",l).attr(g.attr);a("select",l).css({width:"100%"});a.jgrid.bindEv.call(c,a("select",l)[0],g); +!0===b.autosearch&&a("select",l).change(function(){d();return!1});e=null}},a.jgrid.ajaxOptions,c.p.ajaxSelectOptions||{}));else{var r,w,u;f.searchoptions?(r=void 0===f.searchoptions.value?"":f.searchoptions.value,w=void 0===f.searchoptions.separator?":":f.searchoptions.separator,u=void 0===f.searchoptions.delimiter?";":f.searchoptions.delimiter):f.editoptions&&(r=void 0===f.editoptions.value?"":f.editoptions.value,w=void 0===f.editoptions.separator?":":f.editoptions.separator,u=void 0===f.editoptions.delimiter? +";":f.editoptions.delimiter);if(r){var t=document.createElement("select");t.style.width="100%";a(t).attr({name:f.index||f.name,id:"gs_"+f.name});var v;if("string"===typeof r)for(m=r.split(u),v=0;v");a(l).append(n);g.attr&&a("input",l).attr(g.attr);a.jgrid.bindEv.call(c,a("input",l)[0],g);!0===b.autosearch&&(b.searchOnEnter?a("input",l).keypress(function(a){return 13=== +(a.charCode||a.keyCode||0)?(d(),!1):this}):a("input",l).keydown(function(a){switch(a.which){case 13:return!1;case 9:case 16:case 37:case 38:case 39:case 40:case 27:break;default:e&&clearTimeout(e),e=setTimeout(function(){d()},500)}}));break;case "custom":a("td:eq(1)",n).append("");a(l).append(n);try{if(a.isFunction(g.custom_element))if(t=g.custom_element.call(c,void 0!==g.defaultValue?g.defaultValue:"",g))t=a(t).addClass("customelement"), +a(l).find(">span").append(t);else throw"e2";else throw"e1";}catch(y){"e1"===y&&a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.nodefined,a.jgrid.edit.bClose),"e2"===y?a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_element' "+a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose):a.jgrid.info_dialog(a.jgrid.errors.errcap,"string"===typeof y?y:y.message,a.jgrid.edit.bClose)}}}a(p).append(l);a(k).append(p);b.searchOperators||a("td:eq(0)",n).hide()});a("table thead", +c.grid.hDiv).append(k);b.searchOperators&&(a(".soptclass",k).click(function(b){var c=a(this).offset();h(this,c.left,c.top);b.stopPropagation()}),a("body").on("click",function(b){"soptclass"!==b.target.className&&a("#sopt_menu").hide()}));a(".clearsearchclass",k).click(function(e){e=a(this).parents("tr:first");var f=parseInt(a("td.ui-search-oper",e).attr("colindex"),10),g=a.extend({},c.p.colModel[f].searchoptions||{}),g=g.defaultValue?g.defaultValue:"";"select"===c.p.colModel[f].stype?g?a("td.ui-search-input select", +e).val(g):a("td.ui-search-input select",e)[0].selectedIndex=0:a("td.ui-search-input input",e).val(g);!0===b.autosearch&&d()});this.ftoolbar=!0;this.triggerToolbar=d;this.clearToolbar=function(d){var f={},g=0,e;d="boolean"!==typeof d?!0:d;a.each(c.p.colModel,function(){var b,d=a("#gs_"+a.jgrid.jqID(this.name),!0===this.frozen&&!0===c.p.frozenColumns?c.grid.fhDiv:c.grid.hDiv);this.searchoptions&&void 0!==this.searchoptions.defaultValue&&(b=this.searchoptions.defaultValue);e=this.index||this.name;switch(this.stype){case "select":d.find("option").each(function(c){0=== +c&&(this.selected=!0);if(a(this).val()===b)return this.selected=!0,!1});if(void 0!==b)f[e]=b,g++;else try{delete c.p.postData[e]}catch(h){}break;case "text":d.val(b||"");if(void 0!==b)f[e]=b,g++;else try{delete c.p.postData[e]}catch(k){}break;case "custom":a.isFunction(this.searchoptions.custom_value)&&0",{role:"rowheader"}).addClass("ui-jqgrid-labels"); +k=d.headers;d=0;for(h=k.length;d",{role:"row","aria-hidden":"true"}).addClass("jqg-first-row-header").css("height","auto"):n.empty();var r,w=function(a,b){var c=b.length,d;for(d=0;d",{role:"rowheader"}).addClass("ui-jqgrid-labels jqg-third-row-header");for(c=0;c",{role:"gridcell"}).css(e).addClass("ui-first-th-"+this.p.direction).appendTo(n),s.style.width="",e=w(d.name,b.groupHeaders),0<=e){e=b.groupHeaders[e];h=e.numberOfColumns;g=e.titleText;for(e=d=0;e").attr({role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+ +this.p.direction).css({height:"22px","border-top":"0 none"}).html(g);0",{role:"columnheader"}).addClass("ui-state-default ui-th-column-header ui-th-"+this.p.direction).css({display:d.hidden?"none":"","border-top":"0 none"}).insertBefore(f),k.append(s)):(k.append(s),h--);m=a(this).children("thead");m.prepend(n);k.insertAfter(l); +p.append(m);b.useColSpanStyle&&(p.find("span.ui-jqgrid-resize").each(function(){var b=a(this).parent();b.is(":visible")&&(this.style.cssText="height: "+b.height()+"px !important; cursor: col-resize;")}),p.find("div.ui-jqgrid-sortable").each(function(){var b=a(this),c=b.parent();c.is(":visible")&&c.is(":has(span.ui-jqgrid-resize)")&&b.css("top",(c.height()-b.outerHeight())/2+"px")}));r=m.find("tr.jqg-first-row-header");a(this).bind("jqGridResizeStop.setGroupHeaders",function(a,b,c){r.find("th").eq(c).width(b)})})}, +setFrozenColumns:function(){return this.each(function(){if(this.grid){var b=this,c=b.p.colModel,d=0,h=c.length,k=-1,e=!1;if(!0!==b.p.subGrid&&!0!==b.p.treeGrid&&!0!==b.p.cellEdit&&!b.p.sortable&&!b.p.scroll){b.p.rownumbers&&d++;for(b.p.multiselect&&d++;d
');b.grid.fbDiv=a('
');a("#gview_"+a.jgrid.jqID(b.p.id)).append(b.grid.fhDiv);c=a(".ui-jqgrid-htable","#gview_"+a.jgrid.jqID(b.p.id)).clone(!0);if(b.p.groupHeader){a("tr.jqg-first-row-header, tr.jqg-third-row-header", +c).each(function(){a("th:gt("+k+")",this).remove()});var s=-1,f=-1,g,m;a("tr.jqg-second-row-header th",c).each(function(){g=parseInt(a(this).attr("colspan"),10);if(m=parseInt(a(this).attr("rowspan"),10))s++,f++;g&&(s+=g,f++);if(s===k)return!1});s!==k&&(f=k);a("tr.jqg-second-row-header",c).each(function(){a("th:gt("+f+")",this).remove()})}else a("tr",c).each(function(){a("th:gt("+k+")",this).remove()});a(c).width(1);a(b.grid.fhDiv).append(c).mousemove(function(a){if(b.grid.resizing)return b.grid.dragMove(a), +!1});a(b).bind("jqGridResizeStop.setFrozenColumns",function(c,d,e){c=a(".ui-jqgrid-htable",b.grid.fhDiv);a("th:eq("+e+")",c).width(d);c=a(".ui-jqgrid-btable",b.grid.fbDiv);a("tr:first td:eq("+e+")",c).width(d)});a(b).bind("jqGridSortCol.setFrozenColumns",function(c,d,e){c=a("tr.ui-jqgrid-labels:last th:eq("+b.p.lastsort+")",b.grid.fhDiv);d=a("tr.ui-jqgrid-labels:last th:eq("+e+")",b.grid.fhDiv);a("span.ui-grid-ico-sort",c).addClass("ui-state-disabled");a(c).attr("aria-selected","false");a("span.ui-icon-"+ +b.p.sortorder,d).removeClass("ui-state-disabled");a(d).attr("aria-selected","true");b.p.viewsortcols[0]||b.p.lastsort===e||(a("span.s-ico",c).hide(),a("span.s-ico",d).show())});a("#gview_"+a.jgrid.jqID(b.p.id)).append(b.grid.fbDiv);a(b.grid.bDiv).scroll(function(){a(b.grid.fbDiv).scrollTop(a(this).scrollTop())});!0===b.p.hoverrows&&a("#"+a.jgrid.jqID(b.p.id)).unbind("mouseover").unbind("mouseout");a(b).bind("jqGridAfterGridComplete.setFrozenColumns",function(){a("#"+a.jgrid.jqID(b.p.id)+"_frozen").remove(); +a(b.grid.fbDiv).height(a(b.grid.bDiv).height()-16);var c=a("#"+a.jgrid.jqID(b.p.id)).clone(!0);a("tr[role=row]",c).each(function(){a("td[role=gridcell]:gt("+k+")",this).remove()});a(c).width(1).attr("id",b.p.id+"_frozen");a(b.grid.fbDiv).append(c);!0===b.p.hoverrows&&(a("tr.jqgrow",c).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+ +a.jgrid.jqID(b.p.id)).removeClass("ui-state-hover")}),a("tr.jqgrow","#"+a.jgrid.jqID(b.p.id)).hover(function(){a(this).addClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)+"_frozen").addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover");a("#"+a.jgrid.jqID(this.id),"#"+a.jgrid.jqID(b.p.id)+"_frozen").removeClass("ui-state-hover")}));c=null});b.grid.hDiv.loading||a(b).triggerHandler("jqGridAfterGridComplete");b.p.frozenColumns=!0}}}})},destroyFrozenColumns:function(){return this.each(function(){if(this.grid&& +!0===this.p.frozenColumns){a(this.grid.fhDiv).remove();a(this.grid.fbDiv).remove();this.grid.fhDiv=null;this.grid.fbDiv=null;a(this).unbind(".setFrozenColumns");if(!0===this.p.hoverrows){var b;a("#"+a.jgrid.jqID(this.p.id)).bind("mouseover",function(c){b=a(c.target).closest("tr.jqgrow");"ui-subgrid"!==a(b).attr("class")&&a(b).addClass("ui-state-hover")}).bind("mouseout",function(c){b=a(c.target).closest("tr.jqgrow");a(b).removeClass("ui-state-hover")})}this.p.frozenColumns=!1}})}})})(jQuery); +(function(a){a.extend(a.jgrid,{showModal:function(a){a.w.show()},closeModal:function(a){a.w.hide().attr("aria-hidden","true");a.o&&a.o.remove()},hideModal:function(d,b){b=a.extend({jqm:!0,gb:""},b||{});if(b.onClose){var c=b.gb&&"string"===typeof b.gb&&"#gbox_"===b.gb.substr(0,6)?b.onClose.call(a("#"+b.gb.substr(6))[0],d):b.onClose(d);if("boolean"===typeof c&&!c)return}if(a.fn.jqm&&!0===b.jqm)a(d).attr("aria-hidden","true").jqmHide();else{if(""!==b.gb)try{a(".jqgrid-overlay:first",b.gb).hide()}catch(g){}a(d).hide().attr("aria-hidden", +"true")}},findPos:function(a){var b=0,c=0;if(a.offsetParent){do b+=a.offsetLeft,c+=a.offsetTop;while(a=a.offsetParent)}return[b,c]},createModal:function(d,b,c,g,e,h,f){c=a.extend(!0,{},a.jgrid.jqModal||{},c);var k=document.createElement("div"),l,m=this;f=a.extend({},f||{});l="rtl"===a(c.gbox).attr("dir")?!0:!1;k.className="ui-widget ui-widget-content ui-corner-all ui-jqdialog";k.id=d.themodal;var n=document.createElement("div");n.className="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"; +n.id=d.modalhead;a(n).append(""+c.caption+"");var q=a("").hover(function(){q.addClass("ui-state-hover")},function(){q.removeClass("ui-state-hover")}).append("");a(n).append(q);l?(k.dir="rtl",a(".ui-jqdialog-title",n).css("float","right"),a(".ui-jqdialog-titlebar-close",n).css("left","0.3em")):(k.dir="ltr",a(".ui-jqdialog-title",n).css("float","left"),a(".ui-jqdialog-titlebar-close", +n).css("right","0.3em"));var p=document.createElement("div");a(p).addClass("ui-jqdialog-content ui-widget-content").attr("id",d.modalcontent);a(p).append(b);k.appendChild(p);a(k).prepend(n);!0===h?a("body").append(k):"string"===typeof h?a(h).append(k):a(k).insertBefore(g);a(k).css(f);void 0===c.jqModal&&(c.jqModal=!0);b={};if(a.fn.jqm&&!0===c.jqModal)0===c.left&&0===c.top&&c.overlay&&(f=[],f=a.jgrid.findPos(e),c.left=f[0]+4,c.top=f[1]+4),b.top=c.top+"px",b.left=c.left;else if(0!==c.left||0!==c.top)b.left= +c.left,b.top=c.top+"px";a("a.ui-jqdialog-titlebar-close",n).click(function(){var b=a("#"+a.jgrid.jqID(d.themodal)).data("onClose")||c.onClose,e=a("#"+a.jgrid.jqID(d.themodal)).data("gbox")||c.gbox;m.hideModal("#"+a.jgrid.jqID(d.themodal),{gb:e,jqm:c.jqModal,onClose:b});return!1});0!==c.width&&c.width||(c.width=300);0!==c.height&&c.height||(c.height=200);c.zIndex||(g=a(g).parents("*[role=dialog]").filter(":first").css("z-index"),c.zIndex=g?parseInt(g,10)+2:950);g=0;l&&b.left&&!h&&(g=a(c.gbox).width()- +(isNaN(c.width)?0:parseInt(c.width,10))-8,b.left=parseInt(b.left,10)+parseInt(g,10));b.left&&(b.left+="px");a(k).css(a.extend({width:isNaN(c.width)?"auto":c.width+"px",height:isNaN(c.height)?"auto":c.height+"px",zIndex:c.zIndex,overflow:"hidden"},b)).attr({tabIndex:"-1",role:"dialog","aria-labelledby":d.modalhead,"aria-hidden":"true"});void 0===c.drag&&(c.drag=!0);void 0===c.resize&&(c.resize=!0);if(c.drag)if(a(n).css("cursor","move"),a.fn.jqDrag)a(k).jqDrag(n);else try{a(k).draggable({handle:a("#"+ +a.jgrid.jqID(n.id))})}catch(r){}if(c.resize)if(a.fn.jqResize)a(k).append("
"),a("#"+a.jgrid.jqID(d.themodal)).jqResize(".jqResize",d.scrollelm?"#"+a.jgrid.jqID(d.scrollelm):!1);else try{a(k).resizable({handles:"se, sw",alsoResize:d.scrollelm?"#"+a.jgrid.jqID(d.scrollelm):!1})}catch(s){}!0===c.closeOnEscape&&a(k).keydown(function(b){27==b.which&&(b=a("#"+a.jgrid.jqID(d.themodal)).data("onClose")||c.onClose, +m.hideModal("#"+a.jgrid.jqID(d.themodal),{gb:c.gbox,jqm:c.jqModal,onClose:b}))})},viewModal:function(d,b){b=a.extend({toTop:!0,overlay:10,modal:!1,overlayClass:"ui-widget-overlay",onShow:a.jgrid.showModal,onHide:a.jgrid.closeModal,gbox:"",jqm:!0,jqM:!0},b||{});if(a.fn.jqm&&!0===b.jqm)b.jqM?a(d).attr("aria-hidden","false").jqm(b).jqmShow():a(d).attr("aria-hidden","false").jqmShow();else{""!==b.gbox&&(a(".jqgrid-overlay:first",b.gbox).show(),a(d).data("gbox",b.gbox));a(d).show().attr("aria-hidden", +"false");try{a(":input:visible",d)[0].focus()}catch(c){}}},info_dialog:function(d,b,c,g){var e={width:290,height:"auto",dataheight:"auto",drag:!0,resize:!1,left:250,top:170,zIndex:1E3,jqModal:!0,modal:!1,closeOnEscape:!0,align:"center",buttonalign:"center",buttons:[]};a.extend(!0,e,a.jgrid.jqModal||{},{caption:""+d+""},g||{});var h=e.jqModal,f=this;a.fn.jqm&&!h&&(h=!1);d="";if(0"+e.buttons[g].text+"";g=isNaN(e.dataheight)?e.dataheight:e.dataheight+"px";b="
"+("
"+b+"
");b+=c?"
"+ +c+""+d+"
":""!==d?"
"+d+"
":"";b+="
";try{"false"===a("#info_dialog").attr("aria-hidden")&&a.jgrid.hideModal("#info_dialog",{jqm:h}),a("#info_dialog").remove()}catch(k){}a.jgrid.createModal({themodal:"info_dialog",modalhead:"info_head",modalcontent:"info_content",scrollelm:"infocnt"},b,e,"","",!0);d&&a.each(e.buttons, +function(b){a("#"+a.jgrid.jqID(this.id),"#info_id").bind("click",function(){e.buttons[b].onClick.call(a("#info_dialog"));return!1})});a("#closedialog","#info_id").click(function(){f.hideModal("#info_dialog",{jqm:h,onClose:a("#info_dialog").data("onClose")||e.onClose,gb:a("#info_dialog").data("gbox")||e.gbox});return!1});a(".fm-button","#info_dialog").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a.isFunction(e.beforeOpen)&&e.beforeOpen();a.jgrid.viewModal("#info_dialog", +{onHide:function(a){a.w.hide().remove();a.o&&a.o.remove()},modal:e.modal,jqm:h});a.isFunction(e.afterOpen)&&e.afterOpen();try{a("#info_dialog").focus()}catch(l){}},bindEv:function(d,b){a.isFunction(b.dataInit)&&b.dataInit.call(this,d,b);b.dataEvents&&a.each(b.dataEvents,function(){void 0!==this.data?a(d).bind(this.type,this.data,this.fn):a(d).bind(this.type,this.fn)})},createEl:function(d,b,c,g,e){function h(b,d,c){var e="dataInit dataEvents dataUrl buildSelect sopt searchhidden defaultValue attr custom_element custom_value".split(" "); +void 0!==c&&a.isArray(c)&&a.merge(e,c);a.each(d,function(d,c){-1===a.inArray(d,e)&&a(b).attr(d,c)});d.hasOwnProperty("id")||a(b).attr("id",a.jgrid.randId())}var f="",k=this;switch(d){case "textarea":f=document.createElement("textarea");g?b.cols||a(f).css({width:"98%"}):b.cols||(b.cols=20);b.rows||(b.rows=2);if(" "===c||" "===c||1===c.length&&160===c.charCodeAt(0))c="";f.value=c;h(f,b);a(f).attr({role:"textbox",multiline:"true"});break;case "checkbox":f=document.createElement("input");f.type= +"checkbox";b.value?(d=b.value.split(":"),c===d[0]&&(f.checked=!0,f.defaultChecked=!0),f.value=d[0],a(f).attr("offval",d[1])):(d=(c+"").toLowerCase(),0>d.search(/(false|f|0|no|n|off|undefined)/i)&&""!==d?(f.checked=!0,f.defaultChecked=!0,f.value=c):f.value="on",a(f).attr("offval","off"));h(f,b,["value"]);a(f).attr("role","checkbox");break;case "select":f=document.createElement("select");f.setAttribute("role","select");g=[];!0===b.multiple?(d=!0,f.multiple="multiple",a(f).attr("aria-multiselectable", +"true")):d=!1;if(void 0!==b.dataUrl){d=b.name?String(b.id).substring(0,String(b.id).length-String(b.name).length-1):String(b.id);var l=b.postData||e.postData;k.p&&k.p.idPrefix&&(d=a.jgrid.stripPref(k.p.idPrefix,d));a.ajax(a.extend({url:a.isFunction(b.dataUrl)?b.dataUrl.call(k,d,c,String(b.name)):b.dataUrl,type:"GET",dataType:"html",data:a.isFunction(l)?l.call(k,d,c,String(b.name)):l,context:{elem:f,options:b,vl:c},success:function(b){var d=[],c=this.elem,e=this.vl,f=a.extend({},this.options),g=!0=== +f.multiple;b=a.isFunction(f.buildSelect)?f.buildSelect.call(k,b):b;"string"===typeof b&&(b=a(a.trim(b)).html());b&&(a(c).append(b),h(c,f,l?["postData"]:void 0),void 0===f.size&&(f.size=g?3:1),g?(d=e.split(","),d=a.map(d,function(b){return a.trim(b)})):d[0]=a.trim(e),setTimeout(function(){a("option",c).each(function(b){0===b&&c.multiple&&(this.selected=!1);a(this).attr("role","option");if(-1l.length||1>c[a[f]]||12l.length)&&!(h=1>c[a[g]])&&!(h=31(0!==e%4||0===e%100&&0!==e%400?28:29);h=h||c[a[g]]>k[c[a[f]]]}return h?!1:!0},isEmpty:function(a){return a.match(/^\s+$/)||""===a?!0:!1},checkTime:function(d){var b=/^(\d{1,2}):(\d{2})([apAP][Mm])?$/;if(!a.jgrid.isEmpty(d))if(d=d.match(b)){if(d[3]){if(1>d[1]||12parseFloat(e.maxValue))return[!1,h+": "+a.jgrid.edit.msg.maxValue+" "+e.maxValue,""];if(!(!0!==e.email||!1===c&&a.jgrid.isEmpty(d)||(g=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, +g.test(d))))return[!1,h+": "+a.jgrid.edit.msg.email,""];if(!(!0!==e.integer||!1===c&&a.jgrid.isEmpty(d)||!isNaN(d)&&0===d%1&&-1===d.indexOf(".")))return[!1,h+": "+a.jgrid.edit.msg.integer,""];if(!(!0!==e.date||!1===c&&a.jgrid.isEmpty(d)||(f[b].formatoptions&&f[b].formatoptions.newformat?(f=f[b].formatoptions.newformat,a.jgrid.formatter.date.masks.hasOwnProperty(f)&&(f=a.jgrid.formatter.date.masks[f])):f=f[b].datefmt||"Y-m-d",a.jgrid.checkDate(f,d))))return[!1,h+": "+a.jgrid.edit.msg.date+" - "+f, +""];if(!0===e.time&&!(!1===c&&a.jgrid.isEmpty(d)||a.jgrid.checkTime(d)))return[!1,h+": "+a.jgrid.edit.msg.date+" - hh:mm (am/pm)",""];if(!(!0!==e.url||!1===c&&a.jgrid.isEmpty(d)||(g=/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i,g.test(d))))return[!1,h+": "+a.jgrid.edit.msg.url,""];if(!0===e.custom&&(!1!==c||!a.jgrid.isEmpty(d)))return a.isFunction(e.custom_func)?(d=e.custom_func.call(this,d,h,b),a.isArray(d)?d:[!1,a.jgrid.edit.msg.customarray, +""]):[!1,a.jgrid.edit.msg.customfcheck,""]}return[!0,"",""]}})})(jQuery); +(function(a){var b={};a.jgrid.extend({searchGrid:function(b){b=a.extend(!0,{recreateFilter:!1,drag:!0,sField:"searchField",sValue:"searchString",sOper:"searchOper",sFilter:"filters",loadDefaults:!0,beforeShowSearch:null,afterShowSearch:null,onInitializeSearch:null,afterRedraw:null,afterChange:null,closeAfterSearch:!1,closeAfterReset:!1,closeOnEscape:!1,searchOnEnter:!1,multipleSearch:!1,multipleGroup:!1,top:0,left:0,jqModal:!0,modal:!1,resize:!0,width:450,height:"auto",dataheight:"auto",showQuery:!1, +errorcheck:!0,sopt:null,stringResult:void 0,onClose:null,onSearch:null,onReset:null,toTop:!0,overlay:30,columns:[],tmplNames:null,tmplFilters:null,tmplLabel:" Template: ",showOnLoad:!1,layer:null,operands:{eq:"=",ne:"<>",lt:"<",le:"<=",gt:">",ge:">=",bw:"LIKE",bn:"NOT LIKE","in":"IN",ni:"NOT IN",ew:"LIKE",en:"NOT LIKE",cn:"LIKE",nc:"NOT LIKE",nu:"IS NULL",nn:"ISNOT NULL"}},a.jgrid.search,b||{});return this.each(function(){function c(c){w=a(e).triggerHandler("jqGridFilterBeforeShow",[c]);void 0=== +w&&(w=!0);w&&a.isFunction(b.beforeShowSearch)&&(w=b.beforeShowSearch.call(e,c));w&&(a.jgrid.viewModal("#"+a.jgrid.jqID(s.themodal),{gbox:"#gbox_"+a.jgrid.jqID(h),jqm:b.jqModal,modal:b.modal,overlay:b.overlay,toTop:b.toTop}),a(e).triggerHandler("jqGridFilterAfterShow",[c]),a.isFunction(b.afterShowSearch)&&b.afterShowSearch.call(e,c))}var e=this;if(e.grid){var h="fbox_"+e.p.id,w=!0,t=!0,s={themodal:"searchmod"+h,modalhead:"searchhd"+h,modalcontent:"searchcnt"+h,scrollelm:h},r=e.p.postData[b.sFilter]; +"string"===typeof r&&(r=a.jgrid.parse(r));!0===b.recreateFilter&&a("#"+a.jgrid.jqID(s.themodal)).remove();if(void 0!==a("#"+a.jgrid.jqID(s.themodal))[0])c(a("#fbox_"+a.jgrid.jqID(+e.p.id)));else{var f=a("
").insertBefore("#gview_"+a.jgrid.jqID(e.p.id)),k="left",u="";"rtl"===e.p.direction&&(k="right",u=" style='text-align:left'",f.attr("dir","rtl"));var x=a.extend([],e.p.colModel),d=""+ +b.Find+"",v=""+b.Reset+"",g="",m="",p,q=!1,y=-1;b.showQuery&&(g="Query");b.columns.length?(x=b.columns,y=0,p=x[0].index||x[0].name):a.each(x,function(a,b){b.label||(b.label=e.p.colNames[a]);if(!q){var c= +void 0===b.search?!0:b.search,d=!0===b.hidden;if(b.searchoptions&&!0===b.searchoptions.searchhidden&&c||c&&!d)q=!0,p=b.index||b.name,y=a}});if(!r&&p||!1===b.multipleSearch){var D="eq";0<=y&&x[y].searchoptions&&x[y].searchoptions.sopt?D=x[y].searchoptions.sopt[0]:b.sopt&&b.sopt.length&&(D=b.sopt[0]);r={groupOp:"AND",rules:[{field:p,op:D,data:""}]}}q=!1;b.tmplNames&&b.tmplNames.length&&(q=!0,m=b.tmplLabel,m+="");k="

"+v+m+""+g+d+"
";h=a.jgrid.jqID(h);a("#"+h).jqFilter({columns:x,filter:b.loadDefaults?r:null,showQuery:b.showQuery,errorcheck:b.errorcheck,sopt:b.sopt, +groupButton:b.multipleGroup,ruleButtons:b.multipleSearch,afterRedraw:b.afterRedraw,ops:b.odata,operands:b.operands,ajaxSelectOptions:e.p.ajaxSelectOptions,groupOps:b.groupOps,onChange:function(){this.p.showQuery&&a(".query",this).html(this.toUserFriendlyString());a.isFunction(b.afterChange)&&b.afterChange.call(e,a("#"+h),b)},direction:e.p.direction,id:e.p.id});f.append(k);q&&b.tmplFilters&&b.tmplFilters.length&&a(".ui-template",f).bind("change",function(){var c=a(this).val();"default"===c?a("#"+h).jqFilter("addFilter", +r):a("#"+h).jqFilter("addFilter",b.tmplFilters[parseInt(c,10)]);return!1});!0===b.multipleGroup&&(b.multipleSearch=!0);a(e).triggerHandler("jqGridFilterInitialize",[a("#"+h)]);a.isFunction(b.onInitializeSearch)&&b.onInitializeSearch.call(e,a("#"+h));b.gbox="#gbox_"+h;b.layer?a.jgrid.createModal(s,f,b,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0],"#"+a.jgrid.jqID(b.layer),{position:"relative"}):a.jgrid.createModal(s,f,b,"#gview_"+a.jgrid.jqID(e.p.id),a("#gbox_"+a.jgrid.jqID(e.p.id))[0]); +(b.searchOnEnter||b.closeOnEscape)&&a("#"+a.jgrid.jqID(s.themodal)).keydown(function(c){var d=a(c.target);if(b.searchOnEnter&&13===c.which&&!(d.hasClass("add-group")||d.hasClass("add-rule")||d.hasClass("delete-group")||d.hasClass("delete-rule")||d.hasClass("fm-button")&&d.is("[id$=_query]")))return a("#"+h+"_search").click(),!1;if(b.closeOnEscape&&27===c.which)return a("#"+a.jgrid.jqID(s.modalhead)).find(".ui-jqdialog-titlebar-close").click(),!1});g&&a("#"+h+"_query").bind("click",function(){a(".queryresult", +f).toggle();return!1});void 0===b.stringResult&&(b.stringResult=b.multipleSearch);a("#"+h+"_search").bind("click",function(){var c=a("#"+h),d={},n,g;c.find(".input-elm:focus").change();g=c.jqFilter("filterData");if(b.errorcheck&&(c[0].hideError(),b.showQuery||c.jqFilter("toSQLString"),c[0].p.error))return c[0].showError(),!1;if(b.stringResult){try{n=xmlJsonClass.toJson(g,"","",!1)}catch(f){try{n=JSON.stringify(g)}catch(k){}}"string"===typeof n&&(d[b.sFilter]=n,a.each([b.sField,b.sValue,b.sOper],function(){d[this]= +""}))}else b.multipleSearch?(d[b.sFilter]=g,a.each([b.sField,b.sValue,b.sOper],function(){d[this]=""})):(d[b.sField]=g.rules[0].field,d[b.sValue]=g.rules[0].data,d[b.sOper]=g.rules[0].op,d[b.sFilter]="");e.p.search=!0;a.extend(e.p.postData,d);t=a(e).triggerHandler("jqGridFilterSearch");void 0===t&&(t=!0);t&&a.isFunction(b.onSearch)&&(t=b.onSearch.call(e,e.p.filters));!1!==t&&a(e).trigger("reloadGrid",[{page:1}]);b.closeAfterSearch&&a.jgrid.hideModal("#"+a.jgrid.jqID(s.themodal),{gb:"#gbox_"+a.jgrid.jqID(e.p.id), +jqm:b.jqModal,onClose:b.onClose});return!1});a("#"+h+"_reset").bind("click",function(){var c={},d=a("#"+h);e.p.search=!1;e.p.resetsearch=!0;!1===b.multipleSearch?c[b.sField]=c[b.sValue]=c[b.sOper]="":c[b.sFilter]="";d[0].resetFilter();q&&a(".ui-template",f).val("default");a.extend(e.p.postData,c);t=a(e).triggerHandler("jqGridFilterReset");void 0===t&&(t=!0);t&&a.isFunction(b.onReset)&&(t=b.onReset.call(e));!1!==t&&a(e).trigger("reloadGrid",[{page:1}]);b.closeAfterReset&&a.jgrid.hideModal("#"+a.jgrid.jqID(s.themodal), +{gb:"#gbox_"+a.jgrid.jqID(e.p.id),jqm:b.jqModal,onClose:b.onClose});return!1});c(a("#"+h));a(".fm-button:not(.ui-state-disabled)",f).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},editGridRow:function(z,c){c=a.extend(!0,{top:0,left:0,width:300,datawidth:"auto",height:"auto",dataheight:"auto",modal:!1,overlay:30,drag:!0,resize:!0,url:null,mtype:"POST",clearAfterAdd:!0,closeAfterEdit:!1,reloadAfterSubmit:!0,onInitializeForm:null,beforeInitData:null, +beforeShowForm:null,afterShowForm:null,beforeSubmit:null,afterSubmit:null,onclickSubmit:null,afterComplete:null,onclickPgButtons:null,afterclickPgButtons:null,editData:{},recreateForm:!1,jqModal:!0,closeOnEscape:!1,addedrow:"first",topinfo:"",bottominfo:"",saveicon:[],closeicon:[],savekey:[!1,13],navkeys:[!1,38,40],checkOnSubmit:!1,checkOnUpdate:!1,_savedData:{},processing:!1,onClose:null,ajaxEditOptions:{},serializeEditData:null,viewPagerButtons:!0,overlayClass:"ui-widget-overlay"},a.jgrid.edit, +c||{});b[a(this)[0].p.id]=c;return this.each(function(){function e(){a(p+" > tbody > tr > td > .FormElement").each(function(){var b=a(".customelement",this);if(b.length){var c=a(b[0]).attr("name");a.each(d.p.colModel,function(){if(this.name===c&&this.editoptions&&a.isFunction(this.editoptions.custom_value)){try{if(l[c]=this.editoptions.custom_value.call(d,a("#"+a.jgrid.jqID(c),p),"get"),void 0===l[c])throw"e1";}catch(b){"e1"===b?a.jgrid.info_dialog(a.jgrid.errors.errcap,"function 'custom_value' "+ +a.jgrid.edit.msg.novalue,a.jgrid.edit.bClose):a.jgrid.info_dialog(a.jgrid.errors.errcap,b.message,a.jgrid.edit.bClose)}return!0}})}else{switch(a(this).get(0).type){case "checkbox":a(this).is(":checked")?l[this.name]=a(this).val():(b=a(this).attr("offval"),l[this.name]=b);break;case "select-one":l[this.name]=a("option:selected",this).val();break;case "select-multiple":l[this.name]=a(this).val();l[this.name]=l[this.name]?l[this.name].join(","):"";a("option:selected",this).each(function(b,c){a(c).text()}); +break;case "password":case "text":case "textarea":case "button":l[this.name]=a(this).val()}d.p.autoencode&&(l[this.name]=a.jgrid.htmlEncode(l[this.name]))}});return!0}function h(c,e,n,f){var k,l,p,h=0,q,m,r,C=[],u=!1,z="",t;for(t=1;t<=f;t++)z+="  ";"_empty"!==c&&(u=a(e).jqGrid("getInd",c));a(e.p.colModel).each(function(t){k=this.name;m=(l=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)?"style='display:none'":""; +if("cb"!==k&&"subgrid"!==k&&!0===this.editable&&"rn"!==k){if(!1===u)q="";else if(k===e.p.ExpandColumn&&!0===e.p.treeGrid)q=a("td[role='gridcell']:eq("+t+")",e.rows[u]).text();else{try{q=a.unformat.call(e,a("td[role='gridcell']:eq("+t+")",e.rows[u]),{rowId:c,colModel:this},t)}catch(w){q=this.edittype&&"textarea"===this.edittype?a("td[role='gridcell']:eq("+t+")",e.rows[u]).text():a("td[role='gridcell']:eq("+t+")",e.rows[u]).html()}if(!q||" "===q||" "===q||1===q.length&&160===q.charCodeAt(0))q= +""}var s=a.extend({},this.editoptions||{},{id:k,name:k}),y=a.extend({},{elmprefix:"",elmsuffix:"",rowabove:!1,rowcontent:""},this.formoptions||{}),v=parseInt(y.rowpos,10)||h+1,A=parseInt(2*(parseInt(y.colpos,10)||1),10);"_empty"===c&&s.defaultValue&&(q=a.isFunction(s.defaultValue)?s.defaultValue.call(d):s.defaultValue);this.edittype||(this.edittype="text");d.p.autoencode&&(q=a.jgrid.htmlDecode(q));r=a.jgrid.createEl.call(d,this.edittype,s,q,!1,a.extend({},a.jgrid.ajaxOptions,e.p.ajaxSelectOptions|| +{}));if(b[d.p.id].checkOnSubmit||b[d.p.id].checkOnUpdate)b[d.p.id]._savedData[k]=q;a(r).addClass("FormElement");-1"+y.rowcontent+"");a(n).append(x);x[0].rp=v}0===p.length&&(p=a("").addClass("FormData").attr("id","tr_"+k),a(p).append(z),a(n).append(p), +p[0].rp=v);a("td:eq("+(A-2)+")",p[0]).html(void 0===y.label?e.p.colNames[t]:y.label);a("td:eq("+(A-1)+")",p[0]).append(y.elmprefix).append(r).append(y.elmsuffix);"custom"===this.edittype&&a.isFunction(s.custom_value)&&s.custom_value.call(d,a("#"+k,"#"+g),"set",q);a.jgrid.bindEv.call(d,r,s);C[h]=t;h++}});0
").append(H).append(m);a.jgrid.createModal(q, +m,b[a(this)[0].p.id],"#gview_"+a.jgrid.jqID(d.p.id),a("#gbox_"+a.jgrid.jqID(d.p.id))[0]);A&&(a("#pData, #nData",p+"_2").css("float","right"),a(".EditButton",p+"_2").css("text-align","left"));b[d.p.id].topinfo&&a(".tinfo",p).show();b[d.p.id].bottominfo&&a(".binfo",p+"_2").show();m=m=null;a("#"+a.jgrid.jqID(q.themodal)).keydown(function(e){var n=e.target;if(!0===a("#"+g).data("disabled"))return!1;if(!0===b[d.p.id].savekey[0]&&e.which===b[d.p.id].savekey[1]&&"TEXTAREA"!==n.tagName)return a("#sData", +p+"_2").trigger("click"),!1;if(27===e.which){if(!f())return!1;O&&a.jgrid.hideModal("#"+a.jgrid.jqID(q.themodal),{gb:c.gbox,jqm:c.jqModal,onClose:b[d.p.id].onClose});return!1}if(!0===b[d.p.id].navkeys[0]){if("_empty"===a("#id_g",p).val())return!0;if(e.which===b[d.p.id].navkeys[1])return a("#pData",p+"_2").trigger("click"),!1;if(e.which===b[d.p.id].navkeys[2])return a("#nData",p+"_2").trigger("click"),!1}});c.checkOnUpdate&&(a("a.ui-jqdialog-titlebar-close span","#"+a.jgrid.jqID(q.themodal)).removeClass("jqmClose"), +a("a.ui-jqdialog-titlebar-close","#"+a.jgrid.jqID(q.themodal)).unbind("click").click(function(){if(!f())return!1;a.jgrid.hideModal("#"+a.jgrid.jqID(q.themodal),{gb:"#gbox_"+a.jgrid.jqID(v),jqm:c.jqModal,onClose:b[d.p.id].onClose});return!1}));c.saveicon=a.extend([!0,"left","ui-icon-disk"],c.saveicon);c.closeicon=a.extend([!0,"left","ui-icon-close"],c.closeicon);!0===c.saveicon[0]&&a("#sData",p+"_2").addClass("right"===c.saveicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("");!0===c.closeicon[0]&&a("#cData",p+"_2").addClass("right"===c.closeicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("");if(b[d.p.id].checkOnSubmit||b[d.p.id].checkOnUpdate)J=""+c.bYes+"",G=""+c.bNo+"",K=""+ +c.bExit+"",m=c.zIndex||999,m++,a("
"+c.saveData+"

"+J+G+K+"
").insertAfter("#"+g),a("#sNew","#"+a.jgrid.jqID(q.themodal)).click(function(){s();a("#"+g).data("disabled",!1);a(".confirm","#"+a.jgrid.jqID(q.themodal)).hide();return!1}),a("#nNew","#"+a.jgrid.jqID(q.themodal)).click(function(){a(".confirm", +"#"+a.jgrid.jqID(q.themodal)).hide();a("#"+g).data("disabled",!1);setTimeout(function(){a(":input:visible","#"+g)[0].focus()},0);return!1}),a("#cNew","#"+a.jgrid.jqID(q.themodal)).click(function(){a(".confirm","#"+a.jgrid.jqID(q.themodal)).hide();a("#"+g).data("disabled",!1);a.jgrid.hideModal("#"+a.jgrid.jqID(q.themodal),{gb:"#gbox_"+a.jgrid.jqID(v),jqm:c.jqModal,onClose:b[d.p.id].onClose});return!1});a(d).triggerHandler("jqGridAddEditInitializeForm",[a("#"+g),B]);E&&E.call(d,a("#"+g),B);"_empty"!== +z&&b[d.p.id].viewPagerButtons?a("#pData,#nData",p+"_2").show():a("#pData,#nData",p+"_2").hide();a(d).triggerHandler("jqGridAddEditBeforeShowForm",[a("#"+g),B]);y&&y.call(d,a("#"+g),B);a("#"+a.jgrid.jqID(q.themodal)).data("onClose",b[d.p.id].onClose);a.jgrid.viewModal("#"+a.jgrid.jqID(q.themodal),{gbox:"#gbox_"+a.jgrid.jqID(v),jqm:c.jqModal,overlay:c.overlay,modal:c.modal,overlayClass:c.overlayClass,onHide:function(b){a(d).data("formProp",{top:parseFloat(a(b.w).css("top")),left:parseFloat(a(b.w).css("left")), +width:a(b.w).width(),height:a(b.w).height(),dataheight:a("#"+g).height(),datawidth:a("#"+g).width()});b.w.remove();b.o&&b.o.remove()}});N||a("."+a.jgrid.jqID(c.overlayClass)).click(function(){if(!f())return!1;a.jgrid.hideModal("#"+a.jgrid.jqID(q.themodal),{gb:"#gbox_"+a.jgrid.jqID(v),jqm:c.jqModal,onClose:b[d.p.id].onClose});return!1});a(".fm-button","#"+a.jgrid.jqID(q.themodal)).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")});a("#sData",p+"_2").click(function(){l= +{};a("#FormError",p).hide();e();"_empty"===l[d.p.id+"_id"]?s():!0===c.checkOnSubmit?(M=r(l,b[d.p.id]._savedData))?(a("#"+g).data("disabled",!0),a(".confirm","#"+a.jgrid.jqID(q.themodal)).show()):s():s();return!1});a("#cData",p+"_2").click(function(){if(!f())return!1;a.jgrid.hideModal("#"+a.jgrid.jqID(q.themodal),{gb:"#gbox_"+a.jgrid.jqID(v),jqm:c.jqModal,onClose:b[d.p.id].onClose});return!1});a("#nData",p+"_2").click(function(){if(!f())return!1;a("#FormError",p).hide();var b=x();b[0]=parseInt(b[0], +10);if(-1!==b[0]&&b[1][b[0]+1]){a(d).triggerHandler("jqGridAddEditClickPgButtons",["next",a("#"+g),b[1][b[0]]]);var e;if(a.isFunction(c.onclickPgButtons)&&(e=c.onclickPgButtons.call(d,"next",a("#"+g),b[1][b[0]]),void 0!==e&&!1===e)||a("#"+a.jgrid.jqID(b[1][b[0]+1])).hasClass("ui-state-disabled"))return!1;w(b[1][b[0]+1],d,g);a(d).jqGrid("setSelection",b[1][b[0]+1]);a(d).triggerHandler("jqGridAddEditAfterClickPgButtons",["next",a("#"+g),b[1][b[0]]]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons.call(d, +"next",a("#"+g),b[1][b[0]+1]);u(b[0]+1,b)}return!1});a("#pData",p+"_2").click(function(){if(!f())return!1;a("#FormError",p).hide();var b=x();if(-1!==b[0]&&b[1][b[0]-1]){a(d).triggerHandler("jqGridAddEditClickPgButtons",["prev",a("#"+g),b[1][b[0]]]);var e;if(a.isFunction(c.onclickPgButtons)&&(e=c.onclickPgButtons.call(d,"prev",a("#"+g),b[1][b[0]]),void 0!==e&&!1===e)||a("#"+a.jgrid.jqID(b[1][b[0]-1])).hasClass("ui-state-disabled"))return!1;w(b[1][b[0]-1],d,g);a(d).jqGrid("setSelection",b[1][b[0]-1]); +a(d).triggerHandler("jqGridAddEditAfterClickPgButtons",["prev",a("#"+g),b[1][b[0]]]);a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons.call(d,"prev",a("#"+g),b[1][b[0]-1]);u(b[0]-1,b)}return!1});a(d).triggerHandler("jqGridAddEditAfterShowForm",[a("#"+g),B]);D&&D.call(d,a("#"+g),B);y=x();u(y[0],y)}}})},viewGridRow:function(z,c){c=a.extend(!0,{top:0,left:0,width:0,datawidth:"auto",height:"auto",dataheight:"auto",modal:!1,overlay:30,drag:!0,resize:!0,jqModal:!0,closeOnEscape:!1,labelswidth:"30%", +closeicon:[],navkeys:[!1,38,40],onClose:null,beforeShowForm:null,beforeInitData:null,viewPagerButtons:!0,recreateForm:!1},a.jgrid.view,c||{});b[a(this)[0].p.id]=c;return this.each(function(){function e(){!0!==b[r.p.id].closeOnEscape&&!0!==b[r.p.id].navkeys[0]||setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+a.jgrid.jqID(v.modalhead)).focus()},0)}function h(b,d,e,f){var g,k,h,q=0,m,p,r=[],s=!1,t,u="  ", +y="",z=["integer","number","currency"],v=0,w=0,A,x,D;for(t=1;t<=f;t++)y+=1===t?u:"  ";a(d.p.colModel).each(function(){(k=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)||"right"!==this.align||(this.formatter&&-1!==a.inArray(this.formatter,z)?v=Math.max(v,parseInt(this.width,10)):w=Math.max(w,parseInt(this.width,10)))});A=0!==v?v:0!==w?w:0;s=a(d).jqGrid("getInd", +b);a(d.p.colModel).each(function(b){g=this.name;x=!1;p=(k=this.editrules&&!0===this.editrules.edithidden?!1:!0===this.hidden?!0:!1)?"style='display:none'":"";D="boolean"!==typeof this.viewable?!0:this.viewable;if("cb"!==g&&"subgrid"!==g&&"rn"!==g&&D){m=!1===s?"":g===d.p.ExpandColumn&&!0===d.p.treeGrid?a("td:eq("+b+")",d.rows[s]).text():a("td:eq("+b+")",d.rows[s]).html();x="right"===this.align&&0!==A?!0:!1;var c=a.extend({},{rowabove:!1,rowcontent:""},this.formoptions||{}),n=parseInt(c.rowpos,10)|| +q+1,t=parseInt(2*(parseInt(c.colpos,10)||1),10);if(c.rowabove){var u=a(""+c.rowcontent+"");a(e).append(u);u[0].rp=n}h=a(e).find("tr[rowpos="+n+"]");0===h.length&&(h=a("").addClass("FormData").attr("id","trv_"+g),a(h).append(y),a(e).append(h),h[0].rp=n);a("td:eq("+(t-2)+")",h[0]).html(""+(void 0===c.label?d.p.colNames[b]:c.label)+"");a("td:eq("+(t-1)+")",h[0]).append(""+m+"").attr("id","v_"+g); +x&&a("td:eq("+(t-1)+") span",h[0]).css({"text-align":"right",width:A+"px"});r[q]=b;q++}});0
").append(x).append("
"+y+"
");a.jgrid.createModal(v,x,c,"#gview_"+a.jgrid.jqID(r.p.id),a("#gview_"+a.jgrid.jqID(r.p.id))[0]);d&&(a("#pData, #nData","#"+u+"_2").css("float","right"),a(".EditButton","#"+u+"_2").css("text-align","left"));c.viewPagerButtons||a("#pData, #nData","#"+u+"_2").hide();x=null;a("#"+v.themodal).keydown(function(d){if(27===d.which)return b[r.p.id].closeOnEscape&& +a.jgrid.hideModal("#"+a.jgrid.jqID(v.themodal),{gb:c.gbox,jqm:c.jqModal,onClose:c.onClose}),!1;if(!0===c.navkeys[0]){if(d.which===c.navkeys[1])return a("#pData","#"+u+"_2").trigger("click"),!1;if(d.which===c.navkeys[2])return a("#nData","#"+u+"_2").trigger("click"),!1}});c.closeicon=a.extend([!0,"left","ui-icon-close"],c.closeicon);!0===c.closeicon[0]&&a("#cData","#"+u+"_2").addClass("right"===c.closeicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("");a.isFunction(c.beforeShowForm)&&c.beforeShowForm.call(r,a("#"+k));a.jgrid.viewModal("#"+a.jgrid.jqID(v.themodal),{gbox:"#gbox_"+a.jgrid.jqID(f),jqm:c.jqModal,overlay:c.overlay,modal:c.modal,onHide:function(b){a(r).data("viewProp",{top:parseFloat(a(b.w).css("top")),left:parseFloat(a(b.w).css("left")),width:a(b.w).width(),height:a(b.w).height(),dataheight:a("#"+k).height(),datawidth:a("#"+k).width()});b.w.remove();b.o&&b.o.remove()}});a(".fm-button:not(.ui-state-disabled)","#"+u+"_2").hover(function(){a(this).addClass("ui-state-hover")}, +function(){a(this).removeClass("ui-state-hover")});e();a("#cData","#"+u+"_2").click(function(){a.jgrid.hideModal("#"+a.jgrid.jqID(v.themodal),{gb:"#gbox_"+a.jgrid.jqID(f),jqm:c.jqModal,onClose:c.onClose});return!1});a("#nData","#"+u+"_2").click(function(){a("#FormError","#"+u).hide();var b=s();b[0]=parseInt(b[0],10);-1!==b[0]&&b[1][b[0]+1]&&(a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons.call(r,"next",a("#"+k),b[1][b[0]]),w(b[1][b[0]+1],r),a(r).jqGrid("setSelection",b[1][b[0]+1]),a.isFunction(c.afterclickPgButtons)&& +c.afterclickPgButtons.call(r,"next",a("#"+k),b[1][b[0]+1]),t(b[0]+1,b));e();return!1});a("#pData","#"+u+"_2").click(function(){a("#FormError","#"+u).hide();var b=s();-1!==b[0]&&b[1][b[0]-1]&&(a.isFunction(c.onclickPgButtons)&&c.onclickPgButtons.call(r,"prev",a("#"+k),b[1][b[0]]),w(b[1][b[0]-1],r),a(r).jqGrid("setSelection",b[1][b[0]-1]),a.isFunction(c.afterclickPgButtons)&&c.afterclickPgButtons.call(r,"prev",a("#"+k),b[1][b[0]-1]),t(b[0]-1,b));e();return!1});x=s();t(x[0],x)}}})},delGridRow:function(z, +c){c=a.extend(!0,{top:0,left:0,width:240,height:"auto",dataheight:"auto",modal:!1,overlay:30,drag:!0,resize:!0,url:"",mtype:"POST",reloadAfterSubmit:!0,beforeShowForm:null,beforeInitData:null,afterShowForm:null,beforeSubmit:null,onclickSubmit:null,afterSubmit:null,jqModal:!0,closeOnEscape:!1,delData:{},delicon:[],cancelicon:[],onClose:null,ajaxDelOptions:{},processing:!1,serializeDelData:null,useDataProxy:!1},a.jgrid.del,c||{});b[a(this)[0].p.id]=c;return this.each(function(){var e=this;if(e.grid&& +z){var h=a.isFunction(b[e.p.id].beforeShowForm),w=a.isFunction(b[e.p.id].afterShowForm),t=a.isFunction(b[e.p.id].beforeInitData)?b[e.p.id].beforeInitData:!1,s=e.p.id,r={},f=!0,k="DelTbl_"+a.jgrid.jqID(s),u,x,d,v,g="DelTbl_"+s,m={themodal:"delmod"+s,modalhead:"delhd"+s,modalcontent:"delcnt"+s,scrollelm:k};a.isArray(z)&&(z=z.join());if(void 0!==a("#"+a.jgrid.jqID(m.themodal))[0]){t&&(f=t.call(e,a("#"+k)),void 0===f&&(f=!0));if(!1===f)return;a("#DelData>td","#"+k).text(z);a("#DelError","#"+k).hide(); +!0===b[e.p.id].processing&&(b[e.p.id].processing=!1,a("#dData","#"+k).removeClass("ui-state-active"));h&&b[e.p.id].beforeShowForm.call(e,a("#"+k));a.jgrid.viewModal("#"+a.jgrid.jqID(m.themodal),{gbox:"#gbox_"+a.jgrid.jqID(s),jqm:b[e.p.id].jqModal,jqM:!1,overlay:b[e.p.id].overlay,modal:b[e.p.id].modal})}else{var p=isNaN(b[e.p.id].dataheight)?b[e.p.id].dataheight:b[e.p.id].dataheight+"px",q=isNaN(c.datawidth)?c.datawidth:c.datawidth+"px",g="
",g=g+"",g=g+(""),g=g+('"),g=g+"
'+b[e.p.id].msg+"
 
",g=g+("

"+ +(""+c.bSubmit+"")+" "+(""+c.bCancel+"")+"
");c.gbox="#gbox_"+a.jgrid.jqID(s);a.jgrid.createModal(m,g,c,"#gview_"+a.jgrid.jqID(e.p.id),a("#gview_"+a.jgrid.jqID(e.p.id))[0]);t&&(f=t.call(e,a("#"+k)),void 0===f&&(f=!0));if(!1===f)return;a(".fm-button","#"+k+"_2").hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}); +c.delicon=a.extend([!0,"left","ui-icon-scissors"],b[e.p.id].delicon);c.cancelicon=a.extend([!0,"left","ui-icon-cancel"],b[e.p.id].cancelicon);!0===c.delicon[0]&&a("#dData","#"+k+"_2").addClass("right"===c.delicon[1]?"fm-button-icon-right":"fm-button-icon-left").append("");!0===c.cancelicon[0]&&a("#eData","#"+k+"_2").addClass("right"===c.cancelicon[1]?"fm-button-icon-right":"fm-button-icon-left").append(""); +a("#dData","#"+k+"_2").click(function(){var f=[!0,""],g,h=a("#DelData>td","#"+k).text();r={};a.isFunction(b[e.p.id].onclickSubmit)&&(r=b[e.p.id].onclickSubmit.call(e,b[e.p.id],h)||{});a.isFunction(b[e.p.id].beforeSubmit)&&(f=b[e.p.id].beforeSubmit.call(e,h));if(f[0]&&!b[e.p.id].processing){b[e.p.id].processing=!0;d=e.p.prmNames;u=a.extend({},b[e.p.id].delData,r);v=d.oper;u[v]=d.deloper;x=d.id;h=String(h).split(",");if(!h.length)return!1;for(g in h)h.hasOwnProperty(g)&&(h[g]=a.jgrid.stripPref(e.p.idPrefix, +h[g]));u[x]=h.join();a(this).addClass("ui-state-active");g=a.extend({url:b[e.p.id].url||a(e).jqGrid("getGridParam","editurl"),type:b[e.p.id].mtype,data:a.isFunction(b[e.p.id].serializeDelData)?b[e.p.id].serializeDelData.call(e,u):u,complete:function(d,g){var q;300<=d.status&&304!==d.status?(f[0]=!1,a.isFunction(b[e.p.id].errorTextFormat)?f[1]=b[e.p.id].errorTextFormat.call(e,d):f[1]=g+" Status: '"+d.statusText+"'. Error code: "+d.status):a.isFunction(b[e.p.id].afterSubmit)&&(f=b[e.p.id].afterSubmit.call(e, +d,u));if(!1===f[0])a("#DelError>td","#"+k).html(f[1]),a("#DelError","#"+k).show();else{if(b[e.p.id].reloadAfterSubmit&&"local"!==e.p.datatype)a(e).trigger("reloadGrid");else{if(!0===e.p.treeGrid)try{a(e).jqGrid("delTreeNode",e.p.idPrefix+h[0])}catch(p){}else for(q=0;qtd","#"+k).html(f[1]),a("#DelError","#"+k).show());return!1});a("#eData","#"+k+"_2").click(function(){a.jgrid.hideModal("#"+a.jgrid.jqID(m.themodal),{gb:"#gbox_"+a.jgrid.jqID(s),jqm:b[e.p.id].jqModal,onClose:b[e.p.id].onClose});return!1});h&&b[e.p.id].beforeShowForm.call(e,a("#"+k));a.jgrid.viewModal("#"+a.jgrid.jqID(m.themodal),{gbox:"#gbox_"+a.jgrid.jqID(s),jqm:b[e.p.id].jqModal, +overlay:b[e.p.id].overlay,modal:b[e.p.id].modal})}w&&b[e.p.id].afterShowForm.call(e,a("#"+k));!0===b[e.p.id].closeOnEscape&&setTimeout(function(){a(".ui-jqdialog-titlebar-close","#"+a.jgrid.jqID(m.modalhead)).focus()},0)}})},navGrid:function(b,c,e,h,w,t,s){c=a.extend({edit:!0,editicon:"ui-icon-pencil",add:!0,addicon:"ui-icon-plus",del:!0,delicon:"ui-icon-trash",search:!0,searchicon:"ui-icon-search",refresh:!0,refreshicon:"ui-icon-refresh",refreshstate:"firstpage",view:!1,viewicon:"ui-icon-document", +position:"left",closeOnEscape:!0,beforeRefresh:null,afterRefresh:null,cloneToTop:!1,alertwidth:200,alertheight:"auto",alerttop:null,alertleft:null,alertzIndex:null},a.jgrid.nav,c||{});return this.each(function(){if(!this.nav){var r={themodal:"alertmod_"+this.p.id,modalhead:"alerthd_"+this.p.id,modalcontent:"alertcnt_"+this.p.id},f=this,k;if(f.grid&&"string"===typeof b){void 0===a("#"+r.themodal)[0]&&(c.alerttop||c.alertleft||(void 0!==window.innerWidth?(c.alertleft=window.innerWidth,c.alerttop=window.innerHeight): +void 0!==document.documentElement&&void 0!==document.documentElement.clientWidth&&0!==document.documentElement.clientWidth?(c.alertleft=document.documentElement.clientWidth,c.alerttop=document.documentElement.clientHeight):(c.alertleft=1024,c.alerttop=768),c.alertleft=c.alertleft/2-parseInt(c.alertwidth,10)/2,c.alerttop=c.alerttop/2-25),a.jgrid.createModal(r,"
"+c.alerttext+"
",{gbox:"#gbox_"+a.jgrid.jqID(f.p.id),jqModal:!0, +drag:!0,resize:!0,caption:c.alertcap,top:c.alerttop,left:c.alertleft,width:c.alertwidth,height:c.alertheight,closeOnEscape:c.closeOnEscape,zIndex:c.alertzIndex},"#gview_"+a.jgrid.jqID(f.p.id),a("#gbox_"+a.jgrid.jqID(f.p.id))[0],!0));var u=1,x,d=function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},v=function(){a(this).removeClass("ui-state-hover")};c.cloneToTop&&f.p.toppager&&(u=2);for(x=0;x"), +m,p;0===x?(m=b,p=f.p.id,m===f.p.toppager&&(p+="_top",u=1)):(m=f.p.toppager,p=f.p.id+"_top");"rtl"===f.p.direction&&a(g).attr("dir","rtl").css("float","right");c.add&&(h=h||{},k=a(""),a(k).append("
"+c.addtext+"
"),a("tr",g).append(k),a(k,g).attr({title:c.addtitle||"",id:h.id||"add_"+p}).click(function(){a(this).hasClass("ui-state-disabled")||(a.isFunction(c.addfunc)?c.addfunc.call(f): +a(f).jqGrid("editGridRow","new",h));return!1}).hover(d,v),k=null);c.edit&&(k=a(""),e=e||{},a(k).append("
"+c.edittext+"
"),a("tr",g).append(k),a(k,g).attr({title:c.edittitle||"",id:e.id||"edit_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var b=f.p.selrow;b?a.isFunction(c.editfunc)?c.editfunc.call(f,b):a(f).jqGrid("editGridRow",b,e):(a.jgrid.viewModal("#"+r.themodal, +{gbox:"#gbox_"+a.jgrid.jqID(f.p.id),jqm:!0}),a("#jqg_alrt").focus())}return!1}).hover(d,v),k=null);c.view&&(k=a(""),s=s||{},a(k).append("
"+c.viewtext+"
"),a("tr",g).append(k),a(k,g).attr({title:c.viewtitle||"",id:s.id||"view_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var b=f.p.selrow;b?a.isFunction(c.viewfunc)?c.viewfunc.call(f,b):a(f).jqGrid("viewGridRow",b,s): +(a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+a.jgrid.jqID(f.p.id),jqm:!0}),a("#jqg_alrt").focus())}return!1}).hover(d,v),k=null);c.del&&(k=a(""),w=w||{},a(k).append("
"+c.deltext+"
"),a("tr",g).append(k),a(k,g).attr({title:c.deltitle||"",id:w.id||"del_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){var b;f.p.multiselect?(b=f.p.selarrrow,0===b.length&&(b=null)):b= +f.p.selrow;b?a.isFunction(c.delfunc)?c.delfunc.call(f,b):a(f).jqGrid("delGridRow",b,w):(a.jgrid.viewModal("#"+r.themodal,{gbox:"#gbox_"+a.jgrid.jqID(f.p.id),jqm:!0}),a("#jqg_alrt").focus())}return!1}).hover(d,v),k=null);(c.add||c.edit||c.del||c.view)&&a("tr",g).append("");c.search&&(k=a(""),t=t||{},a(k).append("
"+c.searchtext+"
"),a("tr",g).append(k),a(k,g).attr({title:c.searchtitle||"",id:t.id||"search_"+p}).click(function(){a(this).hasClass("ui-state-disabled")||(a.isFunction(c.searchfunc)?c.searchfunc.call(f,t):a(f).jqGrid("searchGrid",t));return!1}).hover(d,v),t.showOnLoad&&!0===t.showOnLoad&&a(k,g).click(),k=null);c.refresh&&(k=a(""),a(k).append("
"+c.refreshtext+ +"
"),a("tr",g).append(k),a(k,g).attr({title:c.refreshtitle||"",id:"refresh_"+p}).click(function(){if(!a(this).hasClass("ui-state-disabled")){a.isFunction(c.beforeRefresh)&&c.beforeRefresh.call(f);f.p.search=!1;f.p.resetsearch=!0;try{var b=f.p.id;f.p.postData.filters="";try{a("#fbox_"+a.jgrid.jqID(b)).jqFilter("resetFilter")}catch(d){}a.isFunction(f.clearToolbar)&&f.clearToolbar.call(f,!1)}catch(e){}switch(c.refreshstate){case "firstpage":a(f).trigger("reloadGrid",[{page:1}]);break;case "current":a(f).trigger("reloadGrid", +[{current:!0}])}a.isFunction(c.afterRefresh)&&c.afterRefresh.call(f)}return!1}).hover(d,v),k=null);k=a(".ui-jqgrid").css("font-size")||"11px";a("body").append("");k=a(g).clone().appendTo("#testpg2").width();a("#testpg2").remove();a(m+"_"+c.position,m).append(g);f.p._nvtd&&(k>f.p._nvtd[0]&&(a(m+"_"+c.position,m).width(k),f.p._nvtd[0]=k),f.p._nvtd[1]=k);g=k=k=null;this.nav=!0}}}})},navButtonAdd:function(b, +c){c=a.extend({caption:"newButton",title:"",buttonicon:"ui-icon-newwin",onClickButton:null,position:"last",cursor:"pointer"},c||{});return this.each(function(){if(this.grid){"string"===typeof b&&0!==b.indexOf("#")&&(b="#"+a.jgrid.jqID(b));var e=a(".navtable",b)[0],h=this;if(e&&(!c.id||void 0===a("#"+a.jgrid.jqID(c.id),e)[0])){var w=a("");"NONE"===c.buttonicon.toString().toUpperCase()?a(w).addClass("ui-pg-button ui-corner-all").append("
"+c.caption+"
"):a(w).addClass("ui-pg-button ui-corner-all").append("
"+c.caption+"
");c.id&&a(w).attr("id",c.id);"first"===c.position?0===e.rows[0].cells.length?a("tr",e).append(w):a("tr td:eq(0)",e).before(w):a("tr",e).append(w);a(w,e).attr("title",c.title||"").click(function(b){a(this).hasClass("ui-state-disabled")||a.isFunction(c.onClickButton)&&c.onClickButton.call(h,b);return!1}).hover(function(){a(this).hasClass("ui-state-disabled")||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})}}})},navSeparatorAdd:function(b, +c){c=a.extend({sepclass:"ui-separator",sepcontent:"",position:"last"},c||{});return this.each(function(){if(this.grid){"string"===typeof b&&0!==b.indexOf("#")&&(b="#"+a.jgrid.jqID(b));var e=a(".navtable",b)[0];if(e){var h=""+c.sepcontent+"";"first"===c.position?0===e.rows[0].cells.length?a("tr",e).append(h):a("tr td:eq(0)",e).before(h):a("tr",e).append(h)}}})},GridToForm:function(b,c){return this.each(function(){var e= +this,h;if(e.grid){var w=a(e).jqGrid("getRowData",b);if(w)for(h in w)w.hasOwnProperty(h)&&(a("[name="+a.jgrid.jqID(h)+"]",c).is("input:radio")||a("[name="+a.jgrid.jqID(h)+"]",c).is("input:checkbox")?a("[name="+a.jgrid.jqID(h)+"]",c).each(function(){if(a(this).val()==w[h])a(this)[e.p.useProp?"prop":"attr"]("checked",!0);else a(this)[e.p.useProp?"prop":"attr"]("checked",!1)}):a("[name="+a.jgrid.jqID(h)+"]",c).val(w[h]))}})},FormToGrid:function(b,c,e,h){return this.each(function(){if(this.grid){e||(e= +"set");h||(h="first");var w=a(c).serializeArray(),t={};a.each(w,function(a,b){t[b.name]=b.value});"add"===e?a(this).jqGrid("addRowData",b,t,h):"set"===e&&a(this).jqGrid("setRowData",b,t)}})}})})(jQuery); +(function(a){a.fn.jqFilter=function(d){if("string"===typeof d){var q=a.fn.jqFilter[d];if(!q)throw"jqFilter - No such method: "+d;var x=a.makeArray(arguments).slice(1);return q.apply(this,x)}var n=a.extend(!0,{filter:null,columns:[],onChange:null,afterRedraw:null,checkValues:null,error:!1,errmsg:"",errorcheck:!0,showQuery:!0,sopt:null,ops:[],operands:null,numopts:"eq ne lt le gt ge nu nn in ni".split(" "),stropts:"eq ne bw bn ew en cn nc nu nn in ni".split(" "),strarr:["text","string","blob"],groupOps:[{op:"AND", +text:"AND"},{op:"OR",text:"OR"}],groupButton:!0,ruleButtons:!0,direction:"ltr"},a.jgrid.filter,d||{});return this.each(function(){if(!this.filter){this.p=n;if(null===this.p.filter||void 0===this.p.filter)this.p.filter={groupOp:this.p.groupOps[0].op,rules:[],groups:[]};var d,q=this.p.columns.length,f,w=/msie/i.test(navigator.userAgent)&&!window.opera;this.p.initFilter=a.extend(!0,{},this.p.filter);if(q){for(d=0;d");var u= +function(g,l){var b=[!0,""],c=a("#"+a.jgrid.jqID(n.id))[0]||null;if(a.isFunction(l.searchrules))b=l.searchrules.call(c,g,l);else if(a.jgrid&&a.jgrid.checkValues)try{b=a.jgrid.checkValues.call(c,g,-1,l.searchrules,l.label)}catch(m){}b&&b.length&&!1===b[0]&&(n.error=!b[0],n.errmsg=b[1])};this.onchange=function(){this.p.error=!1;this.p.errmsg="";return a.isFunction(this.p.onChange)?this.p.onChange.call(this,this.p):!1};this.reDraw=function(){a("table.group:first",this).remove();var g=this.createTableForGroup(n.filter, +null);a(this).append(g);a.isFunction(this.p.afterRedraw)&&this.p.afterRedraw.call(this,this.p)};this.createTableForGroup=function(g,l){var b=this,c,m=a("
"),e="left";"rtl"===this.p.direction&&(e="right",m.attr("dir","rtl"));null===l&&m.append("");var h=a("");m.append(h);e=a("");h.append(e);if(!0===this.p.ruleButtons){var d=a("");e.append(d);var h="",k;for(c=0;c"+b.p.groupOps[c].text+"";d.append(h).bind("change",function(){g.groupOp=a(d).val();b.onchange()})}h="";this.p.groupButton&&(h=a(""),h.bind("click", +function(){void 0===g.groups&&(g.groups=[]);g.groups.push({groupOp:n.groupOps[0].op,rules:[],groups:[]});b.reDraw();b.onchange();return!1}));e.append(h);if(!0===this.p.ruleButtons){var h=a(""),f;h.bind("click",function(){void 0===g.rules&&(g.rules=[]);for(c=0;c"),e.append(h),h.bind("click",function(){for(c=0;c"),m.append(e),h=a(""),e.append(h),h=a(""),h.append(this.createTableForGroup(g.groups[c],g)),e.append(h);void 0===g.groupOp&&(g.groupOp=b.p.groupOps[0].op);if(void 0!==g.rules)for(c=0;c"),e,h,f,k,d="",s;m.append(""); +var p=a("");m.append(p);var q=a(""),r,t=[];p.append(q);q.bind("change",function(){g.field=a(q).val();f=a(this).parents("tr:first");for(e=0;e"+b.p.ops[r].text+"",m++);a(".selectopts",f).empty().append(l);a(".selectopts",f)[0].selectedIndex=0;a.jgrid.msie&&9>a.jgrid.msiever()&&(l=parseInt(a("select.selectopts",f)[0].offsetWidth, +10)+1,a(".selectopts",f).width(l),a(".selectopts",f).css("width","auto"));a(".data",f).empty().append(d);a.jgrid.bindEv.call(c,d,k.searchoptions);a(".input-elm",f).bind("change",function(e){e=e.target;g.data="SPAN"===e.nodeName.toUpperCase()&&k.searchoptions&&a.isFunction(k.searchoptions.custom_value)?k.searchoptions.custom_value.call(c,a(e).children(".customelement:first"),"get"):e.value;b.onchange()});setTimeout(function(){g.data=a(d).val();b.onchange()},0)}});for(e=p=0;e"+b.p.columns[e].label+""}q.append(d);d=a("");m.append(d);k=n.columns[p];k.searchoptions.id=a.jgrid.randId();w&&"text"===k.inputtype&&!k.searchoptions.size&&(k.searchoptions.size=10);p=a.jgrid.createEl.call(c, +k.inputtype,k.searchoptions,g.data,!0,b.p.ajaxSelectOptions||{},!0);if("nu"===g.op||"nn"===g.op)a(p).attr("readonly","true"),a(p).attr("disabled","true");var v=a("");d.append(v);v.bind("change",function(){g.op=a(v).val();f=a(this).parents("tr:first");var c=a(".input-elm",f)[0];"nu"===g.op||"nn"===g.op?(g.data="","SELECT"!==c.tagName.toUpperCase()&&(c.value=""),c.setAttribute("readonly","true"),c.setAttribute("disabled","true")):("SELECT"===c.tagName.toUpperCase()&& +(g.data=c.value),c.removeAttribute("readonly"),c.removeAttribute("disabled"));b.onchange()});h=k.searchoptions.sopt?k.searchoptions.sopt:b.p.sopt?b.p.sopt:-1!==a.inArray(k.searchtype,b.p.strarr)?b.p.stropts:b.p.numopts;d="";a.each(b.p.ops,function(){t.push(this.oper)});for(e=0;e"+b.p.ops[r].text+"");v.append(d);d=a("");m.append(d); +d.append(p);a.jgrid.bindEv.call(c,p,k.searchoptions);a(p).addClass("input-elm").bind("change",function(){g.data="custom"===k.inputtype?k.searchoptions.custom_value.call(c,a(this).children(".customelement:first"),"get"):a(this).val();b.onchange()});d=a("");m.append(d);!0===this.p.ruleButtons&&(p=a(""),d.append(p),p.bind("click",function(){for(e=0;e'+b+"
",a.jgrid.edit.bClose,{buttonalign:"right"})}catch(h){alert(b)}}!0===f.restoreAfterError&&a(d).jqGrid("restoreRow", +c,f.afterrestorefunc)}},a.jgrid.ajaxOptions,d.p.ajaxRowOptions||{}))}return m}},restoreRow:function(c,e){var b=a.makeArray(arguments).slice(1),l={};"object"===a.type(b[0])?l=b[0]:a.isFunction(e)&&(l.afterrestorefunc=e);l=a.extend(!0,{},a.jgrid.inlineEdit,l);return this.each(function(){var b=this,e=-1,p,g={},f;if(b.grid&&(p=a(b).jqGrid("getInd",c,!0),!1!==p&&(f=a.isFunction(l.beforeCancelRow)?l.beforeCancelRow.call(b,l,sr):void 0,void 0===f&&(f=!0),f))){for(f=0;f"+e,b.jgrid.edit.bClose);b(a).jqGrid("restoreCell",d,f)}},b.jgrid.ajaxOptions, +a.p.ajaxCellOptions||{}))}else try{b.jgrid.info_dialog(b.jgrid.errors.errcap,b.jgrid.errors.nourl,b.jgrid.edit.bClose),b(a).jqGrid("restoreCell",d,f)}catch(t){}"clientArray"===a.p.cellsubmit&&(b(g).empty(),b(a).jqGrid("setCell",a.rows[d].id,f,h,!1,!1,!0),b(g).addClass("dirty-cell"),b(a.rows[d]).addClass("edited"),b(a).triggerHandler("jqGridAfterSaveCell",[a.rows[d].id,m,e,d,f]),b.isFunction(a.p.afterSaveCell)&&a.p.afterSaveCell.call(a,a.rows[d].id,m,e,d,f),a.p.savedRow.splice(0,1))}else try{window.setTimeout(function(){b.jgrid.info_dialog(b.jgrid.errors.errcap, +e+" "+s[1],b.jgrid.edit.bClose)},100),b(a).jqGrid("restoreCell",d,f)}catch(u){}}else b(a).jqGrid("restoreCell",d,f)}window.setTimeout(function(){b("#"+b.jgrid.jqID(a.p.knv)).attr("tabindex","-1").focus()},0)}})},restoreCell:function(d,f){return this.each(function(){var a=this,c;if(a.grid&&!0===a.p.cellEdit){c=1<=a.p.savedRow.length?0:null;if(null!==c){var g=b("td:eq("+f+")",a.rows[d]);if(b.isFunction(b.fn.datepicker))try{b("input.hasDatepicker",g).datepicker("hide")}catch(e){}b(g).empty().attr("tabindex", +"-1");b(a).jqGrid("setCell",a.rows[d].id,f,a.p.savedRow[c].v,!1,!1,!0);b(a).triggerHandler("jqGridAfterRestoreCell",[a.rows[d].id,a.p.savedRow[c].v,d,f]);b.isFunction(a.p.afterRestoreCell)&&a.p.afterRestoreCell.call(a,a.rows[d].id,a.p.savedRow[c].v,d,f);a.p.savedRow.splice(0,1)}window.setTimeout(function(){b("#"+a.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(d,f){return this.each(function(){var a=!1,c;if(this.grid&&!0===this.p.cellEdit){for(c=f+1;c=f&&(b(a.grid.bDiv)[0].scrollTop=b(a.grid.bDiv)[0].scrollTop+a.rows[c].clientHeight);"vu"===e&&r=e+parseInt(f, +10)?b(a.grid.bDiv)[0].scrollLeft=b(a.grid.bDiv)[0].scrollLeft+a.rows[c].cells[d].clientWidth:g
"),g,e;b(c).insertBefore(a.grid.cDiv);b("#"+a.p.knv).focus().keydown(function(c){e=c.keyCode;"rtl"===a.p.direction&&(37===e?e=39:39===e&&(e=37));switch(e){case 38:0
").css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":f-1,opacity:e.overlay/100});if(b.a)return d;b.t=k;b.a=!0;b.w.css("z-index",f);e.modal?(m[0]||setTimeout(function(){s("bind")}, +1),m.push(a)):0').insertAfter(b.o);e.onShow?e.onShow(b):b.w.show();p(b);return d}, +close:function(a){a=l[a];if(!a.a)return d;a.a=d;m[0]&&(m.pop(),m[0]||s("unbind"));a.c.toTop&&a.o&&c("#jqmP"+a.w[0]._jqm).after(a.w).remove();if(a.c.onHide)a.c.onHide(a);else a.w.hide(),a.o&&a.o.remove();return d},params:{}};var n=0,l=c.jqm.hash,m=[],d=!1,p=function(a){try{c(":input:visible",a.w)[0].focus()}catch(d){}},s=function(a){c(document)[a]("keypress",q)[a]("keydown",q)[a]("mousedown",q)},q=function(a){var d=l[m[m.length-1]],b=!c(a.target).parents(".jqmID"+d.s)[0];b&&(c(".jqmID"+d.s).each(function(){var d= +c(this),h=d.offset();if(h.top<=a.pageY&&a.pageY<=h.top+d.height()&&h.left<=a.pageX&&a.pageX<=h.left+d.width())return b=!1}),p(d));return!b},r=function(a,k,b){return a.each(function(){var a=this._jqm;c(k).each(function(){this[b]||(this[b]=[],c(this).click(function(){for(var a in{jqmShow:1,jqmHide:1})for(var b in this[a])if(l[this[a][b]])l[this[a][b]].w[a](this);return d}));this[b].push(a)})})}})(jQuery); +(function(b){b.fn.jqDrag=function(a){return h(this,a,"d")};b.fn.jqResize=function(a,b){return h(this,a,"r",b)};b.jqDnR={dnr:{},e:0,drag:function(a){"d"==d.k?e.css({left:d.X+a.pageX-d.pX,top:d.Y+a.pageY-d.pY}):(e.css({width:Math.max(a.pageX-d.pX+d.W,0),height:Math.max(a.pageY-d.pY+d.H,0)}),f&&g.css({width:Math.max(a.pageX-f.pX+f.W,0),height:Math.max(a.pageY-f.pY+f.H,0)}));return!1},stop:function(){b(document).unbind("mousemove",c.drag).unbind("mouseup",c.stop)}};var c=b.jqDnR,d=c.dnr,e=c.e,g,f,h=function(a, +c,h,n){return a.each(function(){c=c?b(c,a):a;c.bind("mousedown",{e:a,k:h},function(a){var c=a.data,k={};e=c.e;g=n?b(n):!1;if("relative"!=e.css("position"))try{e.position(k)}catch(h){}d={X:k.left||l("left")||0,Y:k.top||l("top")||0,W:l("width")||e[0].scrollWidth||0,H:l("height")||e[0].scrollHeight||0,pX:a.pageX,pY:a.pageY,k:c.k};f=g&&"d"!=c.k?{X:k.left||m("left")||0,Y:k.top||m("top")||0,W:g[0].offsetWidth||m("width")||0,H:g[0].offsetHeight||m("height")||0,pX:a.pageX,pY:a.pageY,k:c.k}:!1;if(b("input.hasDatepicker", +e[0])[0])try{b("input.hasDatepicker",e[0]).datepicker("hide")}catch(p){}b(document).mousemove(b.jqDnR.drag).mouseup(b.jqDnR.stop);return!1})})},l=function(a){return parseInt(e.css(a),10)||!1},m=function(a){return parseInt(g.css(a),10)||!1}})(jQuery); +(function(b){b.jgrid.extend({setSubGrid:function(){return this.each(function(){var d,c;this.p.subGridOptions=b.extend({plusicon:"ui-icon-plus",minusicon:"ui-icon-minus",openicon:"ui-icon-carat-1-sw",expandOnLoad:!1,delayOnLoad:50,selectOnExpand:!1,selectOnCollapse:!1,reloadOnExpand:!0},this.p.subGridOptions||{});this.p.colNames.unshift("");this.p.colModel.unshift({name:"subgrid",width:b.jgrid.cell_width?this.p.subGridWidth+this.p.cellLayout:this.p.subGridWidth,sortable:!1,resizable:!1,hidedlg:!0, +search:!1,fixed:!0});d=this.p.subGridModel;if(d[0])for(d[0].align=b.extend([],d[0].align||[]),c=0;c"},addSubGrid:function(d,c){return this.each(function(){var a= +this;if(a.grid){var p=function(c,d,h){d=b("").html(d);b(c).append(d)},n=function(c,d){var h,f,e,g=b("
"),k=b("");for(f=0;f"),b(h).html(a.p.subGridModel[0].name[f]),b(h).width(a.p.subGridModel[0].width[f]),b(k).append(h);b(g).append(k);c&&(e=a.p.xmlReader.subgrid, +b(e.root+" "+e.row,c).each(function(){k=b("");if(!0===e.repeatitems)b(e.cell,this).each(function(a){p(k,b(this).text()||" ",a)});else{var c=a.p.subGridModel[0].mapping||a.p.subGridModel[0].name;if(c)for(f=0;f"),l=b("");for(f=0;f"),b(h).html(a.p.subGridModel[0].name[f]),b(h).width(a.p.subGridModel[0].width[f]),b(l).append(h);b(m).append(l);if(c&&(g=a.p.jsonReader.subgrid,h=b.jgrid.getAccessor(c,g.root),void 0!==h))for(f=0;f"); +if(!0===g.repeatitems)for(g.cell&&(e=e[g.cell]),k=0;k ":"";g=b(a).triggerHandler("jqGridSubGridBeforeExpand",[m+"_"+e,e]);(g=!1===g||"stop"===g?!1:!0)&&b.isFunction(a.p.subGridBeforeExpand)&&(g=a.p.subGridBeforeExpand.call(a,m+"_"+e,e));if(!1===g)return!1;b(c).after(""+ +s+"
");b(a).triggerHandler("jqGridSubGridRowExpanded",[m+"_"+e,e]);b.isFunction(a.p.subGridRowExpanded)?a.p.subGridRowExpanded.call(a,m+"_"+e,e):v(c)}else b(l).show();b(this).html("").removeClass("sgcollapsed").addClass("sgexpanded");a.p.subGridOptions.selectOnExpand&&b(a).jqGrid("setSelection",e)}else if(b(this).hasClass("sgexpanded")){g=b(a).triggerHandler("jqGridSubGridRowColapsed",[m+"_"+e,e]);g=!1===g||"stop"===g?!1:!0;e=c.id;g&&b.isFunction(a.p.subGridRowColapsed)&&(g=a.p.subGridRowColapsed.call(a,m+"_"+e,e));if(!1===g)return!1;!0===a.p.subGridOptions.reloadOnExpand?b(l).remove(".ui-subgrid"):b(l).hasClass("ui-subgrid")&&b(l).hide();b(this).html("").removeClass("sgexpanded").addClass("sgcollapsed");a.p.subGridOptions.selectOnCollapse&&b(a).jqGrid("setSelection",e)}return!1}),q++;!0===a.p.subGridOptions.expandOnLoad&&b(a.rows).filter(".jqgrow").each(function(a,c){b(c.cells[0]).click()});a.subGridXml=function(a,b){n(a,b)};a.subGridJson=function(a,b){r(a,b)}}})},expandSubGridRow:function(d){return this.each(function(){if((this.grid||d)&&!0===this.p.subGrid){var c=b(this).jqGrid("getInd",d,!0);c&&(c=b("td.sgcollapsed", +c)[0])&&b(c).trigger("click")}})},collapseSubGridRow:function(d){return this.each(function(){if((this.grid||d)&&!0===this.p.subGrid){var c=b(this).jqGrid("getInd",d,!0);c&&(c=b("td.sgexpanded",c)[0])&&b(c).trigger("click")}})},toggleSubGridRow:function(d){return this.each(function(){if((this.grid||d)&&!0===this.p.subGrid){var c=b(this).jqGrid("getInd",d,!0);if(c){var a=b("td.sgcollapsed",c)[0];a?b(a).trigger("click"):(a=b("td.sgexpanded",c)[0])&&b(a).trigger("click")}}})}})})(jQuery); +(function(d){d.extend(d.jgrid,{template:function(b){var k=d.makeArray(arguments).slice(1),a,c=k.length;null==b&&(b="");return b.replace(/\{([\w\-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,function(b,m){if(!isNaN(parseInt(m,10)))return k[parseInt(m,10)];for(a=0;atd>span.tree-wrap-"+this.p.direction).removeClass(a).addClass(m),q&&d(n).show().find(">td>span.tree-wrap-"+this.p.direction).removeClass(a).addClass(m))}else p&&(d(e).show(),q&&d(n).show());e=e.nextSibling;q&&(n=n.nextSibling)}f.removeClass(m).addClass(a)}d(this).triggerHandler("jqGridGroupingClickGroup",[b,r]);d.isFunction(this.p.onClickGroup)&&this.p.onClickGroup.call(this, +b,r)});return!1},groupingRender:function(b,k,a,c){return this.each(function(){function g(a,b,c){var d=!1;if(0===b)d=c[a];else{var e=c[a].idx;if(0===e)d=c[a];else for(;0<=a;a--)if(c[a].idx===e-b){d=c[a];break}}return d}function m(a,b,c,f){var h=g(a,b,c),m=e.p.colModel,n,q=h.cnt;a="";var p;for(p=f;p ",t="{0}";d.each(h.summary,function(){if(this.nm===m[p].name){m[p].summaryTpl&&(t=m[p].summaryTpl);"string"===typeof this.st&&"avg"===this.st.toLowerCase()&& +(this.sd&&this.vd?this.v/=this.vd:this.v&&0"+d.jgrid.format(t,n)+"";return!1}});a+=r}return a}var e=this,f=e.p.groupingView,h="",p="",r,q,n=f.groupCollapse?f.plusicon:f.minusicon,t,y=[],z=f.groupField.length,n=n+(" tree-wrap-"+e.p.direction);d.each(e.p.colModel,function(a,b){var c;for(c=0;c(a-1)*c&&l.startRow";try{d.isArray(f.formatDisplayField)&&d.isFunction(f.formatDisplayField[l.idx])?(l.displayValue=f.formatDisplayField[l.idx].call(e,l.displayValue,l.value, +e.p.colModel[y[l.idx]],l.idx,f),t=l.displayValue):t=e.formatter(r,l.displayValue,y[l.idx],l.value)}catch(C){t=l.displayValue}"header"===f.groupSummaryPos[l.idx]?(h+=''+p+d.jgrid.template(f.groupText[l.idx],t,l.cnt,l.summary)+"",h+=m(g,l.idx-1,f.groups,1),h+=""):h+=''+p+d.jgrid.template(f.groupText[l.idx],t,l.cnt,l.summary)+"";if(z-1===l.idx){var s=f.groups[g+1],v,u=0;v=l.startRow;var B=void 0!==s?f.groups[g+1].startRow:b.length;f._locgr&&(u=(a-1)*c,u>l.startRow&&(v=u));for(;v